diff --git a/DEPS b/DEPS index 182c770..18093c71 100644 --- a/DEPS +++ b/DEPS
@@ -78,11 +78,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': 'f91d57b5850f094fafde7621087de87ae2bdd0ef', + 'skia_revision': '6f1151140f331c78d99ede3cac10462dc8b32cde', # 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': '7aa494eb480654a1ff73ce3bc4069f27473a4511', + 'v8_revision': '658c0b5671f9a4badf465811a6b58ea2d4c4840a', # 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. @@ -90,7 +90,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '06f8637740116fa3bc4c30b513fc3ae4a0534521', + 'angle_revision': 'b8cb939f5817e558ca29b9f9c2e2e15c20342eb7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -134,7 +134,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': '08db5c9b282272f8105fe9fefe453bea0dbed057', + 'catapult_revision': 'bd319d25b88622db10d3e63ac613cf23ee83539e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -302,7 +302,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '49edad6de211c0a12f1cd05f0182841477e0b21b', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'a46ce69c97aff6df16b3233103af29e28275256c', 'condition': 'checkout_linux', }, @@ -643,7 +643,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd458ada06171a85af00367251a4ed55db7fe2018', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '65fb17bc281c705bc27c257a7728b49f7b83f978', # commit position 20628 + Var('webrtc_git') + '/src.git' + '@' + '04766e733eb36cc38784c388a0f4499561ae5203', # commit position 20628 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
diff --git a/WATCHLISTS b/WATCHLISTS index 167a742..5fa4d49 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -459,6 +459,14 @@ '|third_party/WebKit/Source/core/svg/SVGScriptElement.*' \ '|third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.*' }, + 'blink_scroll': { + 'filepath': 'third_party/WebKit/Source/core/frame/.*View.*' \ + '|third_party/WebKit/Source/core/input/.*Scroll.*' \ + '|third_party/WebKit/Source/core/input/EventHandler.*' \ + '|third_party/WebKit/Source/core/page/scrolling/' \ + '|third_party/WebKit/Source/core/paint/.*ScrollableArea.*' \ + '|third_party/WebKit/Source/platform/scroll/' + }, 'blink_serviceworkers' : { 'filepath': 'third_party/WebKit/Source/modules/serviceworkers' \ '|third_party/WebKit/LayoutTests/http/tests/serviceworker' \ @@ -505,9 +513,9 @@ 'blink_viewport_interaction': { 'filepath': 'third_party/WebKit/Source/core/css/.*Viewport' \ '|third_party/WebKit/Source/core/dom/ViewportArguments' \ - '|third_party/WebKit/Source/core/html/HTMLMetaElement' \ - '|third_party/WebKit/Source/core/page/FrameView' \ - '|third_party/WebKit/Source/core/page/scrolling' + '|third_party/WebKit/Source/core/frame/FrameView.*' \ + '|third_party/WebKit/Source/core/frame/.*Viewport.*' \ + '|third_party/WebKit/Source/core/html/HTMLMetaElement' }, 'blink_w3ctests': { 'filepath': 'third_party/WebKit/LayoutTests/external/' \ @@ -1817,6 +1825,7 @@ 'blink_script': ['kouhei+script@chromium.org', 'hiroshige+script@chromium.org', 'kochi+script@chromium.org'], + 'blink_scroll': ['bokan@chromium.org'], 'blink_serviceworkers': ['falken+watch@chromium.org', 'horo+watch@chromium.org', 'jsbell+serviceworker@chromium.org', @@ -1848,7 +1857,8 @@ 'silviapf@chromium.org', 'srirama.m@samsung.com'], 'blink_vibration': ['mlamouri+watch-blink@chromium.org'], - 'blink_viewport_interaction': ['kenneth.christiansen@gmail.com'], + 'blink_viewport_interaction': ['kenneth.christiansen@gmail.com', + 'bokan@chromium.org'], 'blink_w3ctests': ['blink-reviews-w3ctests@chromium.org'], 'blink_webp': ['jzern@chromium.org', 'skal@google.com',
diff --git a/android_webview/browser/aw_ssl_host_state_delegate.cc b/android_webview/browser/aw_ssl_host_state_delegate.cc index 7c8374a2..f1997e1 100644 --- a/android_webview/browser/aw_ssl_host_state_delegate.cc +++ b/android_webview/browser/aw_ssl_host_state_delegate.cc
@@ -24,9 +24,7 @@ bool CertPolicy::Check(const net::X509Certificate& cert, net::CertStatus error) const { net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256(); - std::map<net::SHA256HashValue, net::CertStatus, - net::SHA256HashValueLessThan>::const_iterator allowed_iter = - allowed_.find(fingerprint); + auto allowed_iter = allowed_.find(fingerprint); if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) && ((allowed_iter->second & error) == error)) { return true;
diff --git a/android_webview/browser/aw_ssl_host_state_delegate.h b/android_webview/browser/aw_ssl_host_state_delegate.h index 24c9c71..f8b972d1 100644 --- a/android_webview/browser/aw_ssl_host_state_delegate.h +++ b/android_webview/browser/aw_ssl_host_state_delegate.h
@@ -37,8 +37,7 @@ private: // The set of fingerprints of allowed certificates. - std::map<net::SHA256HashValue, net::CertStatus, net::SHA256HashValueLessThan> - allowed_; + std::map<net::SHA256HashValue, net::CertStatus> allowed_; }; } // namespace internal
diff --git a/build/secondary/third_party/android_platform/development/scripts/BUILD.gn b/build/secondary/third_party/android_platform/development/scripts/BUILD.gn index 2ac12d7..d808824 100644 --- a/build/secondary/third_party/android_platform/development/scripts/BUILD.gn +++ b/build/secondary/third_party/android_platform/development/scripts/BUILD.gn
@@ -13,9 +13,5 @@ sources = _py_files data = sources - data += [ - "${android_tool_prefix}addr2line", - "${android_tool_prefix}objdump", - "${android_tool_prefix}c++filt", - ] + data += [ "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer" ] }
diff --git a/build/secondary/third_party/android_platform/development/scripts/stack.pydeps b/build/secondary/third_party/android_platform/development/scripts/stack.pydeps index 2f46729e..1b3ecbb 100644 --- a/build/secondary/third_party/android_platform/development/scripts/stack.pydeps +++ b/build/secondary/third_party/android_platform/development/scripts/stack.pydeps
@@ -4,6 +4,7 @@ ../../../../build/android/pylib/constants/__init__.py ../../../../build/android/pylib/symbols/__init__.py ../../../../build/android/pylib/symbols/elf_symbolizer.py +../../../../tools/python/llvm_symbolizer.py ../../../catapult/devil/devil/__init__.py ../../../catapult/devil/devil/android/__init__.py ../../../catapult/devil/devil/android/constants/__init__.py
diff --git a/chrome/VERSION b/chrome/VERSION index 24b8dfb..52e2726e 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=65 MINOR=0 -BUILD=3307 +BUILD=3308 PATCH=0
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 395303b2..50eab2d 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -1701,6 +1701,48 @@ <message name="IDS_OOBE_EULA_ACCEPT_AND_CONTINUE_BUTTON_TEXT" desc="Label on a button on the Title of Terms of Service OOBE screen to accept EULA and continue."> Accept and continue </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE" desc="The title of the dialog that welcomes the user on the first log in, and explains Chrome Sync and privacy options."> + You're signed in! + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_NAME" desc="Title of the 'Chrome sync' section of the sync confirmation dialog that is displayed on the first user log in."> + Chrome sync + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_DESCRIPTION" desc="The description of 'Chrome sync' section of the sync confirmation dialog that is displayed on the first user log in."> + Your bookmarks, history, passwords, and other settings will be synced to your Google Account so you can use them on all your devices. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_NAME" desc="Title of the personalize services section of the sync confirmation dialog that is displayed on the first user log in."> + Personalize Google services + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_DESCRIPTION" desc="The description of the personalize services section of the sync confirmation dialog that is displayed on the first user log in."> + Google may use your browsing history to personalize Search, ads, and other Google services. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SCREEN_SETTINGS_LINK" desc="A note at the end of the sync confirmation dialog that is displayed on the first user log in, suggesting that preferences may be changed in Settings. It also contains link to Settings page."> + Control how this works in <ph name="LINK_START">$1<ex>>a<</ex></ph>Settings<ph name="LINK_END">$2<ex>>/a<</ex></ph>. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SETTINGS_TITLE" desc="The title of the dialog that is shown on the first user log in, and allows user to select Chrome Sync options."> + Sync settings + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SETTINGS_SUBTITLE" desc="The sub-title of the dialog that is shown on the first user log in, and allows user to select Chrome Sync options. It explains to the user what options can be changed here."> + Your bookmarks, history, passwords, and other settings will be synced to your Google Account so you can use them on all your devices. You can always change this later in your settings. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION" desc="Label for toggle-button UI element that controls whether user settings are synced to user's Google Account."> + Sync everything + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION_ON" desc="A 'turned on' value for the 'Sync everything' toggle-button UI element that controls whether user settings are synced to user's Google Account."> + On + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION_OFF" desc="A 'turned off' value for the 'Sync everything' toggle-button UI element that controls whether user settings are synced to user's Google Account."> + Off + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_STATUS_SYNC_ALL_ON" desc="Status message on the Chrome Sync status dialog explaining 'sync is turned on' status."> + Personalization is on. You can change this at myaccount.google.com. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_STATUS_SYNC_ALL_OFF" desc="Status message on the Chrome Sync status dialog explaining 'sync is turned off' status."> + Personalization is off. You can change this at myaccount.google.com. + </message> + <message name="IDS_LOGIN_SYNC_CONSENT_SAVE_AND_CONTINUE" desc="Label on the button of the Sync Settings dialog that closes the dialog and saves the changes."> + Save and continue + </message> <message name="IDS_DISABLED_ADD_USER_TOOLTIP" desc="Tooltip over disabled Add user button"> The owner of this device has disabled new users from being added </message>
diff --git a/chrome/app/md_extensions_strings.grdp b/chrome/app/md_extensions_strings.grdp index e43e673..f1454042 100644 --- a/chrome/app/md_extensions_strings.grdp +++ b/chrome/app/md_extensions_strings.grdp
@@ -31,6 +31,9 @@ <message name="IDS_MD_EXTENSIONS_ERROR_STACK_TRACE" desc="The label for the stack trace of an extension's error."> Stack Trace </message> + <message name="IDS_MD_EXTENSIONS_ERROR_LINES_NOT_SHOWN" desc="The label displayed to the users indicating that some lines of code are truncated."> + <<ph name="LINE_COUNT">$1<ex>100</ex></ph> lines not shown> + </message> <message name="IDS_MD_EXTENSIONS_LEARN_MORE" desc="Learn more text"> Learn more </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 45cae25..3631368b 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -371,6 +371,10 @@ "data_use_measurement/chrome_data_use_recorder.h", "data_use_measurement/data_use_web_contents_observer.cc", "data_use_measurement/data_use_web_contents_observer.h", + "data_use_measurement/page_load_capping/chrome_page_load_capping_features.cc", + "data_use_measurement/page_load_capping/chrome_page_load_capping_features.h", + "data_use_measurement/page_load_capping/page_load_observer.cc", + "data_use_measurement/page_load_capping/page_load_observer.h", "defaults.cc", "defaults.h", "dom_distiller/dom_distiller_service_factory.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 23f7d399..de7df88 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2361,10 +2361,6 @@ flag_descriptions::kTraceExportEventsToEtwName, flag_descriptions::kTraceExportEventsToEtwDesription, kOsWin, SINGLE_VALUE_TYPE(switches::kTraceExportEventsToETW)}, - {"merge-key-char-events", flag_descriptions::kMergeKeyCharEventsName, - flag_descriptions::kMergeKeyCharEventsDescription, kOsWin, - ENABLE_DISABLE_VALUE_TYPE(switches::kEnableMergeKeyCharEvents, - switches::kDisableMergeKeyCharEvents)}, {"use-winrt-midi-api", flag_descriptions::kUseWinrtMidiApiName, flag_descriptions::kUseWinrtMidiApiDescription, kOsWin, FEATURE_VALUE_TYPE(midi::features::kMidiManagerWinrt)}, @@ -3422,10 +3418,6 @@ FEATURE_VALUE_TYPE(features::kVoiceSearchOnLocalNtp)}, #endif // !defined(OS_ANDROID) - {"pwa-minimal-ui", flag_descriptions::kPwaMinimalUiName, - flag_descriptions::kPwaMinimalUiDescription, kOsAndroid, - FEATURE_VALUE_TYPE(features::kPwaMinimalUi)}, - {"click-to-open-pdf", flag_descriptions::kClickToOpenPDFName, flag_descriptions::kClickToOpenPDFDescription, kOsAll, FEATURE_VALUE_TYPE(features::kClickToOpenPDFPlaceholder)},
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc index 85b0256..cec6ff6 100644 --- a/chrome/browser/android/shortcut_helper.cc +++ b/chrome/browser/android/shortcut_helper.cc
@@ -12,7 +12,6 @@ #include "base/android/jni_string.h" #include "base/bind.h" #include "base/callback.h" -#include "base/feature_list.h" #include "base/guid.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" @@ -20,7 +19,6 @@ #include "chrome/browser/android/webapk/chrome_webapk_host.h" #include "chrome/browser/android/webapk/webapk_install_service.h" #include "chrome/browser/android/webapk/webapk_metrics.h" -#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/manifest_icon_downloader.h" @@ -144,8 +142,7 @@ std::string webapp_id = base::GenerateGUID(); if (info.display == blink::kWebDisplayModeStandalone || info.display == blink::kWebDisplayModeFullscreen || - (info.display == blink::kWebDisplayModeMinimalUi && - base::FeatureList::IsEnabled(features::kPwaMinimalUi))) { + info.display == blink::kWebDisplayModeMinimalUi) { AddWebappWithSkBitmap( info, webapp_id, icon_bitmap, base::Bind(&ShortcutHelper::FetchSplashScreenImage, web_contents,
diff --git a/chrome/browser/android/shortcut_info.cc b/chrome/browser/android/shortcut_info.cc index f5b29e6..d5c0837 100644 --- a/chrome/browser/android/shortcut_info.cc +++ b/chrome/browser/android/shortcut_info.cc
@@ -4,7 +4,6 @@ #include "base/feature_list.h" #include "chrome/browser/android/shortcut_info.h" -#include "chrome/common/chrome_features.h" ShortcutInfo::ShortcutInfo(const GURL& shortcut_url) : url(shortcut_url), @@ -44,13 +43,9 @@ if (manifest.display != blink::kWebDisplayModeUndefined) display = manifest.display; - if (manifest.display == blink::kWebDisplayModeMinimalUi && - !base::FeatureList::IsEnabled(features::kPwaMinimalUi)) { - display = blink::kWebDisplayModeBrowser; - } else if (display == blink::kWebDisplayModeStandalone || - display == blink::kWebDisplayModeFullscreen || - (display == blink::kWebDisplayModeMinimalUi && - base::FeatureList::IsEnabled(features::kPwaMinimalUi))) { + if (display == blink::kWebDisplayModeStandalone || + display == blink::kWebDisplayModeFullscreen || + display == blink::kWebDisplayModeMinimalUi) { source = SOURCE_ADD_TO_HOMESCREEN_STANDALONE; // Set the orientation based on the manifest value, or ignore if the display // mode is different from 'standalone', 'fullscreen' or 'minimal-ui'.
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 1f84895..9b829b7 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -990,6 +990,9 @@ "login/screens/reset_view.h", "login/screens/screen_exit_code.cc", "login/screens/screen_exit_code.h", + "login/screens/sync_consent_screen.cc", + "login/screens/sync_consent_screen.h", + "login/screens/sync_consent_screen_view.h", "login/screens/terms_of_service_screen.cc", "login/screens/terms_of_service_screen.h", "login/screens/terms_of_service_screen_view.h",
diff --git a/chrome/browser/chromeos/certificate_provider/thread_safe_certificate_map.h b/chrome/browser/chromeos/certificate_provider/thread_safe_certificate_map.h index 283e31a..4a7d6fc 100644 --- a/chrome/browser/chromeos/certificate_provider/thread_safe_certificate_map.h +++ b/chrome/browser/chromeos/certificate_provider/thread_safe_certificate_map.h
@@ -14,7 +14,6 @@ #include "chrome/browser/chromeos/certificate_provider/certificate_info.h" namespace net { -class SHA256HashValueLessThan; class X509Certificate; struct SHA256HashValue; } @@ -32,9 +31,7 @@ std::string extension_id; }; using FingerprintToCertAndExtensionMap = - std::map<net::SHA256HashValue, - std::unique_ptr<MapValue>, - net::SHA256HashValueLessThan>; + std::map<net::SHA256HashValue, std::unique_ptr<MapValue>>; ThreadSafeCertificateMap(); ~ThreadSafeCertificateMap();
diff --git a/chrome/browser/chromeos/login/oobe_screen.cc b/chrome/browser/chromeos/login/oobe_screen.cc index 0230cfdb..c03bc82 100644 --- a/chrome/browser/chromeos/login/oobe_screen.cc +++ b/chrome/browser/chromeos/login/oobe_screen.cc
@@ -54,6 +54,7 @@ "login", // SCREEN_SPECIAL_LOGIN "oobe", // SCREEN_SPECIAL_OOBE "test:nowindow", // SCREEN_TEST_NO_WINDOW + "sync-consent", // SCREEN_SYNC_CONSENT "unknown", // SCREEN_UNKNOWN };
diff --git a/chrome/browser/chromeos/login/oobe_screen.h b/chrome/browser/chromeos/login/oobe_screen.h index 07cde09..76ab949 100644 --- a/chrome/browser/chromeos/login/oobe_screen.h +++ b/chrome/browser/chromeos/login/oobe_screen.h
@@ -57,6 +57,8 @@ // Special test value that commands not to create any window yet. SCREEN_TEST_NO_WINDOW, + SCREEN_SYNC_CONSENT, + SCREEN_UNKNOWN // This must always be the last element. };
diff --git a/chrome/browser/chromeos/login/screens/screen_exit_code.cc b/chrome/browser/chromeos/login/screens/screen_exit_code.cc index 4204206..e7d637b 100644 --- a/chrome/browser/chromeos/login/screens/screen_exit_code.cc +++ b/chrome/browser/chromeos/login/screens/screen_exit_code.cc
@@ -70,6 +70,8 @@ return "WAIT_FOR_CONTAINER_READY_FINISHED"; case ScreenExitCode::WAIT_FOR_CONTAINER_READY_ERROR: return "WAIT_FOR_CONTAINER_READY_ERROR"; + case ScreenExitCode::SYNC_CONSENT_FINISHED: + return "SYNC_CONSENT_FINISHED"; case ScreenExitCode::EXIT_CODES_COUNT: default: NOTREACHED();
diff --git a/chrome/browser/chromeos/login/screens/screen_exit_code.h b/chrome/browser/chromeos/login/screens/screen_exit_code.h index 923d712..c217633d 100644 --- a/chrome/browser/chromeos/login/screens/screen_exit_code.h +++ b/chrome/browser/chromeos/login/screens/screen_exit_code.h
@@ -56,6 +56,7 @@ VOICE_INTERACTION_VALUE_PROP_ACCEPTED = 29, WAIT_FOR_CONTAINER_READY_FINISHED = 30, WAIT_FOR_CONTAINER_READY_ERROR = 31, + SYNC_CONSENT_FINISHED = 32, EXIT_CODES_COUNT // not a real code, must be the last };
diff --git a/chrome/browser/chromeos/login/screens/sync_consent_screen.cc b/chrome/browser/chromeos/login/screens/sync_consent_screen.cc new file mode 100644 index 0000000..b9087ca03 --- /dev/null +++ b/chrome/browser/chromeos/login/screens/sync_consent_screen.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 "chrome/browser/chromeos/login/screens/sync_consent_screen.h" + +#include <string> + +#include "base/logging.h" + +namespace chromeos { +namespace { + +constexpr const char kUserActionButtonClicked[] = "save-and-continue"; + +} // namespace + +SyncConsentScreen::SyncConsentScreen(BaseScreenDelegate* base_screen_delegate, + SyncConsentScreenView* view) + : BaseScreen(base_screen_delegate, OobeScreen::SCREEN_SYNC_CONSENT), + view_(view) { + DCHECK(view_); + view_->Bind(this); +} + +SyncConsentScreen::~SyncConsentScreen() { + view_->Bind(NULL); +} + +void SyncConsentScreen::Show() { + // Show the screen. + view_->Show(); +} + +void SyncConsentScreen::Hide() { + view_->Hide(); +} + +void SyncConsentScreen::OnUserAction(const std::string& action_id) { + if (action_id == kUserActionButtonClicked) { + Finish(ScreenExitCode::SYNC_CONSENT_FINISHED); + return; + } + BaseScreen::OnUserAction(action_id); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/sync_consent_screen.h b/chrome/browser/chromeos/login/screens/sync_consent_screen.h new file mode 100644 index 0000000..e257b8e --- /dev/null +++ b/chrome/browser/chromeos/login/screens/sync_consent_screen.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 CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_H_ + +#include <string> + +#include "base/macros.h" +#include "chrome/browser/chromeos/login/screens/base_screen.h" +#include "chrome/browser/chromeos/login/screens/sync_consent_screen_view.h" + +namespace chromeos { + +class BaseScreenDelegate; + +// This is Sync settings screen that is displayed as a part of user first +// sign-in flow. +class SyncConsentScreen : public BaseScreen { + public: + SyncConsentScreen(BaseScreenDelegate* base_screen_delegate, + SyncConsentScreenView* view); + ~SyncConsentScreen() override; + + // BaseScreen: + void Show() override; + void Hide() override; + void OnUserAction(const std::string& action_id) override; + + private: + SyncConsentScreenView* const view_; + + DISALLOW_COPY_AND_ASSIGN(SyncConsentScreen); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_H_
diff --git a/chrome/browser/chromeos/login/screens/sync_consent_screen_view.h b/chrome/browser/chromeos/login/screens/sync_consent_screen_view.h new file mode 100644 index 0000000..3856a6d --- /dev/null +++ b/chrome/browser/chromeos/login/screens/sync_consent_screen_view.h
@@ -0,0 +1,34 @@ +// 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_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_VIEW_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_VIEW_H_ + +#include "chrome/browser/chromeos/login/oobe_screen.h" + +namespace chromeos { + +class SyncConsentScreen; + +// Interface for dependency injection between SyncConsentScreen and its +// WebUI representation. +class SyncConsentScreenView { + public: + constexpr static OobeScreen kScreenId = OobeScreen::SCREEN_SYNC_CONSENT; + + virtual ~SyncConsentScreenView() = default; + + // Sets screen this view belongs to. + virtual void Bind(SyncConsentScreen* screen) = 0; + + // Shows the contents of the screen. + virtual void Show() = 0; + + // Hides the contents of the screen. + virtual void Hide() = 0; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_SYNC_CONSENT_SCREEN_VIEW_H_
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 130b963..5e6d18c7 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -50,6 +50,7 @@ #include "chrome/browser/chromeos/login/screens/network_error.h" #include "chrome/browser/chromeos/login/screens/network_view.h" #include "chrome/browser/chromeos/login/screens/reset_screen.h" +#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h" #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" #include "chrome/browser/chromeos/login/screens/update_required_screen.h" #include "chrome/browser/chromeos/login/screens/update_screen.h" @@ -125,6 +126,7 @@ chromeos::OobeScreen::SCREEN_OOBE_EULA, chromeos::OobeScreen::SCREEN_OOBE_ENROLLMENT, chromeos::OobeScreen::SCREEN_TERMS_OF_SERVICE, + chromeos::OobeScreen::SCREEN_SYNC_CONSENT, chromeos::OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE, chromeos::OobeScreen::SCREEN_AUTO_ENROLLMENT_CHECK}; @@ -405,6 +407,8 @@ } else if (screen == OobeScreen::SCREEN_TERMS_OF_SERVICE) { return new TermsOfServiceScreen(this, oobe_ui_->GetTermsOfServiceScreenView()); + } else if (screen == OobeScreen::SCREEN_SYNC_CONSENT) { + return new SyncConsentScreen(this, oobe_ui_->GetSyncConsentScreenView()); } else if (screen == OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE) { return new ArcTermsOfServiceScreen( this, oobe_ui_->GetArcTermsOfServiceScreenView()); @@ -559,11 +563,11 @@ void WizardController::ShowTermsOfServiceScreen() { // Only show the Terms of Service when logging into a public account and Terms // of Service have been specified through policy. In all other cases, advance - // to the ARC opt-in screen immediately. + // to the post-ToS part immediately. if (!user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() || !ProfileManager::GetActiveUserProfile()->GetPrefs()->IsManagedPreference( prefs::kTermsOfServiceURL)) { - ShowArcTermsOfServiceScreen(); + OnTermsOfServiceAccepted(); return; } @@ -572,6 +576,12 @@ SetCurrentScreen(GetScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE)); } +void WizardController::ShowSyncConsentScreen() { + VLOG(1) << "Showing Sync Consent screen."; + UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_SYNC_CONSENT); + SetCurrentScreen(GetScreen(OobeScreen::SCREEN_SYNC_CONSENT)); +} + void WizardController::ShowArcTermsOfServiceScreen() { if (ShouldShowArcTerms()) { VLOG(1) << "Showing ARC Terms of Service screen."; @@ -863,9 +873,7 @@ } void WizardController::OnTermsOfServiceAccepted() { - // If the user accepts the Terms of Service, advance to the PlayStore terms - // of serice. - ShowArcTermsOfServiceScreen(); + ShowSyncConsentScreen(); } void WizardController::OnArcTermsOfServiceSkipped() { @@ -1154,6 +1162,8 @@ ShowEnrollmentScreen(); } else if (screen == OobeScreen::SCREEN_TERMS_OF_SERVICE) { ShowTermsOfServiceScreen(); + } else if (screen == OobeScreen::SCREEN_SYNC_CONSENT) { + ShowSyncConsentScreen(); } else if (screen == OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE) { ShowArcTermsOfServiceScreen(); } else if (screen == OobeScreen::SCREEN_WRONG_HWID) { @@ -1305,6 +1315,9 @@ case ScreenExitCode::WAIT_FOR_CONTAINER_READY_ERROR: OnOobeFlowFinished(); break; + case ScreenExitCode::SYNC_CONSENT_FINISHED: + ShowArcTermsOfServiceScreen(); + break; default: NOTREACHED(); } @@ -1484,6 +1497,20 @@ // static void WizardController::SkipPostLoginScreensForTesting() { skip_post_login_screens_ = true; + if (!default_controller_ || !default_controller_->current_screen()) + return; + + const OobeScreen current_screen_id = + default_controller_->current_screen()->screen_id(); + if (current_screen_id == OobeScreen::SCREEN_TERMS_OF_SERVICE || + current_screen_id == OobeScreen::SCREEN_SYNC_CONSENT || + current_screen_id == OobeScreen::SCREEN_ARC_TERMS_OF_SERVICE || + current_screen_id == OobeScreen::SCREEN_USER_IMAGE_PICKER) { + default_controller_->OnOobeFlowFinished(); + } else { + LOG(WARNING) << "SkipPostLoginScreensForTesting(): Ignore screen " + << static_cast<int>(current_screen_id); + } } // static
diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index 5237904..8d5e6f1 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h
@@ -146,6 +146,7 @@ void ShowEnableDebuggingScreen(); void ShowKioskEnableScreen(); void ShowTermsOfServiceScreen(); + void ShowSyncConsentScreen(); void ShowArcTermsOfServiceScreen(); void ShowWrongHWIDScreen(); void ShowAutoEnrollmentCheckScreen();
diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 91591f8..973e0e9 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc
@@ -1341,7 +1341,9 @@ // http://crbug.com/706017 // TODO(updowndota): Add tests for Voice Interaction OptIn flow. -static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 32, + +// TODO(alemate): Add tests for Sync Consent UI. +static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 33, "tests for new control flow are missing"); } // namespace chromeos
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys.cc b/chrome/browser/chromeos/platform_keys/platform_keys.cc index 48243d5..a811302 100644 --- a/chrome/browser/chromeos/platform_keys/platform_keys.cc +++ b/chrome/browser/chromeos/platform_keys/platform_keys.cc
@@ -23,8 +23,8 @@ void IntersectOnWorkerThread(const net::CertificateList& certs1, const net::CertificateList& certs2, net::CertificateList* intersection) { - std::map<net::SHA256HashValue, scoped_refptr<net::X509Certificate>, - net::SHA256HashValueLessThan> fingerprints2; + std::map<net::SHA256HashValue, scoped_refptr<net::X509Certificate>> + fingerprints2; // Fill the map with fingerprints of certs from |certs2|. for (const auto& cert2 : certs2) {
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index 19498b7..7d25a7f0 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -727,6 +727,7 @@ void WaitForSessionStart() { if (IsSessionStarted()) return; + chromeos::WizardController::SkipPostLoginScreensForTesting(); content::WindowedNotificationObserver(chrome::NOTIFICATION_SESSION_STARTED, base::Bind(IsSessionStarted)).Wait(); }
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 9b68710..2011c91c 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.cc
@@ -8,9 +8,12 @@ #include <utility> #include <vector> +#include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "build/build_config.h" #include "chrome/browser/data_use_measurement/chrome_data_use_recorder.h" +#include "chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h" +#include "chrome/browser/data_use_measurement/page_load_capping/page_load_observer.h" #include "components/data_use_measurement/content/content_url_request_classifier.h" #include "components/data_use_measurement/core/data_use_recorder.h" #include "components/data_use_measurement/core/data_use_user_data.h" @@ -46,12 +49,24 @@ ChromeDataUseAscriber::ChromeDataUseAscriber() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + if (base::FeatureList::IsEnabled( + page_load_capping::features::kDetectingHeavyPages)) { + page_capping_observer_ = + std::make_unique<page_load_capping::PageLoadObserver>(); + AddObserver(page_capping_observer_.get()); + } } ChromeDataUseAscriber::~ChromeDataUseAscriber() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); DCHECK(main_render_frame_entry_map_.empty()); DCHECK(subframe_to_mainframe_map_.empty()); + + if (page_capping_observer_) { + // Remove the |page_capping_observer_| before the ObserverList is deleted. + RemoveObserver(page_capping_observer_.get()); + } + // DCHECK(pending_navigation_data_use_map_.empty()); // DCHECK(data_use_recorders_.empty()); }
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 0b9dcfc..ce54ee1 100644 --- a/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h +++ b/chrome/browser/data_use_measurement/chrome_data_use_ascriber.h
@@ -202,6 +202,9 @@ std::map<content::GlobalRequestID, DataUseRecorderEntry> pending_navigation_data_use_map_; + // Detects heavy pages. Can be null when the feature is disabled. + std::unique_ptr<DataUseAscriber::PageLoadObserver> page_capping_observer_; + DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriber); };
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 c7656613..7f60562 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
@@ -9,7 +9,9 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" +#include "chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h" #include "components/data_use_measurement/core/data_use_recorder.h" #include "content/public/browser/resource_request_info.h" #include "content/public/common/browser_side_navigation_policy.h" @@ -57,8 +59,12 @@ void TearDown() override { recorders().clear(); } + void CreateAscriber() { + ascriber_ = std::make_unique<ChromeDataUseAscriber>(); + } + std::list<ChromeDataUseRecorder>& recorders() { - return ascriber_.data_use_recorders_; + return ascriber_->data_use_recorders_; } net::TestURLRequestContext* context() { return &context_; } @@ -67,7 +73,7 @@ return resource_context_.get(); } - ChromeDataUseAscriber* ascriber() { return &ascriber_; } + ChromeDataUseAscriber* ascriber() { return ascriber_.get(); } std::unique_ptr<net::URLRequest> CreateNewRequest(std::string url, bool is_main_frame, @@ -89,14 +95,19 @@ return request; } + DataUseAscriber::PageLoadObserver* page_load_capping_observer() { + return ascriber_->page_capping_observer_.get(); + } + private: content::TestBrowserThreadBundle thread_bundle_; - ChromeDataUseAscriber ascriber_; + std::unique_ptr<ChromeDataUseAscriber> ascriber_; net::TestURLRequestContext context_; std::unique_ptr<content::MockResourceContext> resource_context_; }; TEST_F(ChromeDataUseAscriberTest, NoRecorderWithoutFrame) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -127,6 +138,7 @@ } TEST_F(ChromeDataUseAscriberTest, RenderFrameShownAndHidden) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -153,6 +165,7 @@ } TEST_F(ChromeDataUseAscriberTest, RenderFrameHiddenAndShown) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -179,6 +192,7 @@ } TEST_F(ChromeDataUseAscriberTest, RenderFrameHostChanged) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -209,6 +223,7 @@ } TEST_F(ChromeDataUseAscriberTest, MainFrameNavigation) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -246,6 +261,7 @@ } TEST_F(ChromeDataUseAscriberTest, SubResourceRequestsAttributed) { + CreateAscriber(); // A regression test that verifies that subframe requests in the second page // load in the same frame get attributed to the entry correctly. std::unique_ptr<net::URLRequest> page_load_a_main_frame_request = @@ -314,6 +330,7 @@ // ascribed to the previous page load, and requests started after are ascribed // to the next page load. TEST_F(ChromeDataUseAscriberTest, SubResourceRequestsAfterNavigationFinish) { + CreateAscriber(); 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 = @@ -415,6 +432,7 @@ } TEST_F(ChromeDataUseAscriberTest, FailedMainFrameNavigation) { + CreateAscriber(); std::unique_ptr<net::URLRequest> request = CreateNewRequest( "http://test.com", true, kRequestId, kRenderProcessId, kRenderFrameId); @@ -437,6 +455,12 @@ } TEST_F(ChromeDataUseAscriberTest, PageLoadObserverNotified) { + // Make sure that the page load capping observer does not DCHECK. + base::test::ScopedFeatureList feature_list; + feature_list.InitWithFeatures( + {page_load_capping::features::kDetectingHeavyPages}, {}); + + CreateAscriber(); // TODO(rajendrant): Handle PlzNavigate (http://crbug/664233). MockPageLoadObserver mock_observer; ascriber()->AddObserver(&mock_observer); @@ -489,6 +513,7 @@ } TEST_F(ChromeDataUseAscriberTest, PageLoadObserverForErrorPageValidatedURL) { + CreateAscriber(); MockPageLoadObserver mock_observer; ascriber()->AddObserver(&mock_observer); @@ -540,4 +565,17 @@ EXPECT_EQ(0u, recorders().size()); } +// Verify that the page load capping observer is only created when the feature +// is enabled. +TEST_F(ChromeDataUseAscriberTest, CappingObserverNeedsFeature) { + CreateAscriber(); + EXPECT_FALSE(page_load_capping_observer()); + base::test::ScopedFeatureList feature_list; + feature_list.InitWithFeatures( + {page_load_capping::features::kDetectingHeavyPages}, {}); + + CreateAscriber(); + EXPECT_TRUE(page_load_capping_observer()); +} + } // namespace data_use_measurement
diff --git a/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.cc b/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.cc new file mode 100644 index 0000000..dee82425 --- /dev/null +++ b/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.cc
@@ -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. + +#include "chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h" + +namespace data_use_measurement { +namespace page_load_capping { +namespace features { + +// Enables tracking heavy pages in Chrome. +const base::Feature kDetectingHeavyPages{"DetectingHeavyPages", + base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace features +} // namespace page_load_capping +} // namespace data_use_measurement
diff --git a/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h b/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h new file mode 100644 index 0000000..922c4c8 --- /dev/null +++ b/chrome/browser/data_use_measurement/page_load_capping/chrome_page_load_capping_features.h
@@ -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. + +#ifndef CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_CHROME_PAGE_LOAD_CAPPING_FEATURES_H_ +#define CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_CHROME_PAGE_LOAD_CAPPING_FEATURES_H_ + +#include "base/feature_list.h" + +namespace data_use_measurement { +namespace page_load_capping { +namespace features { + +extern const base::Feature kDetectingHeavyPages; + +} // namespace features +} // namespace page_load_capping +} // namespace data_use_measurement + +#endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_CHROME_PAGE_LOAD_CAPPING_FEATURES_H_
diff --git a/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.cc b/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.cc new file mode 100644 index 0000000..c367933 --- /dev/null +++ b/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.cc
@@ -0,0 +1,34 @@ +// 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/data_use_measurement/page_load_capping/page_load_observer.h" + +namespace data_use_measurement { +namespace page_load_capping { + +PageLoadObserver::PageLoadObserver() = default; +PageLoadObserver::~PageLoadObserver() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +// TODO(ryansturm): Add heavy page detection. https://crbug.com/797976 +void PageLoadObserver::OnPageLoadCommit(DataUse* data_use) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void PageLoadObserver::OnPageResourceLoad(const net::URLRequest& request, + DataUse* data_use) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void PageLoadObserver::OnPageDidFinishLoad(DataUse* data_use) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void PageLoadObserver::OnPageLoadConcluded(DataUse* data_use) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +} // namespace page_load_capping +} // namespace data_use_measurement
diff --git a/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.h b/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.h new file mode 100644 index 0000000..954ca67d --- /dev/null +++ b/chrome/browser/data_use_measurement/page_load_capping/page_load_observer.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 CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_PAGE_LOAD_OBSERVER_H_ +#define CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_PAGE_LOAD_OBSERVER_H_ + +#include "base/macros.h" +#include "base/sequence_checker.h" +#include "components/data_use_measurement/core/data_use_ascriber.h" + +namespace data_use_measurement { +namespace page_load_capping { + +class PageLoadObserver : public DataUseAscriber::PageLoadObserver { + public: + PageLoadObserver(); + ~PageLoadObserver() override; + + private: + // DataUseAscriber::PageLoadObserver: + void OnPageLoadCommit(DataUse* data_use) override; + void OnPageResourceLoad(const net::URLRequest& request, + DataUse* data_use) override; + void OnPageDidFinishLoad(DataUse* data_use) override; + void OnPageLoadConcluded(DataUse* data_use) override; + + SEQUENCE_CHECKER(sequence_checker_); + + DISALLOW_COPY_AND_ASSIGN(PageLoadObserver); +}; + +} // namespace page_load_capping +} // namespace data_use_measurement + +#endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_PAGE_LOAD_CAPPING_PAGE_LOAD_OBSERVER_H_
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index b6bf2642..6f0d8bd 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1136,10 +1136,6 @@ "running after the last window is closed, and to launch at OS startup, if " "the Push API needs it."; -const char kPwaMinimalUiName[] = "Minimal-UI display mode for PWAs"; -const char kPwaMinimalUiDescription[] = - "Enables support for Minimal-UI display mode for installed PWAs"; - const char kQuicName[] = "Experimental QUIC protocol"; const char kQuicDescription[] = "Enable experimental QUIC protocol support."; @@ -2277,12 +2273,6 @@ const char kGdiTextPrintingDescription[] = "Use GDI to print text as simply text"; -const char kMergeKeyCharEventsName[] = - "Enable or disable merging merging the key event (WM_KEY*) with char event " - "(WM_CHAR)."; -const char kMergeKeyCharEventsDescription[] = - "If disabled, Chrome will handle WM_KEY* and WM_CHAR separately."; - const char kTraceExportEventsToEtwName[] = "Enable exporting of tracing events to ETW."; const char kTraceExportEventsToEtwDesription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 0f8c5877..c93f4a3 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -702,9 +702,6 @@ extern const char kPushApiBackgroundModeName[]; extern const char kPushApiBackgroundModeDescription[]; -extern const char kPwaMinimalUiName[]; -extern const char kPwaMinimalUiDescription[]; - extern const char kQuicName[]; extern const char kQuicDescription[]; @@ -1394,9 +1391,6 @@ extern const char kGdiTextPrinting[]; extern const char kGdiTextPrintingDescription[]; -extern const char kMergeKeyCharEventsName[]; -extern const char kMergeKeyCharEventsDescription[]; - extern const char kTraceExportEventsToEtwName[]; extern const char kTraceExportEventsToEtwDesription[];
diff --git a/chrome/browser/installable/installable_manager.cc b/chrome/browser/installable/installable_manager.cc index 9cd94479..92a7245 100644 --- a/chrome/browser/installable/installable_manager.cc +++ b/chrome/browser/installable/installable_manager.cc
@@ -5,13 +5,11 @@ #include "chrome/browser/installable/installable_manager.h" #include "base/bind.h" -#include "base/feature_list.h" #include "base/stl_util.h" #include "base/strings/string_util.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ssl/security_state_tab_helper.h" -#include "chrome/common/chrome_features.h" #include "components/security_state/core/security_state.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" @@ -494,8 +492,7 @@ if (manifest.display != blink::kWebDisplayModeStandalone && manifest.display != blink::kWebDisplayModeFullscreen && - !(manifest.display == blink::kWebDisplayModeMinimalUi && - base::FeatureList::IsEnabled(features::kPwaMinimalUi))) { + manifest.display != blink::kWebDisplayModeMinimalUi) { valid_manifest_->error = MANIFEST_DISPLAY_NOT_SUPPORTED; return false; }
diff --git a/chrome/browser/installable/installable_manager_unittest.cc b/chrome/browser/installable/installable_manager_unittest.cc index 7bcbe25..4f1dd80e 100644 --- a/chrome/browser/installable/installable_manager_unittest.cc +++ b/chrome/browser/installable/installable_manager_unittest.cc
@@ -5,8 +5,6 @@ #include "chrome/browser/installable/installable_manager.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/scoped_feature_list.h" -#include "chrome/common/chrome_features.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebDisplayMode.h" @@ -187,8 +185,6 @@ } TEST_F(InstallableManagerUnitTest, ManifestDisplayModes) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndDisableFeature(features::kPwaMinimalUi); content::Manifest manifest = GetValidManifest(); manifest.display = blink::kWebDisplayModeUndefined; @@ -200,8 +196,8 @@ EXPECT_EQ(MANIFEST_DISPLAY_NOT_SUPPORTED, GetErrorCode()); manifest.display = blink::kWebDisplayModeMinimalUi; - EXPECT_FALSE(IsManifestValid(manifest)); - EXPECT_EQ(MANIFEST_DISPLAY_NOT_SUPPORTED, GetErrorCode()); + EXPECT_TRUE(IsManifestValid(manifest)); + EXPECT_EQ(NO_ERROR_DETECTED, GetErrorCode()); manifest.display = blink::kWebDisplayModeStandalone; EXPECT_TRUE(IsManifestValid(manifest)); @@ -211,14 +207,3 @@ EXPECT_TRUE(IsManifestValid(manifest)); EXPECT_EQ(NO_ERROR_DETECTED, GetErrorCode()); } - -TEST_F(InstallableManagerUnitTest, ManifestDisplayModesMinimalUiEnabled) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(features::kPwaMinimalUi); - - content::Manifest manifest = GetValidManifest(); - manifest.display = blink::kWebDisplayModeMinimalUi; - - EXPECT_TRUE(IsManifestValid(manifest)); - EXPECT_EQ(NO_ERROR_DETECTED, GetErrorCode()); -}
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc index 626cbeba..a999df0 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -88,7 +88,6 @@ #include "net/http/http_response_headers.h" #include "net/ssl/client_cert_store.h" #include "net/url_request/url_request.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" #include "third_party/protobuf/src/google/protobuf/repeated_field.h" #if BUILDFLAG(ENABLE_NACL) @@ -282,9 +281,7 @@ content::ResourceContext* resource_context, ResourceType resource_type, std::vector<std::unique_ptr<content::ResourceThrottle>>* throttles) { - bool is_prerendering = info.GetVisibilityState() == - blink::mojom::PageVisibilityState::kPrerender; - if (is_prerendering) + if (info.IsPrerendering()) return; const char* crx_id = NULL; @@ -675,8 +672,7 @@ #endif const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); - if (info->GetVisibilityState() == - blink::mojom::PageVisibilityState::kPrerender) { + if (info->IsPrerendering()) { throttles->push_back( base::MakeUnique<prerender::PrerenderResourceThrottle>(request)); }
diff --git a/chrome/browser/media/router/BUILD.gn b/chrome/browser/media/router/BUILD.gn index 9bdabea..df291727 100644 --- a/chrome/browser/media/router/BUILD.gn +++ b/chrome/browser/media/router/BUILD.gn
@@ -85,6 +85,8 @@ "mojo/media_router_mojo_metrics.h", "mojo/wired_display_media_route_provider.cc", "mojo/wired_display_media_route_provider.h", + "providers/cast/dual_media_sink_service.cc", + "providers/cast/dual_media_sink_service.h", ] }
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service.cc b/chrome/browser/media/router/discovery/dial/dial_media_sink_service.cc index f46d41a..0a1feae 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service.cc +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/common/service_manager_connection.h" @@ -13,23 +14,12 @@ namespace media_router { -namespace { - -void RunDialSinkAddedCallbackOnSequence( - const OnDialSinkAddedCallback& dial_sink_added_cb, - const scoped_refptr<base::SequencedTaskRunner>& task_runner, - const MediaSinkInternal& dial_sink) { - task_runner->PostTask(FROM_HERE, - base::BindOnce(dial_sink_added_cb, dial_sink)); -} - -} // namespace - -DialMediaSinkService::DialMediaSinkService(content::BrowserContext* context) - : impl_(nullptr, base::OnTaskRunnerDeleter(nullptr)) { +DialMediaSinkService::DialMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context) + : impl_(nullptr, base::OnTaskRunnerDeleter(nullptr)), + request_context_(request_context), + weak_ptr_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - auto* profile = Profile::FromBrowserContext(context); - request_context_ = profile->GetRequestContext(); DCHECK(request_context_); } @@ -39,39 +29,25 @@ void DialMediaSinkService::Start( const OnSinksDiscoveredCallback& sink_discovery_cb, - const OnDialSinkAddedCallback& dial_sink_added_cb, - const scoped_refptr<base::SequencedTaskRunner>& - dial_sink_added_cb_sequence) { + const OnDialSinkAddedCallback& dial_sink_added_cb) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!impl_); OnSinksDiscoveredCallback sink_discovery_cb_impl = base::BindRepeating( &RunSinksDiscoveredCallbackOnSequence, - base::SequencedTaskRunnerHandle::Get(), sink_discovery_cb); - OnDialSinkAddedCallback dial_sink_added_cb_impl; - if (dial_sink_added_cb) { - dial_sink_added_cb_impl = - base::BindRepeating(&RunDialSinkAddedCallbackOnSequence, - dial_sink_added_cb, dial_sink_added_cb_sequence); - } + base::SequencedTaskRunnerHandle::Get(), + base::BindRepeating(&DialMediaSinkService::RunSinksDiscoveredCallback, + weak_ptr_factory_.GetWeakPtr(), sink_discovery_cb)); - impl_ = CreateImpl(sink_discovery_cb_impl, dial_sink_added_cb_impl, - request_context_); + impl_ = + CreateImpl(sink_discovery_cb_impl, dial_sink_added_cb, request_context_); impl_->task_runner()->PostTask( FROM_HERE, base::BindOnce(&DialMediaSinkServiceImpl::Start, base::Unretained(impl_.get()))); } -void DialMediaSinkService::ForceSinkDiscoveryCallback() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - impl_->task_runner()->PostTask( - FROM_HERE, - base::BindOnce(&DialMediaSinkServiceImpl::ForceSinkDiscoveryCallback, - base::Unretained(impl_.get()))); -} - void DialMediaSinkService::OnUserGesture() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); impl_->task_runner()->PostTask( @@ -102,4 +78,10 @@ base::OnTaskRunnerDeleter(task_runner)); } +void DialMediaSinkService::RunSinksDiscoveredCallback( + const OnSinksDiscoveredCallback& sinks_discovered_cb, + std::vector<MediaSinkInternal> sinks) { + sinks_discovered_cb.Run(std::move(sinks)); +} + } // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service.h b/chrome/browser/media/router/discovery/dial/dial_media_sink_service.h index f446346..20f14f0 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service.h +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" #include "base/sequenced_task_runner_helpers.h" #include "chrome/common/media_router/discovery/media_sink_internal.h" @@ -16,10 +17,6 @@ #include "content/public/browser/browser_thread.h" #include "net/url_request/url_request_context_getter.h" -namespace content { -class BrowserContext; -} - namespace net { class URLRequestContextGetter; } @@ -36,30 +33,19 @@ // SequencedTaskRunner. class DialMediaSinkService { public: - // TODO(imcheng): We can make this a singleton by using - // |g_browser_process->system_request_context()| as the - // URLRequestContextGetter. - explicit DialMediaSinkService(content::BrowserContext* context); + explicit DialMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context); virtual ~DialMediaSinkService(); // Starts discovery of DIAL sinks. Can only be called once. // |sink_discovery_cb|: Callback to invoke on UI thread when the list of // discovered sinks has been updated. // |dial_sink_added_cb|: Callback to invoke when a new DIAL sink has been - // discovered. Can be null. - // |dial_sink_added_cb_sequence|: The sequence |dial_sink_added_cb| is - // invoked on, or nullptr if the callback is null. - // Both callbacks may be invoked after |this| is destroyed. + // discovered. The callback may be invoked on any thread, and may be invoked + // after |this| is destroyed. Can be null. // Marked virtual for tests. virtual void Start(const OnSinksDiscoveredCallback& sink_discovery_cb, - const OnDialSinkAddedCallback& dial_sink_added_cb, - const scoped_refptr<base::SequencedTaskRunner>& - dial_sink_added_cb_sequence); - - // Forces the sink discovery callback to be invoked with the current list of - // sinks. This method can only be called after |Start()|. - // Marked virtual for tests. - virtual void ForceSinkDiscoveryCallback(); + const OnDialSinkAddedCallback& dial_sink_added_cb); // Initiates discovery immediately in response to a user gesture // (i.e., opening the Media Router dialog). This method can only be called @@ -78,6 +64,10 @@ const OnDialSinkAddedCallback& dial_sink_added_cb, const scoped_refptr<net::URLRequestContextGetter>& request_context); + void RunSinksDiscoveredCallback( + const OnSinksDiscoveredCallback& sinks_discovered_cb, + std::vector<MediaSinkInternal> sinks); + // Created on the UI thread, used and destroyed on its SequencedTaskRunner. std::unique_ptr<DialMediaSinkServiceImpl, base::OnTaskRunnerDeleter> impl_; @@ -85,6 +75,7 @@ scoped_refptr<net::URLRequestContextGetter> request_context_; SEQUENCE_CHECKER(sequence_checker_); + base::WeakPtrFactory<DialMediaSinkService> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(DialMediaSinkService); };
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc index c85b054..e1c1dbc 100644 --- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc
@@ -50,7 +50,6 @@ ~MockDialMediaSinkServiceImpl() override = default; MOCK_METHOD0(Start, void()); - MOCK_METHOD0(ForceSinkDiscoveryCallback, void()); OnSinksDiscoveredCallback sinks_discovered_cb() { return sinks_discovered_cb_; @@ -66,9 +65,9 @@ class TestDialMediaSinkService : public DialMediaSinkService { public: explicit TestDialMediaSinkService( - content::BrowserContext* context, + const scoped_refptr<net::URLRequestContextGetter>& request_context, const scoped_refptr<base::TestSimpleTaskRunner>& task_runner) - : DialMediaSinkService(context), task_runner_(task_runner) {} + : DialMediaSinkService(request_context), task_runner_(task_runner) {} ~TestDialMediaSinkService() override = default; std::unique_ptr<DialMediaSinkServiceImpl, base::OnTaskRunnerDeleter> @@ -97,15 +96,15 @@ public: DialMediaSinkServiceTest() : task_runner_(new base::TestSimpleTaskRunner()), - service_(new TestDialMediaSinkService(&profile_, task_runner_)) {} + service_(new TestDialMediaSinkService(profile_.GetRequestContext(), + task_runner_)) {} void SetUp() override { service_->Start( base::BindRepeating(&DialMediaSinkServiceTest::OnSinksDiscovered, base::Unretained(this)), base::BindRepeating(&DialMediaSinkServiceTest::OnDialSinkAdded, - base::Unretained(this)), - base::SequencedTaskRunnerHandle::Get()); + base::Unretained(this))); mock_impl_ = service_->mock_impl(); ASSERT_TRUE(mock_impl_); EXPECT_CALL(*mock_impl_, Start()).WillOnce(InvokeWithoutArgs([this]() { @@ -133,41 +132,13 @@ DISALLOW_COPY_AND_ASSIGN(DialMediaSinkServiceTest); }; -TEST_F(DialMediaSinkServiceTest, TestForceSinkDiscoveryCallback) { - EXPECT_CALL(*mock_impl_, ForceSinkDiscoveryCallback()) - .WillOnce(InvokeWithoutArgs([this]() { - EXPECT_TRUE(this->task_runner_->RunsTasksInCurrentSequence()); - })); - - service_->ForceSinkDiscoveryCallback(); - task_runner_->RunUntilIdle(); - - // Actually invoke the callback. - std::vector<MediaSinkInternal> sinks = {CreateTestDialSink()}; - task_runner_->PostTask( - FROM_HERE, base::BindOnce(mock_impl_->sinks_discovered_cb(), sinks)); - task_runner_->RunUntilIdle(); - - EXPECT_CALL(*this, OnSinksDiscovered(sinks)).WillOnce(InvokeWithoutArgs([]() { - EXPECT_TRUE( - content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - })); - base::RunLoop().RunUntilIdle(); -} - TEST_F(DialMediaSinkServiceTest, OnDialSinkAddedCallback) { // Runs the callback on |task_runner_| and expects it to post task back to // UI thread. MediaSinkInternal sink = CreateTestDialSink(); - task_runner_->PostTask( - FROM_HERE, base::BindOnce(mock_impl_->dial_sink_added_cb(), sink)); - task_runner_->RunUntilIdle(); - EXPECT_CALL(*this, OnDialSinkAdded(sink)).WillOnce(InvokeWithoutArgs([]() { - EXPECT_TRUE( - content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - })); - base::RunLoop().RunUntilIdle(); + EXPECT_CALL(*this, OnDialSinkAdded(sink)); + mock_impl_->dial_sink_added_cb().Run(sink); } } // namespace media_router
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.cc index 32a5852c..60a65567 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.cc
@@ -90,10 +90,12 @@ const char CastMediaSinkService::kCastServiceType[] = "_googlecast._tcp.local"; CastMediaSinkService::CastMediaSinkService( - content::BrowserContext* browser_context) + const scoped_refptr<net::URLRequestContextGetter>& request_context) : impl_(nullptr, base::OnTaskRunnerDeleter(nullptr)), - browser_context_(browser_context) { + request_context_(request_context), + weak_ptr_factory_(this) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK(request_context_); } CastMediaSinkService::~CastMediaSinkService() { @@ -111,9 +113,14 @@ DCHECK(!impl_); // |sinks_discovered_cb| should only be invoked on the current sequence. - impl_ = CreateImpl(base::BindRepeating(&RunSinksDiscoveredCallbackOnSequence, - base::SequencedTaskRunnerHandle::Get(), - sinks_discovered_cb)); + // We wrap |sinks_discovered_cb| in a member function bound with WeakPtr to + // ensure it will only be invoked while |this| is still valid. + impl_ = CreateImpl(base::BindRepeating( + &RunSinksDiscoveredCallbackOnSequence, + base::SequencedTaskRunnerHandle::Get(), + base::BindRepeating(&CastMediaSinkService::RunSinksDiscoveredCallback, + weak_ptr_factory_.GetWeakPtr(), + sinks_discovered_cb))); impl_->task_runner()->PostTask( FROM_HERE, base::BindOnce(&CastMediaSinkServiceImpl::Start, base::Unretained(impl_.get()))); @@ -131,10 +138,9 @@ scoped_refptr<base::SequencedTaskRunner> task_runner = cast_socket_service->task_runner(); return std::unique_ptr<CastMediaSinkServiceImpl, base::OnTaskRunnerDeleter>( - new CastMediaSinkServiceImpl( - sinks_discovered_cb, cast_socket_service, - DiscoveryNetworkMonitor::GetInstance(), - Profile::FromBrowserContext(browser_context_)->GetRequestContext()), + new CastMediaSinkServiceImpl(sinks_discovered_cb, cast_socket_service, + DiscoveryNetworkMonitor::GetInstance(), + request_context_), base::OnTaskRunnerDeleter(task_runner)); } @@ -150,14 +156,6 @@ } } -void CastMediaSinkService::ForceSinkDiscoveryCallback() { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - impl_->task_runner()->PostTask( - FROM_HERE, - base::BindOnce(&CastMediaSinkServiceImpl::ForceSinkDiscoveryCallback, - base::Unretained(impl_.get()))); -} - void CastMediaSinkService::OnUserGesture() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (dns_sd_registry_) @@ -210,11 +208,6 @@ return impl_->GetDialSinkAddedCallback(); } -scoped_refptr<base::SequencedTaskRunner> -CastMediaSinkService::GetImplTaskRunner() { - return impl_->task_runner(); -} - void CastMediaSinkService::OnDialSinkAdded(const MediaSinkInternal& sink) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); impl_->task_runner()->PostTask( @@ -222,4 +215,10 @@ base::Unretained(impl_.get()), sink)); } +void CastMediaSinkService::RunSinksDiscoveredCallback( + const OnSinksDiscoveredCallback& sinks_discovered_cb, + std::vector<MediaSinkInternal> sinks) { + sinks_discovered_cb.Run(std::move(sinks)); +} + } // namespace media_router
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h index 1d4bfa9..3c973bb 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h
@@ -10,6 +10,7 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h" #include "chrome/browser/media/router/discovery/mdns/dns_sd_delegate.h" @@ -18,10 +19,6 @@ #include "chrome/common/media_router/discovery/media_sink_service_util.h" #include "content/public/browser/browser_thread.h" -namespace content { -class BrowserContext; -} // namespace content - namespace media_router { class CastMediaSinkServiceImpl; @@ -34,7 +31,8 @@ // mDNS service types. static const char kCastServiceType[]; - explicit CastMediaSinkService(content::BrowserContext* browser_context); + explicit CastMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context); ~CastMediaSinkService() override; @@ -42,25 +40,14 @@ // to perform dual discovery). The callback must be run on the sequence given // by |GetImplTaskRunner()|. It is safe to invoke this callback after |this| // is destroyed. - // TODO(imcheng): It would be better to have this callback PostTask to the - // correct SequencedTaskRunner rather than making the caller do it. OnDialSinkAddedCallback GetDialSinkAddedCallback(); - // Returns |impl_|'s task runner to be used with |GetDialSinkAddedCallback()|. - scoped_refptr<base::SequencedTaskRunner> GetImplTaskRunner(); - // Starts Cast sink discovery. No-ops if already started. // |sink_discovery_cb|: Callback to invoke when the list of discovered sinks - // has been updated. The callback is invoked on the UI thread and may be - // invoked after |this| is destroyed. + // has been updated. // Marked virtual for tests. virtual void Start(const OnSinksDiscoveredCallback& sinks_discovered_cb); - // Forces the sink discovery callback to be invoked with the current list of - // sinks. - // Marked virtual for tests. - virtual void ForceSinkDiscoveryCallback(); - // Initiates discovery immediately in response to a user gesture // (i.e., opening the Media Router dialog). // TODO(imcheng): Rename to ManuallyInitiateDiscovery() or similar. @@ -91,6 +78,9 @@ FRIEND_TEST_ALL_PREFIXES(CastMediaSinkServiceTest, TestTimer); void OnDialSinkAdded(const MediaSinkInternal& sink); + void RunSinksDiscoveredCallback( + const OnSinksDiscoveredCallback& sinks_discovered_cb, + std::vector<MediaSinkInternal> sinks); // DnsSdRegistry::DnsSdObserver implementation void OnDnsSdEvent(const std::string& service_type, @@ -106,7 +96,9 @@ // List of cast sinks found in current round of mDNS discovery. std::vector<MediaSinkInternal> cast_sinks_; - content::BrowserContext* browser_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; + + base::WeakPtrFactory<CastMediaSinkService> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(CastMediaSinkService); };
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc index 3f69a5cb..d1567ef 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.cc
@@ -605,8 +605,19 @@ } OnDialSinkAddedCallback CastMediaSinkServiceImpl::GetDialSinkAddedCallback() { - return base::BindRepeating(&CastMediaSinkServiceImpl::OnDialSinkAdded, - GetWeakPtr()); + return base::BindRepeating( + &CastMediaSinkServiceImpl::InvokeOnDialSinkAddedOnTaskRunner, + GetWeakPtr(), task_runner_); +} + +// static +void CastMediaSinkServiceImpl::InvokeOnDialSinkAddedOnTaskRunner( + const base::WeakPtr<CastMediaSinkServiceImpl>& impl, + const scoped_refptr<base::SequencedTaskRunner>& task_runner, + const MediaSinkInternal& dial_sink) { + task_runner->PostTask( + FROM_HERE, base::BindOnce(&CastMediaSinkServiceImpl::OnDialSinkAdded, + impl, dial_sink)); } CastMediaSinkServiceImpl::RetryParams::RetryParams()
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h index ef4bd73..fa76b49 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h
@@ -198,6 +198,14 @@ static OpenParams GetFromFieldTrialParam(); }; + // Invokes |impl->OnDialSinkAdded| with |dial_sink| on |task_runner|. This + // method may be called on any thread, and may be called after |impl| is + // destroyed. + static void InvokeOnDialSinkAddedOnTaskRunner( + const base::WeakPtr<CastMediaSinkServiceImpl>& impl, + const scoped_refptr<base::SequencedTaskRunner>& task_runner, + const MediaSinkInternal& dial_sink); + // Marked virtual for testing. virtual void OpenChannels(const std::vector<MediaSinkInternal>& cast_sinks, SinkSource sink_source);
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc index a510b8f1..8491f294 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_unittest.cc
@@ -71,7 +71,6 @@ MOCK_METHOD2(OpenChannels, void(const std::vector<MediaSinkInternal>& cast_sinks, CastMediaSinkServiceImpl::SinkSource sink_source)); - MOCK_METHOD0(ForceSinkDiscoveryCallback, void()); OnSinksDiscoveredCallback sinks_discovered_cb() { return sinks_discovered_cb_; @@ -83,10 +82,11 @@ class TestCastMediaSinkService : public CastMediaSinkService { public: - TestCastMediaSinkService(content::BrowserContext* browser_context, - cast_channel::CastSocketService* cast_socket_service, - DiscoveryNetworkMonitor* network_monitor) - : CastMediaSinkService(browser_context), + TestCastMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context, + cast_channel::CastSocketService* cast_socket_service, + DiscoveryNetworkMonitor* network_monitor) + : CastMediaSinkService(request_context), cast_socket_service_(cast_socket_service), network_monitor_(network_monitor) {} ~TestCastMediaSinkService() override = default; @@ -118,7 +118,7 @@ mock_cast_socket_service_( new cast_channel::MockCastSocketService(task_runner_)), media_sink_service_(new TestCastMediaSinkService( - &profile_, + profile_.GetRequestContext(), mock_cast_socket_service_.get(), DiscoveryNetworkMonitor::GetInstance())), test_dns_sd_registry_(media_sink_service_.get()) {} @@ -187,27 +187,4 @@ EXPECT_EQ(2u, sinks.size()); } -TEST_F(CastMediaSinkServiceTest, TestForceSinkDiscoveryCallback) { - EXPECT_CALL(*mock_impl_, ForceSinkDiscoveryCallback()) - .WillOnce(InvokeWithoutArgs([this]() { - EXPECT_TRUE(this->task_runner_->RunsTasksInCurrentSequence()); - })); - - media_sink_service_->ForceSinkDiscoveryCallback(); - task_runner_->RunUntilIdle(); - - // Actually invoke the callback. - task_runner_->PostTask(FROM_HERE, - base::BindOnce(mock_impl_->sinks_discovered_cb(), - std::vector<MediaSinkInternal>())); - task_runner_->RunUntilIdle(); - - EXPECT_CALL(mock_sink_discovered_ui_cb_, Run(_)) - .WillOnce(InvokeWithoutArgs([]() { - EXPECT_TRUE( - content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - })); - base::RunLoop().RunUntilIdle(); -} - } // namespace media_router
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.cc b/chrome/browser/media/router/mojo/media_router_desktop.cc index c4b62128..778bb102 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.cc +++ b/chrome/browser/media/router/mojo/media_router_desktop.cc
@@ -5,13 +5,13 @@ #include "chrome/browser/media/router/mojo/media_router_desktop.h" #include "base/strings/string_util.h" -#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" -#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/media/router/media_router_factory.h" #include "chrome/browser/media/router/media_router_feature.h" #include "chrome/browser/media/router/mojo/media_route_controller.h" #include "chrome/browser/media/router/mojo/media_router_mojo_metrics.h" #include "chrome/browser/media/router/mojo/wired_display_media_route_provider.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_features.h" #include "chrome/common/media_router/media_source_helper.h" #include "extensions/common/extension.h" @@ -42,11 +42,8 @@ // media source. UpdateMediaSinks(MediaSourceForDesktop().id()); - if (dial_media_sink_service_) - dial_media_sink_service_->OnUserGesture(); - - if (cast_media_sink_service_) - cast_media_sink_service_->OnUserGesture(); + if (media_sink_service_) + media_sink_service_->OnUserGesture(); #if defined(OS_WIN) EnsureMdnsDiscoveryEnabled(); @@ -67,7 +64,9 @@ } MediaRouterDesktop::MediaRouterDesktop(content::BrowserContext* context) - : MediaRouterMojoImpl(context), weak_factory_(this) { + : MediaRouterMojoImpl(context), + media_sink_service_(nullptr), + weak_factory_(this) { InitializeMediaRouteProviders(); #if defined(OS_WIN) CanFirewallUseLocalPorts( @@ -76,13 +75,10 @@ #endif } -MediaRouterDesktop::MediaRouterDesktop( - content::BrowserContext* context, - std::unique_ptr<DialMediaSinkService> dial_media_sink_service, - std::unique_ptr<CastMediaSinkService> cast_media_sink_service) +MediaRouterDesktop::MediaRouterDesktop(content::BrowserContext* context, + DualMediaSinkService* media_sink_service) : MediaRouterMojoImpl(context), - dial_media_sink_service_(std::move(dial_media_sink_service)), - cast_media_sink_service_(std::move(cast_media_sink_service)), + media_sink_service_(media_sink_service), weak_factory_(this) { InitializeMediaRouteProviders(); } @@ -112,7 +108,7 @@ void MediaRouterDesktop::RegisterExtensionMediaRouteProvider( mojom::MediaRouteProviderPtr extension_provider_ptr) { - StartDiscovery(); + ProvideSinksToExtension(); #if defined(OS_WIN) // The extension MRP already turns on mDNS discovery for platforms other than // Windows. It only relies on this signalling from MR on Windows to avoid @@ -149,48 +145,33 @@ } } -void MediaRouterDesktop::StartDiscovery() { +void MediaRouterDesktop::ProvideSinksToExtension() { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - DVLOG(1) << "StartDiscovery"; + DVLOG(1) << "ProvideSinksToExtension"; + if (!media_sink_service_) + media_sink_service_ = DualMediaSinkService::GetInstance(); - if (media_router::CastDiscoveryEnabled()) { - if (!cast_media_sink_service_) { - cast_media_sink_service_ = - std::make_unique<CastMediaSinkService>(context()); - cast_media_sink_service_->Start( - base::BindRepeating(&MediaRouterDesktop::ProvideSinks, - weak_factory_.GetWeakPtr(), "cast")); - } else { - cast_media_sink_service_->ForceSinkDiscoveryCallback(); - } + // If calling |ProvideSinksToExtension| for the first time, add a callback to + // be notified of sink updates. + if (!media_sink_service_subscription_) { + media_sink_service_subscription_ = + media_sink_service_->AddSinksDiscoveredCallback(base::BindRepeating( + &MediaRouterDesktop::ProvideSinks, base::Unretained(this))); } - if (!dial_media_sink_service_) { - dial_media_sink_service_ = - std::make_unique<DialMediaSinkService>(context()); - - OnDialSinkAddedCallback dial_sink_added_cb; - scoped_refptr<base::SequencedTaskRunner> dial_sink_added_cb_sequence; - if (cast_media_sink_service_) { - dial_sink_added_cb = cast_media_sink_service_->GetDialSinkAddedCallback(); - dial_sink_added_cb_sequence = - cast_media_sink_service_->GetImplTaskRunner(); - } - dial_media_sink_service_->Start( - base::BindRepeating(&MediaRouterDesktop::ProvideSinks, - weak_factory_.GetWeakPtr(), "dial"), - dial_sink_added_cb, dial_sink_added_cb_sequence); - } else { - dial_media_sink_service_->ForceSinkDiscoveryCallback(); - } + // Sync the current list of sinks to the extension. + for (const auto& provider_and_sinks : media_sink_service_->current_sinks()) + ProvideSinks(provider_and_sinks.first, provider_and_sinks.second); } -void MediaRouterDesktop::ProvideSinks(const std::string& provider_name, - std::vector<MediaSinkInternal> sinks) { +void MediaRouterDesktop::ProvideSinks( + const std::string& provider_name, + const std::vector<MediaSinkInternal>& sinks) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DVLOG(1) << "Provider [" << provider_name << "] found " << sinks.size() << " devices..."; - extension_provider_proxy_->ProvideSinks(provider_name, std::move(sinks)); + media_route_providers_[MediaRouteProviderId::EXTENSION]->ProvideSinks( + provider_name, sinks); } void MediaRouterDesktop::InitializeMediaRouteProviders() { @@ -224,8 +205,9 @@ #if defined(OS_WIN) void MediaRouterDesktop::EnsureMdnsDiscoveryEnabled() { - if (cast_media_sink_service_) { - cast_media_sink_service_->StartMdnsDiscovery(); + if (media_router::CastDiscoveryEnabled()) { + if (media_sink_service_) + media_sink_service_->StartMdnsDiscovery(); } else { media_route_providers_[MediaRouteProviderId::EXTENSION] ->EnableMdnsDiscovery();
diff --git a/chrome/browser/media/router/mojo/media_router_desktop.h b/chrome/browser/media/router/mojo/media_router_desktop.h index 91d0f35..28ec294 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop.h +++ b/chrome/browser/media/router/mojo/media_router_desktop.h
@@ -9,6 +9,7 @@ #include "build/build_config.h" #include "chrome/browser/media/router/mojo/extension_media_route_provider_proxy.h" #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" +#include "chrome/browser/media/router/providers/cast/dual_media_sink_service.h" namespace content { class RenderFrameHost; @@ -19,8 +20,7 @@ } namespace media_router { -class CastMediaSinkService; -class DialMediaSinkService; +class DualMediaSinkService; class WiredDisplayMediaRouteProvider; // MediaRouter implementation that uses the MediaRouteProvider implemented in @@ -55,7 +55,7 @@ template <bool> friend class MediaRouterDesktopTestBase; friend class MediaRouterFactory; - FRIEND_TEST_ALL_PREFIXES(MediaRouterDesktopTest, TestProvideSinks); + FRIEND_TEST_ALL_PREFIXES(MediaRouterDesktopTest, ProvideSinks); // This constructor performs a firewall check on Windows and is not suitable // for use in unit tests; instead use the constructor below. @@ -63,10 +63,8 @@ // Used by tests only. This constructor skips the firewall check so unit tests // do not have to depend on the system's firewall configuration. - MediaRouterDesktop( - content::BrowserContext* context, - std::unique_ptr<DialMediaSinkService> dial_media_sink_service, - std::unique_ptr<CastMediaSinkService> cast_media_sink_service); + MediaRouterDesktop(content::BrowserContext* context, + DualMediaSinkService* media_sink_service); // mojom::MediaRouter implementation. void RegisterMediaRouteProvider( @@ -86,15 +84,16 @@ void BindToMojoRequest(mojo::InterfaceRequest<mojom::MediaRouter> request, const extensions::Extension& extension); - // Starts browser side sink discovery. - void StartDiscovery(); + // Provides the current list of sinks from |media_sink_service_| to the + // extension. Also registers with |media_sink_service_| to listen for updates. + void ProvideSinksToExtension(); // Notifies the Media Router that the list of MediaSinks discovered by a // MediaSinkService has been updated. // |provider_name|: Name of the MediaSinkService providing the sinks. // |sinks|: sinks discovered by MediaSinkService. void ProvideSinks(const std::string& provider_name, - std::vector<MediaSinkInternal> sinks); + const std::vector<MediaSinkInternal>& sinks); // Initializes MRPs and adds them to |media_route_providers_|. void InitializeMediaRouteProviders(); @@ -122,11 +121,8 @@ // MediaRouteProvider for casting to local screens. std::unique_ptr<WiredDisplayMediaRouteProvider> wired_display_provider_; - // Media sink service for DIAL devices. - std::unique_ptr<DialMediaSinkService> dial_media_sink_service_; - - // Media sink service for CAST devices. - std::unique_ptr<CastMediaSinkService> cast_media_sink_service_; + DualMediaSinkService* media_sink_service_; + DualMediaSinkService::Subscription media_sink_service_subscription_; // A flag to ensure that we record the provider version once, during the // initial event page wakeup attempt.
diff --git a/chrome/browser/media/router/mojo/media_router_desktop_unittest.cc b/chrome/browser/media/router/mojo/media_router_desktop_unittest.cc index a46f21c..82ac575 100644 --- a/chrome/browser/media/router/mojo/media_router_desktop_unittest.cc +++ b/chrome/browser/media/router/mojo/media_router_desktop_unittest.cc
@@ -14,13 +14,12 @@ #include "base/run_loop.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" -#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" -#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" #include "chrome/browser/media/router/event_page_request_manager.h" #include "chrome/browser/media/router/event_page_request_manager_factory.h" #include "chrome/browser/media/router/media_router_factory.h" #include "chrome/browser/media/router/media_router_feature.h" #include "chrome/browser/media/router/mojo/media_router_mojo_test.h" +#include "chrome/browser/media/router/test_helper.h" #include "chrome/common/media_router/media_source_helper.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -49,32 +48,6 @@ final {} }; -class MockDialMediaSinkService : public DialMediaSinkService { - public: - explicit MockDialMediaSinkService(content::BrowserContext* context) - : DialMediaSinkService(context) {} - ~MockDialMediaSinkService() override {} - - MOCK_METHOD3(Start, - void(const OnSinksDiscoveredCallback&, - const OnDialSinkAddedCallback&, - const scoped_refptr<base::SequencedTaskRunner>&)); - MOCK_METHOD0(ForceSinkDiscoveryCallback, void()); - MOCK_METHOD0(OnUserGesture, void()); -}; - -class MockCastMediaSinkService : public CastMediaSinkService { - public: - explicit MockCastMediaSinkService(content::BrowserContext* context) - : CastMediaSinkService(context) {} - ~MockCastMediaSinkService() override {} - - MOCK_METHOD1(Start, void(const OnSinksDiscoveredCallback&)); - MOCK_METHOD0(ForceSinkDiscoveryCallback, void()); - MOCK_METHOD0(OnUserGesture, void()); - MOCK_METHOD0(StartMdnsDiscovery, void()); -}; - } // namespace template <bool enable_cast_discovery> @@ -83,43 +56,38 @@ MediaRouterDesktopTestBase() {} ~MediaRouterDesktopTestBase() override {} - protected: - void SetUp() override { - if (enable_cast_discovery) - feature_list_.InitWithFeatures({kEnableCastDiscovery}, {}); - - MediaRouterMojoTest::SetUp(); + DualMediaSinkService* media_sink_service() { + return media_sink_service_.get(); } - std::unique_ptr<MediaRouterMojoImpl> CreateMediaRouter() override { - auto dial_media_sink_service = - std::make_unique<MockDialMediaSinkService>(profile()); - dial_media_sink_service_ = dial_media_sink_service.get(); + MockCastMediaSinkService* cast_media_sink_service() { + return cast_media_sink_service_; + } + protected: + std::unique_ptr<MediaRouterMojoImpl> CreateMediaRouter() override { std::unique_ptr<MockCastMediaSinkService> cast_media_sink_service; if (enable_cast_discovery) { - cast_media_sink_service = - std::make_unique<MockCastMediaSinkService>(profile()); + feature_list_.InitWithFeatures({kEnableCastDiscovery}, {}); + cast_media_sink_service = std::make_unique<MockCastMediaSinkService>( + profile()->GetRequestContext()); cast_media_sink_service_ = cast_media_sink_service.get(); } + media_sink_service_ = std::unique_ptr<DualMediaSinkService>( + new DualMediaSinkService(std::move(cast_media_sink_service), + std::make_unique<MockDialMediaSinkService>( + profile()->GetRequestContext()))); return std::unique_ptr<MediaRouterDesktop>( - new MediaRouterDesktop(profile(), std::move(dial_media_sink_service), - std::move(cast_media_sink_service))); - } - - MockDialMediaSinkService* dial_media_sink_service() const { - return dial_media_sink_service_; - } - - MockCastMediaSinkService* cast_media_sink_service() const { - return cast_media_sink_service_; + new MediaRouterDesktop(profile(), media_sink_service_.get())); } private: base::test::ScopedFeatureList feature_list_; - MockDialMediaSinkService* dial_media_sink_service_ = nullptr; - MockCastMediaSinkService* cast_media_sink_service_ = nullptr; + std::unique_ptr<DualMediaSinkService> media_sink_service_; + + // Owned by |media_sink_service_|. + MockCastMediaSinkService* cast_media_sink_service_; DISALLOW_COPY_AND_ASSIGN(MediaRouterDesktopTestBase); }; @@ -169,8 +137,6 @@ TEST_F(MediaRouterDesktopTest, OnUserGesture) { EXPECT_CALL(mock_extension_provider_, UpdateMediaSinks(MediaSourceForDesktop().id())); - EXPECT_CALL(*dial_media_sink_service(), OnUserGesture()); - EXPECT_CALL(*cast_media_sink_service(), OnUserGesture()); router()->OnUserGesture(); base::RunLoop().RunUntilIdle(); } @@ -203,7 +169,7 @@ EXPECT_TRUE(Mock::VerifyAndClearExpectations(&mock_extension_provider_)); } -TEST_F(MediaRouterDesktopTest, TestProvideSinks) { +TEST_F(MediaRouterDesktopTest, ProvideSinks) { std::vector<MediaSinkInternal> sinks; MediaSink sink("sinkId", "sinkName", SinkIconType::CAST, MediaRouteProviderId::EXTENSION); @@ -217,11 +183,14 @@ sinks.push_back(expected_sink); std::string provider_name = "cast"; + // |router()| is already registered with |media_sink_service_| during + // |SetUp()|. EXPECT_CALL(mock_extension_provider_, ProvideSinks(provider_name, sinks)); + media_sink_service()->OnSinksDiscovered(provider_name, sinks); + base::RunLoop().RunUntilIdle(); - MediaRouterDesktop* media_router_desktop = - static_cast<MediaRouterDesktop*>(router()); - media_router_desktop->ProvideSinks(provider_name, sinks); + EXPECT_CALL(mock_extension_provider_, ProvideSinks(provider_name, sinks)); + static_cast<MediaRouterDesktop*>(router())->ProvideSinksToExtension(); base::RunLoop().RunUntilIdle(); }
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_test.cc b/chrome/browser/media/router/mojo/media_router_mojo_test.cc index c28f8937..ca2ed0ed 100644 --- a/chrome/browser/media/router/mojo/media_router_mojo_test.cc +++ b/chrome/browser/media/router/mojo/media_router_mojo_test.cc
@@ -197,7 +197,10 @@ } void MediaRouterMojoTest::TearDown() { + sinks_observer_.reset(); + routes_observer_.reset(); media_router_->Shutdown(); + media_router_.reset(); } void MediaRouterMojoTest::ProvideTestRoute(MediaRouteProviderId provider_id,
diff --git a/chrome/browser/media/router/providers/cast/dual_media_sink_service.cc b/chrome/browser/media/router/providers/cast/dual_media_sink_service.cc new file mode 100644 index 0000000..fa4cd15 --- /dev/null +++ b/chrome/browser/media/router/providers/cast/dual_media_sink_service.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 "chrome/browser/media/router/providers/cast/dual_media_sink_service.h" + +#include "base/memory/ref_counted.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" +#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" +#include "chrome/browser/media/router/media_router_feature.h" +#include "content/public/browser/browser_thread.h" +#include "net/url_request/url_request_context_getter.h" + +namespace media_router { + +// static +DualMediaSinkService* DualMediaSinkService::GetInstance() { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + static DualMediaSinkService* instance = new DualMediaSinkService(); + return instance; +} + +DualMediaSinkService::Subscription +DualMediaSinkService::AddSinksDiscoveredCallback( + const OnSinksDiscoveredProviderCallback& callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return sinks_discovered_callbacks_.Add(callback); +} + +void DualMediaSinkService::OnUserGesture() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + dial_media_sink_service_->OnUserGesture(); + if (cast_media_sink_service_) + cast_media_sink_service_->OnUserGesture(); +} + +void DualMediaSinkService::StartMdnsDiscovery() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (cast_media_sink_service_) + cast_media_sink_service_->StartMdnsDiscovery(); +} + +DualMediaSinkService::DualMediaSinkService() { + scoped_refptr<net::URLRequestContextGetter> request_context = + g_browser_process->system_request_context(); + + if (media_router::CastDiscoveryEnabled()) { + cast_media_sink_service_ = + std::make_unique<CastMediaSinkService>(request_context); + cast_media_sink_service_->Start( + base::BindRepeating(&DualMediaSinkService::OnSinksDiscovered, + base::Unretained(this), "cast")); + } + + OnDialSinkAddedCallback dial_sink_added_cb; + if (cast_media_sink_service_) + dial_sink_added_cb = cast_media_sink_service_->GetDialSinkAddedCallback(); + + dial_media_sink_service_ = std::make_unique<DialMediaSinkService>( + g_browser_process->system_request_context()); + dial_media_sink_service_->Start( + base::BindRepeating(&DualMediaSinkService::OnSinksDiscovered, + base::Unretained(this), "dial"), + dial_sink_added_cb); +} + +DualMediaSinkService::DualMediaSinkService( + std::unique_ptr<CastMediaSinkService> cast_media_sink_service, + std::unique_ptr<DialMediaSinkService> dial_media_sink_service) + : cast_media_sink_service_(std::move(cast_media_sink_service)), + dial_media_sink_service_(std::move(dial_media_sink_service)) {} + +DualMediaSinkService::~DualMediaSinkService() = default; + +void DualMediaSinkService::OnSinksDiscovered( + const std::string& provider_name, + std::vector<MediaSinkInternal> sinks) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + auto& sinks_for_provider = current_sinks_[provider_name]; + sinks_for_provider = std::move(sinks); + sinks_discovered_callbacks_.Notify(provider_name, sinks_for_provider); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/providers/cast/dual_media_sink_service.h b/chrome/browser/media/router/providers/cast/dual_media_sink_service.h new file mode 100644 index 0000000..881fa7d --- /dev/null +++ b/chrome/browser/media/router/providers/cast/dual_media_sink_service.h
@@ -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. + +#ifndef CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_DUAL_MEDIA_SINK_SERVICE_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_DUAL_MEDIA_SINK_SERVICE_H_ + +#include <memory> +#include <string> +#include <vector> + +#include "base/callback.h" +#include "base/callback_list.h" +#include "base/containers/flat_map.h" +#include "base/gtest_prod_util.h" +#include "base/macros.h" +#include "base/sequence_checker.h" +#include "chrome/common/media_router/discovery/media_sink_internal.h" + +namespace media_router { + +class CastMediaSinkService; +class DialMediaSinkService; + +// This class uses DialMediaSinkService and CastMediaSinkService to discover +// sinks used by the Cast MediaRouteProvider. It also encapsulates the setup +// necessary to enable dual discovery on Dial/CastMediaSinkService. +// All methods must be called on the UI thread. +class DualMediaSinkService { + public: + // Arg 0: Provider name ("dial" or "cast"). + // Arg 1: List of sinks for the provider. + using OnSinksDiscoveredProviderCallback = + base::RepeatingCallback<void(const std::string&, + const std::vector<MediaSinkInternal>&)>; + using OnSinksDiscoveredProviderCallbackList = + base::CallbackList<void(const std::string&, + const std::vector<MediaSinkInternal>&)>; + using Subscription = + std::unique_ptr<OnSinksDiscoveredProviderCallbackList::Subscription>; + + // Returns the lazily-created leaky singleton instance. + static DualMediaSinkService* GetInstance(); + + // Returns the current list of sinks, keyed by provider name. + const base::flat_map<std::string, std::vector<MediaSinkInternal>>& + current_sinks() { + return current_sinks_; + } + + // Adds |callback| to be notified when the list of discovered sinks changes. + // The caller is responsible for destroying the returned Subscription when it + // no longer wishes to receive updates. + Subscription AddSinksDiscoveredCallback( + const OnSinksDiscoveredProviderCallback& callback); + + void OnUserGesture(); + + // Starts mDNS discovery on |cast_media_sink_service_| if it is not already + // started. + void StartMdnsDiscovery(); + + private: + friend class DualMediaSinkServiceTest; + FRIEND_TEST_ALL_PREFIXES(DualMediaSinkServiceTest, + AddSinksDiscoveredCallback); + template <bool> + friend class MediaRouterDesktopTestBase; + FRIEND_TEST_ALL_PREFIXES(MediaRouterDesktopTest, ProvideSinks); + + friend struct std::default_delete<DualMediaSinkService>; + + DualMediaSinkService(); + + // Used by tests. + DualMediaSinkService( + std::unique_ptr<CastMediaSinkService> cast_media_sink_service, + std::unique_ptr<DialMediaSinkService> dial_media_sink_service); + + ~DualMediaSinkService(); + + void OnSinksDiscovered(const std::string& provider_name, + std::vector<MediaSinkInternal> sinks); + + std::unique_ptr<CastMediaSinkService> cast_media_sink_service_; + std::unique_ptr<DialMediaSinkService> dial_media_sink_service_; + + OnSinksDiscoveredProviderCallbackList sinks_discovered_callbacks_; + base::flat_map<std::string, std::vector<MediaSinkInternal>> current_sinks_; + + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(DualMediaSinkService); +}; + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_DUAL_MEDIA_SINK_SERVICE_H_
diff --git a/chrome/browser/media/router/providers/cast/dual_media_sink_service_unittest.cc b/chrome/browser/media/router/providers/cast/dual_media_sink_service_unittest.cc new file mode 100644 index 0000000..9f107d5 --- /dev/null +++ b/chrome/browser/media/router/providers/cast/dual_media_sink_service_unittest.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 "chrome/browser/media/router/providers/cast/dual_media_sink_service.h" + +#include "chrome/browser/media/router/test_helper.h" +#include "chrome/test/base/testing_profile.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media_router { + +class DualMediaSinkServiceTest : public testing::Test { + public: + DualMediaSinkServiceTest() { + auto cast_media_sink_service = std::make_unique<MockCastMediaSinkService>( + profile_.GetRequestContext()); + auto dial_media_sink_service = std::make_unique<MockDialMediaSinkService>( + profile_.GetRequestContext()); + cast_media_sink_service_ = cast_media_sink_service.get(); + dial_media_sink_service_ = dial_media_sink_service.get(); + dual_media_sink_service_ = std::unique_ptr<DualMediaSinkService>( + new DualMediaSinkService(std::move(cast_media_sink_service), + std::move(dial_media_sink_service))); + } + + ~DualMediaSinkServiceTest() override = default; + + MockDialMediaSinkService* dial_media_sink_service() { + return dial_media_sink_service_; + } + MockCastMediaSinkService* cast_media_sink_service() { + return cast_media_sink_service_; + } + DualMediaSinkService* dual_media_sink_service() { + return dual_media_sink_service_.get(); + } + + MOCK_METHOD2(OnSinksDiscovered, + void(const std::string& provider_name, + const std::vector<MediaSinkInternal>& sinks)); + + private: + content::TestBrowserThreadBundle thread_bundle_; + TestingProfile profile_; + MockCastMediaSinkService* cast_media_sink_service_; + MockDialMediaSinkService* dial_media_sink_service_; + std::unique_ptr<DualMediaSinkService> dual_media_sink_service_; +}; + +TEST_F(DualMediaSinkServiceTest, OnUserGesture) { + EXPECT_CALL(*cast_media_sink_service(), OnUserGesture()); + EXPECT_CALL(*dial_media_sink_service(), OnUserGesture()); + dual_media_sink_service()->OnUserGesture(); +} + +TEST_F(DualMediaSinkServiceTest, AddSinksDiscoveredCallback) { + auto subscription = dual_media_sink_service()->AddSinksDiscoveredCallback( + base::BindRepeating(&DualMediaSinkServiceTest::OnSinksDiscovered, + base::Unretained(this))); + + base::flat_map<std::string, std::vector<MediaSinkInternal>> sink_map; + std::string dial_provider_name = "dial"; + MediaSinkInternal dial_sink1; + dial_sink1.set_sink(MediaSink("dial_sink1", "", SinkIconType::GENERIC, + MediaRouteProviderId::EXTENSION)); + MediaSinkInternal dial_sink2; + dial_sink2.set_sink(MediaSink("dial_sink2", "", SinkIconType::GENERIC, + MediaRouteProviderId::EXTENSION)); + + sink_map[dial_provider_name] = {dial_sink1, dial_sink2}; + + EXPECT_CALL(*this, OnSinksDiscovered(dial_provider_name, + sink_map[dial_provider_name])); + dual_media_sink_service()->OnSinksDiscovered(dial_provider_name, + sink_map[dial_provider_name]); + + EXPECT_EQ(sink_map, dual_media_sink_service()->current_sinks()); + + // |this| no longer receive updates. + subscription.reset(); + + std::string cast_provider_name = "cast"; + MediaSinkInternal cast_sink; + cast_sink.set_sink(MediaSink("cast_sink", "", SinkIconType::CAST, + MediaRouteProviderId::EXTENSION)); + sink_map[cast_provider_name] = {cast_sink}; + EXPECT_CALL(*this, OnSinksDiscovered(testing::_, testing::_)).Times(0); + dual_media_sink_service()->OnSinksDiscovered(cast_provider_name, + sink_map[cast_provider_name]); + + EXPECT_EQ(sink_map, dual_media_sink_service()->current_sinks()); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/test_helper.cc b/chrome/browser/media/router/test_helper.cc index a92ecb2..0a5a247 100644 --- a/chrome/browser/media/router/test_helper.cc +++ b/chrome/browser/media/router/test_helper.cc
@@ -49,4 +49,16 @@ MockPresentationConnectionProxy::MockPresentationConnectionProxy() {} MockPresentationConnectionProxy::~MockPresentationConnectionProxy() {} +#if !defined(OS_ANDROID) +MockDialMediaSinkService::MockDialMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context) + : DialMediaSinkService(request_context) {} +MockDialMediaSinkService::~MockDialMediaSinkService() = default; + +MockCastMediaSinkService::MockCastMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context) + : CastMediaSinkService(request_context) {} +MockCastMediaSinkService::~MockCastMediaSinkService() = default; +#endif // !defined(OS_ANDROID) + } // namespace media_router
diff --git a/chrome/browser/media/router/test_helper.h b/chrome/browser/media/router/test_helper.h index 2a2423b..efc2b7e 100644 --- a/chrome/browser/media/router/test_helper.h +++ b/chrome/browser/media/router/test_helper.h
@@ -12,6 +12,9 @@ #include <vector> #include "base/macros.h" +#include "build/build_config.h" +#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" +#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" #include "chrome/browser/media/router/issue_manager.h" #include "chrome/browser/media/router/issues_observer.h" #include "chrome/browser/media/router/media_routes_observer.h" @@ -103,6 +106,31 @@ MOCK_METHOD0(RequestClose, void()); }; +#if !defined(OS_ANDROID) +class MockDialMediaSinkService : public DialMediaSinkService { + public: + explicit MockDialMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context); + ~MockDialMediaSinkService() override; + + MOCK_METHOD2(Start, + void(const OnSinksDiscoveredCallback&, + const OnDialSinkAddedCallback&)); + MOCK_METHOD0(OnUserGesture, void()); +}; + +class MockCastMediaSinkService : public CastMediaSinkService { + public: + explicit MockCastMediaSinkService( + const scoped_refptr<net::URLRequestContextGetter>& request_context); + ~MockCastMediaSinkService() override; + + MOCK_METHOD1(Start, void(const OnSinksDiscoveredCallback&)); + MOCK_METHOD0(OnUserGesture, void()); + MOCK_METHOD0(StartMdnsDiscovery, void()); +}; +#endif // !defined(OS_ANDROID) + } // namespace media_router #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_HELPER_H_
diff --git a/chrome/browser/net/errorpage_browsertest.cc b/chrome/browser/net/errorpage_browsertest.cc index ba8cce24..7b29449 100644 --- a/chrome/browser/net/errorpage_browsertest.cc +++ b/chrome/browser/net/errorpage_browsertest.cc
@@ -264,8 +264,8 @@ // Navigates the active tab to a mock url created for the file at |path|. void NavigateToFileURL(const std::string& path) { - ui_test_utils::NavigateToURL(browser(), - net::URLRequestMockHTTPJob::GetMockUrl(path)); + GURL url = embedded_test_server()->GetURL(path); + ui_test_utils::NavigateToURL(browser(), url); } // Navigates to the given URL and waits for |num_navigations| to occur, and @@ -445,7 +445,57 @@ class DNSErrorPageTest : public ErrorPageTest { public: - DNSErrorPageTest() = default; + DNSErrorPageTest() { + if (!base::FeatureList::IsEnabled(features::kNetworkService)) + return; + + url_loader_interceptor_ = std::make_unique<content::URLLoaderInterceptor>( + base::BindRepeating( + [](DNSErrorPageTest* owner, + content::URLLoaderInterceptor::RequestParams* params) { + // Handle mock failed request. The error code is embedded in the + // query. Here we strip it out, and call OnComplete with it. + // TODO(dougt) mock.failed.request handling can be moved into the + // URLLoaderInterceptor implementation so that we can share this + // with other tests. + if (params->url_request.url.GetWithEmptyPath().spec() == + "http://mock.failed.request/") { + std::string query = params->url_request.url.query(); + std::string error_code = query.substr(query.find("=") + 1); + + int error = 0; + base::StringToInt(error_code, &error); + network::URLLoaderCompletionStatus status; + status.error_code = error; + params->client->OnComplete(status); + return true; + } + + // Add an interceptor that serves LinkDoctor responses + if (google_util::LinkDoctorBaseURL() == params->url_request.url) { + // Send RequestCreated so that anyone blocking on + // WaitForRequests can continue. + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce(&DNSErrorPageTest::RequestCreated, + base::Unretained(owner))); + + return WriteFileToURLLoader(params, "mock-link-doctor.json"); + } + + // Add an interceptor for the search engine the error page will + // use. + if (params->url_request.url.host() == + owner->search_term_url_.host()) { + return WriteFileToURLLoader(params, "title3.html"); + } + + return false; + }, + this), + true, true); + } + ~DNSErrorPageTest() override = default; static void InstallMockInterceptors( @@ -477,18 +527,45 @@ "\x01")); } + void TearDownOnMainThread() override { url_loader_interceptor_.reset(); } + + static bool WriteFileToURLLoader( + content::URLLoaderInterceptor::RequestParams* params, + std::string path) { + base::ScopedAllowBlockingForTesting allow_blocking; + + if (path[0] == '/') + path.erase(0, 1); + + if (path == "favicon.ico") + return false; + + base::FilePath file_path; + PathService::Get(chrome::DIR_TEST_DATA, &file_path); + file_path = file_path.AppendASCII(path); + + std::string contents; + const bool result = base::ReadFileToString(file_path, &contents); + EXPECT_TRUE(result); + + content::URLLoaderInterceptor::WriteResponse( + net::URLRequestTestJob::test_headers(), contents, params->client.get()); + return true; + } + void SetUpOnMainThread() override { - std::unique_ptr<net::URLRequestInterceptor> owned_interceptor( - new LinkDoctorInterceptor(this)); - // Ownership of the |interceptor_| is passed to an object the IO thread, but - // a pointer is kept in the test fixture. As soon as anything calls - // URLRequestFilter::ClearHandlers(), |interceptor_| can become invalid. UIThreadSearchTermsData search_terms_data(browser()->profile()); - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&DNSErrorPageTest::InstallMockInterceptors, - GURL(search_terms_data.GoogleBaseURLValue()), - base::Passed(&owned_interceptor))); + search_term_url_ = GURL(search_terms_data.GoogleBaseURLValue()); + + if (!base::FeatureList::IsEnabled(features::kNetworkService)) { + std::unique_ptr<net::URLRequestInterceptor> owned_interceptor( + new LinkDoctorInterceptor(this)); + + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&InstallMockInterceptors, search_term_url_, + base::Passed(&owned_interceptor))); + } } void WaitForRequests(int32_t requests_to_wait_for) { @@ -529,8 +606,9 @@ // These are only used on the UI thread. int32_t num_requests_ = 0; int32_t requests_to_wait_for_ = -1; + GURL search_term_url_; std::unique_ptr<base::RunLoop> run_loop_; - + std::unique_ptr<content::URLLoaderInterceptor> url_loader_interceptor_; }; // Test an error with a file URL, and make sure it doesn't have a @@ -577,7 +655,9 @@ // Test that a DNS error occuring in the main frame does not result in an // additional session history entry. IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, DNSError_GoBack1) { - NavigateToFileURL("title2.html"); + ASSERT_TRUE(embedded_test_server()->Start()); + + NavigateToFileURL("/title2.html"); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( browser(), GetDnsErrorURL(), 2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); @@ -588,14 +668,16 @@ // Test that a DNS error occuring in the main frame does not result in an // additional session history entry. IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, DNSError_GoBack2) { - NavigateToFileURL("title2.html"); + ASSERT_TRUE(embedded_test_server()->Start()); + + NavigateToFileURL("/title2.html"); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( browser(), GetDnsErrorURL(), 2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); EXPECT_EQ(1, num_requests()); - NavigateToFileURL("title3.html"); + NavigateToFileURL("/title3.html"); GoBackAndWaitForNavigations(2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); @@ -608,14 +690,16 @@ // Test that a DNS error occuring in the main frame does not result in an // additional session history entry. IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, DNSError_GoBack2AndForward) { - NavigateToFileURL("title2.html"); + ASSERT_TRUE(embedded_test_server()->Start()); + + NavigateToFileURL("/title2.html"); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( browser(), GetDnsErrorURL(), 2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); EXPECT_EQ(1, num_requests()); - NavigateToFileURL("title3.html"); + NavigateToFileURL("/title3.html"); GoBackAndWaitForNavigations(2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); @@ -631,14 +715,16 @@ // Test that a DNS error occuring in the main frame does not result in an // additional session history entry. IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, DNSError_GoBack2Forward2) { - NavigateToFileURL("title3.html"); + ASSERT_TRUE(embedded_test_server()->Start()); + + NavigateToFileURL("/title3.html"); ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( browser(), GetDnsErrorURL(), 2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); EXPECT_EQ(1, num_requests()); - NavigateToFileURL("title2.html"); + NavigateToFileURL("/title2.html"); GoBackAndWaitForNavigations(2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); @@ -777,6 +863,7 @@ IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, DNSError_DoClickLink) { // The first navigation should fail, and the second one should be the error // page. + ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( browser(), GetDnsErrorURL(), 2); ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); @@ -855,8 +942,10 @@ // additional session history entry. IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, MAYBE_IFrameDNSError_GoBackAndForward) { - NavigateToFileURL("title2.html"); - NavigateToFileURL("iframe_dns_error.html"); + ASSERT_TRUE(embedded_test_server()->Start()); + + NavigateToFileURL("/title2.html"); + NavigateToFileURL("/iframe_dns_error.html"); GoBackAndWaitForTitle("Title Of Awesomeness", 1); GoForwardAndWaitForTitle("Blah", 1); EXPECT_EQ(0, num_requests()); @@ -944,9 +1033,10 @@ IN_PROC_BROWSER_TEST_F(DNSErrorPageTest, Empty404) { // The first navigation should fail and load a blank page, while it fetches // the Link Doctor response. The second navigation is the Link Doctor. - ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( - browser(), - net::URLRequestMockHTTPJob::GetMockUrl("errorpage/empty404.html"), 2); + ASSERT_TRUE(embedded_test_server()->Start()); + + GURL url = embedded_test_server()->GetURL("/errorpage/empty404.html"); + ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(browser(), url, 2); // This depends on the non-internationalized error ID string in // localized_error.cc. ExpectDisplayingNavigationCorrections(browser(), "HTTP ERROR 404");
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc index 5e55fde..f2b6c13 100644 --- a/chrome/browser/password_manager/credential_manager_browsertest.cc +++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -338,6 +338,274 @@ } IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, + StoreExistingCredentialIsNoOp) { + scoped_refptr<password_manager::TestPasswordStore> password_store = + static_cast<password_manager::TestPasswordStore*>( + PasswordStoreFactory::GetForProfile( + browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) + .get()); + + GURL origin = embedded_test_server()->base_url(); + + autofill::PasswordForm form_1; + form_1.signon_realm = origin.spec(); + form_1.username_value = base::ASCIIToUTF16("user1"); + form_1.password_value = base::ASCIIToUTF16("abcdef"); + form_1.preferred = true; + + autofill::PasswordForm form_2; + form_2.signon_realm = origin.spec(); + form_2.username_value = base::ASCIIToUTF16("user2"); + form_2.password_value = base::ASCIIToUTF16("123456"); + + password_store->AddLogin(form_1); + password_store->AddLogin(form_2); + WaitForPasswordStore(); + + // Check that the password store contains the values we expect. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("abcdef"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("123456"), passwords[1].password_value); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user1' with the old password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user1', password: 'abcdef' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user2' with the old password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user2', password: '123456' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + // Wait for the password store to process the store request. + WaitForPasswordStore(); + + // Check that the password still store contains the values we expect. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("abcdef"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("123456"), passwords[1].password_value); + } +} + +IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, + StoreUpdatesPasswordOfExistingCredential) { + scoped_refptr<password_manager::TestPasswordStore> password_store = + static_cast<password_manager::TestPasswordStore*>( + PasswordStoreFactory::GetForProfile( + browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) + .get()); + + GURL origin = embedded_test_server()->base_url(); + + autofill::PasswordForm form_1; + form_1.signon_realm = origin.spec(); + form_1.username_value = base::ASCIIToUTF16("user1"); + form_1.password_value = base::ASCIIToUTF16("abcdef"); + form_1.preferred = true; + + autofill::PasswordForm form_2; + form_2.signon_realm = origin.spec(); + form_2.username_value = base::ASCIIToUTF16("user2"); + form_2.password_value = base::ASCIIToUTF16("123456"); + + password_store->AddLogin(form_1); + password_store->AddLogin(form_2); + WaitForPasswordStore(); + + // Check that the password store contains the values we expect. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("abcdef"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("123456"), passwords[1].password_value); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user1' with a new password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user1', password: 'ABCDEF' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user2' with a new password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user2', password: 'UVWXYZ' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + + // Wait for the password store to process the store request. + WaitForPasswordStore(); + + // Check that the password store contains the values we expect. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("ABCDEF"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("UVWXYZ"), passwords[1].password_value); + } +} + +IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, + StoreUpdatesPasswordOfExistingCredentialWithAttributes) { + // This test is the same as the previous one, except that the already existing + // credentials contain metadata. + scoped_refptr<password_manager::TestPasswordStore> password_store = + static_cast<password_manager::TestPasswordStore*>( + PasswordStoreFactory::GetForProfile( + browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) + .get()); + + GURL origin = embedded_test_server()->base_url(); + + autofill::PasswordForm form_1; + form_1.signon_realm = origin.spec(); + form_1.username_value = base::ASCIIToUTF16("user1"); + form_1.password_value = base::ASCIIToUTF16("abcdef"); + form_1.username_element = base::ASCIIToUTF16("user"); + form_1.password_element = base::ASCIIToUTF16("pass"); + form_1.origin = GURL(origin.spec() + "/my/custom/path/"); + form_1.preferred = true; + + autofill::PasswordForm form_2; + form_2.signon_realm = origin.spec(); + form_2.username_value = base::ASCIIToUTF16("user2"); + form_2.password_value = base::ASCIIToUTF16("123456"); + form_2.username_element = base::ASCIIToUTF16("username"); + form_2.password_element = base::ASCIIToUTF16("password"); + form_2.origin = GURL(origin.spec() + "/my/other/path/"); + + password_store->AddLogin(form_1); + password_store->AddLogin(form_2); + WaitForPasswordStore(); + + // Check that the password store contains the values we expect. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("abcdef"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user"), passwords[0].username_element); + EXPECT_EQ(base::ASCIIToUTF16("pass"), passwords[0].password_element); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("123456"), passwords[1].password_value); + EXPECT_EQ(base::ASCIIToUTF16("username"), passwords[1].username_element); + EXPECT_EQ(base::ASCIIToUTF16("password"), passwords[1].password_element); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user1' with a new password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user1', password: 'ABCDEF' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + + { + NavigateToFile("/password/simple_password.html"); + + // Call the API to store 'user2' with a new password. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user2', password: 'UVWXYZ' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + } + + // Wait for the password store to process the store request. + WaitForPasswordStore(); + + // Check that the password store contains the values we expect. + // Note that we don't check for username and password elements, as they don't + // exist for credentials saved by the API. + { + auto found = password_store->stored_passwords().find(origin.spec()); + ASSERT_NE(password_store->stored_passwords().end(), found); + const std::vector<autofill::PasswordForm>& passwords = found->second; + + ASSERT_EQ(2U, passwords.size()); + EXPECT_EQ(base::ASCIIToUTF16("user1"), passwords[0].username_value); + EXPECT_EQ(base::ASCIIToUTF16("ABCDEF"), passwords[0].password_value); + EXPECT_EQ(base::ASCIIToUTF16("user2"), passwords[1].username_value); + EXPECT_EQ(base::ASCIIToUTF16("UVWXYZ"), passwords[1].password_value); + } +} + +IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, StoreSavesPSLMatchedCredential) { scoped_refptr<password_manager::TestPasswordStore> password_store = static_cast<password_manager::TestPasswordStore*>( @@ -395,6 +663,61 @@ } IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, + UpdatingPSLMatchedCredentialCreatesSecondEntry) { + scoped_refptr<password_manager::TestPasswordStore> password_store = + static_cast<password_manager::TestPasswordStore*>( + PasswordStoreFactory::GetForProfile( + browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS) + .get()); + + // The call to |GetURL| is needed to get the correct port. + GURL psl_url = https_test_server().GetURL("psl.example.com", "/"); + + autofill::PasswordForm signin_form; + signin_form.signon_realm = psl_url.spec(); + signin_form.password_value = base::ASCIIToUTF16("password"); + signin_form.username_value = base::ASCIIToUTF16("user"); + signin_form.origin = psl_url; + password_store->AddLogin(signin_form); + + NavigateToURL(https_test_server(), "www.example.com", + "/password/password_form.html"); + + // Call the API to trigger |get| and |store| and redirect. + ASSERT_TRUE(content::ExecuteScript( + RenderViewHost(), + "navigator.credentials.store(" + " new PasswordCredential({ id: 'user', password: 'P4SSW0RD' }))" + ".then(cred => window.location = '/password/done.html');")); + + NavigationObserver observer(WebContents()); + observer.SetPathToWaitFor("/password/done.html"); + observer.Wait(); + + BubbleObserver prompt_observer(WebContents()); + prompt_observer.WaitForAutomaticSavePrompt(); + ASSERT_TRUE(prompt_observer.IsSavePromptShownAutomatically()); + prompt_observer.AcceptSavePrompt(); + WaitForPasswordStore(); + + // There should be an entry for both psl.example.com and www.example.com. + password_manager::TestPasswordStore::PasswordMap passwords = + password_store->stored_passwords(); + GURL www_url = https_test_server().GetURL("www.example.com", "/"); + EXPECT_EQ(2U, passwords.size()); + EXPECT_TRUE(base::ContainsKey(passwords, psl_url.spec())); + EXPECT_TRUE(base::ContainsKey(passwords, www_url.spec())); + EXPECT_EQ(base::ASCIIToUTF16("user"), + passwords[psl_url.spec()].front().username_value); + EXPECT_EQ(base::ASCIIToUTF16("password"), + passwords[psl_url.spec()].front().password_value); + EXPECT_EQ(base::ASCIIToUTF16("user"), + passwords[www_url.spec()].front().username_value); + EXPECT_EQ(base::ASCIIToUTF16("P4SSW0RD"), + passwords[www_url.spec()].front().password_value); +} + +IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, ObsoleteHttpCredentialMovedOnMigrationToHstsSite) { // Add an http credential to the password store. GURL https_origin = https_test_server().base_url();
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.html b/chrome/browser/resources/chromeos/login/custom_elements_login.html index d7ef61c..a35918e4 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.html
@@ -29,5 +29,6 @@ <include src="oobe_wait_for_container_ready.html"> <include src="encryption_migration.html"> <include src="enrollment_license_card.html"> +<include src="sync_consent.html"> <script src="chrome://oobe/custom_elements.js"></script>
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.js b/chrome/browser/resources/chromeos/login/custom_elements_login.js index d2937fd..4e1ca270 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.js
@@ -28,4 +28,5 @@ // <include src="encryption_migration.js"> // <include src="oobe_voice_interaction_value_prop.js"> // <include src="oobe_wait_for_container_ready.js"> -// <include src="enrollment_license_card.js"> \ No newline at end of file +// <include src="enrollment_license_card.js"> +// <include src="sync_consent.js">
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html index e9d7197c..987f988 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html
@@ -33,5 +33,6 @@ <include src="active_directory_password_change.html"> <include src="arc_terms_of_service.html"> <include src="enrollment_license_card.html"> +<include src="sync_consent.html"> <script src="chrome://oobe/custom_elements.js"></script>
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js index 8500404..29d1a1c 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js
@@ -43,3 +43,4 @@ // <include src="oobe_voice_interaction_value_prop.js"> // <include src="oobe_wait_for_container_ready.js"> // <include src="enrollment_license_card.js"> +// <include src="sync_consent.js">
diff --git a/chrome/browser/resources/chromeos/login/login.js b/chrome/browser/resources/chromeos/login/login.js index 5e1858b..5cacf2a 100644 --- a/chrome/browser/resources/chromeos/login/login.js +++ b/chrome/browser/resources/chromeos/login/login.js
@@ -43,6 +43,7 @@ login.PasswordChangedScreen.register(); login.SupervisedUserCreationScreen.register(); login.TermsOfServiceScreen.register(); + login.SyncConsentScreen.register(); login.ArcTermsOfServiceScreen.register(); login.AppLaunchSplashScreen.register(); login.ArcKioskSplashScreen.register();
diff --git a/chrome/browser/resources/chromeos/login/login_non_lock_shared.js b/chrome/browser/resources/chromeos/login/login_non_lock_shared.js index 765a6bec..6472b1d 100644 --- a/chrome/browser/resources/chromeos/login/login_non_lock_shared.js +++ b/chrome/browser/resources/chromeos/login/login_non_lock_shared.js
@@ -35,6 +35,7 @@ // <include src="screen_active_directory_password_change.js"> // <include src="screen_encryption_migration.js"> // <include src="screen_update_required.js"> +// <include src="screen_sync_consent.js"> // <include src="../../gaia_auth_host/authenticator.js">
diff --git a/chrome/browser/resources/chromeos/login/login_screens.html b/chrome/browser/resources/chromeos/login/login_screens.html index f32accf..d58b5f0 100644 --- a/chrome/browser/resources/chromeos/login/login_screens.html +++ b/chrome/browser/resources/chromeos/login/login_screens.html
@@ -22,3 +22,4 @@ <include src="screen_active_directory_password_change.html"> <include src="screen_encryption_migration.html"> <include src="screen_update_required.html"> +<include src="screen_sync_consent.html">
diff --git a/chrome/browser/resources/chromeos/login/md_login.js b/chrome/browser/resources/chromeos/login/md_login.js index c5b1e54..ed0f74d 100644 --- a/chrome/browser/resources/chromeos/login/md_login.js +++ b/chrome/browser/resources/chromeos/login/md_login.js
@@ -43,6 +43,7 @@ login.PasswordChangedScreen.register(); login.SupervisedUserCreationScreen.register(); login.TermsOfServiceScreen.register(); + login.SyncConsentScreen.register(); login.ArcTermsOfServiceScreen.register(); login.AppLaunchSplashScreen.register(); login.ArcKioskSplashScreen.register();
diff --git a/chrome/browser/resources/chromeos/login/md_login_screens.html b/chrome/browser/resources/chromeos/login/md_login_screens.html index 7ef0aff..1891e6d 100644 --- a/chrome/browser/resources/chromeos/login/md_login_screens.html +++ b/chrome/browser/resources/chromeos/login/md_login_screens.html
@@ -22,3 +22,4 @@ <include src="screen_active_directory_password_change.html"> <include src="screen_encryption_migration.html"> <include src="screen_update_required.html"> +<include src="screen_sync_consent.html">
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js index e9801fb9..ea7fcfc 100644 --- a/chrome/browser/resources/chromeos/login/oobe.js +++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -125,6 +125,7 @@ login.PasswordChangedScreen.register(); login.SupervisedUserCreationScreen.register(); login.TermsOfServiceScreen.register(); + login.SyncConsentScreen.register(); login.ArcTermsOfServiceScreen.register(); login.AppLaunchSplashScreen.register(); login.ArcKioskSplashScreen.register();
diff --git a/chrome/browser/resources/chromeos/login/oobe_screens.html b/chrome/browser/resources/chromeos/login/oobe_screens.html index 47071ba..59c7e91 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screens.html +++ b/chrome/browser/resources/chromeos/login/oobe_screens.html
@@ -28,3 +28,4 @@ <include src="screen_device_disabled.html"> <include src="screen_active_directory_password_change.html"> <include src="screen_update_required.html"> +<include src="screen_sync_consent.html">
diff --git a/chrome/browser/resources/chromeos/login/screen_sync_consent.html b/chrome/browser/resources/chromeos/login/screen_sync_consent.html new file mode 100644 index 0000000..2f26daa --- /dev/null +++ b/chrome/browser/resources/chromeos/login/screen_sync_consent.html
@@ -0,0 +1,7 @@ +<!-- 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. --> + +<div class="step right hidden" id="sync-consent" hidden> + <sync-consent id="sync-consent-impl"></sync-consent> +</div>
diff --git a/chrome/browser/resources/chromeos/login/screen_sync_consent.js b/chrome/browser/resources/chromeos/login/screen_sync_consent.js new file mode 100644 index 0000000..1fbac139 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/screen_sync_consent.js
@@ -0,0 +1,26 @@ +// Copyright 2007 The Chromium 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 First user log in Sync Consent screen implementation. + */ + +login.createScreen('SyncConsentScreen', 'sync-consent', function() { + return { + /** + * Returns the control which should receive initial focus. + */ + get defaultControl() { + return $('sync-consent-impl'); + }, + + /** + * Event handler that is invoked just before the screen is shown. + * @param {object} data Screen init payload. + */ + onBeforeShow: function(data) { + Oobe.getInstance().headerHidden = true; + } + }; +});
diff --git a/chrome/browser/resources/chromeos/login/sync_consent.css b/chrome/browser/resources/chromeos/login/sync_consent.css new file mode 100644 index 0000000..97cce828 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/sync_consent.css
@@ -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. */ + +:root { + color: #333; + font: 13px Roboto, sans-serif; + font-weight: 400; /* roboto-regular */ + height: 640px; + width: 768px; + --sync-consent-dialog-list-item-border: 1px solid rgba(0, 0, 0, 0.06); +} + +.overview-list-item { + background-color: var(--google-grey-100); + margin-bottom: 16px; + padding: 16px; +} + +.overview-list-item-icon { + -webkit-padding-end: 16px; +} + +.overview-list-item-title { + font-weight: 500; /* roboto-medium */ + margin-bottom: 4px; +} + +.sync-status-line { + padding-top: 32px; +} + +a { + color: var(--google-blue-500); + text-decoration: none; + width: fit-content; +} + +/************* Settings Section **************/ +#syncConsentSettingsDialog oobe-a11y-option { + border-top: var(--sync-consent-dialog-list-item-border); + min-height: 56px; +} + +#syncConsentSettingsDialog oobe-a11y-option:last-of-type { + border-bottom: var(--sync-consent-dialog-list-item-border); +} + +#syncConsentSettingsDialog .bottom-buttons { + padding: 0 24px; +} +
diff --git a/chrome/browser/resources/chromeos/login/sync_consent.html b/chrome/browser/resources/chromeos/login/sync_consent.html new file mode 100644 index 0000000..2d85595c --- /dev/null +++ b/chrome/browser/resources/chromeos/login/sync_consent.html
@@ -0,0 +1,140 @@ +<!-- 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. --> + +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html"> + +<iron-iconset-svg name="sync-consent-32" size="32"> + <svg> + <defs> + <!-- The Google "G" icon. --> + <g id="googleg" fill="none" fill-rule="evenodd"> + <path d="M30.42 16.83c0-1.03-.092-2.017-.264-2.966H16.5v5.61h7.804c-.336 1.81-1.358 3.347-2.894 4.375v3.637h4.686c2.742-2.524 4.324-6.242 4.324-10.657z" fill="#4285F4"></path> + <path d="M16.5 31c3.915 0 7.197-1.298 9.596-3.513L21.41 23.85c-1.298.87-2.96 1.383-4.91 1.383-3.777 0-6.973-2.55-8.113-5.978H3.542v3.757C5.928 27.752 10.832 31 16.5 31z" fill="#34A853"></path> + <path d="M8.387 19.255c-.29-.87-.455-1.8-.455-2.755 0-.956.165-1.885.455-2.755V9.988H3.542C2.56 11.946 2 14.16 2 16.5s.56 4.554 1.542 6.512l4.845-3.757z" fill="#FBBC05"></path> + <path d="M16.5 7.767c2.13 0 4.04.732 5.543 2.168l4.16-4.158C23.69 3.437 20.407 2 16.5 2 10.832 2 5.928 5.25 3.542 9.988l4.845 3.757c1.14-3.427 4.336-5.978 8.113-5.978z" fill="#EA4335"></path> + <path d="M2 2h29v29H2"></path> + </g> + </defs> + </svg> +</iron-iconset-svg> + +<iron-iconset-svg name="sync-consent-64" size="64"> + <svg> + <defs> + <!-- The Google "G" icon. --> + <g id="googleg" fill="none" fill-rule="evenodd"> + <path d="M59.84 32.66c0-2.057-.185-4.035-.527-5.933H32v11.218h15.607c-.672 3.625-2.715 6.696-5.787 8.753v7.276h9.373c5.483-5.05 8.647-12.483 8.647-21.315z" fill="#4285F4"></path> + <path d="M32 61c7.83 0 14.395-2.597 19.193-7.026l-9.373-7.276c-2.596 1.74-5.918 2.768-9.82 2.768-7.553 0-13.946-5.1-16.227-11.956H6.085v7.514C10.855 54.5 20.665 61 32 61z" fill="#34A853"></path> + <path d="M15.773 37.51c-.58-1.74-.91-3.6-.91-5.51 0-1.91.33-3.77.91-5.51v-7.514H6.085C4.12 22.89 3 27.32 3 32s1.12 9.11 3.085 13.024l9.688-7.514z" fill="#FBBC05"></path> + <path d="M32 14.534c4.258 0 8.08 1.463 11.086 4.337l8.318-8.317C46.38 5.873 39.817 3 32 3 20.664 3 10.856 9.5 6.085 18.976l9.688 7.514c2.28-6.855 8.674-11.956 16.227-11.956z" fill="#EA4335"></path> + <path d="M3 3h58v58H3"></path> + </g> + </defs> + </svg> +</iron-iconset-svg> + +<dom-module id="sync-consent"> + <template> + <link rel="stylesheet" href="sync_consent.css"> + <link rel="stylesheet" href="oobe_dialog_parameters.css"> + <link rel="stylesheet" href="oobe_flex_layout.css"> + <oobe-dialog id="syncConsentOverviewDialog" role="dialog" has-buttons + aria-label="[[i18nDynamic(locale, 'syncConsentScreenTitle')]]" + hidden="[[isSectionHidden_(activeSection_,'overview')]]"> + <hd-iron-icon class="oobe-icon" + icon1x="sync-consent-32:googleg" icon2x="sync-consent-64:googleg"> + </hd-iron-icon> + <div class="header"> + <h1 class="title"> + [[i18nDynamic(locale, 'syncConsentScreenTitle')]] + </h1> + </div> + <div class="footer layout vertical"> + <div class="overview-list-item flex layout horizontal center"> + <hd-iron-icon class="overview-list-item-icon" + icon1x="sync-consent-32:googleg" icon2x="sync-consent-64:googleg"> + </hd-iron-icon> + <div class="overview-list-item-text flex layout vertical + center-justified"> + <div class="overview-list-item-title"> + [[i18nDynamic(locale, 'syncConsentScreenChromeSyncName')]] + </div> + <div class="overview-list-item-description"> + [[i18nDynamic(locale, 'syncConsentScreenChromeSyncDescription')]] + </div> + </div> + </div> + <div class="overview-list-item flex layout horizontal center"> + <hd-iron-icon class="overview-list-item-icon" + icon1x="sync-consent-32:googleg" icon2x="sync-consent-64:googleg"> + </hd-iron-icon> + <div class="overview-list-item-text flex layout vertical + center-justified"> + <div class="overview-list-item-title"> + [[i18nDynamic(locale, 'syncConsentScreenPersonalizeGoogleServicesName')]] + </div> + <div class="overview-list-item-description"> + [[i18nDynamic(locale, 'syncConsentScreenPersonalizeGoogleServicesDescription')]] + </div> + </div> + </div> + <div id="settingsLink" class="sync-status-line" + locale-monitor="[[updateSettingsLink_(locale)]]"> + </div> + </div> + <div class="bottom-buttons layout horizontal end-justified"> + <oobe-next-button on-tap="onSettingsSaveAndContinue_" + class="focus-on-show"> + </oobe-next-button> + </div> + </oobe-dialog> + <oobe-dialog id="syncConsentSettingsDialog" role="dialog" has-buttons + aria-label="[[i18nDynamic(locale, 'syncConsentSettingsDialogTitle')]]" + hidden="[[isSectionHidden_(activeSection_,'settings')]]"> + <hd-iron-icon class="oobe-icon" + icon1x="sync-consent-32:googleg" icon2x="sync-consent-64:googleg"> + </hd-iron-icon> + <div class="header"> + <h1 class="title"> + [[i18nDynamic(locale, 'syncConsentSettingsDialogTitle')]] + </h1> + <div class="subtitle"> + [[i18nDynamic(locale, 'syncConsentSettingsDialogSubTitle')]] + </div> + </div> + <div class="footer layout vertical"> + <oobe-a11y-option checked="[[syncAllEnabled_]]" + on-change="onSyncAllEnabledChanged_" + label-for-aria="[[i18nDynamic(locale, 'syncConsentSyncAllOptionTitle')]]" + class="focus-on-show"> + <span class="title"> + [[i18nDynamic(locale, 'syncConsentSyncAllOptionTitle')]] + </span> + <span class="checked-value"> + [[i18nDynamic(locale, 'syncConsentSyncAllOptionOn')]] + </span> + <span class="unchecked-value"> + [[i18nDynamic(locale, 'syncConsentSyncAllOptionOff')]] + </span> + </oobe-a11y-option> + <div class="sync-status-line" hidden="[[!syncAllEnabled_]]"> + [[i18nDynamic(locale, 'syncConsentSettingsStatusSyncAllOn')]] + </div> + <div class="sync-status-line" hidden="[[syncAllEnabled_]]"> + [[i18nDynamic(locale, 'syncConsentSettingsStatusSyncAllOff')]] + </div> + </div> + <div class="bottom-buttons layout horizontal justified"> + <oobe-back-button on-tap="onSettingsBack_"> + </oobe-back-button> + <oobe-text-button inverse on-tap="onSettingsSaveAndContinue_"> + <div> + [[i18nDynamic(locale, 'syncConsentSettingsSaveAndContinue')]] + </div> + </oobe-text-button> + </div> + </oobe-dialog> + </template> +</dom-module>
diff --git a/chrome/browser/resources/chromeos/login/sync_consent.js b/chrome/browser/resources/chromeos/login/sync_consent.js new file mode 100644 index 0000000..b57236f --- /dev/null +++ b/chrome/browser/resources/chromeos/login/sync_consent.js
@@ -0,0 +1,92 @@ +// 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 Polymer element for displaying material design Sync Consent + * screen. + */ + +Polymer({ + is: 'sync-consent', + + behaviors: [I18nBehavior], + + properties: { + /** + * Value of "Sync all" trigger button. + */ + syncAllEnabled_: { + type: Boolean, + value: true, + }, + + /** + * Name of currently active section. + */ + activeSection_: { + type: String, + value: 'overview', + } + }, + + focus: function() { + if (this.activeSection_ == 'overview') { + this.$.syncConsentOverviewDialog.show(); + } else { + this.$.syncConsentSettingsDialog.show(); + } + }, + + isSectionHidden_: function(activeSectionName, thisSectionName) { + return activeSectionName != thisSectionName; + }, + + /** + * This is 'on-tap' event handler for 'Back' button of Settings section. + * @private + */ + onSettingsBack_: function() { + this.activeSection_ = 'overview'; + this.focus(); + }, + + /** + * This updates link to 'Settings' section on locale change. + * @param {string} locale The UI language used. + * @private + */ + updateSettingsLink_: function(locale) { + this.$.settingsLink.innerHTML = loadTimeData.getStringF( + 'syncConsentScreenSettingsLink', '<a id="settingsLinkAnchor" href="#">', + '</a>'); + this.$$('#settingsLinkAnchor') + .addEventListener('click', this.switchToSettingsDialog_.bind(this)); + }, + + /** + * This is called when "Settings" link is clicked. + * @private + */ + switchToSettingsDialog_: function() { + this.activeSection_ = 'settings'; + this.focus(); + }, + + /** + * This is called when "Sync all" trigger value is changed. + * @param {!Event} event + * @private + */ + onSyncAllEnabledChanged_: function(event) { + this.syncAllEnabled_ = event.currentTarget.checked; + }, + + /** + * This is 'on-tap' event handler for 'AcceptAndContinue/Next' buttons. + * @private + */ + onSettingsSaveAndContinue_: function() { + chrome.send('login.SyncConsentScreen.userActed', ['save-and-continue']); + }, +});
diff --git a/chrome/browser/resources/md_extensions/code_section.html b/chrome/browser/resources/md_extensions/code_section.html index 9127531d..424fbae 100644 --- a/chrome/browser/resources/md_extensions/code_section.html +++ b/chrome/browser/resources/md_extensions/code_section.html
@@ -2,6 +2,7 @@ <link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html"> <link rel="import" href="chrome://resources/html/cr.html"> +<link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> <dom-module id="extensions-code-section"> @@ -23,13 +24,13 @@ display: flex; font-family: monospace; min-height: 100%; - white-space: pre; } #line-numbers { background: var(--paper-grey-300); border-right: 1px solid var(--paper-grey-500); display: flex; + flex-direction: column; padding: 0 8px; text-align: right; } @@ -40,18 +41,41 @@ flex-direction: column; } + #line-numbers span, + #source span { + white-space: pre; + } + #no-code { color: var(--paper-grey-800); text-align: center; } + + .more-code { + color: var(--paper-grey-500); + } </style> <div id="scroll-container" hidden="[[!codeText_]]"> <div id="main"> <div id="line-numbers"> - <span>[[computeLineNumbersContent_(codeText_)]]</span> + <div class="more-code before" hidden="[[!truncatedBefore_]]"> + ... + </div> + <span>[[lineNumbers_]]</span> + <div class="more-code after" hidden="[[!truncatedAfter_]]"> + ... + </div> </div> <div id="source"> + <div class="more-code before" hidden="[[!truncatedBefore_]]"> + [[getLinesNotShownLabel_( + truncatedBefore_,'$i18nPolymer{errorLinesNotShown}')]] + </div> <span>[[codeText_]]</span> + <div class="more-code after" hidden="[[!truncatedAfter_]]"> + [[getLinesNotShownLabel_( + truncatedAfter_, '$i18nPolymer{errorLinesNotShown}')]] + </div> </div> </div> </div>
diff --git a/chrome/browser/resources/md_extensions/code_section.js b/chrome/browser/resources/md_extensions/code_section.js index 305ee29..ad9d9bf 100644 --- a/chrome/browser/resources/md_extensions/code_section.js +++ b/chrome/browser/resources/md_extensions/code_section.js
@@ -5,6 +5,19 @@ cr.define('extensions', function() { 'use strict'; + /** + * @param {number} totalCount + * @param {number} oppositeCount + * @return {number} + */ + function visibleLineCount(totalCount, oppositeCount) { + // We limit the number of lines shown for DOM performance. + const MAX_VISIBLE_LINES = 1000; + const max = + Math.max(MAX_VISIBLE_LINES / 2, MAX_VISIBLE_LINES - oppositeCount); + return Math.min(max, totalCount); + } + const CodeSection = Polymer({ is: 'extensions-code-section', @@ -15,8 +28,6 @@ */ code: { type: Object, - // We initialize to null so that Polymer sees it as defined and calls - // isMainHidden_(). value: null, }, @@ -26,10 +37,16 @@ * changes. * @private */ - codeText_: { - type: String, - computed: 'computeCodeText_(code.*)', - }, + codeText_: String, + + /** @private */ + lineNumbers_: String, + + /** @private */ + truncatedBefore_: Number, + + /** @private */ + truncatedAfter_: Number, /** * The string to display if no |code| is set (e.g. because we couldn't @@ -40,49 +57,86 @@ }, observers: [ - 'onHighlightChanged_(code.highlight)', + 'onCodeChanged_(code.*)', ], /** - * @return {string} * @private */ - computeCodeText_: function() { - if (!this.code) - return ''; + onCodeChanged_: function() { + if (!this.code || + (!this.code.beforeHighlight && !this.code.highlight && + !this.code.afterHighlight)) { + this.codeText_ = ''; + this.lineNumbers_ = ''; + return; + } - return this.code.beforeHighlight + this.code.highlight + - this.code.afterHighlight; + const before = this.code.beforeHighlight; + const highlight = this.code.highlight; + const after = this.code.afterHighlight; + + const linesBefore = before ? before.split('\n') : []; + const linesAfter = after ? after.split('\n') : []; + const visibleLineCountBefore = + visibleLineCount(linesBefore.length, linesAfter.length); + const visibleLineCountAfter = + visibleLineCount(linesAfter.length, linesBefore.length); + + const visibleBefore = + linesBefore.slice(linesBefore.length - visibleLineCountBefore) + .join('\n'); + let visibleAfter = linesAfter.slice(0, visibleLineCountAfter).join('\n'); + // If the last character is a \n, force it to be rendered. + if (visibleAfter.charAt(visibleAfter.length - 1) == '\n') + visibleAfter += ' '; + + this.codeText_ = visibleBefore + highlight + visibleAfter; + this.truncatedBefore_ = linesBefore.length - visibleLineCountBefore; + this.truncatedAfter_ = linesAfter.length - visibleLineCountAfter; + + this.setLineNumbers_( + this.truncatedBefore_ + 1, + this.truncatedBefore_ + this.codeText_.split('\n').length); + this.createHighlight_( + visibleBefore.length, visibleBefore.length + highlight.length); + this.scrollToHighlight_(visibleLineCountBefore); }, /** - * Computes the content of the line numbers span, which basically just - * contains 1\n2\n3\n... for the number of lines. + * @param {number} lineCount + * @param {string} stringTemplate * @return {string} * @private */ - computeLineNumbersContent_: function() { - if (!this.codeText_) - return ''; + getLinesNotShownLabel_(lineCount, stringTemplate) { + return loadTimeData.substituteString(stringTemplate, lineCount); + }, - const lines = this.codeText_.match(/\n/g); - const lineCount = lines ? lines.length : 0; - let textContent = ''; - for (let i = 1; i <= lineCount + 1; ++i) - textContent += i + '\n'; - return textContent; + /** + * @param {number} start + * @param {number} end + * @private + */ + setLineNumbers_: function(start, end) { + let lineNumbers = ''; + for (let i = start; i <= end; ++i) + lineNumbers += i + '\n'; + + this.lineNumbers_ = lineNumbers; }, /** * Uses the native text-selection API to highlight desired code. + * @param {number} start + * @param {number} end * @private */ - createHighlight_: function() { + createHighlight_: function(start, end) { const range = document.createRange(); const node = this.$.source.querySelector('span').firstChild; - range.setStart(node, this.code.beforeHighlight.length); - range.setEnd( - node, this.code.beforeHighlight.length + this.code.highlight.length); + range.setStart(node, start); + range.setEnd(node, end); const selection = window.getSelection(); selection.removeAllRanges(); @@ -90,44 +144,19 @@ }, /** - * Scroll the highlight code to roughly the middle. It will do smooth - * scrolling if the target scroll position is close-by, or jump to it if - * it's far away. + * @param {number} linesBeforeHighlight * @private */ - scrollToHighlight_: function() { + scrollToHighlight_: function(linesBeforeHighlight) { const CSS_LINE_HEIGHT = 20; - const SCROLL_LOC_THRESHOLD = 100; - - const linesBeforeHighlight = this.code.beforeHighlight.match(/\n/g); // Count how many pixels is above the highlighted code. - const highlightTop = linesBeforeHighlight ? - linesBeforeHighlight.length * CSS_LINE_HEIGHT : - 0; + const highlightTop = linesBeforeHighlight * CSS_LINE_HEIGHT; // Find the position to show the highlight roughly in the middle. const targetTop = highlightTop - this.clientHeight * 0.5; - // Smooth scrolling if moving within ~100 LOC, otherwise just jump to it. - const behavior = - Math.abs(this.$['scroll-container'].scrollTop - targetTop) < - (CSS_LINE_HEIGHT * SCROLL_LOC_THRESHOLD) ? - 'smooth' : - 'auto'; - this.$['scroll-container'].scrollTo({ - top: targetTop, - behavior: behavior, - }); - }, - - /** @private */ - onHighlightChanged_: function() { - if (!this.codeText_) - return; - - this.createHighlight_(); - this.scrollToHighlight_(); + this.$['scroll-container'].scrollTo({top: targetTop}); }, });
diff --git a/chrome/browser/resources/md_extensions/compiled_resources2.gyp b/chrome/browser/resources/md_extensions/compiled_resources2.gyp index a78abb0..20a34daf 100644 --- a/chrome/browser/resources/md_extensions/compiled_resources2.gyp +++ b/chrome/browser/resources/md_extensions/compiled_resources2.gyp
@@ -7,6 +7,7 @@ 'target_name': 'code_section', 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(EXTERNS_GYP):developer_private', ], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js index 991de6bc..507b84d 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
@@ -279,7 +279,7 @@ /** * If true, the scan offered view is rendered on state idle, regardless of * the idle reason received from the cleaner controller. The goal is to - * ignore previous interactions (such as completed cleanups) perfomed on + * ignore previous interactions (such as completed cleanups) performed on * other tabs or if this tab is reloaded. * Set to false whenever there is a transition to a non-idle state while the * current tab is open.
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js index f855f46..fc387e2 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_browser_proxy.js
@@ -40,7 +40,7 @@ /** * @return {!Promise<!Array<!ImportantSite>>} - * A promise resolved when imporant sites are retrieved. + * A promise resolved when important sites are retrieved. */ getImportantSites() {}
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.js b/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.js index 5cf45a4..c49359c 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.js +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/history_deletion_dialog.js
@@ -17,7 +17,7 @@ }, /** - * Tap handler for the "OK" buton. + * Tap handler for the "OK" button. * @private */ onOkTap_: function() {
diff --git a/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js b/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js index a156940..0ff4183 100644 --- a/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js +++ b/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js
@@ -5,13 +5,13 @@ (function() { /** - * The time in millseconds of the animation updates. + * The time in milliseconds of the animation updates. * @const {number} */ var ANIMATE_TICKS_MS = 20; /** - * The duration in millseconds of the animation of the progress circle when the + * The duration in milliseconds of the animation of the progress circle when the * user is touching the scanner. * @const {number} */ @@ -51,7 +51,7 @@ is: 'settings-fingerprint-progress-arc', // Also put these values as member values so they can be overriden by tests - // and the tests do not need to be changed everytime the UI is. + // and the tests do not need to be changed every time the UI is. /** @private {number} */ canvasCircleRadius_: CANVAS_CIRCLE_RADIUS, /** @private {number} */
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.js b/chrome/browser/resources/settings/people_page/lock_screen.js index aaac86af..1f0983d 100644 --- a/chrome/browser/resources/settings/people_page/lock_screen.js +++ b/chrome/browser/resources/settings/people_page/lock_screen.js
@@ -15,7 +15,7 @@ */ /** - * Possible values of the proximity threshould displayed to the user. + * Possible values of the proximity threshold displayed to the user. * This should be kept in sync with the enum defined here: * components/proximity_auth/proximity_monitor_impl.cc */
diff --git a/chrome/browser/resources/settings/people_page/sync_page.html b/chrome/browser/resources/settings/people_page/sync_page.html index 07ae46a..bea84fd 100644 --- a/chrome/browser/resources/settings/people_page/sync_page.html +++ b/chrome/browser/resources/settings/people_page/sync_page.html
@@ -128,7 +128,7 @@ $i18n{autofillCheckboxLabel} </div> <!-- Autofill has a special on-change handler to deal with - Payments integriation. --> + Payments integration. --> <cr-toggle checked="{{syncPrefs.autofillSynced}}" on-change="onAutofillDataTypeChanged_" disabled="[[shouldSyncCheckboxBeDisabled_(
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_banner.js b/chrome/browser/resources/settings/reset_page/reset_profile_banner.js index 9b95c0f1..441279b7 100644 --- a/chrome/browser/resources/settings/reset_page/reset_profile_banner.js +++ b/chrome/browser/resources/settings/reset_page/reset_profile_banner.js
@@ -4,7 +4,7 @@ /** * @fileoverview - * 'settings-reset-profile-banner' is the banner shown for propmting the user to + * 'settings-reset-profile-banner' is the banner shown for prompting the user to * clear profile settings. */ Polymer({
diff --git a/chrome/browser/resources/settings/site_settings/compiled_resources2.gyp b/chrome/browser/resources/settings/site_settings/compiled_resources2.gyp index 952595b..38e5e6c 100644 --- a/chrome/browser/resources/settings/site_settings/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/site_settings/compiled_resources2.gyp
@@ -147,7 +147,6 @@ 'dependencies': [ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', - '<(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:web_ui_listener_behavior', 'constants',
diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.html b/chrome/browser/resources/settings/site_settings/site_details_permission.html index 0b7894e..fc064fd 100644 --- a/chrome/browser/resources/settings/site_settings/site_details_permission.html +++ b/chrome/browser/resources/settings/site_settings/site_details_permission.html
@@ -1,7 +1,6 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/md_select_css.html"> -<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="../settings_shared_css.html"> @@ -40,7 +39,8 @@ '$i18nPolymer{siteSettingsSourceExtensionAsk}', '$i18nPolymer{siteSettingsSourcePolicyAllow}', '$i18nPolymer{siteSettingsSourcePolicyBlock}', - '$i18nPolymer{siteSettingsSourcePolicyAsk}')]]"> + '$i18nPolymer{siteSettingsSourcePolicyAsk}', + '$i18nPolymer{siteSettingsSourceDrmDisabled}')]]"> </div> </div> <div class="md-select-wrapper">
diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chrome/browser/resources/settings/site_settings/site_details_permission.js index 0c358041..a4dc47b1 100644 --- a/chrome/browser/resources/settings/site_settings/site_details_permission.js +++ b/chrome/browser/resources/settings/site_settings/site_details_permission.js
@@ -10,7 +10,7 @@ Polymer({ is: 'site-details-permission', - behaviors: [SiteSettingsBehavior, WebUIListenerBehavior, I18nBehavior], + behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], properties: { /** @@ -136,7 +136,7 @@ // Set all permission info string arguments as null. This is OK // because there is no need to know what the information string // will be, just whether there is one or not. - null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null) != ''; }, @@ -210,6 +210,7 @@ * @param {?string} policyAllowString * @param {?string} policyBlockString * @param {?string} policyAskString + * @param {?string} drmDisabledString * @return {?string} The permission information string to display in the HTML. * @private */ @@ -217,8 +218,8 @@ source, category, setting, adsBlacklistString, adsBlockString, embargoString, insecureOriginString, killSwitchString, extensionAllowString, extensionBlockString, extensionAskString, - policyAllowString, policyBlockString, policyAskString) { - + policyAllowString, policyBlockString, policyAskString, + drmDisabledString) { /** @type {Object<!settings.ContentSetting, ?string>} */ var extensionStrings = {}; extensionStrings[settings.ContentSetting.ALLOW] = extensionAllowString; @@ -247,10 +248,12 @@ assert( settings.ContentSettingsTypes.PROTECTED_CONTENT == category, 'The DRM disabled source only applies to Protected Content.'); - return this.i18nAdvanced('siteSettingsSourceDrmDisabled', { - substitutions: - [settings.routes.SITE_SETTINGS_PROTECTED_CONTENT.getAbsolutePath()] - }); + if (!drmDisabledString) { + return null; + } + return loadTimeData.sanitizeInnerHtml(loadTimeData.substituteString( + drmDisabledString, + settings.routes.SITE_SETTINGS_PROTECTED_CONTENT.getAbsolutePath())); } else if (source == settings.SiteSettingSource.EMBARGO) { assert( settings.ContentSetting.BLOCK == setting,
diff --git a/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html b/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html index c50f01c4..41dac3c 100644 --- a/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html +++ b/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html
@@ -1,7 +1,7 @@ <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/cr.html"> -<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icon.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/image-icons.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/notification-icons.html">
diff --git a/chrome/browser/ssl/ssl_error_assistant.cc b/chrome/browser/ssl/ssl_error_assistant.cc index 1902cac6..ea2fc55 100644 --- a/chrome/browser/ssl/ssl_error_assistant.cc +++ b/chrome/browser/ssl/ssl_error_assistant.cc
@@ -100,7 +100,7 @@ } for (const net::HashValue& hash_value : ssl_info.public_key_hashes) { - if (hash_value.tag != net::HASH_VALUE_SHA256) { + if (hash_value.tag() != net::HASH_VALUE_SHA256) { continue; } if (captive_portal_spki_hashes_->find(hash_value.ToString()) !=
diff --git a/chrome/browser/task_manager/task_manager_browsertest.cc b/chrome/browser/task_manager/task_manager_browsertest.cc index ca9270cd..3d33090 100644 --- a/chrome/browser/task_manager/task_manager_browsertest.cc +++ b/chrome/browser/task_manager/task_manager_browsertest.cc
@@ -975,7 +975,8 @@ MatchSubframe("http://e.com/"), ColumnSpecifier::MEMORY_FOOTPRINT, 1000)); } -IN_PROC_BROWSER_TEST_P(TaskManagerOOPIFBrowserTest, KillSubframe) { +// Flaky, see https://crbug.com/797860. +IN_PROC_BROWSER_TEST_P(TaskManagerOOPIFBrowserTest, DISABLED_KillSubframe) { ShowTaskManager(); content::TestNavigationObserver navigation_observer(
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 75a7d48..720e8b1 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1451,6 +1451,8 @@ "webui/chromeos/login/signin_screen_handler.h", "webui/chromeos/login/supervised_user_creation_screen_handler.cc", "webui/chromeos/login/supervised_user_creation_screen_handler.h", + "webui/chromeos/login/sync_consent_screen_handler.cc", + "webui/chromeos/login/sync_consent_screen_handler.h", "webui/chromeos/login/terms_of_service_screen_handler.cc", "webui/chromeos/login/terms_of_service_screen_handler.h", "webui/chromeos/login/update_required_screen_handler.cc",
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index 786868f..e003100 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -56,6 +56,7 @@ #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen_handler.h" +#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/update_required_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" @@ -293,6 +294,8 @@ AddScreenHandler( base::MakeUnique<TermsOfServiceScreenHandler>(core_handler_)); + AddScreenHandler(base::MakeUnique<SyncConsentScreenHandler>()); + AddScreenHandler(base::MakeUnique<ArcTermsOfServiceScreenHandler>()); AddScreenHandler(base::MakeUnique<UserImageScreenHandler>()); @@ -427,6 +430,10 @@ return GetView<TermsOfServiceScreenHandler>(); } +SyncConsentScreenView* OobeUI::GetSyncConsentScreenView() { + return GetView<SyncConsentScreenHandler>(); +} + ArcTermsOfServiceScreenView* OobeUI::GetArcTermsOfServiceScreenView() { return GetView<ArcTermsOfServiceScreenHandler>(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h index c0ad51d..0f97d1a 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
@@ -54,6 +54,7 @@ class SigninScreenHandlerDelegate; class SupervisedUserCreationScreenHandler; class ResetView; +class SyncConsentScreenView; class TermsOfServiceScreenView; class UserBoardView; class UserImageView; @@ -105,6 +106,7 @@ KioskAutolaunchScreenView* GetKioskAutolaunchScreenView(); KioskEnableScreenView* GetKioskEnableScreenView(); TermsOfServiceScreenView* GetTermsOfServiceScreenView(); + SyncConsentScreenView* GetSyncConsentScreenView(); ArcTermsOfServiceScreenView* GetArcTermsOfServiceScreenView(); UserImageView* GetUserImageView(); ErrorScreen* GetErrorScreen();
diff --git a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc new file mode 100644 index 0000000..b2c4325 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.cc
@@ -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. + +#include "chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h" + +#include "chrome/browser/chromeos/login/screens/sync_consent_screen.h" +#include "chrome/grit/generated_resources.h" +#include "components/login/localized_values_builder.h" + +namespace { + +const char kJsScreenPath[] = "login.SyncConsentScreen"; + +} // namespace + +namespace chromeos { + +SyncConsentScreenHandler::SyncConsentScreenHandler() + : BaseScreenHandler(kScreenId) { + set_call_js_prefix(kJsScreenPath); +} + +SyncConsentScreenHandler::~SyncConsentScreenHandler() {} + +void SyncConsentScreenHandler::DeclareLocalizedValues( + ::login::LocalizedValuesBuilder* builder) { + builder->Add("syncConsentScreenTitle", IDS_LOGIN_SYNC_CONSENT_SCREEN_TITLE); + builder->Add("syncConsentScreenChromeSyncName", + IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_NAME); + builder->Add("syncConsentScreenChromeSyncDescription", + IDS_LOGIN_SYNC_CONSENT_SCREEN_CHROME_SYNC_DESCRIPTION); + builder->Add("syncConsentScreenPersonalizeGoogleServicesName", + IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_NAME); + builder->Add( + "syncConsentScreenPersonalizeGoogleServicesDescription", + IDS_LOGIN_SYNC_CONSENT_SCREEN_PERSONALIZE_GOOGLE_SERVICES_DESCRIPTION); + builder->Add("syncConsentScreenSettingsLink", + IDS_LOGIN_SYNC_CONSENT_SCREEN_SETTINGS_LINK); + builder->Add("syncConsentSettingsDialogTitle", + IDS_LOGIN_SYNC_CONSENT_SETTINGS_TITLE); + builder->Add("syncConsentSettingsDialogSubTitle", + IDS_LOGIN_SYNC_CONSENT_SETTINGS_SUBTITLE); + builder->Add("syncConsentSyncAllOptionTitle", + IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION); + builder->Add("syncConsentSyncAllOptionOn", + IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION_ON); + builder->Add("syncConsentSyncAllOptionOff", + IDS_LOGIN_SYNC_CONSENT_SYNC_ALL_OPTION_OFF); + builder->Add("syncConsentSettingsStatusSyncAllOn", + IDS_LOGIN_SYNC_CONSENT_STATUS_SYNC_ALL_ON); + builder->Add("syncConsentSettingsStatusSyncAllOff", + IDS_LOGIN_SYNC_CONSENT_STATUS_SYNC_ALL_OFF); + builder->Add("syncConsentSettingsSaveAndContinue", + IDS_LOGIN_SYNC_CONSENT_SAVE_AND_CONTINUE); +} + +void SyncConsentScreenHandler::Bind(SyncConsentScreen* screen) { + BaseScreenHandler::SetBaseScreen(screen); +} + +void SyncConsentScreenHandler::Show() { + ShowScreen(kScreenId); +} + +void SyncConsentScreenHandler::Hide() {} + +void SyncConsentScreenHandler::Initialize() {} + +} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.h new file mode 100644 index 0000000..0883c9d --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/login/sync_consent_screen_handler.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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_ + +#include "base/macros.h" +#include "chrome/browser/chromeos/login/screens/sync_consent_screen_view.h" +#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" + +namespace chromeos { + +class SyncConsentScreen; + +// The sole implementation of the SyncConsentScreenView, using WebUI. +class SyncConsentScreenHandler : public BaseScreenHandler, + public SyncConsentScreenView { + public: + SyncConsentScreenHandler(); + ~SyncConsentScreenHandler() override; + + // BaseScreenHandler: + void DeclareLocalizedValues( + ::login::LocalizedValuesBuilder* builder) override; + + // SyncConsentScreenView: + void Bind(SyncConsentScreen* screen) override; + void Show() override; + void Hide() override; + + private: + // BaseScreenHandler: + void Initialize() override; + + DISALLOW_COPY_AND_ASSIGN(SyncConsentScreenHandler); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SYNC_CONSENT_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc index 457081c5..abf82d1 100644 --- a/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -162,6 +162,8 @@ IDS_MD_EXTENSIONS_ERROR_CONTEXT_UNKNOWN); source->AddLocalizedString("openInDevtool", IDS_MD_EXTENSIONS_ERROR_LAUNCH_DEVTOOLS); + source->AddLocalizedString("errorLinesNotShown", + IDS_MD_EXTENSIONS_ERROR_LINES_NOT_SHOWN); source->AddLocalizedString("stackTrace", IDS_MD_EXTENSIONS_ERROR_STACK_TRACE); // TODO(dpapad): Unify with Settings' IDS_SETTINGS_WEB_STORE. source->AddLocalizedString("openChromeWebStore",
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 4495d94c..83fb3f0 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -467,10 +467,6 @@ const base::Feature kPushMessagingBackgroundMode{ "PushMessagingBackgroundMode", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enables support for Minimal-UI PWA display mode. -const base::Feature kPwaMinimalUi{"PwaMinimalUi", - base::FEATURE_ENABLED_BY_DEFAULT}; - #if !defined(OS_ANDROID) const base::Feature kRemoveUsageOfDeprecatedGaiaSigninEndpoint{ "RemoveUsageOfDeprecatedGaiaSigninEndpoint",
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 019f866f..edc33b2 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -243,8 +243,6 @@ extern const base::Feature kPushMessagingBackgroundMode; -extern const base::Feature kPwaMinimalUi; - #if !defined(OS_ANDROID) extern const base::Feature kRemoveUsageOfDeprecatedGaiaSigninEndpoint; #endif
diff --git a/chrome/common/media_router/discovery/media_sink_service_base.cc b/chrome/common/media_router/discovery/media_sink_service_base.cc index 4ddf0ef..9374c4ff 100644 --- a/chrome/common/media_router/discovery/media_sink_service_base.cc +++ b/chrome/common/media_router/discovery/media_sink_service_base.cc
@@ -36,7 +36,11 @@ return; } - ForceSinkDiscoveryCallback(); + DVLOG(2) << "Send sinks to media router, [size]: " << current_sinks_.size(); + on_sinks_discovered_cb_.Run(std::vector<MediaSinkInternal>( + current_sinks_.begin(), current_sinks_.end())); + mrp_sinks_ = current_sinks_; + discovery_timer_->Stop(); RecordDeviceCounts(); } @@ -55,15 +59,6 @@ DoStart(); } -void MediaSinkServiceBase::ForceSinkDiscoveryCallback() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DVLOG(2) << "Send sinks to media router, [size]: " << current_sinks_.size(); - on_sinks_discovered_cb_.Run(std::vector<MediaSinkInternal>( - current_sinks_.begin(), current_sinks_.end())); - mrp_sinks_ = current_sinks_; - discovery_timer_->Stop(); -} - void MediaSinkServiceBase::DoStart() { base::TimeDelta finish_delay = base::TimeDelta::FromSeconds(kFetchCompleteTimeoutSecs);
diff --git a/chrome/common/media_router/discovery/media_sink_service_base.h b/chrome/common/media_router/discovery/media_sink_service_base.h index 9587542d..ea0b503 100644 --- a/chrome/common/media_router/discovery/media_sink_service_base.h +++ b/chrome/common/media_router/discovery/media_sink_service_base.h
@@ -28,10 +28,6 @@ explicit MediaSinkServiceBase(const OnSinksDiscoveredCallback& callback); virtual ~MediaSinkServiceBase(); - // Forces |callback| to be invoked with the latest sink list. - // Marked virtual for tests. - virtual void ForceSinkDiscoveryCallback(); - protected: void SetTimerForTest(std::unique_ptr<base::Timer> timer);
diff --git a/chrome/renderer/net/net_error_helper.cc b/chrome/renderer/net/net_error_helper.cc index 1f5077d..d65d8d5e 100644 --- a/chrome/renderer/net/net_error_helper.cc +++ b/chrome/renderer/net/net_error_helper.cc
@@ -9,6 +9,7 @@ #include <utility> #include "base/command_line.h" +#include "base/feature_list.h" #include "base/i18n/rtl.h" #include "base/json/json_writer.h" #include "base/metrics/histogram.h" @@ -24,6 +25,7 @@ #include "components/error_page/common/net_error_info.h" #include "components/grit/components_resources.h" #include "content/public/common/content_client.h" +#include "content/public/common/content_features.h" #include "content/public/common/url_constants.h" #include "content/public/renderer/child_url_loader_factory_getter.h" #include "content/public/renderer/content_renderer_client.h" @@ -303,9 +305,7 @@ correction_fetcher_->Start( render_frame()->GetWebFrame(), blink::WebURLRequest::kRequestContextInternal, - render_frame() - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + render_frame()->GetURLLoaderFactory(navigation_correction_url), GetNetworkTrafficAnnotationTag(), base::BindOnce(&NetErrorHelper::OnNavigationCorrectionsFetched, base::Unretained(this))); @@ -330,9 +330,7 @@ tracking_fetcher_->Start( render_frame()->GetWebFrame(), blink::WebURLRequest::kRequestContextInternal, - render_frame() - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + render_frame()->GetURLLoaderFactory(tracking_url), GetNetworkTrafficAnnotationTag(), base::BindOnce(&NetErrorHelper::OnTrackingRequestComplete, base::Unretained(this)));
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index d07b588a..bdaf88b 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -879,6 +879,8 @@ "data/webui/history_ui_browsertest.h", "data/webui/ntp4_browsertest.cc", "data/webui/ntp4_browsertest.h", + "data/webui/signin_browsertest.cc", + "data/webui/signin_browsertest.h", "data/webui/webui_resource_browsertest.cc", "gpu/webgl_infobar_browsertest.cc", "ppapi/ppapi_browsertest.cc", @@ -2992,6 +2994,7 @@ "../browser/media/router/mojo/media_router_mojo_impl_unittest.cc", "../browser/media/router/mojo/media_router_mojo_metrics_unittest.cc", "../browser/media/router/mojo/wired_display_media_route_provider_unittest.cc", + "../browser/media/router/providers/cast/dual_media_sink_service_unittest.cc", "../browser/policy/local_sync_policy_handler_unittest.cc", "../browser/renderer_context_menu/render_view_context_menu_test_util.cc", "../browser/renderer_context_menu/render_view_context_menu_test_util.h",
diff --git a/chrome/test/data/webui/BUILD.gn b/chrome/test/data/webui/BUILD.gn index 5a68905..940e14ec 100644 --- a/chrome/test/data/webui/BUILD.gn +++ b/chrome/test/data/webui/BUILD.gn
@@ -117,6 +117,10 @@ "settings/easy_unlock_browsertest_chromeos.js", "sys_internals/sys_internals_browsertest.js", ] + } else { + sources += [ + "signin/signin_browsertest.js", + ] } if (is_chrome_branded) {
diff --git a/chrome/test/data/webui/extensions/cr_extensions_browsertest.js b/chrome/test/data/webui/extensions/cr_extensions_browsertest.js index a30664a4..86962a31 100644 --- a/chrome/test/data/webui/extensions/cr_extensions_browsertest.js +++ b/chrome/test/data/webui/extensions/cr_extensions_browsertest.js
@@ -597,6 +597,10 @@ this.runMochaTest(extension_code_section_tests.TestNames.Layout); }); +TEST_F('CrExtensionsCodeSectionTest', 'LongSource', function() { + this.runMochaTest(extension_code_section_tests.TestNames.LongSource); +}); + //////////////////////////////////////////////////////////////////////////////// // Extension Navigation Helper Tests
diff --git a/chrome/test/data/webui/extensions/extension_code_section_test.js b/chrome/test/data/webui/extensions/extension_code_section_test.js index 32eec28..eb50d13 100644 --- a/chrome/test/data/webui/extensions/extension_code_section_test.js +++ b/chrome/test/data/webui/extensions/extension_code_section_test.js
@@ -7,19 +7,12 @@ /** @enum {string} */ var TestNames = { Layout: 'layout', + LongSource: 'long source', }; var suiteName = 'ExtensionCodeSectionTest'; suite(suiteName, function() { - /** @type {chrome.developerPrivate.RequestFileSourceResponse} */ - var code = { - beforeHighlight: 'this part before the highlight\nAnd this too\n', - highlight: 'highlight this part\n', - afterHighlight: 'this part after the highlight\n', - message: 'Highlight message', - }; - /** @type {extensions.CodeSection} */ var codeSection; @@ -34,14 +27,19 @@ }); test(assert(TestNames.Layout), function() { - Polymer.dom.flush(); + /** @type {chrome.developerPrivate.RequestFileSourceResponse} */ + var code = { + beforeHighlight: 'this part before the highlight\nAnd this too\n', + highlight: 'highlight this part\n', + afterHighlight: 'this part after the highlight', + message: 'Highlight message', + }; var testIsVisible = extension_test_util.isVisible.bind(null, codeSection); expectFalse(!!codeSection.code); expectTrue(codeSection.$$('#scroll-container').hidden); expectFalse(testIsVisible('#main')); expectTrue(testIsVisible('#no-code')); - expectEquals('', codeSection.$['line-numbers'].textContent.trim()); codeSection.code = code; expectTrue(testIsVisible('#main')); @@ -54,7 +52,63 @@ var highlightedText = window.getSelection().toString(); expectEquals(code.highlight, highlightedText); expectEquals( - '1\n2\n3\n4\n5', codeSection.$['line-numbers'].textContent.trim()); + '1\n2\n3\n4', + codeSection.$$('#line-numbers span').textContent.trim()); + }); + + test(assert(TestNames.LongSource), function() { + /** @type {chrome.developerPrivate.RequestFileSourceResponse} */ + var code; + var lineNums; + + function setCodeContent(beforeLineCount, afterLineCount) { + code = { + beforeHighlight: '', + highlight: 'highlight', + afterHighlight: '', + message: 'Highlight message', + }; + for (let i = 0; i < beforeLineCount; i++) + code.beforeHighlight += 'a\n'; + for (let i = 0; i < afterLineCount; i++) + code.afterHighlight += 'a\n'; + } + + setCodeContent(0, 2000); + codeSection.code = code; + lineNums = codeSection.$$('#line-numbers span').textContent; + // Length should be 1000 +- 1. + expectTrue(lineNums.split('\n').length >= 999); + expectTrue(lineNums.split('\n').length <= 1001); + expectTrue(!!lineNums.match(/^1\n/)); + expectTrue(!!lineNums.match(/1000/)); + expectFalse(!!lineNums.match(/1001/)); + expectTrue(codeSection.$$('#line-numbers .more-code.before').hidden); + expectFalse(codeSection.$$('#line-numbers .more-code.after').hidden); + + setCodeContent(1000, 1000); + codeSection.code = code; + lineNums = codeSection.$$('#line-numbers span').textContent; + // Length should be 1000 +- 1. + expectTrue(lineNums.split('\n').length >= 999); + expectTrue(lineNums.split('\n').length <= 1001); + expectFalse(!!lineNums.match(/^1\n/)); + expectTrue(!!lineNums.match(/1000/)); + expectFalse(!!lineNums.match(/1999/)); + expectFalse(codeSection.$$('#line-numbers .more-code.before').hidden); + expectFalse(codeSection.$$('#line-numbers .more-code.after').hidden); + + setCodeContent(2000, 0); + codeSection.code = code; + lineNums = codeSection.$$('#line-numbers span').textContent; + // Length should be 1000 +- 1. + expectTrue(lineNums.split('\n').length >= 999); + expectTrue(lineNums.split('\n').length <= 1001); + expectFalse(!!lineNums.match(/^1\n/)); + expectTrue(!!lineNums.match(/1002/)); + expectTrue(!!lineNums.match(/2000/)); + expectFalse(codeSection.$$('#line-numbers .more-code.before').hidden); + expectTrue(codeSection.$$('#line-numbers .more-code.after').hidden); }); });
diff --git a/chrome/test/data/webui/signin/signin_browsertest.js b/chrome/test/data/webui/signin/signin_browsertest.js new file mode 100644 index 0000000..bec045ad --- /dev/null +++ b/chrome/test/data/webui/signin/signin_browsertest.js
@@ -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. + +/** @fileoverview Runs the Sign-in web UI tests. */ + +/** @const {string} Path to source root. */ +const ROOT_PATH = '../../../../../'; + +// Polymer BrowserTest fixture. +GEN_INCLUDE( + [ROOT_PATH + 'chrome/test/data/webui/polymer_browser_test_base.js']); +GEN('#include "base/command_line.h"'); +GEN('#include "chrome/test/data/webui/signin_browsertest.h"'); + +/** + * Test fixture for + * chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation.html. + * This has to be declared as a variable for TEST_F to find it correctly. + */ +var SigninSyncConfirmationTest = class extends PolymerTest { + /** @override */ + get typedefCppFixture() { + return 'SigninBrowserTest'; + } + + /** @override */ + testGenPreamble() { + GEN(' EnableDice();'); + } + + /** @override */ + get browsePreload() { + return 'chrome://sync-confirmation/sync_confirmation_app.html'; + } + + /** @override */ + get extraLibraries() { + return PolymerTest.getLibraries(ROOT_PATH).concat([ + 'sync_confirmation_test.js', + ]); + } +}; + +TEST_F('SigninSyncConfirmationTest', 'DialogWithDice', function() { + mocha.run(); +});
diff --git a/chrome/test/data/webui/signin/sync_confirmation_test.js b/chrome/test/data/webui/signin/sync_confirmation_test.js new file mode 100644 index 0000000..ca76806 --- /dev/null +++ b/chrome/test/data/webui/signin/sync_confirmation_test.js
@@ -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. + +cr.define('signin_sync_confirmation', function() { + + suite('SigninSyncConfirmationTest', function() { + let app; + setup(function() { + PolymerTest.clearBody(); + app = document.createElement('sync-confirmation-app'); + document.body.append(app); + }); + + // Tests that no DCHECKS are thrown during initialization of the UI. + test('LoadPage', function() { + assertTrue(!!app.$.heading); + }); + }); +});
diff --git a/chrome/test/data/webui/signin_browsertest.cc b/chrome/test/data/webui/signin_browsertest.cc new file mode 100644 index 0000000..54025cb0 --- /dev/null +++ b/chrome/test/data/webui/signin_browsertest.cc
@@ -0,0 +1,18 @@ +// 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/test/data/webui/signin_browsertest.h" + +#include "components/signin/core/browser/profile_management_switches.h" +#include "components/signin/core/browser/scoped_account_consistency.h" + +SigninBrowserTest::SigninBrowserTest() {} + +SigninBrowserTest::~SigninBrowserTest() {} + +void SigninBrowserTest::EnableDice() { + scoped_account_consistency_ = + base::MakeUnique<signin::ScopedAccountConsistency>( + signin::AccountConsistencyMethod::kDice); +}
diff --git a/chrome/test/data/webui/signin_browsertest.h b/chrome/test/data/webui/signin_browsertest.h new file mode 100644 index 0000000..f5899c4 --- /dev/null +++ b/chrome/test/data/webui/signin_browsertest.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 CHROME_TEST_DATA_WEBUI_SIGNIN_BROWSERTEST_H_ +#define CHROME_TEST_DATA_WEBUI_SIGNIN_BROWSERTEST_H_ + +#include "base/macros.h" +#include "chrome/test/base/web_ui_browser_test.h" +#include "components/signin/core/browser/scoped_account_consistency.h" + +class SigninBrowserTest : public WebUIBrowserTest { + public: + SigninBrowserTest(); + ~SigninBrowserTest() override; + + protected: + void EnableDice(); + + private: + std::unique_ptr<signin::ScopedAccountConsistency> scoped_account_consistency_; + + DISALLOW_COPY_AND_ASSIGN(SigninBrowserTest); +}; + +#endif // CHROME_TEST_DATA_WEBUI_SIGNIN_BROWSERTEST_H_
diff --git a/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc b/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc index c9cae15..1dfa0634 100644 --- a/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc +++ b/chromeos/network/onc/onc_certificate_importer_impl_unittest.cc
@@ -150,9 +150,8 @@ std::sort(result.begin(), result.end(), [](const net::ScopedCERTCertificate& lhs, const net::ScopedCERTCertificate& rhs) { - return net::SHA256HashValueLessThan()( - net::x509_util::CalculateFingerprint256(lhs.get()), - net::x509_util::CalculateFingerprint256(rhs.get())); + return net::x509_util::CalculateFingerprint256(lhs.get()) < + net::x509_util::CalculateFingerprint256(rhs.get()); }); return result; }
diff --git a/components/certificate_transparency/single_tree_tracker.cc b/components/certificate_transparency/single_tree_tracker.cc index 30a8c7f..3636f4a 100644 --- a/components/certificate_transparency/single_tree_tracker.cc +++ b/components/certificate_transparency/single_tree_tracker.cc
@@ -246,10 +246,8 @@ bool SingleTreeTracker::OrderByTimestamp::operator()( const EntryToAudit& lhs, const EntryToAudit& rhs) const { - if (lhs.sct_timestamp != rhs.sct_timestamp) - return lhs.sct_timestamp < rhs.sct_timestamp; - - return net::SHA256HashValueLessThan()(lhs.leaf_hash, rhs.leaf_hash); + return std::tie(lhs.sct_timestamp, lhs.leaf_hash) < + std::tie(rhs.sct_timestamp, rhs.leaf_hash); } SingleTreeTracker::SingleTreeTracker(
diff --git a/components/certificate_transparency/single_tree_tracker.h b/components/certificate_transparency/single_tree_tracker.h index a87c71ca..dfe49c3 100644 --- a/components/certificate_transparency/single_tree_tracker.h +++ b/components/certificate_transparency/single_tree_tracker.h
@@ -190,10 +190,7 @@ // of an entry in |checked_entries_| indicates success. // To extend support for caching failures, a success indicator should be // added to the EntryAuditResult struct. - base::MRUCache<net::SHA256HashValue, - EntryAuditResult, - net::SHA256HashValueLessThan> - checked_entries_; + base::MRUCache<net::SHA256HashValue, EntryAuditResult> checked_entries_; LogDnsClient* dns_client_;
diff --git a/components/cronet/android/test/mock_cert_verifier.cc b/components/cronet/android/test/mock_cert_verifier.cc index 3002d254f..a1629f5 100644 --- a/components/cronet/android/test/mock_cert_verifier.cc +++ b/components/cronet/android/test/mock_cert_verifier.cc
@@ -39,7 +39,7 @@ return false; } // Calculate SHA256 hash of public key bytes. - out_hash_value->tag = net::HASH_VALUE_SHA256; + *out_hash_value = net::HashValue(net::HASH_VALUE_SHA256); crypto::SHA256HashString(spki_bytes, out_hash_value->data(), crypto::kSHA256Length); return true;
diff --git a/components/cronet/ios/test/cronet_test_base.mm b/components/cronet/ios/test/cronet_test_base.mm index 7f8113d..725350a 100644 --- a/components/cronet/ios/test/cronet_test_base.mm +++ b/components/cronet/ios/test/cronet_test_base.mm
@@ -269,7 +269,7 @@ return false; } // Calculate SHA256 hash of public key bytes. - out_hash_value->tag = net::HASH_VALUE_SHA256; + *out_hash_value = net::HashValue(net::HASH_VALUE_SHA256); crypto::SHA256HashString(spki_bytes, out_hash_value->data(), crypto::kSHA256Length); return true;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h index 7c178a8..6bde0e5 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.h
@@ -72,11 +72,7 @@ void SetTickClockForTesting(base::TickClock* tick_clock); protected: - // Protected so that these methods are accessible for testing. - void GetAlternativeProxy(const GURL& url, - const net::ProxyServer& resolved_proxy_server, - net::ProxyServer* alternative_proxy_server) const; - + // Protected so that this method is accessible for testing. // net::ProxyDelegate implementation: void OnAlternativeProxyBroken( const net::ProxyServer& alternative_proxy_server) override; @@ -102,6 +98,10 @@ // NetworkChangeNotifier::IPAddressObserver: void OnIPAddressChanged() override; + void GetAlternativeProxy(const GURL& url, + const net::ProxyServer& resolved_proxy_server, + net::ProxyServer* alternative_proxy_server) const; + const DataReductionProxyConfig* config_; const DataReductionProxyConfigurator* configurator_; DataReductionProxyEventCreator* event_creator_;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc index dba34b6..8c03fed 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
@@ -74,8 +74,7 @@ return net::ProxyServer::FromURI("quic://origin.net:443", net::ProxyServer::SCHEME_QUIC); case net::ProxyServer::SCHEME_DIRECT: - return net::ProxyServer::FromURI("DIRECT", - net::ProxyServer::SCHEME_DIRECT); + return net::ProxyServer::Direct(); default: NOTREACHED(); return net::ProxyServer::FromURI("", net::ProxyServer::SCHEME_INVALID); @@ -132,7 +131,6 @@ } } - using DataReductionProxyDelegate::GetAlternativeProxy; using DataReductionProxyDelegate::OnAlternativeProxyBroken; using DataReductionProxyDelegate::QuicProxyStatus; @@ -217,224 +215,6 @@ } } -// Verifies that DataReductionProxyDelegate correctly implements -// alternative proxy functionality. -TEST(DataReductionProxyDelegate, AlternativeProxy) { - base::MessageLoopForIO message_loop_; - std::unique_ptr<DataReductionProxyTestContext> test_context = - DataReductionProxyTestContext::Builder() - .WithConfigClient() - .WithMockDataReductionProxyService() - .Build(); - - const struct { - bool is_in_quic_field_trial; - bool proxy_supports_quic; - GURL gurl; - net::ProxyServer::Scheme first_proxy_scheme; - net::ProxyServer::Scheme second_proxy_scheme; - } tests[] = { - {false, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTP, net::ProxyServer::SCHEME_DIRECT}, - {false, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTP}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTP, net::ProxyServer::SCHEME_DIRECT}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_QUIC, net::ProxyServer::SCHEME_DIRECT}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_DIRECT, net::ProxyServer::SCHEME_DIRECT}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_DIRECT}, - {true, true, GURL("https://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_DIRECT}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_DIRECT, net::ProxyServer::SCHEME_HTTPS}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTPS}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTP, net::ProxyServer::SCHEME_HTTPS}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_QUIC, net::ProxyServer::SCHEME_HTTP}, - {true, true, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_QUIC, net::ProxyServer::SCHEME_HTTPS}, - {true, false, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTP}, - {true, false, GURL("http://www.example.com"), - net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTPS}}; - for (const auto test : tests) { - // True if there should exist a valid alternative proxy server corresponding - // to the first proxy in the list of proxies available to the data reduction - // proxy. - const bool expect_alternative_proxy_server_to_first_proxy = - test.is_in_quic_field_trial && test.proxy_supports_quic && - !test.gurl.SchemeIsCryptographic() && - test.first_proxy_scheme == net::ProxyServer::SCHEME_HTTPS; - - // True if there should exist a valid alternative proxy server corresponding - // to the second proxy in the list of proxies available to the data - // reduction proxy. - const bool expect_alternative_proxy_server_to_second_proxy = - test.is_in_quic_field_trial && test.proxy_supports_quic && - !test.gurl.SchemeIsCryptographic() && - test.second_proxy_scheme == net::ProxyServer::SCHEME_HTTPS; - - std::vector<DataReductionProxyServer> proxies_for_http; - net::ProxyServer first_proxy; - net::ProxyServer second_proxy; - if (test.first_proxy_scheme != net::ProxyServer::SCHEME_INVALID) { - first_proxy = GetProxyWithScheme(test.first_proxy_scheme); - proxies_for_http.push_back( - DataReductionProxyServer(first_proxy, ProxyServer::CORE)); - } - if (test.second_proxy_scheme != net::ProxyServer::SCHEME_INVALID) { - second_proxy = GetProxyWithScheme(test.second_proxy_scheme); - proxies_for_http.push_back(DataReductionProxyServer( - second_proxy, ProxyServer::UNSPECIFIED_TYPE)); - } - - std::unique_ptr<DataReductionProxyMutableConfigValues> config_values = - base::MakeUnique<DataReductionProxyMutableConfigValues>(); - config_values->UpdateValues(proxies_for_http); - - std::unique_ptr<DataReductionProxyConfig> config( - new DataReductionProxyConfig( - message_loop_.task_runner(), test_context->net_log(), - std::move(config_values), test_context->configurator(), - test_context->event_creator())); - - TestDataReductionProxyDelegate delegate( - config.get(), test_context->io_data()->configurator(), - test_context->io_data()->event_creator(), - test_context->io_data()->bypass_stats(), test.proxy_supports_quic, - test_context->io_data()->net_log()); - - base::FieldTrialList field_trial_list(nullptr); - base::FieldTrialList::CreateFieldTrial( - params::GetQuicFieldTrialName(), - test.is_in_quic_field_trial ? "Enabled" : "Control"); - - net::ProxyServer alternative_proxy_server_to_first_proxy; - net::ProxyServer alternative_proxy_server_to_second_proxy; - - { - // Test if the alternative proxy is correctly set if the resolved proxy is - // |first_proxy|. - base::HistogramTester histogram_tester; - delegate.GetAlternativeProxy(test.gurl, first_proxy, - &alternative_proxy_server_to_first_proxy); - EXPECT_EQ(expect_alternative_proxy_server_to_first_proxy, - alternative_proxy_server_to_first_proxy.is_valid()); - - // Verify that the metrics are recorded correctly. - if (test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic() && - test.first_proxy_scheme == net::ProxyServer::SCHEME_HTTPS) { - delegate.VerifyQuicHistogramCounts( - histogram_tester, expect_alternative_proxy_server_to_first_proxy, - test.proxy_supports_quic, false); - } else { - if (!test.is_in_quic_field_trial && - !test.gurl.SchemeIsCryptographic()) { - histogram_tester.ExpectUniqueSample( - "DataReductionProxy.Quic.ProxyStatus", - 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); - } else { - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.ProxyStatus", 0); - } - } - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); - } - - { - // Test if the alternative proxy is correctly set if the resolved proxy is - // |second_proxy|. - base::HistogramTester histogram_tester; - delegate.GetAlternativeProxy(test.gurl, second_proxy, - &alternative_proxy_server_to_second_proxy); - EXPECT_EQ(expect_alternative_proxy_server_to_first_proxy, - alternative_proxy_server_to_first_proxy.is_valid()); - EXPECT_EQ(expect_alternative_proxy_server_to_second_proxy, - alternative_proxy_server_to_second_proxy.is_valid()); - - // Verify that the metrics are recorded correctly. - if (test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic() && - test.second_proxy_scheme == net::ProxyServer::SCHEME_HTTPS) { - delegate.VerifyQuicHistogramCounts( - histogram_tester, expect_alternative_proxy_server_to_second_proxy, - test.proxy_supports_quic, false); - } else { - if (!test.is_in_quic_field_trial && - !test.gurl.SchemeIsCryptographic()) { - histogram_tester.ExpectUniqueSample( - "DataReductionProxy.Quic.ProxyStatus", - 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); - } else { - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.ProxyStatus", 0); - } - } - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); - } - - { - // Test if the alternative proxy is correctly set if the resolved proxy is - // a not a data reduction proxy. - base::HistogramTester histogram_tester; - net::ProxyServer alternative_proxy_server_to_non_data_reduction_proxy; - delegate.GetAlternativeProxy( - test.gurl, - net::ProxyServer::FromURI("not.data.reduction.proxy.net:443", - net::ProxyServer::SCHEME_HTTPS), - &alternative_proxy_server_to_non_data_reduction_proxy); - EXPECT_FALSE( - alternative_proxy_server_to_non_data_reduction_proxy.is_valid()); - - // Verify that the metrics are recorded correctly. - if (!test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic()) { - histogram_tester.ExpectUniqueSample( - "DataReductionProxy.Quic.ProxyStatus", - 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); - } else { - histogram_tester.ExpectTotalCount("DataReductionProxy.Quic.ProxyStatus", - 0); - } - - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); - } - - // Test if the alternative proxy is correctly marked as broken. - if (expect_alternative_proxy_server_to_first_proxy) { - base::HistogramTester histogram_tester; - // Verify that when the alternative proxy server is reported as broken, - // then it is no longer returned when GetAlternativeProxy is called. - EXPECT_EQ( - first_proxy.host_port_pair().host(), - alternative_proxy_server_to_first_proxy.host_port_pair().host()); - EXPECT_EQ( - first_proxy.host_port_pair().port(), - alternative_proxy_server_to_first_proxy.host_port_pair().port()); - EXPECT_EQ(net::ProxyServer::SCHEME_QUIC, - alternative_proxy_server_to_first_proxy.scheme()); - - delegate.OnAlternativeProxyBroken(first_proxy); - alternative_proxy_server_to_first_proxy = net::ProxyServer(); - delegate.GetAlternativeProxy(test.gurl, first_proxy, - &alternative_proxy_server_to_first_proxy); - - delegate.VerifyQuicHistogramCounts( - histogram_tester, expect_alternative_proxy_server_to_first_proxy, - test.proxy_supports_quic, true); - histogram_tester.ExpectTotalCount( - "DataReductionProxy.Quic.OnAlternativeProxyBroken", 1); - EXPECT_FALSE(alternative_proxy_server_to_first_proxy.is_valid()); - } - } -} - #if defined(OS_ANDROID) const Client kClient = Client::CHROME_ANDROID; #elif defined(OS_IOS) @@ -551,6 +331,10 @@ return test_context_->config(); } + TestDataReductionProxyIOData* io_data() const { + return test_context_->io_data(); + } + DataReductionProxyDelegate* proxy_delegate() const { return proxy_delegate_.get(); } @@ -730,6 +514,206 @@ } } +// Verifies that DataReductionProxyDelegate correctly implements +// alternative proxy functionality. +TEST_F(DataReductionProxyDelegateTest, AlternativeProxy) { + const struct { + bool is_in_quic_field_trial; + bool proxy_supports_quic; + GURL gurl; + net::ProxyServer::Scheme first_proxy_scheme; + net::ProxyServer::Scheme second_proxy_scheme; + } tests[] = {{false, true, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTP}, + {true, true, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTP}, + {true, true, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_HTTP, net::ProxyServer::SCHEME_HTTPS}, + {true, true, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_QUIC, net::ProxyServer::SCHEME_HTTP}, + {true, true, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_QUIC, net::ProxyServer::SCHEME_HTTPS}, + {true, false, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_HTTPS, net::ProxyServer::SCHEME_HTTP}, + {true, false, GURL("http://www.example.com"), + net::ProxyServer::SCHEME_HTTP, net::ProxyServer::SCHEME_HTTPS}}; + for (const auto test : tests) { + // True if there should exist a valid alternative proxy server corresponding + // to the first proxy in the list of proxies available to the data reduction + // proxy. + const bool expect_alternative_proxy_server_to_first_proxy = + test.is_in_quic_field_trial && test.proxy_supports_quic && + !test.gurl.SchemeIsCryptographic() && + test.first_proxy_scheme == net::ProxyServer::SCHEME_HTTPS; + + // True if there should exist a valid alternative proxy server corresponding + // to the second proxy in the list of proxies available to the data + // reduction proxy. + const bool expect_alternative_proxy_server_to_second_proxy = + test.is_in_quic_field_trial && test.proxy_supports_quic && + !test.gurl.SchemeIsCryptographic() && + test.second_proxy_scheme == net::ProxyServer::SCHEME_HTTPS; + + std::vector<DataReductionProxyServer> proxies_for_http; + + net::ProxyServer first_proxy = GetProxyWithScheme(test.first_proxy_scheme); + proxies_for_http.push_back( + DataReductionProxyServer(first_proxy, ProxyServer::CORE)); + + net::ProxyServer second_proxy = + GetProxyWithScheme(test.second_proxy_scheme); + proxies_for_http.push_back( + DataReductionProxyServer(second_proxy, ProxyServer::UNSPECIFIED_TYPE)); + + params()->SetProxiesForHttpForTesting(proxies_for_http); + + TestDataReductionProxyDelegate delegate( + config(), io_data()->configurator(), io_data()->event_creator(), + io_data()->bypass_stats(), test.proxy_supports_quic, + io_data()->net_log()); + + base::FieldTrialList field_trial_list(nullptr); + base::FieldTrialList::CreateFieldTrial( + params::GetQuicFieldTrialName(), + test.is_in_quic_field_trial ? "Enabled" : "Control"); + + net::ProxyInfo proxy_info; + net::ProxyRetryInfoMap empty_proxy_retry_info; + net::ProxyServer alternative_proxy_server_to_first_proxy; + net::ProxyServer alternative_proxy_server_to_second_proxy; + + { + proxy_info.UseDirect(); + + // Test if the alternative proxy is correctly set if the resolved proxy is + // |first_proxy|. + base::HistogramTester histogram_tester; + delegate.OnResolveProxy(test.gurl, "GET", empty_proxy_retry_info, + &proxy_info); + ASSERT_EQ(first_proxy, proxy_info.proxy_server()); + alternative_proxy_server_to_first_proxy = proxy_info.alternative_proxy(); + EXPECT_EQ(expect_alternative_proxy_server_to_first_proxy, + alternative_proxy_server_to_first_proxy.is_valid()); + + // Verify that the metrics are recorded correctly. + if (test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic() && + test.first_proxy_scheme == net::ProxyServer::SCHEME_HTTPS) { + delegate.VerifyQuicHistogramCounts( + histogram_tester, expect_alternative_proxy_server_to_first_proxy, + test.proxy_supports_quic, false); + } else { + if (!test.is_in_quic_field_trial && + !test.gurl.SchemeIsCryptographic()) { + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.Quic.ProxyStatus", + 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); + } else { + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.ProxyStatus", 0); + } + } + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); + } + + { + // Test if the alternative proxy is correctly set if the resolved proxy is + // |second_proxy|. Mark the first proxy as failed so that the second is + // selected. + proxy_info.UseDirect(); + net::ProxyRetryInfoMap proxy_retry_info; + net::ProxyRetryInfo bad_proxy_info; + bad_proxy_info.bad_until = base::TimeTicks() + base::TimeDelta::Max(); + proxy_retry_info[first_proxy.ToURI()] = bad_proxy_info; + + base::HistogramTester histogram_tester; + delegate.OnResolveProxy(test.gurl, "GET", proxy_retry_info, &proxy_info); + ASSERT_EQ(second_proxy, proxy_info.proxy_server()); + alternative_proxy_server_to_second_proxy = proxy_info.alternative_proxy(); + EXPECT_EQ(expect_alternative_proxy_server_to_first_proxy, + alternative_proxy_server_to_first_proxy.is_valid()); + EXPECT_EQ(expect_alternative_proxy_server_to_second_proxy, + alternative_proxy_server_to_second_proxy.is_valid()); + + // Verify that the metrics are recorded correctly. + if (test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic() && + test.second_proxy_scheme == net::ProxyServer::SCHEME_HTTPS) { + delegate.VerifyQuicHistogramCounts( + histogram_tester, expect_alternative_proxy_server_to_second_proxy, + test.proxy_supports_quic, false); + } else { + if (!test.is_in_quic_field_trial && + !test.gurl.SchemeIsCryptographic()) { + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.Quic.ProxyStatus", + 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); + } else { + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.ProxyStatus", 0); + } + } + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); + } + + { + // Test if the alternative proxy is correctly set if the resolved proxy is + // a not a data reduction proxy. + net::ProxyServer non_drp_proxy_server = net::ProxyServer::FromURI( + "not.data.reduction.proxy.net:443", net::ProxyServer::SCHEME_HTTPS); + proxy_info.UseProxyServer(non_drp_proxy_server); + + base::HistogramTester histogram_tester; + delegate.OnResolveProxy(test.gurl, "GET", empty_proxy_retry_info, + &proxy_info); + ASSERT_EQ(non_drp_proxy_server, proxy_info.proxy_server()); + EXPECT_FALSE(proxy_info.alternative_proxy().is_valid()); + + // Verify that the metrics are recorded correctly. + if (!test.is_in_quic_field_trial && !test.gurl.SchemeIsCryptographic()) { + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.Quic.ProxyStatus", + 3 /* QUIC_PROXY_DISABLED_VIA_FIELD_TRIAL */, 1); + } else { + histogram_tester.ExpectTotalCount("DataReductionProxy.Quic.ProxyStatus", + 0); + } + + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.OnAlternativeProxyBroken", 0); + } + + // Test if the alternative proxy is correctly marked as broken. + if (expect_alternative_proxy_server_to_first_proxy) { + proxy_info.UseDirect(); + + base::HistogramTester histogram_tester; + // Verify that when the alternative proxy server is reported as broken, + // then it is no longer returned when OnResolveProxy is called. + EXPECT_EQ( + first_proxy.host_port_pair().host(), + alternative_proxy_server_to_first_proxy.host_port_pair().host()); + EXPECT_EQ( + first_proxy.host_port_pair().port(), + alternative_proxy_server_to_first_proxy.host_port_pair().port()); + EXPECT_EQ(net::ProxyServer::SCHEME_QUIC, + alternative_proxy_server_to_first_proxy.scheme()); + + delegate.OnAlternativeProxyBroken(first_proxy); + delegate.OnResolveProxy(test.gurl, "GET", empty_proxy_retry_info, + &proxy_info); + ASSERT_EQ(first_proxy, proxy_info.proxy_server()); + + delegate.VerifyQuicHistogramCounts( + histogram_tester, expect_alternative_proxy_server_to_first_proxy, + test.proxy_supports_quic, true); + histogram_tester.ExpectTotalCount( + "DataReductionProxy.Quic.OnAlternativeProxyBroken", 1); + EXPECT_FALSE(proxy_info.alternative_proxy().is_valid()); + } + } +} + // Verifies that requests that were not proxied through data saver proxy due to // missing config are recorded properly. TEST_F(DataReductionProxyDelegateTest, HTTPRequests) {
diff --git a/components/password_manager/core/browser/credential_manager_impl.cc b/components/password_manager/core/browser/credential_manager_impl.cc index 27b6896..2708d60 100644 --- a/components/password_manager/core/browser/credential_manager_impl.cc +++ b/components/password_manager/core/browser/credential_manager_impl.cc
@@ -4,6 +4,9 @@ #include "components/password_manager/core/browser/credential_manager_impl.h" #include <memory> +#include <string> +#include <utility> +#include <vector> #include "base/metrics/user_metrics.h" #include "components/password_manager/core/browser/credential_manager_logger.h" @@ -241,7 +244,11 @@ // 'skip_zero_click' state, as we've gotten an explicit signal that the page // understands the credential management API and so can be trusted to notify // us when they sign the user out. - form_manager_->Update(*form_manager_->preferred_match()); + auto best_match = form_manager_->best_matches().find(form.username_value); + // NOTE: We can't use DCHECK_NE here, since std::map<>::iterator does not + // support operator<<. + DCHECK(best_match != form_manager_->best_matches().end()); + form_manager_->Update(*best_match->second); return; }
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 8db09406..6130700 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -486,6 +486,20 @@ pending_login_managers_.clear(); } +void PasswordManager::OnPasswordFormSubmittedNoChecks( + password_manager::PasswordManagerDriver* driver, + const autofill::PasswordForm& password_form) { + if (password_manager_util::IsLoggingActive(client_)) { + BrowserSavePasswordProgressLogger logger(client_->GetLogManager()); + logger.LogMessage(Logger::STRING_ON_IN_PAGE_NAVIGATION); + } + + ProvisionallySavePassword(password_form, driver); + + if (CanProvisionalManagerSave()) + OnLoginSuccessful(); +} + void PasswordManager::OnPasswordFormForceSaveRequested( password_manager::PasswordManagerDriver* driver, const PasswordForm& password_form) { @@ -785,19 +799,7 @@ void PasswordManager::OnInPageNavigation( password_manager::PasswordManagerDriver* driver, const PasswordForm& password_form) { - std::unique_ptr<BrowserSavePasswordProgressLogger> logger; - if (password_manager_util::IsLoggingActive(client_)) { - logger.reset( - new BrowserSavePasswordProgressLogger(client_->GetLogManager())); - logger->LogMessage(Logger::STRING_ON_IN_PAGE_NAVIGATION); - } - - ProvisionallySavePassword(password_form, driver); - - if (!CanProvisionalManagerSave()) - return; - - OnLoginSuccessful(); + OnPasswordFormSubmittedNoChecks(driver, password_form); } void PasswordManager::OnLoginSuccessful() {
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h index 7e4f02f8..bfafe7f 100644 --- a/components/password_manager/core/browser/password_manager.h +++ b/components/password_manager/core/browser/password_manager.h
@@ -153,6 +153,12 @@ password_manager::PasswordManagerDriver* driver, const autofill::PasswordForm& password_form); + // Handles a password form being submitted, assumes that submission is + // successful and does not do any checks on success of submission. + void OnPasswordFormSubmittedNoChecks( + password_manager::PasswordManagerDriver* driver, + const autofill::PasswordForm& password_form); + // Handles a manual request to save password. void OnPasswordFormForceSaveRequested( password_manager::PasswordManagerDriver* driver, @@ -170,6 +176,7 @@ // Called if |password_form| was filled upon in-page navigation. This often // means history.pushState being called from JavaScript. If this causes false // positive in password saving, update http://crbug.com/357696. + // TODO(https://crbug.com/795462): find better name for this function. void OnInPageNavigation(password_manager::PasswordManagerDriver* driver, const autofill::PasswordForm& password_form);
diff --git a/components/startup_metric_utils/browser/startup_metric_utils.cc b/components/startup_metric_utils/browser/startup_metric_utils.cc index 96bd7c11..7ac6044 100644 --- a/components/startup_metric_utils/browser/startup_metric_utils.cc +++ b/components/startup_metric_utils/browser/startup_metric_utils.cc
@@ -443,13 +443,6 @@ TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( "startup", "Startup.BrowserMainEntryPoint", 0, g_browser_main_entry_point_ticks.Get()); - - if (!g_process_creation_ticks.Get().is_null()) - { - TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( - "startup", "Startup.BrowserProcessCreation", 0, - g_process_creation_ticks.Get()); - } } // Logs the Startup.TimeSinceLastStartup histogram. Obtains the timestamp of the
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index a0118f9a..5e5fad0 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -641,8 +641,6 @@ "devtools/shared_worker_devtools_agent_host.h", "devtools/shared_worker_devtools_manager.cc", "devtools/shared_worker_devtools_manager.h", - "devtools/worker_devtools_agent_host.cc", - "devtools/worker_devtools_agent_host.h", "discardable_shared_memory_manager.cc", "dom_storage/dom_storage_area.cc", "dom_storage/dom_storage_area.h",
diff --git a/content/browser/devtools/devtools_url_interceptor_request_job.cc b/content/browser/devtools/devtools_url_interceptor_request_job.cc index c0eaf3c..157c4ec 100644 --- a/content/browser/devtools/devtools_url_interceptor_request_job.cc +++ b/content/browser/devtools/devtools_url_interceptor_request_job.cc
@@ -137,7 +137,7 @@ resource_request_info->do_not_prompt_for_login(), resource_request_info->keepalive(), resource_request_info->GetReferrerPolicy(), - resource_request_info->GetVisibilityState(), + resource_request_info->IsPrerendering(), resource_request_info->GetContext(), resource_request_info->ShouldReportRawHeaders(), resource_request_info->IsAsync(),
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc index 711af6a..d4d3db85 100644 --- a/content/browser/devtools/protocol/network_handler.cc +++ b/content/browser/devtools/protocol/network_handler.cc
@@ -39,7 +39,6 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" -#include "content/public/common/resource_devtools_info.h" #include "content/public/common/resource_request.h" #include "content/public/common/resource_response.h" #include "net/base/net_errors.h" @@ -50,6 +49,7 @@ #include "net/http/http_util.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" +#include "services/network/public/cpp/http_raw_request_response_info.h" #include "services/network/public/cpp/url_loader_completion_status.h" namespace content { @@ -973,12 +973,10 @@ } void NetworkHandler::NavigationPreloadRequestSent( - int worker_version_id, const std::string& request_id, const ResourceRequest& request) { if (!enabled_) return; - const std::string version_id(base::IntToString(worker_version_id)); std::unique_ptr<DictionaryValue> headers_dict(DictionaryValue::create()); for (net::HttpRequestHeaders::Iterator it(request.headers); it.GetNext();) headers_dict->setString(it.name(), it.value()); @@ -1002,13 +1000,11 @@ } void NetworkHandler::NavigationPreloadResponseReceived( - int worker_version_id, const std::string& request_id, const GURL& url, const ResourceResponseHead& head) { if (!enabled_) return; - const std::string version_id(base::IntToString(worker_version_id)); std::unique_ptr<DictionaryValue> headers_dict(DictionaryValue::create()); size_t iterator = 0; std::string name; @@ -1031,23 +1027,25 @@ head.response_time < head.load_timing.request_start_time) .Build()); - if (head.devtools_info) { - if (head.devtools_info->http_status_code) { - response->SetStatus(head.devtools_info->http_status_code); - response->SetStatusText(head.devtools_info->http_status_text); + if (head.raw_request_response_info) { + if (head.raw_request_response_info->http_status_code) { + response->SetStatus(head.raw_request_response_info->http_status_code); + response->SetStatusText(head.raw_request_response_info->http_status_text); } - if (head.devtools_info->request_headers.size()) { + if (head.raw_request_response_info->request_headers.size()) { response->SetRequestHeaders( - getHeaders(head.devtools_info->request_headers)); + getHeaders(head.raw_request_response_info->request_headers)); } - if (!head.devtools_info->request_headers_text.empty()) { + if (!head.raw_request_response_info->request_headers_text.empty()) { response->SetRequestHeadersText( - head.devtools_info->request_headers_text); + head.raw_request_response_info->request_headers_text); } - if (head.devtools_info->response_headers.size()) - response->SetHeaders(getHeaders(head.devtools_info->response_headers)); - if (!head.devtools_info->response_headers_text.empty()) - response->SetHeadersText(head.devtools_info->response_headers_text); + if (head.raw_request_response_info->response_headers.size()) + response->SetHeaders( + getHeaders(head.raw_request_response_info->response_headers)); + if (!head.raw_request_response_info->response_headers_text.empty()) + response->SetHeadersText( + head.raw_request_response_info->response_headers_text); } response->SetProtocol(getProtocol(url, head)); response->SetRemoteIPAddress(head.socket_address.HostForURL());
diff --git a/content/browser/devtools/protocol/network_handler.h b/content/browser/devtools/protocol/network_handler.h index 01bb4b2..93912ab 100644 --- a/content/browser/devtools/protocol/network_handler.h +++ b/content/browser/devtools/protocol/network_handler.h
@@ -116,11 +116,9 @@ std::unique_ptr<GetResponseBodyForInterceptionCallback> callback) override; - void NavigationPreloadRequestSent(int worker_version_id, - const std::string& request_id, + void NavigationPreloadRequestSent(const std::string& request_id, const ResourceRequest& request); - void NavigationPreloadResponseReceived(int worker_version_id, - const std::string& request_id, + void NavigationPreloadResponseReceived(const std::string& request_id, const GURL& url, const ResourceResponseHead& head); void NavigationPreloadCompleted(
diff --git a/content/browser/devtools/service_worker_devtools_agent_host.cc b/content/browser/devtools/service_worker_devtools_agent_host.cc index 63fb561..3cde8b9b 100644 --- a/content/browser/devtools/service_worker_devtools_agent_host.cc +++ b/content/browser/devtools/service_worker_devtools_agent_host.cc
@@ -5,7 +5,11 @@ #include "content/browser/devtools/service_worker_devtools_agent_host.h" #include "base/strings/stringprintf.h" +#include "content/browser/devtools/devtools_session.h" +#include "content/browser/devtools/protocol/inspector_handler.h" #include "content/browser/devtools/protocol/network_handler.h" +#include "content/browser/devtools/protocol/protocol.h" +#include "content/browser/devtools/protocol/schema_handler.h" #include "content/browser/devtools/service_worker_devtools_manager.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_version.h" @@ -16,8 +20,6 @@ namespace { -void StatusNoOp(ServiceWorkerStatusCode status) {} - void TerminateServiceWorkerOnIO( base::WeakPtr<ServiceWorkerContextCore> context_weak, int64_t version_id) { @@ -27,18 +29,6 @@ } } -void UnregisterServiceWorkerOnIO( - base::WeakPtr<ServiceWorkerContextCore> context_weak, - int64_t version_id) { - if (ServiceWorkerContextCore* context = context_weak.get()) { - if (ServiceWorkerVersion* version = context->GetLiveVersion(version_id)) { - version->StopWorker(base::BindOnce(&base::DoNothing)); - context->UnregisterServiceWorker(version->scope(), - base::Bind(&StatusNoOp)); - } - } -} - void SetDevToolsAttachedOnIO( base::WeakPtr<ServiceWorkerContextCore> context_weak, int64_t version_id, @@ -52,31 +42,45 @@ } // namespace ServiceWorkerDevToolsAgentHost::ServiceWorkerDevToolsAgentHost( - WorkerId worker_id, - const ServiceWorkerIdentifier& service_worker, - bool is_installed_version) - : WorkerDevToolsAgentHost(service_worker.devtools_worker_token(), - worker_id), - service_worker_(new ServiceWorkerIdentifier(service_worker)), + int worker_process_id, + int worker_route_id, + const ServiceWorkerContextCore* context, + base::WeakPtr<ServiceWorkerContextCore> context_weak, + int64_t version_id, + const GURL& url, + const GURL& scope, + bool is_installed_version, + const base::UnguessableToken& devtools_worker_token) + : DevToolsAgentHostImpl(devtools_worker_token.ToString()), + state_(WORKER_UNINSPECTED), + devtools_worker_token_(devtools_worker_token), + worker_process_id_(worker_process_id), + worker_route_id_(worker_route_id), + context_(context), + context_weak_(context_weak), + version_id_(version_id), + url_(url), + scope_(scope), version_installed_time_(is_installed_version ? base::Time::Now() : base::Time()) { NotifyCreated(); } +BrowserContext* ServiceWorkerDevToolsAgentHost::GetBrowserContext() { + RenderProcessHost* rph = RenderProcessHost::FromID(worker_process_id_); + return rph ? rph->GetBrowserContext() : nullptr; +} + std::string ServiceWorkerDevToolsAgentHost::GetType() { return kTypeServiceWorker; } std::string ServiceWorkerDevToolsAgentHost::GetTitle() { - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id().first)) { - return base::StringPrintf("Worker pid:%" CrPRIdPid, - base::GetProcId(host->GetHandle())); - } - return ""; + return "Service Worker " + url_.spec(); } GURL ServiceWorkerDevToolsAgentHost::GetURL() { - return service_worker_->url(); + return url_; } bool ServiceWorkerDevToolsAgentHost::Activate() { @@ -87,25 +91,10 @@ } bool ServiceWorkerDevToolsAgentHost::Close() { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::BindOnce(&TerminateServiceWorkerOnIO, - service_worker_->context_weak(), - service_worker_->version_id())); - return true; -} - -void ServiceWorkerDevToolsAgentHost::UnregisterWorker() { - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - base::BindOnce(&UnregisterServiceWorkerOnIO, - service_worker_->context_weak(), - service_worker_->version_id())); -} - -void ServiceWorkerDevToolsAgentHost::OnAttachedStateChanged(bool attached) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::BindOnce(&SetDevToolsAttachedOnIO, service_worker_->context_weak(), - service_worker_->version_id(), attached)); + base::BindOnce(&TerminateServiceWorkerOnIO, context_weak_, version_id_)); + return true; } void ServiceWorkerDevToolsAgentHost::WorkerVersionInstalled() { @@ -116,48 +105,164 @@ version_doomed_time_ = base::Time::Now(); } -void ServiceWorkerDevToolsAgentHost::NavigationPreloadRequestSent( - const std::string& request_id, - const ResourceRequest& request) { - for (auto* network : protocol::NetworkHandler::ForAgentHost(this)) { - network->NavigationPreloadRequestSent(worker_id().first, request_id, - request); - } -} - -void ServiceWorkerDevToolsAgentHost::NavigationPreloadResponseReceived( - const std::string& request_id, - const GURL& url, - const ResourceResponseHead& head) { - for (auto* network : protocol::NetworkHandler::ForAgentHost(this)) { - network->NavigationPreloadResponseReceived(worker_id().first, request_id, - url, head); - } -} - -void ServiceWorkerDevToolsAgentHost::NavigationPreloadCompleted( - const std::string& request_id, - const network::URLLoaderCompletionStatus& status) { - for (auto* network : protocol::NetworkHandler::ForAgentHost(this)) - network->NavigationPreloadCompleted(request_id, status); -} - -int64_t ServiceWorkerDevToolsAgentHost::service_worker_version_id() const { - return service_worker_->version_id(); -} - -GURL ServiceWorkerDevToolsAgentHost::scope() const { - return service_worker_->scope(); -} - bool ServiceWorkerDevToolsAgentHost::Matches( - const ServiceWorkerIdentifier& other) { - return service_worker_->Matches(other); + const ServiceWorkerContextCore* context, + int64_t version_id) { + return context_ == context && version_id_ == version_id; } ServiceWorkerDevToolsAgentHost::~ServiceWorkerDevToolsAgentHost() { - ServiceWorkerDevToolsManager::GetInstance()->RemoveInspectedWorkerData( - worker_id()); + ServiceWorkerDevToolsManager::GetInstance()->AgentHostDestroyed(this); +} + +void ServiceWorkerDevToolsAgentHost::AttachSession(DevToolsSession* session) { + if (state_ != WORKER_INSPECTED) { + state_ = WORKER_INSPECTED; + AttachToWorker(); + } + if (RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_)) { + session->SetRenderer(host, nullptr); + host->Send( + new DevToolsAgentMsg_Attach(worker_route_id_, session->session_id())); + } + session->SetFallThroughForNotFound(true); + session->AddHandler(base::WrapUnique(new protocol::InspectorHandler())); + session->AddHandler(base::WrapUnique(new protocol::NetworkHandler(GetId()))); + session->AddHandler(base::WrapUnique(new protocol::SchemaHandler())); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(&SetDevToolsAttachedOnIO, + context_weak_, version_id_, true)); +} + +void ServiceWorkerDevToolsAgentHost::DetachSession(int session_id) { + if (RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_)) + host->Send(new DevToolsAgentMsg_Detach(worker_route_id_, session_id)); + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(&SetDevToolsAttachedOnIO, + context_weak_, version_id_, false)); + if (state_ == WORKER_INSPECTED) { + state_ = WORKER_UNINSPECTED; + DetachFromWorker(); + } else if (state_ == WORKER_PAUSED_FOR_REATTACH) { + state_ = WORKER_UNINSPECTED; + } +} + +bool ServiceWorkerDevToolsAgentHost::DispatchProtocolMessage( + DevToolsSession* session, + const std::string& message) { + if (state_ != WORKER_INSPECTED) + return true; + + int call_id = 0; + std::string method; + if (session->Dispatch(message, &call_id, &method) != + protocol::Response::kFallThrough) { + return true; + } + + if (RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_)) { + host->Send(new DevToolsAgentMsg_DispatchOnInspectorBackend( + worker_route_id_, session->session_id(), call_id, method, message)); + session->waiting_messages()[call_id] = {method, message}; + } + return true; +} + +bool ServiceWorkerDevToolsAgentHost::OnMessageReceived( + const IPC::Message& msg) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + bool handled = true; + IPC_BEGIN_MESSAGE_MAP(ServiceWorkerDevToolsAgentHost, msg) + IPC_MESSAGE_HANDLER(DevToolsClientMsg_DispatchOnInspectorFrontend, + OnDispatchOnInspectorFrontend) + IPC_MESSAGE_UNHANDLED(handled = false) + IPC_END_MESSAGE_MAP() + return handled; +} + +void ServiceWorkerDevToolsAgentHost::PauseForDebugOnStart() { + DCHECK(state_ == WORKER_UNINSPECTED); + state_ = WORKER_PAUSED_FOR_DEBUG_ON_START; +} + +bool ServiceWorkerDevToolsAgentHost::IsPausedForDebugOnStart() { + return state_ == WORKER_PAUSED_FOR_DEBUG_ON_START || + state_ == WORKER_READY_FOR_DEBUG_ON_START; +} + +bool ServiceWorkerDevToolsAgentHost::IsReadyForInspection() { + return state_ == WORKER_INSPECTED || state_ == WORKER_UNINSPECTED || + state_ == WORKER_READY_FOR_DEBUG_ON_START; +} + +void ServiceWorkerDevToolsAgentHost::WorkerReadyForInspection() { + if (state_ == WORKER_PAUSED_FOR_REATTACH) { + DCHECK(IsAttached()); + state_ = WORKER_INSPECTED; + AttachToWorker(); + if (RenderProcessHost* host = + RenderProcessHost::FromID(worker_process_id_)) { + for (DevToolsSession* session : sessions()) { + session->SetRenderer(host, nullptr); + host->Send(new DevToolsAgentMsg_Reattach( + worker_route_id_, session->session_id(), session->state_cookie())); + for (const auto& pair : session->waiting_messages()) { + int call_id = pair.first; + const DevToolsSession::Message& message = pair.second; + host->Send(new DevToolsAgentMsg_DispatchOnInspectorBackend( + worker_route_id_, session->session_id(), call_id, message.method, + message.message)); + } + } + } + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + base::BindOnce(&SetDevToolsAttachedOnIO, + context_weak_, version_id_, true)); + } else if (state_ == WORKER_PAUSED_FOR_DEBUG_ON_START) { + state_ = WORKER_READY_FOR_DEBUG_ON_START; + } +} + +void ServiceWorkerDevToolsAgentHost::WorkerRestarted(int worker_process_id, + int worker_route_id) { + DCHECK_EQ(WORKER_TERMINATED, state_); + state_ = IsAttached() ? WORKER_PAUSED_FOR_REATTACH : WORKER_UNINSPECTED; + worker_process_id_ = worker_process_id; + worker_route_id_ = worker_route_id; + RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_); + for (DevToolsSession* session : sessions()) + session->SetRenderer(host, nullptr); +} + +void ServiceWorkerDevToolsAgentHost::WorkerDestroyed() { + DCHECK_NE(WORKER_TERMINATED, state_); + if (state_ == WORKER_INSPECTED) { + DCHECK(IsAttached()); + for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this)) + inspector->TargetCrashed(); + DetachFromWorker(); + for (DevToolsSession* session : sessions()) + session->SetRenderer(nullptr, nullptr); + } + state_ = WORKER_TERMINATED; +} + +void ServiceWorkerDevToolsAgentHost::AttachToWorker() { + if (RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_)) + host->AddRoute(worker_route_id_, this); +} + +void ServiceWorkerDevToolsAgentHost::DetachFromWorker() { + if (RenderProcessHost* host = RenderProcessHost::FromID(worker_process_id_)) + host->RemoveRoute(worker_route_id_); +} + +void ServiceWorkerDevToolsAgentHost::OnDispatchOnInspectorFrontend( + const DevToolsMessageChunk& message) { + DevToolsSession* session = SessionById(message.session_id); + if (session) + session->ReceiveMessageChunk(message); } } // namespace content
diff --git a/content/browser/devtools/service_worker_devtools_agent_host.h b/content/browser/devtools/service_worker_devtools_agent_host.h index c0acba1..ab2f075 100644 --- a/content/browser/devtools/service_worker_devtools_agent_host.h +++ b/content/browser/devtools/service_worker_devtools_agent_host.h
@@ -11,33 +11,35 @@ #include "base/macros.h" #include "base/time/time.h" +#include "base/unguessable_token.h" +#include "content/browser/devtools/devtools_agent_host_impl.h" #include "content/browser/devtools/service_worker_devtools_manager.h" -#include "content/browser/devtools/worker_devtools_agent_host.h" - -namespace network { -struct URLLoaderCompletionStatus; -} +#include "ipc/ipc_listener.h" namespace content { -struct ResourceRequest; -struct ResourceResponseHead; +class BrowserContext; -class ServiceWorkerDevToolsAgentHost : public WorkerDevToolsAgentHost { +class ServiceWorkerDevToolsAgentHost : public DevToolsAgentHostImpl, + public IPC::Listener { public: using List = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; using Map = std::map<std::string, scoped_refptr<ServiceWorkerDevToolsAgentHost>>; - using ServiceWorkerIdentifier = - ServiceWorkerDevToolsManager::ServiceWorkerIdentifier; - ServiceWorkerDevToolsAgentHost(WorkerId worker_id, - const ServiceWorkerIdentifier& service_worker, - bool is_installed_version); - - void UnregisterWorker(); + ServiceWorkerDevToolsAgentHost( + int worker_process_id, + int worker_route_id, + const ServiceWorkerContextCore* context, + base::WeakPtr<ServiceWorkerContextCore> context_weak, + int64_t version_id, + const GURL& url, + const GURL& scope, + bool is_installed_version, + const base::UnguessableToken& devtools_worker_token); // DevToolsAgentHost overrides. + BrowserContext* GetBrowserContext() override; std::string GetType() override; std::string GetTitle() override; GURL GetURL() override; @@ -45,23 +47,28 @@ void Reload() override; bool Close() override; - // WorkerDevToolsAgentHost overrides. - void OnAttachedStateChanged(bool attached) override; + // DevToolsAgentHostImpl overrides. + void AttachSession(DevToolsSession* session) override; + void DetachSession(int session_id) override; + bool DispatchProtocolMessage(DevToolsSession* session, + const std::string& message) override; + // IPC::Listener implementation. + bool OnMessageReceived(const IPC::Message& msg) override; + + void PauseForDebugOnStart(); + bool IsPausedForDebugOnStart(); + bool IsReadyForInspection(); + void WorkerReadyForInspection(); + void WorkerRestarted(int worker_process_id, int worker_route_id); + void WorkerDestroyed(); void WorkerVersionInstalled(); void WorkerVersionDoomed(); - void NavigationPreloadRequestSent(const std::string& request_id, - const ResourceRequest& request); - void NavigationPreloadResponseReceived(const std::string& request_id, - const GURL& url, - const ResourceResponseHead& head); - void NavigationPreloadCompleted( - const std::string& request_id, - const network::URLLoaderCompletionStatus& status); - - int64_t service_worker_version_id() const; - GURL scope() const; + const GURL& scope() const { return scope_; } + const base::UnguessableToken& devtools_worker_token() const { + return devtools_worker_token_; + } // If the ServiceWorker has been installed before the worker instance started, // it returns the time when the instance started. Otherwise returns the time @@ -71,11 +78,33 @@ // Returns the time when the ServiceWorker was doomed. base::Time version_doomed_time() const { return version_doomed_time_; } - bool Matches(const ServiceWorkerIdentifier& other); + bool Matches(const ServiceWorkerContextCore* context, int64_t version_id); private: + enum WorkerState { + WORKER_UNINSPECTED, + WORKER_INSPECTED, + WORKER_TERMINATED, + WORKER_PAUSED_FOR_DEBUG_ON_START, + WORKER_READY_FOR_DEBUG_ON_START, + WORKER_PAUSED_FOR_REATTACH, + }; + ~ServiceWorkerDevToolsAgentHost() override; - std::unique_ptr<ServiceWorkerIdentifier> service_worker_; + + void AttachToWorker(); + void DetachFromWorker(); + void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); + + WorkerState state_; + base::UnguessableToken devtools_worker_token_; + int worker_process_id_; + int worker_route_id_; + const ServiceWorkerContextCore* context_; + base::WeakPtr<ServiceWorkerContextCore> context_weak_; + int64_t version_id_; + GURL url_; + GURL scope_; base::Time version_installed_time_; base::Time version_doomed_time_;
diff --git a/content/browser/devtools/service_worker_devtools_manager.cc b/content/browser/devtools/service_worker_devtools_manager.cc index 053de715..403288b 100644 --- a/content/browser/devtools/service_worker_devtools_manager.cc +++ b/content/browser/devtools/service_worker_devtools_manager.cc
@@ -4,7 +4,7 @@ #include "content/browser/devtools/service_worker_devtools_manager.h" -#include "content/browser/devtools/devtools_agent_host_impl.h" +#include "content/browser/devtools/protocol/network_handler.h" #include "content/browser/devtools/service_worker_devtools_agent_host.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" @@ -12,34 +12,6 @@ namespace content { -ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier( - const ServiceWorkerContextCore* context, - base::WeakPtr<ServiceWorkerContextCore> context_weak, - int64_t version_id, - const GURL& url, - const GURL& scope, - const base::UnguessableToken& devtools_worker_token) - : context_(context), - context_weak_(context_weak), - version_id_(version_id), - url_(url), - scope_(scope), - devtools_worker_token_(devtools_worker_token) { - DCHECK(!devtools_worker_token_.is_empty()); -} - -ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::ServiceWorkerIdentifier( - const ServiceWorkerIdentifier& other) = default; - -ServiceWorkerDevToolsManager:: -ServiceWorkerIdentifier::~ServiceWorkerIdentifier() { -} - -bool ServiceWorkerDevToolsManager::ServiceWorkerIdentifier::Matches( - const ServiceWorkerIdentifier& other) const { - return context_ == other.context_ && version_id_ == other.version_id_; -} - // static ServiceWorkerDevToolsManager* ServiceWorkerDevToolsManager::GetInstance() { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -50,65 +22,76 @@ ServiceWorkerDevToolsManager::GetDevToolsAgentHostForWorker( int worker_process_id, int worker_route_id) { - AgentHostMap::iterator it = workers_.find( - WorkerId(worker_process_id, worker_route_id)); - return it == workers_.end() ? NULL : it->second; + auto it = live_hosts_.find(WorkerId(worker_process_id, worker_route_id)); + return it == live_hosts_.end() ? nullptr : it->second.get(); } void ServiceWorkerDevToolsManager::AddAllAgentHosts( ServiceWorkerDevToolsAgentHost::List* result) { - for (auto& worker : workers_) { - if (!worker.second->IsTerminated()) - result->push_back(worker.second); - } + for (auto& it : live_hosts_) + result->push_back(it.second.get()); } void ServiceWorkerDevToolsManager::AddAllAgentHostsForBrowserContext( BrowserContext* browser_context, ServiceWorkerDevToolsAgentHost::List* result) { - for (auto& worker : workers_) { - if (!worker.second->IsTerminated() && - worker.second->GetBrowserContext() == browser_context) { - result->push_back(worker.second); - } + for (auto& it : live_hosts_) { + if (it.second->GetBrowserContext() == browser_context) + result->push_back(it.second.get()); } } -bool ServiceWorkerDevToolsManager::WorkerCreated( +void ServiceWorkerDevToolsManager::WorkerCreated( int worker_process_id, int worker_route_id, - const ServiceWorkerIdentifier& service_worker_id, - bool is_installed_version) { + const ServiceWorkerContextCore* context, + base::WeakPtr<ServiceWorkerContextCore> context_weak, + int64_t version_id, + const GURL& url, + const GURL& scope, + bool is_installed_version, + base::UnguessableToken* devtools_worker_token, + bool* pause_on_start) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - const WorkerId id(worker_process_id, worker_route_id); - AgentHostMap::iterator it = FindExistingWorkerAgentHost(service_worker_id); - if (it == workers_.end()) { + const WorkerId worker_id(worker_process_id, worker_route_id); + DCHECK(live_hosts_.find(worker_id) == live_hosts_.end()); + + auto it = std::find_if( + terminated_hosts_.begin(), terminated_hosts_.end(), + [&context, &version_id](ServiceWorkerDevToolsAgentHost* agent_host) { + return agent_host->Matches(context, version_id); + }); + if (it == terminated_hosts_.end()) { + *devtools_worker_token = base::UnguessableToken::Create(); scoped_refptr<ServiceWorkerDevToolsAgentHost> host = - new ServiceWorkerDevToolsAgentHost(id, service_worker_id, - is_installed_version); - workers_[id] = host.get(); + new ServiceWorkerDevToolsAgentHost(worker_process_id, worker_route_id, + context, context_weak, version_id, + url, scope, is_installed_version, + *devtools_worker_token); + live_hosts_[worker_id] = host; for (auto& observer : observer_list_) observer.WorkerCreated(host.get()); if (debug_service_worker_on_start_) - host->PauseForDebugOnStart(); - return host->IsPausedForDebugOnStart(); + host->PauseForDebugOnStart(); + *pause_on_start = host->IsPausedForDebugOnStart(); + return; } - // Worker was restarted. - ServiceWorkerDevToolsAgentHost* agent_host = it->second; - agent_host->WorkerRestarted(id); - workers_.erase(it); - workers_[id] = agent_host; - return agent_host->IsAttached(); + ServiceWorkerDevToolsAgentHost* agent_host = *it; + terminated_hosts_.erase(it); + live_hosts_[worker_id] = agent_host; + agent_host->WorkerRestarted(worker_process_id, worker_route_id); + *devtools_worker_token = agent_host->devtools_worker_token(); + *pause_on_start = agent_host->IsAttached(); } void ServiceWorkerDevToolsManager::WorkerReadyForInspection( int worker_process_id, int worker_route_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - const WorkerId id(worker_process_id, worker_route_id); - AgentHostMap::iterator it = workers_.find(id); - if (it == workers_.end()) + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) return; scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; host->WorkerReadyForInspection(); @@ -117,15 +100,15 @@ // Then bring up UI for the ones not picked by other clients. if (host->IsPausedForDebugOnStart() && !host->IsAttached()) - static_cast<DevToolsAgentHostImpl*>(host.get())->Inspect(); + host->Inspect(); } void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, int worker_route_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - const WorkerId id(worker_process_id, worker_route_id); - AgentHostMap::iterator it = workers_.find(id); - if (it == workers_.end()) + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) return; scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; host->WorkerVersionInstalled(); @@ -136,9 +119,9 @@ void ServiceWorkerDevToolsManager::WorkerVersionDoomed(int worker_process_id, int worker_route_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - const WorkerId id(worker_process_id, worker_route_id); - AgentHostMap::iterator it = workers_.find(id); - if (it == workers_.end()) + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) return; scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; host->WorkerVersionDoomed(); @@ -149,19 +132,27 @@ void ServiceWorkerDevToolsManager::WorkerDestroyed(int worker_process_id, int worker_route_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - const WorkerId id(worker_process_id, worker_route_id); - AgentHostMap::iterator it = workers_.find(id); - if (it == workers_.end()) + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) return; - scoped_refptr<WorkerDevToolsAgentHost> agent_host(it->second); + scoped_refptr<ServiceWorkerDevToolsAgentHost> agent_host(it->second); + live_hosts_.erase(it); + terminated_hosts_.insert(agent_host.get()); agent_host->WorkerDestroyed(); for (auto& observer : observer_list_) - observer.WorkerDestroyed(it->second); + observer.WorkerDestroyed(agent_host.get()); } -void ServiceWorkerDevToolsManager::RemoveInspectedWorkerData(WorkerId id) { +void ServiceWorkerDevToolsManager::AgentHostDestroyed( + ServiceWorkerDevToolsAgentHost* agent_host) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - workers_.erase(id); + auto it = terminated_hosts_.find(agent_host); + // Might be missing during shutdown due to different + // destruction order of this manager, service workers + // and their agent hosts. + if (it != terminated_hosts_.end()) + terminated_hosts_.erase(it); } void ServiceWorkerDevToolsManager::AddObserver(Observer* observer) { @@ -184,19 +175,44 @@ ServiceWorkerDevToolsManager::~ServiceWorkerDevToolsManager() { } -ServiceWorkerDevToolsManager::AgentHostMap::iterator -ServiceWorkerDevToolsManager::FindExistingWorkerAgentHost( - const ServiceWorkerIdentifier& service_worker_id) { - AgentHostMap::iterator it = workers_.begin(); - for (; it != workers_.end(); ++it) { - if (it->second->Matches(service_worker_id)) - break; - } - return it; +void ServiceWorkerDevToolsManager::NavigationPreloadRequestSent( + int worker_process_id, + int worker_route_id, + const std::string& request_id, + const ResourceRequest& request) { + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) + return; + for (auto* network : protocol::NetworkHandler::ForAgentHost(it->second.get())) + network->NavigationPreloadRequestSent(request_id, request); } -void ServiceWorkerDevToolsManager::ResetForTesting() { - workers_.clear(); +void ServiceWorkerDevToolsManager::NavigationPreloadResponseReceived( + int worker_process_id, + int worker_route_id, + const std::string& request_id, + const GURL& url, + const ResourceResponseHead& head) { + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) + return; + for (auto* network : protocol::NetworkHandler::ForAgentHost(it->second.get())) + network->NavigationPreloadResponseReceived(request_id, url, head); +} + +void ServiceWorkerDevToolsManager::NavigationPreloadCompleted( + int worker_process_id, + int worker_route_id, + const std::string& request_id, + const network::URLLoaderCompletionStatus& status) { + const WorkerId worker_id(worker_process_id, worker_route_id); + auto it = live_hosts_.find(worker_id); + if (it == live_hosts_.end()) + return; + for (auto* network : protocol::NetworkHandler::ForAgentHost(it->second.get())) + network->NavigationPreloadCompleted(request_id, status); } } // namespace content
diff --git a/content/browser/devtools/service_worker_devtools_manager.h b/content/browser/devtools/service_worker_devtools_manager.h index 079b18c2..174295f 100644 --- a/content/browser/devtools/service_worker_devtools_manager.h +++ b/content/browser/devtools/service_worker_devtools_manager.h
@@ -9,26 +9,30 @@ #include <map> +#include "base/containers/flat_set.h" #include "base/macros.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/unguessable_token.h" -#include "content/public/browser/devtools_agent_host.h" +#include "content/common/content_export.h" +#include "url/gurl.h" + +namespace network { +struct URLLoaderCompletionStatus; +} namespace content { class BrowserContext; +struct ResourceRequest; +struct ResourceResponseHead; class ServiceWorkerDevToolsAgentHost; class ServiceWorkerContextCore; -// Manages WorkerDevToolsAgentHost's for Service Workers. -// This class lives on UI thread. +// Manages ServiceWorkerDevToolsAgentHost's. This class lives on UI thread. class CONTENT_EXPORT ServiceWorkerDevToolsManager { public: - using WorkerId = std::pair<int, int>; - using AgentList = std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>; - class Observer { public: virtual void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) {} @@ -42,40 +46,6 @@ virtual ~Observer() {} }; - class ServiceWorkerIdentifier { - public: - ServiceWorkerIdentifier( - const ServiceWorkerContextCore* context, - base::WeakPtr<ServiceWorkerContextCore> context_weak, - int64_t version_id, - const GURL& url, - const GURL& scope, - const base::UnguessableToken& devtools_worker_token); - ServiceWorkerIdentifier(const ServiceWorkerIdentifier& other); - ~ServiceWorkerIdentifier(); - - bool Matches(const ServiceWorkerIdentifier& other) const; - - const ServiceWorkerContextCore* context() const { return context_; } - base::WeakPtr<ServiceWorkerContextCore> context_weak() const { - return context_weak_; - } - int64_t version_id() const { return version_id_; } - GURL url() const { return url_; } - GURL scope() const { return scope_; } - const base::UnguessableToken& devtools_worker_token() const { - return devtools_worker_token_; - } - - private: - const ServiceWorkerContextCore* const context_; - const base::WeakPtr<ServiceWorkerContextCore> context_weak_; - const int64_t version_id_; - const GURL url_; - const GURL scope_; - const base::UnguessableToken devtools_worker_token_; - }; - // Returns the ServiceWorkerDevToolsManager singleton. static ServiceWorkerDevToolsManager* GetInstance(); @@ -88,18 +58,34 @@ BrowserContext* browser_context, std::vector<scoped_refptr<ServiceWorkerDevToolsAgentHost>>* result); - // Returns true when the worker must be paused on start because a DevTool - // window for the same former ServiceWorkerIdentifier is still opened or - // debug-on-start is enabled in chrome://serviceworker-internals. - bool WorkerCreated(int worker_process_id, + void WorkerCreated(int worker_process_id, int worker_route_id, - const ServiceWorkerIdentifier& service_worker_id, - bool is_installed_version); + const ServiceWorkerContextCore* context, + base::WeakPtr<ServiceWorkerContextCore> context_weak, + int64_t version_id, + const GURL& url, + const GURL& scope, + bool is_installed_version, + base::UnguessableToken* devtools_worker_token, + bool* pause_on_start); void WorkerReadyForInspection(int worker_process_id, int worker_route_id); void WorkerVersionInstalled(int worker_process_id, int worker_route_id); void WorkerVersionDoomed(int worker_process_id, int worker_route_id); void WorkerDestroyed(int worker_process_id, int worker_route_id); - void RemoveInspectedWorkerData(WorkerId id); + void NavigationPreloadRequestSent(int worker_process_id, + int worker_route_id, + const std::string& request_id, + const ResourceRequest& request); + void NavigationPreloadResponseReceived(int worker_process_id, + int worker_route_id, + const std::string& request_id, + const GURL& url, + const ResourceResponseHead& head); + void NavigationPreloadCompleted( + int worker_process_id, + int worker_route_id, + const std::string& request_id, + const network::URLLoaderCompletionStatus& status); void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -108,26 +94,27 @@ bool debug_service_worker_on_start() const { return debug_service_worker_on_start_; } + void AgentHostDestroyed(ServiceWorkerDevToolsAgentHost* agent_host); private: friend struct base::DefaultSingletonTraits<ServiceWorkerDevToolsManager>; friend class ServiceWorkerDevToolsAgentHost; - using AgentHostMap = std::map<WorkerId, ServiceWorkerDevToolsAgentHost*>; + using WorkerId = std::pair<int, int>; ServiceWorkerDevToolsManager(); ~ServiceWorkerDevToolsManager(); - AgentHostMap::iterator FindExistingWorkerAgentHost( - const ServiceWorkerIdentifier& service_worker_id); - - // Resets to its initial state as if newly created. - void ResetForTesting(); - base::ObserverList<Observer> observer_list_; - AgentHostMap workers_; bool debug_service_worker_on_start_; + // We retatin agent hosts as long as the service worker is alive. + std::map<WorkerId, scoped_refptr<ServiceWorkerDevToolsAgentHost>> live_hosts_; + + // Clients may retain agent host for the terminated shared worker, + // and we reconnect them when shared worker is restarted. + base::flat_set<ServiceWorkerDevToolsAgentHost*> terminated_hosts_; + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDevToolsManager); };
diff --git a/content/browser/devtools/shared_worker_devtools_agent_host.cc b/content/browser/devtools/shared_worker_devtools_agent_host.cc index 91fd27e5..d3812ae 100644 --- a/content/browser/devtools/shared_worker_devtools_agent_host.cc +++ b/content/browser/devtools/shared_worker_devtools_agent_host.cc
@@ -19,10 +19,11 @@ namespace content { SharedWorkerDevToolsAgentHost::SharedWorkerDevToolsAgentHost( - SharedWorkerHost* worker_host) - : DevToolsAgentHostImpl( - worker_host->instance()->devtools_worker_token().ToString()), + SharedWorkerHost* worker_host, + const base::UnguessableToken& devtools_worker_token) + : DevToolsAgentHostImpl(devtools_worker_token.ToString()), worker_host_(worker_host), + devtools_worker_token_(devtools_worker_token), instance_(new SharedWorkerInstance(*worker_host->instance())) { NotifyCreated(); }
diff --git a/content/browser/devtools/shared_worker_devtools_agent_host.h b/content/browser/devtools/shared_worker_devtools_agent_host.h index c445bc9..46252435 100644 --- a/content/browser/devtools/shared_worker_devtools_agent_host.h +++ b/content/browser/devtools/shared_worker_devtools_agent_host.h
@@ -6,6 +6,7 @@ #define CONTENT_BROWSER_DEVTOOLS_SHARED_WORKER_DEVTOOLS_AGENT_HOST_H_ #include "base/macros.h" +#include "base/unguessable_token.h" #include "content/browser/devtools/devtools_agent_host_impl.h" #include "ipc/ipc_listener.h" @@ -20,7 +21,9 @@ public: using List = std::vector<scoped_refptr<SharedWorkerDevToolsAgentHost>>; - explicit SharedWorkerDevToolsAgentHost(SharedWorkerHost* worker_host); + SharedWorkerDevToolsAgentHost( + SharedWorkerHost* worker_host, + const base::UnguessableToken& devtools_worker_token); // DevToolsAgentHost override. BrowserContext* GetBrowserContext() override; @@ -46,6 +49,10 @@ bool WorkerRestarted(SharedWorkerHost* worker_host); void WorkerDestroyed(); + const base::UnguessableToken& devtools_worker_token() const { + return devtools_worker_token_; + } + private: friend class SharedWorkerDevToolsManagerTest; @@ -54,6 +61,7 @@ void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); SharedWorkerHost* worker_host_; + base::UnguessableToken devtools_worker_token_; std::unique_ptr<SharedWorkerInstance> instance_; bool waiting_ready_for_reattach_ = false;
diff --git a/content/browser/devtools/shared_worker_devtools_manager.cc b/content/browser/devtools/shared_worker_devtools_manager.cc index 1ba4e39..779f122c 100644 --- a/content/browser/devtools/shared_worker_devtools_manager.cc +++ b/content/browser/devtools/shared_worker_devtools_manager.cc
@@ -22,7 +22,10 @@ result->push_back(it.second.get()); } -bool SharedWorkerDevToolsManager::WorkerCreated(SharedWorkerHost* worker_host) { +void SharedWorkerDevToolsManager::WorkerCreated( + SharedWorkerHost* worker_host, + bool* pause_on_start, + base::UnguessableToken* devtools_worker_token) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(live_hosts_.find(worker_host) == live_hosts_.end()); @@ -32,14 +35,18 @@ return agent_host->Matches(worker_host); }); if (it == terminated_hosts_.end()) { - live_hosts_[worker_host] = new SharedWorkerDevToolsAgentHost(worker_host); - return false; + *devtools_worker_token = base::UnguessableToken::Create(); + live_hosts_[worker_host] = + new SharedWorkerDevToolsAgentHost(worker_host, *devtools_worker_token); + *pause_on_start = false; + return; } SharedWorkerDevToolsAgentHost* agent_host = *it; terminated_hosts_.erase(it); live_hosts_[worker_host] = agent_host; - return agent_host->WorkerRestarted(worker_host); + *pause_on_start = agent_host->WorkerRestarted(worker_host); + *devtools_worker_token = agent_host->devtools_worker_token(); } void SharedWorkerDevToolsManager::WorkerReadyForInspection(
diff --git a/content/browser/devtools/shared_worker_devtools_manager.h b/content/browser/devtools/shared_worker_devtools_manager.h index 551d2ef..becbdd0 100644 --- a/content/browser/devtools/shared_worker_devtools_manager.h +++ b/content/browser/devtools/shared_worker_devtools_manager.h
@@ -11,6 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/singleton.h" +#include "base/unguessable_token.h" #include "content/public/browser/devtools_agent_host.h" namespace content { @@ -28,9 +29,9 @@ void AddAllAgentHosts( std::vector<scoped_refptr<SharedWorkerDevToolsAgentHost>>* result); - // Returns true when the worker must be paused on start because a DevTool - // window for the same former SharedWorkerInstance is still opened. - bool WorkerCreated(SharedWorkerHost* worker_host); + void WorkerCreated(SharedWorkerHost* worker_host, + bool* pause_on_start, + base::UnguessableToken* devtools_worker_token); void WorkerReadyForInspection(SharedWorkerHost* worker_host); void WorkerDestroyed(SharedWorkerHost* worker_host);
diff --git a/content/browser/devtools/worker_devtools_agent_host.cc b/content/browser/devtools/worker_devtools_agent_host.cc deleted file mode 100644 index f7163f2..0000000 --- a/content/browser/devtools/worker_devtools_agent_host.cc +++ /dev/null
@@ -1,193 +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 "content/browser/devtools/worker_devtools_agent_host.h" - -#include "base/guid.h" -#include "base/memory/ptr_util.h" -#include "content/browser/devtools/devtools_session.h" -#include "content/browser/devtools/protocol/inspector_handler.h" -#include "content/browser/devtools/protocol/network_handler.h" -#include "content/browser/devtools/protocol/protocol.h" -#include "content/browser/devtools/protocol/schema_handler.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/render_process_host.h" - -namespace content { - -BrowserContext* WorkerDevToolsAgentHost::GetBrowserContext() { - RenderProcessHost* rph = RenderProcessHost::FromID(worker_id_.first); - return rph ? rph->GetBrowserContext() : nullptr; -} - -void WorkerDevToolsAgentHost::AttachSession(DevToolsSession* session) { - if (state_ != WORKER_INSPECTED) { - state_ = WORKER_INSPECTED; - AttachToWorker(); - } - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) { - session->SetRenderer(host, nullptr); - host->Send( - new DevToolsAgentMsg_Attach(worker_id_.second, session->session_id())); - } - session->SetFallThroughForNotFound(true); - session->AddHandler(base::WrapUnique(new protocol::InspectorHandler())); - session->AddHandler(base::WrapUnique(new protocol::NetworkHandler(GetId()))); - session->AddHandler(base::WrapUnique(new protocol::SchemaHandler())); - OnAttachedStateChanged(true); -} - -void WorkerDevToolsAgentHost::DetachSession(int session_id) { - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) - host->Send(new DevToolsAgentMsg_Detach(worker_id_.second, session_id)); - OnAttachedStateChanged(false); - if (state_ == WORKER_INSPECTED) { - state_ = WORKER_UNINSPECTED; - DetachFromWorker(); - } else if (state_ == WORKER_PAUSED_FOR_REATTACH) { - state_ = WORKER_UNINSPECTED; - } -} - -bool WorkerDevToolsAgentHost::DispatchProtocolMessage( - DevToolsSession* session, - const std::string& message) { - if (state_ != WORKER_INSPECTED) - return true; - - int call_id = 0; - std::string method; - if (session->Dispatch(message, &call_id, &method) != - protocol::Response::kFallThrough) { - return true; - } - - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) { - host->Send(new DevToolsAgentMsg_DispatchOnInspectorBackend( - worker_id_.second, session->session_id(), call_id, method, message)); - session->waiting_messages()[call_id] = {method, message}; - } - return true; -} - -bool WorkerDevToolsAgentHost::OnMessageReceived( - const IPC::Message& msg) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(WorkerDevToolsAgentHost, msg) - IPC_MESSAGE_HANDLER(DevToolsClientMsg_DispatchOnInspectorFrontend, - OnDispatchOnInspectorFrontend) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void WorkerDevToolsAgentHost::PauseForDebugOnStart() { - DCHECK(state_ == WORKER_UNINSPECTED); - state_ = WORKER_PAUSED_FOR_DEBUG_ON_START; -} - -bool WorkerDevToolsAgentHost::IsPausedForDebugOnStart() { - return state_ == WORKER_PAUSED_FOR_DEBUG_ON_START || - state_ == WORKER_READY_FOR_DEBUG_ON_START; -} - -bool WorkerDevToolsAgentHost::IsReadyForInspection() { - return state_ == WORKER_INSPECTED || state_ == WORKER_UNINSPECTED || - state_ == WORKER_READY_FOR_DEBUG_ON_START; -} - -void WorkerDevToolsAgentHost::WorkerReadyForInspection() { - if (state_ == WORKER_PAUSED_FOR_REATTACH) { - DCHECK(IsAttached()); - state_ = WORKER_INSPECTED; - AttachToWorker(); - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) { - for (DevToolsSession* session : sessions()) { - session->SetRenderer(host, nullptr); - host->Send(new DevToolsAgentMsg_Reattach( - worker_id_.second, session->session_id(), session->state_cookie())); - for (const auto& pair : session->waiting_messages()) { - int call_id = pair.first; - const DevToolsSession::Message& message = pair.second; - host->Send(new DevToolsAgentMsg_DispatchOnInspectorBackend( - worker_id_.second, session->session_id(), call_id, message.method, - message.message)); - } - } - } - OnAttachedStateChanged(true); - } else if (state_ == WORKER_PAUSED_FOR_DEBUG_ON_START) { - state_ = WORKER_READY_FOR_DEBUG_ON_START; - } -} - -void WorkerDevToolsAgentHost::WorkerRestarted(WorkerId worker_id) { - DCHECK_EQ(WORKER_TERMINATED, state_); - state_ = IsAttached() ? WORKER_PAUSED_FOR_REATTACH : WORKER_UNINSPECTED; - worker_id_ = worker_id; - RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first); - for (DevToolsSession* session : sessions()) - session->SetRenderer(host, nullptr); - WorkerCreated(); -} - -void WorkerDevToolsAgentHost::WorkerDestroyed() { - DCHECK_NE(WORKER_TERMINATED, state_); - if (state_ == WORKER_INSPECTED) { - DCHECK(IsAttached()); - for (auto* inspector : protocol::InspectorHandler::ForAgentHost(this)) - inspector->TargetCrashed(); - DetachFromWorker(); - for (DevToolsSession* session : sessions()) - session->SetRenderer(nullptr, nullptr); - } - state_ = WORKER_TERMINATED; - Release(); // Balanced in WorkerCreated(). -} - -bool WorkerDevToolsAgentHost::IsTerminated() { - return state_ == WORKER_TERMINATED; -} - -WorkerDevToolsAgentHost::WorkerDevToolsAgentHost( - const base::UnguessableToken& devtools_worker_token, - WorkerId worker_id) - : DevToolsAgentHostImpl(devtools_worker_token.ToString()), - state_(WORKER_UNINSPECTED), - worker_id_(worker_id) { - WorkerCreated(); -} - -WorkerDevToolsAgentHost::~WorkerDevToolsAgentHost() { - DCHECK_EQ(WORKER_TERMINATED, state_); -} - -void WorkerDevToolsAgentHost::OnAttachedStateChanged(bool attached) { -} - -void WorkerDevToolsAgentHost::AttachToWorker() { - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) - host->AddRoute(worker_id_.second, this); -} - -void WorkerDevToolsAgentHost::DetachFromWorker() { - if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) - host->RemoveRoute(worker_id_.second); -} - -void WorkerDevToolsAgentHost::WorkerCreated() { - AddRef(); // Balanced in WorkerDestroyed() -} - -void WorkerDevToolsAgentHost::OnDispatchOnInspectorFrontend( - const DevToolsMessageChunk& message) { - if (!IsAttached()) - return; - DevToolsSession* session = SessionById(message.session_id); - if (session) - session->ReceiveMessageChunk(message); -} - -} // namespace content
diff --git a/content/browser/devtools/worker_devtools_agent_host.h b/content/browser/devtools/worker_devtools_agent_host.h deleted file mode 100644 index 5cbb578c..0000000 --- a/content/browser/devtools/worker_devtools_agent_host.h +++ /dev/null
@@ -1,77 +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 CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ -#define CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ - -#include "base/macros.h" -#include "base/unguessable_token.h" -#include "content/browser/devtools/devtools_agent_host_impl.h" -#include "content/common/content_export.h" -#include "ipc/ipc_listener.h" - -namespace content { - -class BrowserContext; - -class CONTENT_EXPORT WorkerDevToolsAgentHost : public DevToolsAgentHostImpl, - public IPC::Listener { - public: - typedef std::pair<int, int> WorkerId; - - // DevToolsAgentHost override. - BrowserContext* GetBrowserContext() override; - - // DevToolsAgentHostImpl overrides. - void AttachSession(DevToolsSession* session) override; - void DetachSession(int session_id) override; - bool DispatchProtocolMessage( - DevToolsSession* session, - const std::string& message) override; - - // IPC::Listener implementation. - bool OnMessageReceived(const IPC::Message& msg) override; - - void PauseForDebugOnStart(); - bool IsPausedForDebugOnStart(); - bool IsReadyForInspection(); - - void WorkerReadyForInspection(); - void WorkerRestarted(WorkerId worker_id); - void WorkerDestroyed(); - bool IsTerminated(); - - protected: - WorkerDevToolsAgentHost(const base::UnguessableToken& devtools_worker_token, - WorkerId worker_id); - ~WorkerDevToolsAgentHost() override; - - enum WorkerState { - WORKER_UNINSPECTED, - WORKER_INSPECTED, - WORKER_TERMINATED, - WORKER_PAUSED_FOR_DEBUG_ON_START, - WORKER_READY_FOR_DEBUG_ON_START, - WORKER_PAUSED_FOR_REATTACH, - }; - - virtual void OnAttachedStateChanged(bool attached); - const WorkerId& worker_id() const { return worker_id_; } - - private: - friend class SharedWorkerDevToolsManagerTest; - - void AttachToWorker(); - void DetachFromWorker(); - void WorkerCreated(); - void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); - - WorkerState state_; - WorkerId worker_id_; - DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc index 1f26f248..3be2bdc 100644 --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -112,17 +112,6 @@ // in the expected parts of the NavigationEntry in each stage of navigation, and // that we don't kill the renderer on reload. See https://crbug.com/522567. IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURL) { - // LoadDataWithBaseURL is never subject to --site-per-process policy today - // (this API is only used by Android WebView [where OOPIFs have not shipped - // yet] and WebView Guest tag [which always hosts guests inside a renderer - // without an origin lock]). Therefore, skip the test in --site-per-process - // mode to avoid renderer kills which won't happen in practice as described - // above. - // TODO(lukasza): https://crbug.com/614463: Consider enabling this test - // once WebView guests support OOPIFs and/or origin locks. - if (AreAllSitesIsolatedForTesting()) - return; - const GURL base_url("http://baseurl"); const GURL history_url("http://historyurl"); const std::string data = "<html><body>foo</body></html>"; @@ -176,17 +165,6 @@ // See https://crbug.com/612196. IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, LoadDataWithBaseURLTitleAfterBack) { - // LoadDataWithBaseURL is never subject to --site-per-process policy today - // (this API is only used by Android WebView [where OOPIFs have not shipped - // yet] and WebView Guest tag [which always hosts guests inside a renderer - // without an origin lock]). Therefore, skip the test in --site-per-process - // mode to avoid renderer kills which won't happen in practice as described - // above. - // TODO(lukasza): https://crbug.com/614463: Consider enabling this test - // once WebView guests support OOPIFs and/or origin locks. - if (AreAllSitesIsolatedForTesting()) - return; - const GURL base_url("http://baseurl"); const GURL history_url( embedded_test_server()->GetURL("/navigation_controller/form.html")); @@ -307,17 +285,6 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, NavigateFromLoadDataWithBaseURL) { - // LoadDataWithBaseURL is never subject to --site-per-process policy today - // (this API is only used by Android WebView [where OOPIFs have not shipped - // yet] and WebView Guest tag [which always hosts guests inside a renderer - // without an origin lock]). Therefore, skip the test in --site-per-process - // mode to avoid renderer kills which won't happen in practice as described - // above. - // TODO(lukasza): https://crbug.com/614463: Consider enabling this test - // once WebView guests support OOPIFs and/or origin locks. - if (AreAllSitesIsolatedForTesting()) - return; - const GURL base_url("http://baseurl"); const GURL history_url("http://historyurl"); const std::string data = "<html><body></body></html>"; @@ -362,17 +329,6 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, FragmentNavigateFromLoadDataWithBaseURL) { - // LoadDataWithBaseURL is never subject to --site-per-process policy today - // (this API is only used by Android WebView [where OOPIFs have not shipped - // yet] and WebView Guest tag [which always hosts guests inside a renderer - // without an origin lock]). Therefore, skip the test in --site-per-process - // mode to avoid renderer kills which won't happen in practice as described - // above. - // TODO(lukasza): https://crbug.com/614463: Consider enabling this test - // once WebView guests support OOPIFs and/or origin locks. - if (AreAllSitesIsolatedForTesting()) - return; - const GURL base_url("http://baseurl"); const GURL history_url("http://historyurl"); const std::string data = @@ -741,17 +697,6 @@ // crash. See https://crbug.com/768575. IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, NavigateBackInChildOfLoadDataWithBaseURL) { - // LoadDataWithBaseURL is never subject to --site-per-process policy today - // (this API is only used by Android WebView [where OOPIFs have not shipped - // yet] and WebView Guest tag [which always hosts guests inside a renderer - // without an origin lock]). Therefore, skip the test in --site-per-process - // mode to avoid renderer kills which won't happen in practice as described - // above. - // TODO(lukasza): https://crbug.com/614463: Consider enabling this test - // once WebView guests support OOPIFs and/or origin locks. - if (AreAllSitesIsolatedForTesting()) - return; - GURL iframe_url(embedded_test_server()->GetURL( "/navigation_controller/page_with_links.html"));
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index b49d022..210f076 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -245,11 +245,6 @@ return navigation_request->common_params().url; } - TestRenderFrameHost* GetNavigatingRenderFrameHost() { - return AreAllSitesIsolatedForTesting() ? contents()->GetPendingMainFrame() - : contents()->GetMainFrame(); - } - protected: GURL navigated_url_; size_t navigation_entry_committed_counter_ = 0; @@ -980,7 +975,9 @@ // ... Do a new navigation. const GURL kNewURL("http://see"); - NavigationSimulator::NavigateAndCommitFromDocument(kNewURL, main_test_rfh()); + main_test_rfh()->SendRendererInitiatedNavigationRequest(kNewURL, true); + main_test_rfh()->PrepareForCommit(); + contents()->GetMainFrame()->SendNavigate(0, true, kNewURL); // There should no longer be any pending entry, and the third navigation we // just made should be committed. @@ -1438,8 +1435,7 @@ EXPECT_EQ(0U, navigation_list_pruned_counter_); main_test_rfh()->PrepareForCommitWithServerRedirect(url2); - TestRenderFrameHost* navigating_rfh = GetNavigatingRenderFrameHost(); - navigating_rfh->SendNavigate(entry_id, true, url2); + main_test_rfh()->SendNavigate(entry_id, true, url2); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; @@ -1635,7 +1631,7 @@ // Normal navigation will preserve redirects in the committed entry. main_test_rfh()->PrepareForCommitWithServerRedirect(url2); - main_test_rfh()->SendNavigateWithModificationCallback(entry_id, true, url2, + main_test_rfh()->SendNavigateWithModificationCallback(entry_id, true, url1, set_redirects_callback); NavigationEntryImpl* committed_entry = controller.GetLastCommittedEntry(); ASSERT_EQ(1U, committed_entry->GetRedirectChain().size()); @@ -1721,9 +1717,11 @@ EXPECT_GE(controller.GetEntryAtIndex(1)->GetTimestamp(), controller.GetEntryAtIndex(0)->GetTimestamp()); - TestRenderFrameHost* navigating_rfh = GetNavigatingRenderFrameHost(); + TestRenderFrameHost* navigating_rfh = AreAllSitesIsolatedForTesting() + ? contents()->GetPendingMainFrame() + : contents()->GetMainFrame(); navigating_rfh->PrepareForCommit(); - navigating_rfh->SendNavigate(entry_id, false, url1); + navigating_rfh->SendNavigate(entry_id, false, url2); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; @@ -1838,16 +1836,25 @@ const GURL url1("http://foo1"); const GURL url2("http://foo2"); - NavigationSimulator::NavigateAndCommitFromDocument(url1, main_test_rfh()); + main_test_rfh()->SendRendererInitiatedNavigationRequest(url1, true); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(0, true, url1); + NavigationEntry* entry1 = controller.GetLastCommittedEntry(); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; - NavigationSimulator::NavigateAndCommitFromDocument(url2, main_test_rfh()); + main_test_rfh()->SendRendererInitiatedNavigationRequest(url2, true); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(0, true, url2); NavigationEntry* entry2 = controller.GetLastCommittedEntry(); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; - NavigationSimulator::GoBack(contents()); + controller.GoBack(); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigateWithTransition( + entry1->GetUniqueID(), false, url1, + controller.GetPendingEntry()->GetTransitionType()); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; @@ -1871,9 +1878,8 @@ EXPECT_GE(controller.GetEntryAtIndex(0)->GetTimestamp(), controller.GetEntryAtIndex(1)->GetTimestamp()); - TestRenderFrameHost* navigating_rfh = GetNavigatingRenderFrameHost(); - navigating_rfh->PrepareForCommit(); - navigating_rfh->SendNavigateWithTransition( + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigateWithTransition( entry2->GetUniqueID(), false, url2, controller.GetPendingEntry()->GetTransitionType()); EXPECT_EQ(1U, navigation_entry_committed_counter_); @@ -1905,16 +1911,24 @@ const GURL url2("http://foo2"); const GURL url3("http://foo3"); - NavigationSimulator::NavigateAndCommitFromDocument(url1, main_test_rfh()); + main_test_rfh()->SendRendererInitiatedNavigationRequest(url1, true); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(0, true, url1); EXPECT_EQ(1U, navigation_entry_committed_counter_); + NavigationEntry* entry1 = controller.GetLastCommittedEntry(); navigation_entry_committed_counter_ = 0; - - NavigationSimulator::NavigateAndCommitFromDocument(url2, main_test_rfh()); + main_test_rfh()->SendRendererInitiatedNavigationRequest(url2, true); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(0, true, url2); EXPECT_EQ(1U, navigation_entry_committed_counter_); NavigationEntry* entry2 = controller.GetLastCommittedEntry(); navigation_entry_committed_counter_ = 0; - NavigationSimulator::GoBack(contents()); + controller.GoBack(); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigateWithTransition( + entry1->GetUniqueID(), false, url1, + controller.GetPendingEntry()->GetTransitionType()); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; @@ -1930,9 +1944,8 @@ EXPECT_TRUE(controller.CanGoBack()); EXPECT_FALSE(controller.CanGoForward()); - GetNavigatingRenderFrameHost()->PrepareForCommitWithServerRedirect(url3); - GetNavigatingRenderFrameHost()->SendNavigate(entry2->GetUniqueID(), true, - url3); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(entry2->GetUniqueID(), true, url3); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0; EXPECT_EQ(1U, navigation_list_pruned_counter_); @@ -3053,18 +3066,23 @@ NavigationControllerImpl& controller = controller_impl(); // First navigate somewhere normal. const GURL url1("http://foo"); - NavigationSimulator::NavigateAndCommitFromBrowser(contents(), url1); + controller.LoadURL( + url1, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); + int entry_id = controller.GetPendingEntry()->GetUniqueID(); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(entry_id, true, url1); // Now navigate somewhere with an interstitial. const GURL url2("http://bar"); - std::unique_ptr<NavigationSimulator> simulator = - NavigationSimulator::CreateBrowserInitiated(url2, contents()); - simulator->Start(); + controller.LoadURL(url2, Referrer(), ui::PAGE_TRANSITION_TYPED, + std::string()); + entry_id = controller.GetPendingEntry()->GetUniqueID(); controller.GetPendingEntry()->set_page_type(PAGE_TYPE_INTERSTITIAL); // At this point the interstitial will be displayed and the load will still // be pending. If the user continues, the load will commit. - simulator->Commit(); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigate(entry_id, true, url2); // The page should be a normal page again. EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetURL()); @@ -3437,15 +3455,14 @@ // If the user clicks another link, we should replace the pending entry. main_test_rfh()->SendRendererInitiatedNavigationRequest(url2, false); - TestRenderFrameHost* navigating_rfh = GetNavigatingRenderFrameHost(); - navigating_rfh->PrepareForCommit(); - navigator->DidStartProvisionalLoad(navigating_rfh, url2, std::vector<GURL>(), + main_test_rfh()->PrepareForCommit(); + navigator->DidStartProvisionalLoad(main_test_rfh(), url2, std::vector<GURL>(), base::TimeTicks::Now()); EXPECT_EQ(url2, controller.GetPendingEntry()->GetURL()); EXPECT_EQ(url2, controller.GetPendingEntry()->GetVirtualURL()); // Once it commits, the URL and virtual URL should reflect the actual page. - navigating_rfh->SendNavigate(0, true, url2); + main_test_rfh()->SendNavigate(0, true, url2); EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetURL()); EXPECT_EQ(url2, controller.GetLastCommittedEntry()->GetVirtualURL()); @@ -3807,8 +3824,7 @@ // Don't honor allow_universal_access_from_file_urls if actual URL is // not file scheme. const GURL url("http://www.google.com/home.html"); - NavigationSimulator::NavigateAndCommitFromDocument(url, main_test_rfh()); - rph = main_test_rfh()->GetProcess(); // Navigation could swap the process. + main_test_rfh()->NavigateAndCommitRendererInitiated(true, url); EXPECT_FALSE(controller.IsURLSameDocumentNavigation( different_origin_url, url::Origin::Create(different_origin_url), true, main_test_rfh())); @@ -4721,11 +4737,13 @@ favicon_status.valid = true; EXPECT_FALSE(DoImagesMatch(kDefaultFavicon, entry->GetFavicon().image)); - std::unique_ptr<NavigationSimulator> simulator = - NavigationSimulator::CreateRendererInitiated(kPageWithoutFavicon, - main_test_rfh()); - simulator->SetTransition(ui::PAGE_TRANSITION_CLIENT_REDIRECT); - simulator->Commit(); + main_test_rfh()->SendRendererInitiatedNavigationRequest(kPageWithoutFavicon, + false); + main_test_rfh()->PrepareForCommit(); + main_test_rfh()->SendNavigateWithTransition( + 0, // nav_entry_id + false, // no new entry + kPageWithoutFavicon, ui::PAGE_TRANSITION_CLIENT_REDIRECT); EXPECT_EQ(1U, navigation_entry_committed_counter_); navigation_entry_committed_counter_ = 0;
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index a294da6..1ab9ee4b 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -1078,7 +1078,9 @@ frame_tree_node_->IsMainFrame(), parent_is_main_frame, IsSecureFrame(frame_tree_node_->parent()), frame_tree_node_->frame_tree_node_id(), is_for_guests_only, - report_raw_headers, navigating_frame_host->GetVisibilityState()), + report_raw_headers, + navigating_frame_host->GetVisibilityState() == + blink::mojom::PageVisibilityState::kPrerender), std::move(navigation_ui_data), navigation_handle_->service_worker_handle(), navigation_handle_->appcache_handle(), this);
diff --git a/content/browser/frame_host/navigation_request_info.cc b/content/browser/frame_host/navigation_request_info.cc index cd825b6..6982bf8 100644 --- a/content/browser/frame_host/navigation_request_info.cc +++ b/content/browser/frame_host/navigation_request_info.cc
@@ -4,7 +4,6 @@ #include "content/browser/frame_host/navigation_request_info.h" #include "content/common/service_worker/service_worker_types.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" namespace content { @@ -18,7 +17,7 @@ int frame_tree_node_id, bool is_for_guests_only, bool report_raw_headers, - blink::mojom::PageVisibilityState page_visibility_state) + bool is_prerendering) : common_params(common_params), begin_params(std::move(begin_params)), site_for_cookies(site_for_cookies), @@ -28,7 +27,7 @@ frame_tree_node_id(frame_tree_node_id), is_for_guests_only(is_for_guests_only), report_raw_headers(report_raw_headers), - page_visibility_state(page_visibility_state) {} + is_prerendering(is_prerendering) {} NavigationRequestInfo::~NavigationRequestInfo() {}
diff --git a/content/browser/frame_host/navigation_request_info.h b/content/browser/frame_host/navigation_request_info.h index 5a0c03f..65256b5 100644 --- a/content/browser/frame_host/navigation_request_info.h +++ b/content/browser/frame_host/navigation_request_info.h
@@ -12,7 +12,6 @@ #include "content/common/navigation_params.h" #include "content/common/navigation_params.mojom.h" #include "content/public/common/referrer.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" #include "url/gurl.h" #include "url/origin.h" @@ -22,17 +21,16 @@ // ResourceDispatcherHost. It is initialized on the UI thread, and then passed // to the IO thread by a NavigationRequest object. struct CONTENT_EXPORT NavigationRequestInfo { - NavigationRequestInfo( - const CommonNavigationParams& common_params, - mojom::BeginNavigationParamsPtr begin_params, - const GURL& site_for_cookies, - bool is_main_frame, - bool parent_is_main_frame, - bool are_ancestors_secure, - int frame_tree_node_id, - bool is_for_guests_only, - bool report_raw_headers, - blink::mojom::PageVisibilityState page_visibility_state); + NavigationRequestInfo(const CommonNavigationParams& common_params, + mojom::BeginNavigationParamsPtr begin_params, + const GURL& site_for_cookies, + bool is_main_frame, + bool parent_is_main_frame, + bool are_ancestors_secure, + int frame_tree_node_id, + bool is_for_guests_only, + bool report_raw_headers, + bool is_prerendering); ~NavigationRequestInfo(); const CommonNavigationParams common_params; @@ -55,7 +53,7 @@ const bool report_raw_headers; - blink::mojom::PageVisibilityState page_visibility_state; + const bool is_prerendering; }; } // namespace content
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 4e24794..ceddb61 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -3217,9 +3217,7 @@ } // It is safe to commit into a unique origin, regardless of the URL, as it is - // restricted from accessing other origins. Note that all error pages commit - // as a unique origin - this helps avoid renderer kills when - // ERR_BLOCKED_BY_CLIENT commits in an unexpected renderer process. + // restricted from accessing other origins. if (origin.unique()) return true; @@ -3232,32 +3230,6 @@ // conversion to GURL. GURL origin_url = origin.GetPhysicalOrigin().GetURL(); - // Check the origin against the (potential) origin lock of the current - // process. - // TODO(lukasza): https://crbug.com/770239: Expand the check to cover other - // verifications from RenderProcessHostImpl::IsSuitableHost (e.g. WebUI - // bindings, extension process privilege level, etc.). Avoid duplicating - // the code here and in IsSuitableHost. - BrowserContext* browser_context = GetSiteInstance()->GetBrowserContext(); - GURL site_url = SiteInstance::GetSiteForURL(browser_context, origin_url); - auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); - switch (policy->CheckOriginLock(GetProcess()->GetID(), site_url)) { - case ChildProcessSecurityPolicyImpl::CheckOriginLockResult::HAS_EQUAL_LOCK: - break; - case ChildProcessSecurityPolicyImpl::CheckOriginLockResult::HAS_WRONG_LOCK: - // If the process is locked to an origin, disallow reusing this process - // for a different origin. - return false; - case ChildProcessSecurityPolicyImpl::CheckOriginLockResult::NO_LOCK: - // TODO(lukasza): https://crbug.com/794315: Return false if - // ShouldLockToOrigin(site_url) returns true, similarily to how this is - // done by RenderProcessHostImpl::IsSuitableHost. We don't do this here, - // because this breaks hosted apps (which can return - // !ShouldLockToOrigin(full_url_with_path, but here they would return - // ShouldLockToOrigin(origin_only_part_of_url)). - break; - } - // Verify that the origin is allowed to commit in this process. // Note: This also handles non-standard cases for |url|, such as // about:blank, data, and blob URLs.
diff --git a/content/browser/loader/navigation_url_loader_network_service_unittest.cc b/content/browser/loader/navigation_url_loader_network_service_unittest.cc index c3a220c..3280ecb7 100644 --- a/content/browser/loader/navigation_url_loader_network_service_unittest.cc +++ b/content/browser/loader/navigation_url_loader_network_service_unittest.cc
@@ -125,7 +125,7 @@ true /* is_main_frame */, false /* parent_is_main_frame */, false /* are_ancestors_secure */, -1 /* frame_tree_node_id */, false /* is_for_guests_only */, false /* report_raw_headers */, - blink::mojom::PageVisibilityState::kVisible)); + false /* is_prerenering */)); std::vector<std::unique_ptr<URLLoaderRequestHandler>> handlers; most_recent_resource_request_ = base::nullopt; handlers.push_back(std::make_unique<TestURLLoaderRequestHandler>(
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc index f469ad0..84db684 100644 --- a/content/browser/loader/navigation_url_loader_unittest.cc +++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -160,8 +160,7 @@ std::unique_ptr<NavigationRequestInfo> request_info( new NavigationRequestInfo(common_params, std::move(begin_params), url, - true, false, false, -1, false, false, - blink::mojom::PageVisibilityState::kVisible)); + true, false, false, -1, false, false, false)); return NavigationURLLoader::Create( browser_context_->GetResourceContext(), BrowserContext::GetDefaultStoragePartition(browser_context_.get()),
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index aba2a76..71ff6d2 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -120,7 +120,6 @@ #include "storage/browser/blob/shareable_file_reference.h" #include "storage/browser/fileapi/file_permission_policy.h" #include "storage/browser/fileapi/file_system_context.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" #include "url/third_party/mozilla/url_parse.h" #include "url/url_constants.h" @@ -1217,7 +1216,7 @@ do_not_prompt_for_login, request_data.keepalive, Referrer::NetReferrerPolicyToBlinkReferrerPolicy( request_data.referrer_policy), - request_data.visibility_state, resource_context, report_raw_headers, + request_data.is_prerendering, resource_context, report_raw_headers, !is_sync_load, previews_state, request_data.request_body, request_data.initiated_in_secure_context); extra_info->SetBlobHandles(std::move(blob_handles)); @@ -1509,7 +1508,8 @@ false, // do_not_prompt_for_login false, // keepalive blink::kWebReferrerPolicyDefault, - blink::mojom::PageVisibilityState::kVisible, context, + false, // is_prerendering + context, false, // report_raw_headers true, // is_async previews_state, // previews_state @@ -1943,7 +1943,7 @@ false, // enable_upload_progress false, // do_not_prompt_for_login false, // keepalive - info.common_params.referrer.policy, info.page_visibility_state, + info.common_params.referrer.policy, info.is_prerendering, resource_context, info.report_raw_headers, true, // is_async previews_state, info.common_params.post_data,
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index db4b890..b0cdc50 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -818,9 +818,9 @@ CommonNavigationParams common_params; common_params.url = url; std::unique_ptr<NavigationRequestInfo> request_info( - new NavigationRequestInfo( - common_params, std::move(begin_params), url, true, false, false, - -1, false, false, blink::mojom::PageVisibilityState::kVisible)); + new NavigationRequestInfo(common_params, std::move(begin_params), url, + true, false, false, -1, false, false, + false)); std::unique_ptr<NavigationURLLoader> test_loader = NavigationURLLoader::Create( browser_context_->GetResourceContext(),
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index 5e4d137..71331e2a 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc
@@ -74,8 +74,8 @@ if (request_info) response->head.previews_state = request_info->GetPreviewsState(); if (info->ShouldReportRawHeaders()) { - response->head.devtools_info = - BuildDevToolsInfo(*request, raw_request_headers, raw_response_headers); + response->head.raw_request_response_info = BuildRawRequestResponseInfo( + *request, raw_request_headers, raw_response_headers); } response->head.effective_connection_type =
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc index d875a4f6..cbd2ff93 100644 --- a/content/browser/loader/resource_request_info_impl.cc +++ b/content/browser/loader/resource_request_info_impl.cc
@@ -15,7 +15,6 @@ #include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/process_type.h" #include "net/url_request/url_request.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" namespace content { @@ -80,13 +79,13 @@ false, // do_not_prompt_for_login false, // keep_alive blink::kWebReferrerPolicyDefault, // referrer_policy - blink::mojom::PageVisibilityState::kVisible, // visibility_state - context, // context - false, // report_raw_headers - is_async, // is_async - previews_state, // previews_state - nullptr, // body - false); // initiated_in_secure_context + false, // is_prerendering + context, // context + false, // report_raw_headers + is_async, // is_async + previews_state, // previews_state + nullptr, // body + false); // initiated_in_secure_context info->AssociateWithRequest(request); info->set_navigation_ui_data(std::move(navigation_ui_data)); } @@ -148,7 +147,7 @@ bool do_not_prompt_for_login, bool keepalive, blink::WebReferrerPolicy referrer_policy, - blink::mojom::PageVisibilityState visibility_state, + bool is_prerendering, ResourceContext* context, bool report_raw_headers, bool is_async, @@ -177,7 +176,7 @@ transition_type_(transition_type), memory_cost_(0), referrer_policy_(referrer_policy), - visibility_state_(visibility_state), + is_prerendering_(is_prerendering), context_(context), report_raw_headers_(report_raw_headers), is_async_(is_async), @@ -275,9 +274,8 @@ return referrer_policy_; } -blink::mojom::PageVisibilityState ResourceRequestInfoImpl::GetVisibilityState() - const { - return visibility_state_; +bool ResourceRequestInfoImpl::IsPrerendering() const { + return is_prerendering_; } ui::PageTransition ResourceRequestInfoImpl::GetPageTransition() const {
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h index d21c5ee..faab481e 100644 --- a/content/browser/loader/resource_request_info_impl.h +++ b/content/browser/loader/resource_request_info_impl.h
@@ -66,7 +66,7 @@ bool do_not_prompt_for_login, bool keepalive, blink::WebReferrerPolicy referrer_policy, - blink::mojom::PageVisibilityState visibility_state, + bool is_prerendering, ResourceContext* context, bool report_raw_headers, bool is_async, @@ -89,7 +89,7 @@ ResourceType GetResourceType() const override; int GetProcessType() const override; blink::WebReferrerPolicy GetReferrerPolicy() const override; - blink::mojom::PageVisibilityState GetVisibilityState() const override; + bool IsPrerendering() const override; ui::PageTransition GetPageTransition() const override; bool HasUserGesture() const override; bool GetAssociatedRenderFrame(int* render_process_id, @@ -231,7 +231,7 @@ ui::PageTransition transition_type_; int memory_cost_; blink::WebReferrerPolicy referrer_policy_; - blink::mojom::PageVisibilityState visibility_state_; + bool is_prerendering_; ResourceContext* context_; bool report_raw_headers_; bool is_async_;
diff --git a/content/browser/message_port_provider_browsertest.cc b/content/browser/message_port_provider_browsertest.cc index 5f8892193..3563529 100644 --- a/content/browser/message_port_provider_browsertest.cc +++ b/content/browser/message_port_provider_browsertest.cc
@@ -23,34 +23,25 @@ // Verify that messages can be posted to main frame. IN_PROC_BROWSER_TEST_F(MessagePortProviderBrowserTest, PostMessage) { - // Listen for a message. - ASSERT_TRUE(embedded_test_server()->Start()); - GURL url(embedded_test_server()->GetURL("/title1.html")); - EXPECT_TRUE(NavigateToURL(shell(), url)); - EXPECT_TRUE(ExecuteScript(shell(), R"( - onmessage = function(e) { - domAutomationController.send(e.origin + ':' + e.data); - } )")); - - // Post a message. - const std::string target_origin(url.GetOrigin().spec()); - const std::string source_origin("https://source.origin.com"); - const std::string message("success"); - DOMMessageQueue msg_queue; - MessagePortProvider::PostMessageToFrame( - shell()->web_contents(), base::UTF8ToUTF16(source_origin), - base::UTF8ToUTF16(target_origin), base::UTF8ToUTF16(message)); - - // Verify that the message was received (and had the expected payload). - std::string expected_test_reply; - expected_test_reply += '"'; - expected_test_reply += source_origin; - expected_test_reply += ':'; - expected_test_reply += message; - expected_test_reply += '"'; - std::string actual_test_reply; - EXPECT_TRUE(msg_queue.WaitForMessage(&actual_test_reply)); - EXPECT_EQ(expected_test_reply, actual_test_reply); + const std::string data = + "<!DOCTYPE html><html><body>" + " <script type=\"text/javascript\">" + " onmessage = function (e) { document.title = e.data; }" + " </script>" + "</body></html>"; + const base::string16 target_origin(base::UTF8ToUTF16("http://baseurl")); + const GURL base_url(target_origin); + const GURL history_url; + // Load data. Blocks until it is done. + content::LoadDataWithBaseURL(shell(), history_url, data, base_url); + const base::string16 source_origin(base::UTF8ToUTF16("source")); + const base::string16 message(base::UTF8ToUTF16("success")); + content::TitleWatcher title_watcher(shell()->web_contents(), message); + MessagePortProvider::PostMessageToFrame(shell()->web_contents(), + source_origin, + target_origin, + message); + EXPECT_EQ(message, title_watcher.WaitAndGetTitle()); } } // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index fe662b3..e98cf4a 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -864,18 +864,6 @@ } } -void RenderWidgetHostViewAura::UpdateScreenInfo(gfx::NativeView view) { - RenderWidgetHostViewBase::UpdateScreenInfo(view); - if (!host_->auto_resize_enabled()) - return; - - window_->AllocateLocalSurfaceId(); - host_->DidAllocateLocalSurfaceIdForAutoResize( - host_->last_auto_resize_request_number()); - if (delegated_frame_host_) - delegated_frame_host_->WasResized(); -} - gfx::Size RenderWidgetHostViewAura::GetRequestedRendererSize() const { return delegated_frame_host_ ? delegated_frame_host_->GetRequestedRendererSize() @@ -2479,4 +2467,14 @@ } } +void RenderWidgetHostViewAura::OnSynchronizedDisplayPropertiesChanged() { + window_->AllocateLocalSurfaceId(); + if (delegated_frame_host_) + delegated_frame_host_->WasResized(); + if (host_->auto_resize_enabled()) { + host_->DidAllocateLocalSurfaceIdForAutoResize( + host_->last_auto_resize_request_number()); + } +} + } // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index ab61c8a..dad96717 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -138,7 +138,6 @@ int error_code) override; void Destroy() override; void SetTooltipText(const base::string16& tooltip_text) override; - void UpdateScreenInfo(gfx::NativeView view) override; gfx::Size GetRequestedRendererSize() const override; bool IsSurfaceAvailableForCopy() const override; void CopyFromSurface(const gfx::Rect& src_rect, @@ -205,6 +204,7 @@ void ScheduleEmbed(ui::mojom::WindowTreeClientPtr client, base::OnceCallback<void(const base::UnguessableToken&)> callback) override; + void OnSynchronizedDisplayPropertiesChanged() override; // Overridden from ui::TextInputClient: void SetCompositionText(const ui::CompositionText& composition) override;
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 731e35a8..f87d722b 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
@@ -2256,11 +2256,12 @@ sink_->ClearMessages(); aura_test_helper_->test_screen()->SetDeviceScaleFactor(2.0f); - EXPECT_EQ(2u, sink_->message_count()); { - const IPC::Message* msg = sink_->GetMessageAt(1); - EXPECT_EQ(static_cast<uint32_t>(ViewMsg_SetLocalSurfaceIdForAutoResize::ID), - msg->type()); + // TODO(samans): There should be only one message in the sink, but some + // testers are seeing two (crrev.com/c/839580). Investigate why. + const IPC::Message* msg = sink_->GetFirstMessageMatching( + ViewMsg_SetLocalSurfaceIdForAutoResize::ID); + ASSERT_TRUE(msg); ViewMsg_SetLocalSurfaceIdForAutoResize::Param params; ViewMsg_SetLocalSurfaceIdForAutoResize::Read(msg, ¶ms); EXPECT_EQ(1u, std::get<0>(params)); // sequence_number @@ -3015,6 +3016,7 @@ view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), gfx::Rect()); + view_->window_->layer()->SetShowSolidColorContent(); EXPECT_FALSE(view_->HasPrimarySurface()); ASSERT_TRUE(view_->delegated_frame_host_); @@ -3041,7 +3043,6 @@ // Prevent the DelegatedFrameHost from skipping frames. view_->DisableResizeLock(); - EXPECT_FALSE(view_->HasPrimarySurface()); ASSERT_TRUE(view_->delegated_frame_host_); view_->SetSize(gfx::Size(300, 300)); @@ -3077,7 +3078,6 @@ // Prevent the DelegatedFrameHost from skipping frames. view_->DisableResizeLock(); - EXPECT_FALSE(view_->HasPrimarySurface()); view_->SetSize(gfx::Size(300, 300)); ASSERT_TRUE(view_->HasPrimarySurface());
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 07364f0..180e4cc 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -250,8 +250,10 @@ if (impl && impl->delegate()) impl->delegate()->SendScreenRects(); - if (HasDisplayPropertyChanged(view) && impl) + if (HasDisplayPropertyChanged(view) && impl) { + OnSynchronizedDisplayPropertiesChanged(); impl->NotifyScreenInfoChanged(); + } } bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) {
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index ca1e9a83..a73be9d 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -155,7 +155,7 @@ void DidReceiveRendererFrame(); // Notification that a resize or move session ended on the native widget. - virtual void UpdateScreenInfo(gfx::NativeView view); + void UpdateScreenInfo(gfx::NativeView view); // Tells if the display property (work area/scale factor) has // changed since the last time. @@ -560,6 +560,12 @@ const base::UnguessableToken& token); #endif + // Called when display properties that need to be synchronized with the + // renderer process changes. This method is called before notifying + // RenderWidgetHostImpl in order to allow the view to allocate a new + // LocalSurfaceId. + virtual void OnSynchronizedDisplayPropertiesChanged() {} + gfx::Rect current_display_area_; uint32_t renderer_frame_number_;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 9b7f340..624e5345 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -310,7 +310,6 @@ int error_code) override; void Destroy() override; void SetTooltipText(const base::string16& tooltip_text) override; - void UpdateScreenInfo(gfx::NativeView view) override; gfx::Size GetRequestedRendererSize() const override; bool IsSurfaceAvailableForCopy() const override; void CopyFromSurface(const gfx::Rect& src_rect, @@ -342,6 +341,7 @@ bool HasAcceleratedSurface(const gfx::Size& desired_size) override; gfx::Rect GetBoundsInRootWindow() override; + void OnSynchronizedDisplayPropertiesChanged() override; bool LockMouse() override; void UnlockMouse() override;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index eaaf27f..3dba408 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1086,12 +1086,8 @@ } } -void RenderWidgetHostViewMac::UpdateScreenInfo(gfx::NativeView view) { - // Propagate the new size to the BrowserCompositor first, so it can update the - // size that will be returned by GetRequestedRendererSize before the RWHImpl - // requests it (which will happen in RWHVBase::UpdateScreenInfo). +void RenderWidgetHostViewMac::OnSynchronizedDisplayPropertiesChanged() { browser_compositor_->WasResized(); - RenderWidgetHostViewBase::UpdateScreenInfo(view); } gfx::Size RenderWidgetHostViewMac::GetRequestedRendererSize() const {
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index 2df31a823..f09d54c 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -535,7 +535,9 @@ // Setup an URL which will never commit, allowing this test to send its own, // malformed, commit message. - GURL url(embedded_test_server()->GetURL("/hung")); + GURL url(embedded_test_server()->GetURL("/title2.html")); + NavigationStallDelegate stall_delegate(url); + ResourceDispatcherHost::Get()->SetDelegate(&stall_delegate); // Use LoadURL, as the test shouldn't wait for navigation commit. NavigationController& controller = shell()->web_contents()->GetController(); @@ -562,10 +564,8 @@ params->page_state = PageState::CreateFromURL(url); params->origin = url::Origin::Create(GURL("http://bar.com/")); - service_manager::mojom::InterfaceProviderPtr interface_provider; static_cast<mojom::FrameHost*>(root->current_frame_host()) - ->DidCommitProvisionalLoad(std::move(params), - mojo::MakeRequest(&interface_provider)); + ->DidCommitProvisionalLoad(std::move(params), nullptr); // When the IPC message is received and validation fails, the process is // terminated. However, the notification for that should be processed in a @@ -575,6 +575,7 @@ exit_observer.Wait(); EXPECT_FALSE(exit_observer.did_exit_normally()); + ResourceDispatcherHost::Get()->SetDelegate(nullptr); } namespace {
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc index b635ffc..38f3bb2f 100644 --- a/content/browser/service_worker/embedded_worker_instance.cc +++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -130,13 +130,11 @@ // Register to DevTools and update params accordingly. const int routing_id = rph->GetNextRoutingID(); - params->wait_for_debugger = - ServiceWorkerDevToolsManager::GetInstance()->WorkerCreated( - process_id, routing_id, - ServiceWorkerDevToolsManager::ServiceWorkerIdentifier( - context, weak_context, params->service_worker_version_id, - params->script_url, params->scope, params->devtools_worker_token), - params->is_installed); + ServiceWorkerDevToolsManager::GetInstance()->WorkerCreated( + process_id, routing_id, context, weak_context, + params->service_worker_version_id, params->script_url, params->scope, + params->is_installed, ¶ms->devtools_worker_token, + ¶ms->wait_for_debugger); params->worker_devtools_agent_route_id = routing_id; // Create DevToolsProxy here to ensure that the WorkerCreated() call is // balanced by DevToolsProxy's destructor calling WorkerDestroyed(). @@ -505,7 +503,6 @@ params->embedded_worker_id = embedded_worker_id_; params->worker_devtools_agent_route_id = MSG_ROUTING_NONE; params->wait_for_debugger = false; - params->devtools_worker_token = devtools_worker_token_; params->v8_cache_options = GetV8CacheOptions(); mojom::EmbeddedWorkerInstanceClientAssociatedRequest request = @@ -597,7 +594,6 @@ thread_id_(kInvalidEmbeddedWorkerThreadId), instance_host_binding_(this), devtools_attached_(false), - devtools_worker_token_(base::UnguessableToken::Create()), network_accessed_for_script_(false), weak_factory_(this) { DCHECK_CURRENTLY_ON(BrowserThread::IO);
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h index c1d1fda..9cdb3c2 100644 --- a/content/browser/service_worker/embedded_worker_instance.h +++ b/content/browser/service_worker/embedded_worker_instance.h
@@ -343,9 +343,6 @@ // Whether devtools is attached or not. bool devtools_attached_; - // Unique token identifying this worker for DevTools. - base::UnguessableToken devtools_worker_token_; - // True if the script load request accessed the network. If the script was // served from HTTPCache or ServiceWorkerDatabase this value is false. bool network_accessed_for_script_;
diff --git a/content/browser/service_worker/service_worker_fetch_dispatcher.cc b/content/browser/service_worker/service_worker_fetch_dispatcher.cc index bb6168b..a64ec68 100644 --- a/content/browser/service_worker/service_worker_fetch_dispatcher.cc +++ b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
@@ -92,19 +92,13 @@ DISALLOW_COPY_AND_ASSIGN(DelegatingURLLoader); }; -ServiceWorkerDevToolsAgentHost* GetAgentHost( - const std::pair<int, int>& worker_id) { - return ServiceWorkerDevToolsManager::GetInstance() - ->GetDevToolsAgentHostForWorker(worker_id.first, worker_id.second); -} - void NotifyNavigationPreloadRequestSentOnUI( const ResourceRequest& request, const std::pair<int, int>& worker_id, const std::string& request_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (ServiceWorkerDevToolsAgentHost* agent_host = GetAgentHost(worker_id)) - agent_host->NavigationPreloadRequestSent(request_id, request); + ServiceWorkerDevToolsManager::GetInstance()->NavigationPreloadRequestSent( + worker_id.first, worker_id.second, request_id, request); } void NotifyNavigationPreloadResponseReceivedOnUI( @@ -113,8 +107,9 @@ const std::pair<int, int>& worker_id, const std::string& request_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (ServiceWorkerDevToolsAgentHost* agent_host = GetAgentHost(worker_id)) - agent_host->NavigationPreloadResponseReceived(request_id, url, head); + ServiceWorkerDevToolsManager::GetInstance() + ->NavigationPreloadResponseReceived(worker_id.first, worker_id.second, + request_id, url, head); } void NotifyNavigationPreloadCompletedOnUI( @@ -122,8 +117,8 @@ const std::pair<int, int>& worker_id, const std::string& request_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (ServiceWorkerDevToolsAgentHost* agent_host = GetAgentHost(worker_id)) - agent_host->NavigationPreloadCompleted(request_id, status); + ServiceWorkerDevToolsManager::GetInstance()->NavigationPreloadCompleted( + worker_id.first, worker_id.second, request_id, status); } // DelegatingURLLoaderClient is the URLLoaderClient for the navigation preload @@ -729,7 +724,7 @@ request.referrer = GURL(original_request->referrer()); request.referrer_policy = Referrer::ReferrerPolicyForUrlRequest(original_info->GetReferrerPolicy()); - request.visibility_state = original_info->GetVisibilityState(); + request.is_prerendering = original_info->IsPrerendering(); request.load_flags = original_request->load_flags(); // Set to SUB_RESOURCE because we shouldn't trigger NavigationResourceThrottle // for the service worker navigation preload request.
diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc index d783957..4c7c9051 100644 --- a/content/browser/shared_worker/shared_worker_host.cc +++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -74,8 +74,10 @@ SharedWorkerDevToolsManager::GetInstance()->WorkerDestroyed(this); } -void SharedWorkerHost::Start(mojom::SharedWorkerFactoryPtr factory, - bool pause_on_start) { +void SharedWorkerHost::Start( + mojom::SharedWorkerFactoryPtr factory, + bool pause_on_start, + const base::UnguessableToken& devtools_worker_token) { blink::mojom::WorkerContentSettingsProxyPtr content_settings; content_settings_ = std::make_unique<SharedWorkerContentSettingsProxyImpl>( instance_->url(), this, mojo::MakeRequest(&content_settings)); @@ -94,9 +96,9 @@ instance_->creation_address_space())); factory->CreateSharedWorker( - std::move(info), pause_on_start, instance_->devtools_worker_token(), - route_id_, std::move(content_settings), std::move(host), - mojo::MakeRequest(&worker_), std::move(interface_provider)); + std::move(info), pause_on_start, devtools_worker_token, route_id_, + std::move(content_settings), std::move(host), mojo::MakeRequest(&worker_), + std::move(interface_provider)); // Monitor the lifetime of the worker. worker_.set_connection_error_handler(base::BindOnce(
diff --git a/content/browser/shared_worker/shared_worker_host.h b/content/browser/shared_worker/shared_worker_host.h index 47f5ce9..da3b79e 100644 --- a/content/browser/shared_worker/shared_worker_host.h +++ b/content/browser/shared_worker/shared_worker_host.h
@@ -15,6 +15,7 @@ #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "base/time/time.h" +#include "base/unguessable_token.h" #include "content/common/shared_worker/shared_worker.mojom.h" #include "content/common/shared_worker/shared_worker_client.mojom.h" #include "content/common/shared_worker/shared_worker_factory.mojom.h" @@ -46,7 +47,9 @@ ~SharedWorkerHost() override; // Starts the SharedWorker in the renderer process. - void Start(mojom::SharedWorkerFactoryPtr factory, bool pause_on_start); + void Start(mojom::SharedWorkerFactoryPtr factory, + bool pause_on_start, + const base::UnguessableToken& devtools_worker_token); void AllowFileSystem(const GURL& url, base::OnceCallback<void(bool)> callback);
diff --git a/content/browser/shared_worker/shared_worker_instance.cc b/content/browser/shared_worker/shared_worker_instance.cc index be023a1..bb2eceb6 100644 --- a/content/browser/shared_worker/shared_worker_instance.cc +++ b/content/browser/shared_worker/shared_worker_instance.cc
@@ -17,8 +17,7 @@ blink::WebAddressSpace creation_address_space, ResourceContext* resource_context, const WorkerStoragePartitionId& partition_id, - blink::mojom::SharedWorkerCreationContextType creation_context_type, - const base::UnguessableToken& devtools_worker_token) + blink::mojom::SharedWorkerCreationContextType creation_context_type) : url_(url), name_(name), constructor_origin_(constructor_origin), @@ -27,10 +26,8 @@ creation_address_space_(creation_address_space), resource_context_(resource_context), partition_id_(partition_id), - creation_context_type_(creation_context_type), - devtools_worker_token_(devtools_worker_token) { + creation_context_type_(creation_context_type) { DCHECK(resource_context_); - DCHECK(!devtools_worker_token_.is_empty()); } SharedWorkerInstance::SharedWorkerInstance(const SharedWorkerInstance& other) =
diff --git a/content/browser/shared_worker/shared_worker_instance.h b/content/browser/shared_worker/shared_worker_instance.h index f064cb51..fac028f4 100644 --- a/content/browser/shared_worker/shared_worker_instance.h +++ b/content/browser/shared_worker/shared_worker_instance.h
@@ -7,7 +7,6 @@ #include <string> -#include "base/unguessable_token.h" #include "content/browser/shared_worker/worker_storage_partition.h" #include "content/common/content_export.h" #include "third_party/WebKit/public/platform/WebAddressSpace.h" @@ -32,8 +31,7 @@ blink::WebAddressSpace creation_address_space, ResourceContext* resource_context, const WorkerStoragePartitionId& partition_id, - blink::mojom::SharedWorkerCreationContextType creation_context_type, - const base::UnguessableToken& devtools_worker_token); + blink::mojom::SharedWorkerCreationContextType creation_context_type); SharedWorkerInstance(const SharedWorkerInstance& other); ~SharedWorkerInstance(); @@ -68,9 +66,6 @@ blink::mojom::SharedWorkerCreationContextType creation_context_type() const { return creation_context_type_; } - const base::UnguessableToken& devtools_worker_token() const { - return devtools_worker_token_; - } private: const GURL url_; @@ -87,7 +82,6 @@ ResourceContext* const resource_context_; const WorkerStoragePartitionId partition_id_; const blink::mojom::SharedWorkerCreationContextType creation_context_type_; - const base::UnguessableToken devtools_worker_token_; }; } // namespace content
diff --git a/content/browser/shared_worker/shared_worker_instance_unittest.cc b/content/browser/shared_worker/shared_worker_instance_unittest.cc index 0845739..b8d00d2 100644 --- a/content/browser/shared_worker/shared_worker_instance_unittest.cc +++ b/content/browser/shared_worker/shared_worker_instance_unittest.cc
@@ -41,8 +41,7 @@ blink::kWebContentSecurityPolicyTypeReport, blink::kWebAddressSpacePublic, browser_context_->GetResourceContext(), partition_id_, - blink::mojom::SharedWorkerCreationContextType::kNonsecure, - base::UnguessableToken::Create()); + blink::mojom::SharedWorkerCreationContextType::kNonsecure); } bool Matches(const SharedWorkerInstance& instance, @@ -225,8 +224,7 @@ blink::kWebContentSecurityPolicyTypeReport, static_cast<blink::WebAddressSpace>(i), browser_context_->GetResourceContext(), partition_id_, - blink::mojom::SharedWorkerCreationContextType::kNonsecure, - base::UnguessableToken::Create()); + blink::mojom::SharedWorkerCreationContextType::kNonsecure); EXPECT_EQ(static_cast<blink::WebAddressSpace>(i), instance.creation_address_space()); }
diff --git a/content/browser/shared_worker/shared_worker_service_impl.cc b/content/browser/shared_worker/shared_worker_service_impl.cc index 06a96095..847e3b1 100644 --- a/content/browser/shared_worker/shared_worker_service_impl.cc +++ b/content/browser/shared_worker/shared_worker_service_impl.cc
@@ -138,7 +138,7 @@ info->url, info->name, render_frame_host->GetLastCommittedOrigin(), info->content_security_policy, info->content_security_policy_type, info->creation_address_space, resource_context, partition_id, - creation_context_type, base::UnguessableToken::Create()); + creation_context_type); SharedWorkerHost* host = FindAvailableSharedWorkerHost(*instance); if (host) { @@ -204,15 +204,17 @@ auto host = std::make_unique<SharedWorkerHost>( std::move(instance), worker_process_id, worker_route_id); - bool pause_on_start = - SharedWorkerDevToolsManager::GetInstance()->WorkerCreated(host.get()); + bool pause_on_start; + base::UnguessableToken devtools_worker_token; + SharedWorkerDevToolsManager::GetInstance()->WorkerCreated( + host.get(), &pause_on_start, &devtools_worker_token); // Get the factory used to instantiate the new shared worker instance in // the target process. mojom::SharedWorkerFactoryPtr factory; BindInterface(process_host, &factory); - host->Start(std::move(factory), pause_on_start); + host->Start(std::move(factory), pause_on_start, devtools_worker_token); host->AddClient(std::move(client), process_id, frame_id, message_port); const GURL url = host->instance()->url();
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index af2cb15..37445b29 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -38,7 +38,6 @@ #include "build/build_config.h" #include "cc/input/touch_action.h" #include "components/network_session_configurator/common/network_switches.h" -#include "content/browser/child_process_security_policy_impl.h" #include "content/browser/frame_host/cross_process_frame_connector.h" #include "content/browser/frame_host/frame_navigation_entry.h" #include "content/browser/frame_host/frame_tree.h" @@ -128,6 +127,7 @@ #include "base/android/jni_android.h" #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" +#include "base/json/json_reader.h" #include "content/browser/android/ime_adapter_android.h" #include "content/browser/renderer_host/input/touch_selection_controller_client_manager_android.h" #include "content/browser/renderer_host/render_widget_host_view_android.h" @@ -1833,9 +1833,9 @@ RenderFrameHostImpl* child_frame_b = root->child_at(0)->current_frame_host(); RenderFrameHostImpl* child_frame_c = root->child_at(0)->child_at(0)->current_frame_host(); - RenderWidgetHostView* main_frame_rwhv = main_frame->GetView(); - RenderWidgetHostView* child_frame_b_rwhv = child_frame_b->GetView(); - RenderWidgetHostView* child_frame_c_rwhv = child_frame_c->GetView(); + RenderWidgetHostView *main_frame_rwhv = main_frame->GetView(), + *child_frame_b_rwhv = child_frame_b->GetView(), + *child_frame_c_rwhv = child_frame_c->GetView(); // Wait until <iframe> 'b' is not visible (in main frame). while (main_frame_rwhv->GetViewBounds().Intersects( @@ -12932,64 +12932,4 @@ } } -// Test that a renderer locked to origin A will be killed if it tries to commit -// a navigation to origin B. See also https://crbug.com/770239. -IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, - CommittedOriginIncompatibleWithOriginLock) { - GURL start_url(embedded_test_server()->GetURL("a.com", "/title1.html")); - EXPECT_TRUE(NavigateToURL(shell(), start_url)); - FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) - ->GetFrameTree() - ->root(); - - // Setup an URL which will never commit, allowing this test to send its own, - // malformed, commit message. - GURL another_url(embedded_test_server()->GetURL("b.com", "/hung")); - - // Use LoadURL, as the test shouldn't wait for navigation commit. - NavigationController& controller = shell()->web_contents()->GetController(); - controller.LoadURL(another_url, Referrer(), ui::PAGE_TRANSITION_LINK, - std::string()); - EXPECT_NE(nullptr, controller.GetPendingEntry()); - EXPECT_EQ(another_url, controller.GetPendingEntry()->GetURL()); - - RenderProcessHostWatcher exit_observer( - root->current_frame_host()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); - - // Create commit params with a different origin than the origin lock - // of the process. - std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params> params = - std::make_unique<FrameHostMsg_DidCommitProvisionalLoad_Params>(); - params->nav_entry_id = 0; - params->did_create_new_entry = false; - params->url = another_url; - params->transition = ui::PAGE_TRANSITION_LINK; - params->should_update_history = false; - params->gesture = NavigationGestureAuto; - params->was_within_same_document = false; - params->method = "GET"; - params->page_state = PageState::CreateFromURL(another_url); - // Use an origin mismatched with the origin lock. - params->origin = url::Origin::Create(another_url); - auto* policy = ChildProcessSecurityPolicyImpl::GetInstance(); - int process_id = root->current_frame_host()->GetProcess()->GetID(); - EXPECT_EQ(start_url.host(), policy->GetOriginLock(process_id).host()); - EXPECT_NE(another_url.host(), policy->GetOriginLock(process_id).host()); - // Simulate a commit IPC. - service_manager::mojom::InterfaceProviderPtr interface_provider; - static_cast<mojom::FrameHost*>(root->current_frame_host()) - ->DidCommitProvisionalLoad(std::move(params), - mojo::MakeRequest(&interface_provider)); - - // When the IPC message is received and validation fails, the process is - // terminated. However, the notification for that should be processed in a - // separate task of the message loop, so ensure that the process is still - // considered alive. - EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); - - exit_observer.Wait(); - EXPECT_FALSE(exit_observer.did_exit_normally()); -} - } // namespace content
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index ae56adf..4e3c31a 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -1755,7 +1755,7 @@ TEST_F(WebContentsImplTest, ShowInterstitialFromBrowserNewNavigationProceed) { // Navigate to a page. - GURL url1("http://www.thepage.com/one"); + GURL url1("http://www.google.com"); NavigationSimulator::NavigateAndCommitFromDocument(url1, main_test_rfh()); EXPECT_EQ(1, controller().GetEntryCount()); @@ -1797,7 +1797,7 @@ // Simulate the navigation to the page, that's when the interstitial gets // hidden. - GURL url3("http://www.thepage.com/two"); + GURL url3("http://www.thepage.com"); main_test_rfh()->PrepareForCommit(); main_test_rfh()->SendNavigate(0, true, url3); @@ -2241,7 +2241,7 @@ // Test showing an interstitial while another interstitial is already showing. TEST_F(WebContentsImplTest, ShowInterstitialOnInterstitial) { // Navigate to a page so we have a navigation entry in the controller. - GURL start_url("http://www.thepage.com/one"); + GURL start_url("http://www.google.com"); NavigationSimulator::NavigateAndCommitFromDocument(start_url, main_test_rfh()); EXPECT_EQ(1, controller().GetEntryCount()); @@ -2280,7 +2280,7 @@ // Let's make sure interstitial2 is working as intended. interstitial2->Proceed(); - GURL landing_url("http://www.thepage.com/two"); + GURL landing_url("http://www.thepage.com"); main_test_rfh()->SendNavigate(0, true, landing_url); EXPECT_FALSE(contents()->ShowingInterstitialPage()); @@ -2297,7 +2297,7 @@ // interstitial. TEST_F(WebContentsImplTest, ShowInterstitialProceedShowInterstitial) { // Navigate to a page so we have a navigation entry in the controller. - GURL start_url("http://www.thepage.com/one"); + GURL start_url("http://www.google.com"); NavigationSimulator::NavigateAndCommitFromDocument(start_url, main_test_rfh()); EXPECT_EQ(1, controller().GetEntryCount()); @@ -2340,7 +2340,7 @@ // Let's make sure interstitial2 is working as intended. interstitial2->Proceed(); - GURL landing_url("http://www.thepage.com/two"); + GURL landing_url("http://www.thepage.com"); main_test_rfh()->SendNavigate(0, true, landing_url); RunAllPendingInMessageLoop(); @@ -3241,9 +3241,9 @@ // TODO(fdegans): Rewrite the test for PlzNavigate when DidStartLoading and // DidStopLoading are properly called. TEST_F(WebContentsImplTest, NoEarlyStop) { - const GURL kUrl1("http://www.chromium.org/one"); + const GURL kUrl1("http://www.chromium.org"); const GURL kUrl2("http://www.google.com"); - const GURL kUrl3("http://www.chromium.org/two"); + const GURL kUrl3("http://www.wikipedia.org"); contents()->NavigateAndCommit(kUrl1);
diff --git a/content/common/loader_util.cc b/content/common/loader_util.cc index 894c00bc..0960fe4a 100644 --- a/content/common/loader_util.cc +++ b/content/common/loader_util.cc
@@ -7,7 +7,6 @@ #include <string> #include "base/strings/stringprintf.h" -#include "content/public/common/resource_devtools_info.h" #include "content/public/common/resource_request.h" #include "content/public/common/resource_response.h" #include "net/base/load_flags.h" @@ -15,6 +14,7 @@ #include "net/http/http_raw_request_headers.h" #include "net/http/http_util.h" #include "net/url_request/url_request.h" +#include "services/network/public/cpp/http_raw_request_response_info.h" namespace content { @@ -51,11 +51,12 @@ return false; } -scoped_refptr<ResourceDevToolsInfo> BuildDevToolsInfo( +scoped_refptr<network::HttpRawRequestResponseInfo> BuildRawRequestResponseInfo( const net::URLRequest& request, const net::HttpRawRequestHeaders& raw_request_headers, const net::HttpResponseHeaders* raw_response_headers) { - scoped_refptr<ResourceDevToolsInfo> info = new ResourceDevToolsInfo(); + scoped_refptr<network::HttpRawRequestResponseInfo> info = + new network::HttpRawRequestResponseInfo(); const net::HttpResponseInfo& response_info = request.response_info(); // Unparsed headers only make sense if they were sent as text, i.e. HTTP 1.x.
diff --git a/content/common/loader_util.h b/content/common/loader_util.h index e91cf4b..0f8531b 100644 --- a/content/common/loader_util.h +++ b/content/common/loader_util.h
@@ -14,8 +14,11 @@ class URLRequest; } +namespace network { +struct HttpRawRequestResponseInfo; +} + namespace content { -struct ResourceDevToolsInfo; struct ResourceRequest; struct ResourceResponse; @@ -27,8 +30,8 @@ bool ShouldSniffContent(net::URLRequest* url_request, ResourceResponse* response); -// Fill ResourceDevToolsInfo based on raw headers. -scoped_refptr<ResourceDevToolsInfo> BuildDevToolsInfo( +// Fill HttpRawRequestResponseInfo based on raw headers. +scoped_refptr<network::HttpRawRequestResponseInfo> BuildRawRequestResponseInfo( const net::URLRequest& request, const net::HttpRawRequestHeaders& raw_request_headers, const net::HttpResponseHeaders* raw_response_headers);
diff --git a/content/common/resource_messages.cc b/content/common/resource_messages.cc index 63071fe..e257a203 100644 --- a/content/common/resource_messages.cc +++ b/content/common/resource_messages.cc
@@ -13,33 +13,6 @@ namespace IPC { -void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Write( - base::Pickle* m, - const param_type& p) { - WriteParam(m, p.get() != nullptr); - if (p.get()) { - // Do not disclose Set-Cookie headers over IPC. - p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); - } -} - -bool ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Read( - const base::Pickle* m, - base::PickleIterator* iter, - param_type* r) { - bool has_object; - if (!ReadParam(m, iter, &has_object)) - return false; - if (has_object) - *r = new net::HttpResponseHeaders(iter); - return true; -} - -void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log( - const param_type& p, std::string* l) { - l->append("<HttpResponseHeaders>"); -} - void ParamTraits<storage::DataElement>::Write(base::Pickle* m, const param_type& p) { WriteParam(m, static_cast<int>(p.type())); @@ -215,50 +188,6 @@ l->append("<storage::DataElement>"); } -void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::Write( - base::Pickle* m, - const param_type& p) { - WriteParam(m, p.get() != nullptr); - if (p.get()) { - WriteParam(m, p->http_status_code); - WriteParam(m, p->http_status_text); - WriteParam(m, p->request_headers); - WriteParam(m, p->response_headers); - WriteParam(m, p->request_headers_text); - WriteParam(m, p->response_headers_text); - } -} - -bool ParamTraits<scoped_refptr<content::ResourceDevToolsInfo>>::Read( - const base::Pickle* m, - base::PickleIterator* iter, - param_type* r) { - bool has_object; - if (!ReadParam(m, iter, &has_object)) - return false; - if (!has_object) - return true; - *r = new content::ResourceDevToolsInfo(); - return - ReadParam(m, iter, &(*r)->http_status_code) && - ReadParam(m, iter, &(*r)->http_status_text) && - ReadParam(m, iter, &(*r)->request_headers) && - ReadParam(m, iter, &(*r)->response_headers) && - ReadParam(m, iter, &(*r)->request_headers_text) && - ReadParam(m, iter, &(*r)->response_headers_text); -} - -void ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> >::Log( - const param_type& p, std::string* l) { - l->append("("); - if (p.get()) { - LogParam(p->request_headers, l); - l->append(", "); - LogParam(p->response_headers, l); - } - l->append(")"); -} - void ParamTraits<net::LoadTimingInfo>::Write(base::Pickle* m, const param_type& p) { WriteParam(m, p.socket_log_id);
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index 1ecd22e..ddbf42b 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h
@@ -26,9 +26,7 @@ #include "net/http/http_response_info.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "net/url_request/redirect_info.h" -#include "services/network/public/cpp/cors_error_status.h" #include "services/network/public/cpp/network_param_ipc_traits.h" -#include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/interfaces/fetch_api.mojom.h" #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" @@ -39,23 +37,9 @@ struct LoadTimingInfo; } -namespace content { -struct ResourceDevToolsInfo; -} - namespace IPC { template <> -struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { - typedef scoped_refptr<net::HttpResponseHeaders> param_type; - static void Write(base::Pickle* m, const param_type& p); - static bool Read(const base::Pickle* m, - base::PickleIterator* iter, - param_type* r); - static void Log(const param_type& p, std::string* l); -}; - -template <> struct CONTENT_EXPORT ParamTraits<storage::DataElement> { typedef storage::DataElement param_type; static void Write(base::Pickle* m, const param_type& p); @@ -66,16 +50,6 @@ }; template <> -struct ParamTraits<scoped_refptr<content::ResourceDevToolsInfo> > { - typedef scoped_refptr<content::ResourceDevToolsInfo> param_type; - static void Write(base::Pickle* m, const param_type& p); - static bool Read(const base::Pickle* m, - base::PickleIterator* iter, - param_type* r); - static void Log(const param_type& p, std::string* l); -}; - -template <> struct ParamTraits<net::LoadTimingInfo> { typedef net::LoadTimingInfo param_type; static void Write(base::Pickle* m, const param_type& p); @@ -149,7 +123,7 @@ IPC_STRUCT_TRAITS_MEMBER(appcache_id) IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url) IPC_STRUCT_TRAITS_MEMBER(load_timing) - IPC_STRUCT_TRAITS_MEMBER(devtools_info) + IPC_STRUCT_TRAITS_MEMBER(raw_request_response_info) IPC_STRUCT_TRAITS_MEMBER(download_file_path) IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy) IPC_STRUCT_TRAITS_MEMBER(was_alpn_negotiated) @@ -200,7 +174,7 @@ IPC_STRUCT_TRAITS_MEMBER(request_initiator) IPC_STRUCT_TRAITS_MEMBER(referrer) IPC_STRUCT_TRAITS_MEMBER(referrer_policy) - IPC_STRUCT_TRAITS_MEMBER(visibility_state) + IPC_STRUCT_TRAITS_MEMBER(is_prerendering) IPC_STRUCT_TRAITS_MEMBER(headers) IPC_STRUCT_TRAITS_MEMBER(load_flags) IPC_STRUCT_TRAITS_MEMBER(plugin_child_id) @@ -239,24 +213,4 @@ IPC_STRUCT_TRAITS_MEMBER(download_to_network_cache_only) IPC_STRUCT_TRAITS_END() -// Parameters for a ResourceMsg_RequestComplete -IPC_ENUM_TRAITS_MAX_VALUE(network::mojom::CORSError, - network::mojom::CORSError::kLast) - -IPC_STRUCT_TRAITS_BEGIN(network::CORSErrorStatus) - IPC_STRUCT_TRAITS_MEMBER(cors_error) - IPC_STRUCT_TRAITS_MEMBER(related_response_headers) -IPC_STRUCT_TRAITS_END() - -IPC_STRUCT_TRAITS_BEGIN(network::URLLoaderCompletionStatus) - IPC_STRUCT_TRAITS_MEMBER(error_code) - IPC_STRUCT_TRAITS_MEMBER(exists_in_cache) - IPC_STRUCT_TRAITS_MEMBER(completion_time) - IPC_STRUCT_TRAITS_MEMBER(encoded_data_length) - IPC_STRUCT_TRAITS_MEMBER(encoded_body_length) - IPC_STRUCT_TRAITS_MEMBER(decoded_body_length) - IPC_STRUCT_TRAITS_MEMBER(cors_error_status) - IPC_STRUCT_TRAITS_MEMBER(ssl_info) -IPC_STRUCT_TRAITS_END() - #endif // CONTENT_COMMON_RESOURCE_MESSAGES_H_
diff --git a/content/network/network_service_unittest.cc b/content/network/network_service_unittest.cc index 0e564cac..eae9f966 100644 --- a/content/network/network_service_unittest.cc +++ b/content/network/network_service_unittest.cc
@@ -199,10 +199,10 @@ StartLoadingURL(request, 0); client()->RunUntilRedirectReceived(); EXPECT_TRUE(client()->has_received_redirect()); - EXPECT_TRUE(!client()->response_head().devtools_info); + EXPECT_TRUE(!client()->response_head().raw_request_response_info); loader()->FollowRedirect(); client()->RunUntilComplete(); - EXPECT_TRUE(!client()->response_head().devtools_info); + EXPECT_TRUE(!client()->response_head().raw_request_response_info); } TEST_F(NetworkServiceTestWithService, RawRequestHeadersPresent) { @@ -215,33 +215,33 @@ client()->RunUntilRedirectReceived(); EXPECT_TRUE(client()->has_received_redirect()); { - scoped_refptr<ResourceDevToolsInfo> devtools_info = - client()->response_head().devtools_info; - ASSERT_TRUE(devtools_info); - EXPECT_EQ(301, devtools_info->http_status_code); - EXPECT_EQ("Moved Permanently", devtools_info->http_status_text); - EXPECT_TRUE(base::StartsWith(devtools_info->request_headers_text, + scoped_refptr<network::HttpRawRequestResponseInfo> request_response_info = + client()->response_head().raw_request_response_info; + ASSERT_TRUE(request_response_info); + EXPECT_EQ(301, request_response_info->http_status_code); + EXPECT_EQ("Moved Permanently", request_response_info->http_status_text); + EXPECT_TRUE(base::StartsWith(request_response_info->request_headers_text, "GET /server-redirect?/echo HTTP/1.1\r\n", base::CompareCase::SENSITIVE)); - EXPECT_GE(devtools_info->request_headers.size(), 1lu); - EXPECT_GE(devtools_info->response_headers.size(), 1lu); - EXPECT_TRUE(base::StartsWith(devtools_info->response_headers_text, + EXPECT_GE(request_response_info->request_headers.size(), 1lu); + EXPECT_GE(request_response_info->response_headers.size(), 1lu); + EXPECT_TRUE(base::StartsWith(request_response_info->response_headers_text, "HTTP/1.1 301 Moved Permanently\r", base::CompareCase::SENSITIVE)); } loader()->FollowRedirect(); client()->RunUntilComplete(); { - scoped_refptr<ResourceDevToolsInfo> devtools_info = - client()->response_head().devtools_info; - EXPECT_EQ(200, devtools_info->http_status_code); - EXPECT_EQ("OK", devtools_info->http_status_text); - EXPECT_TRUE(base::StartsWith(devtools_info->request_headers_text, + scoped_refptr<network::HttpRawRequestResponseInfo> request_response_info = + client()->response_head().raw_request_response_info; + EXPECT_EQ(200, request_response_info->http_status_code); + EXPECT_EQ("OK", request_response_info->http_status_text); + EXPECT_TRUE(base::StartsWith(request_response_info->request_headers_text, "GET /echo HTTP/1.1\r\n", base::CompareCase::SENSITIVE)); - EXPECT_GE(devtools_info->request_headers.size(), 1lu); - EXPECT_GE(devtools_info->response_headers.size(), 1lu); - EXPECT_TRUE(base::StartsWith(devtools_info->response_headers_text, + EXPECT_GE(request_response_info->request_headers.size(), 1lu); + EXPECT_GE(request_response_info->response_headers.size(), 1lu); + EXPECT_TRUE(base::StartsWith(request_response_info->response_headers_text, "HTTP/1.1 200 OK\r", base::CompareCase::SENSITIVE)); } @@ -257,22 +257,22 @@ StartLoadingURL(request, process_id); client()->RunUntilComplete(); - EXPECT_FALSE(client()->response_head().devtools_info); + EXPECT_FALSE(client()->response_head().raw_request_response_info); service()->SetRawHeadersAccess(process_id, true); StartLoadingURL(request, process_id); client()->RunUntilComplete(); { - scoped_refptr<ResourceDevToolsInfo> devtools_info = - client()->response_head().devtools_info; - ASSERT_TRUE(devtools_info); - EXPECT_EQ(200, devtools_info->http_status_code); - EXPECT_EQ("OK", devtools_info->http_status_text); + scoped_refptr<network::HttpRawRequestResponseInfo> request_response_info = + client()->response_head().raw_request_response_info; + ASSERT_TRUE(request_response_info); + EXPECT_EQ(200, request_response_info->http_status_code); + EXPECT_EQ("OK", request_response_info->http_status_text); } service()->SetRawHeadersAccess(process_id, false); StartLoadingURL(request, process_id); client()->RunUntilComplete(); - EXPECT_FALSE(client()->response_head().devtools_info.get()); + EXPECT_FALSE(client()->response_head().raw_request_response_info.get()); } TEST_F(NetworkServiceTestWithService, SetNetworkConditions) {
diff --git a/content/network/url_loader.cc b/content/network/url_loader.cc index 3ec5a88e..813a2df3 100644 --- a/content/network/url_loader.cc +++ b/content/network/url_loader.cc
@@ -362,7 +362,7 @@ PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_, response.get()); if (report_raw_headers_) { - response->head.devtools_info = BuildDevToolsInfo( + response->head.raw_request_response_info = BuildRawRequestResponseInfo( *url_request_, raw_request_headers_, raw_response_headers_.get()); raw_request_headers_ = net::HttpRawRequestHeaders(); raw_response_headers_ = nullptr; @@ -415,7 +415,7 @@ PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_, response_.get()); if (report_raw_headers_) { - response_->head.devtools_info = BuildDevToolsInfo( + response_->head.raw_request_response_info = BuildRawRequestResponseInfo( *url_request_, raw_request_headers_, raw_response_headers_.get()); raw_request_headers_ = net::HttpRawRequestHeaders(); raw_response_headers_ = nullptr;
diff --git a/content/public/browser/resource_request_info.h b/content/public/browser/resource_request_info.h index 374d38e..065e82cf 100644 --- a/content/public/browser/resource_request_info.h +++ b/content/public/browser/resource_request_info.h
@@ -11,7 +11,6 @@ #include "content/public/browser/navigation_ui_data.h" #include "content/public/common/previews_state.h" #include "content/public/common/resource_type.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" #include "ui/base/page_transition_types.h" @@ -139,9 +138,9 @@ // Returns the associated referrer policy. virtual blink::WebReferrerPolicy GetReferrerPolicy() const = 0; - // Returns the associated visibility state at the time the request was started - // in the renderer. - virtual blink::mojom::PageVisibilityState GetVisibilityState() const = 0; + // Returns whether the frame that initiated this request is used for + // prerendering. + virtual bool IsPrerendering() const = 0; // Returns the associated page transition type. virtual ui::PageTransition GetPageTransition() const = 0;
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index f072e2e..348af3d 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -202,8 +202,6 @@ "renderer_preferences.cc", "renderer_preferences.h", "request_context_type.h", - "resource_devtools_info.cc", - "resource_devtools_info.h", "resource_request.cc", "resource_request.h", "resource_request_body.cc", @@ -290,6 +288,7 @@ "//mojo/common", "//ppapi/c", "//ppapi/features", + "//services/network/public/cpp", "//services/service_manager/public/cpp", "//skia", "//storage/common",
diff --git a/content/public/common/DEPS b/content/public/common/DEPS index 15b058f2..ca3193b 100644 --- a/content/public/common/DEPS +++ b/content/public/common/DEPS
@@ -4,6 +4,9 @@ "+services/network/public/cpp", "+third_party/WebKit/common", ], + "resource_response_info.h": [ + "+services/network/public/cpp", + ], "simple_url_loader\.cc": [ "-content/", "+content/public/common/simple_url_loader\.h",
diff --git a/content/public/common/cors_error_status.typemap b/content/public/common/cors_error_status.typemap index 6b66c33..5b798116 100644 --- a/content/public/common/cors_error_status.typemap +++ b/content/public/common/cors_error_status.typemap
@@ -4,10 +4,8 @@ mojom = "//content/public/common/url_loader.mojom" public_headers = [ "//services/network/public/cpp/cors_error_status.h" ] -traits_headers = [ "//content/common/resource_messages.h" ] +traits_headers = [ "//services/network/public/cpp/network_param_ipc_traits.h" ] deps = [ - "//content:export", - "//net:net", - "//third_party/WebKit/public:blink_headers", + "//services/network/public/cpp", ] type_mappings = [ "content.mojom.CORSErrorStatus=network::CORSErrorStatus" ]
diff --git a/content/public/common/resource_devtools_info.cc b/content/public/common/resource_devtools_info.cc deleted file mode 100644 index 93ea6d1..0000000 --- a/content/public/common/resource_devtools_info.cc +++ /dev/null
@@ -1,27 +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 "content/public/common/resource_devtools_info.h" - -namespace content { - -ResourceDevToolsInfo::ResourceDevToolsInfo() - : http_status_code(0) { -} - -ResourceDevToolsInfo::~ResourceDevToolsInfo() { -} - -scoped_refptr<ResourceDevToolsInfo> ResourceDevToolsInfo::DeepCopy() const { - scoped_refptr<ResourceDevToolsInfo> new_info = new ResourceDevToolsInfo; - new_info->http_status_code = http_status_code; - new_info->http_status_text = http_status_text; - new_info->request_headers = request_headers; - new_info->response_headers = response_headers; - new_info->request_headers_text = request_headers_text; - new_info->response_headers_text = response_headers_text; - return new_info; -} - -} // namespace content
diff --git a/content/public/common/resource_devtools_info.h b/content/public/common/resource_devtools_info.h deleted file mode 100644 index 51326c0..0000000 --- a/content/public/common/resource_devtools_info.h +++ /dev/null
@@ -1,42 +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 CONTENT_PUBLIC_COMMON_RESOURCE_DEVTOOLS_INFO_H_ -#define CONTENT_PUBLIC_COMMON_RESOURCE_DEVTOOLS_INFO_H_ - -#include <stdint.h> - -#include <string> -#include <vector> - -#include "base/memory/ref_counted.h" -#include "base/strings/string_split.h" -#include "content/common/content_export.h" - -namespace content { - -// Note: when modifying this structure, also update DeepCopy in -// resource_devtools_info.cc. -struct ResourceDevToolsInfo : base::RefCounted<ResourceDevToolsInfo> { - typedef base::StringPairs HeadersVector; - - CONTENT_EXPORT ResourceDevToolsInfo(); - - scoped_refptr<ResourceDevToolsInfo> DeepCopy() const; - - int32_t http_status_code; - std::string http_status_text; - HeadersVector request_headers; - HeadersVector response_headers; - std::string request_headers_text; - std::string response_headers_text; - - private: - friend class base::RefCounted<ResourceDevToolsInfo>; - CONTENT_EXPORT ~ResourceDevToolsInfo(); -}; - -} // namespace content - -#endif // CONTENT_PUBLIC_COMMON_RESOURCE_DEVTOOLS_INFO_H_
diff --git a/content/public/common/resource_request.h b/content/public/common/resource_request.h index d637851..00d26f8b 100644 --- a/content/public/common/resource_request.h +++ b/content/public/common/resource_request.h
@@ -60,9 +60,8 @@ net::URLRequest::ReferrerPolicy referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; - // The frame's visibility state. - blink::mojom::PageVisibilityState visibility_state = - blink::mojom::PageVisibilityState::kVisible; + // Whether the frame that initiated this request is used for prerendering. + bool is_prerendering = false; // Additional HTTP request headers. net::HttpRequestHeaders headers;
diff --git a/content/public/common/resource_response.cc b/content/public/common/resource_response.cc index a26e5f59..34bf52b 100644 --- a/content/public/common/resource_response.cc +++ b/content/public/common/resource_response.cc
@@ -26,8 +26,9 @@ new_response->head.appcache_id = head.appcache_id; new_response->head.appcache_manifest_url = head.appcache_manifest_url; new_response->head.load_timing = head.load_timing; - if (head.devtools_info.get()) { - new_response->head.devtools_info = head.devtools_info->DeepCopy(); + if (head.raw_request_response_info.get()) { + new_response->head.raw_request_response_info = + head.raw_request_response_info->DeepCopy(); } new_response->head.download_file_path = head.download_file_path; new_response->head.was_fetched_via_spdy = head.was_fetched_via_spdy;
diff --git a/content/public/common/resource_response_info.h b/content/public/common/resource_response_info.h index 16f5a8a5..9111e41 100644 --- a/content/public/common/resource_response_info.h +++ b/content/public/common/resource_response_info.h
@@ -14,13 +14,13 @@ #include "base/time/time.h" #include "content/common/content_export.h" #include "content/public/common/previews_state.h" -#include "content/public/common/resource_devtools_info.h" #include "net/base/host_port_pair.h" #include "net/base/load_timing_info.h" #include "net/cert/signed_certificate_timestamp_and_status.h" #include "net/http/http_response_headers.h" #include "net/http/http_response_info.h" #include "net/nqe/effective_connection_type.h" +#include "services/network/public/cpp/http_raw_request_response_info.h" #include "services/network/public/interfaces/fetch_api.mojom.h" #include "url/gurl.h" @@ -83,7 +83,7 @@ // Actual request and response headers, as obtained from the network stack. // Only present if the renderer set report_raw_headers to true and had the // CanReadRawCookies permission. - scoped_refptr<ResourceDevToolsInfo> devtools_info; + scoped_refptr<network::HttpRawRequestResponseInfo> raw_request_response_info; // The path to a file that will contain the response body. It may only // contain a portion of the response body at the time that the ResponseInfo
diff --git a/content/public/common/url_loader_completion_status.typemap b/content/public/common/url_loader_completion_status.typemap index bd756bb..405cced 100644 --- a/content/public/common/url_loader_completion_status.typemap +++ b/content/public/common/url_loader_completion_status.typemap
@@ -5,11 +5,12 @@ mojom = "//content/public/common/url_loader.mojom" public_headers = [ "//services/network/public/cpp/url_loader_completion_status.h" ] -traits_headers = [ "//content/common/resource_messages.h" ] +traits_headers = [ "//services/network/public/cpp/network_param_ipc_traits.h" ] deps = [ - "//content:export", "//net", "//services/network/public/cpp", "//third_party/WebKit/public:blink_headers", ] -type_mappings = [ "content.mojom.URLLoaderCompletionStatus=network::URLLoaderCompletionStatus" ] +type_mappings = [ + "content.mojom.URLLoaderCompletionStatus=network::URLLoaderCompletionStatus", +]
diff --git a/content/public/network/ignore_errors_cert_verifier.cc b/content/public/network/ignore_errors_cert_verifier.cc index 9c0798a..6ece4236 100644 --- a/content/public/network/ignore_errors_cert_verifier.cc +++ b/content/public/network/ignore_errors_cert_verifier.cc
@@ -27,7 +27,6 @@ using ::net::CompletionCallback; using ::net::HashValue; using ::net::SHA256HashValue; -using ::net::SHA256HashValueLessThan; using ::net::X509Certificate; namespace content { @@ -105,13 +104,12 @@ auto whitelist_end = whitelist_.end(); auto fingerprints_begin = spki_fingerprints.begin(); auto fingerprints_end = spki_fingerprints.end(); - static const SHA256HashValueLessThan sha256_lt; bool ignore_errors = false; while (whitelist_begin != whitelist_end && fingerprints_begin != fingerprints_end) { - if (sha256_lt(*whitelist_begin, *fingerprints_begin)) { + if (*whitelist_begin < *fingerprints_begin) { ++whitelist_begin; - } else if (sha256_lt(*fingerprints_begin, *whitelist_begin)) { + } else if (*fingerprints_begin < *whitelist_begin) { ++fingerprints_begin; } else { ignore_errors = true;
diff --git a/content/public/network/ignore_errors_cert_verifier.h b/content/public/network/ignore_errors_cert_verifier.h index 9c5c503..e58d34e5 100644 --- a/content/public/network/ignore_errors_cert_verifier.h +++ b/content/public/network/ignore_errors_cert_verifier.h
@@ -16,7 +16,6 @@ namespace net { struct SHA256HashValue; -class SHA256HashValueLessThan; } // namespace net namespace content { @@ -27,8 +26,7 @@ class CONTENT_EXPORT IgnoreErrorsCertVerifier : public net::CertVerifier { public: // SPKIHashSet is a set of SHA-256 SPKI fingerprints (RFC 7469, Section 2.4). - using SPKIHashSet = - base::flat_set<net::SHA256HashValue, net::SHA256HashValueLessThan>; + using SPKIHashSet = base::flat_set<net::SHA256HashValue>; // If the |user_data_dir_switch| is passed in as a valid pointer but // --user-data-dir flag is missing, or --ignore-certificate-errors-spki-list
diff --git a/content/public/network/ignore_errors_cert_verifier_unittest.cc b/content/public/network/ignore_errors_cert_verifier_unittest.cc index d719245..ec79648 100644 --- a/content/public/network/ignore_errors_cert_verifier_unittest.cc +++ b/content/public/network/ignore_errors_cert_verifier_unittest.cc
@@ -30,7 +30,6 @@ using net::CompletionCallback; using net::HashValue; using net::SHA256HashValue; -using net::SHA256HashValueLessThan; using net::X509Certificate; using net::TestCompletionCallback; using net::CertVerifyResult;
diff --git a/content/public/renderer/render_frame.h b/content/public/renderer/render_frame.h index a36ff10..20c4e4b 100644 --- a/content/public/renderer/render_frame.h +++ b/content/public/renderer/render_frame.h
@@ -15,6 +15,7 @@ #include "content/common/content_export.h" #include "content/public/common/console_message_level.h" #include "content/public/common/previews_state.h" +#include "content/public/common/url_loader_factory.mojom.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" #include "ppapi/features/features.h" @@ -48,7 +49,6 @@ } namespace content { -class ChildURLLoaderFactoryGetter; class ContextMenuClient; class PluginInstanceThrottler; class RenderAccessibility; @@ -258,13 +258,13 @@ // BindingsPolicy for details. virtual int GetEnabledBindings() const = 0; - // Returns a default ChildURLLoaderFactoryGetter for the RenderFrame. - // Used to obtain a right mojom::URLLoaderFactory. - virtual ChildURLLoaderFactoryGetter* GetDefaultURLLoaderFactoryGetter() = 0; - // Set the accessibility mode to force creation of RenderAccessibility. virtual void SetAccessibilityModeForTest(ui::AXMode new_mode) = 0; + // Returns the URLLoaderFactory for the given GURL + virtual mojom::URLLoaderFactory* GetURLLoaderFactory( + const GURL& request_url) = 0; + protected: ~RenderFrame() override {}
diff --git a/content/renderer/fetchers/resource_fetcher_browsertest.cc b/content/renderer/fetchers/resource_fetcher_browsertest.cc index 44d98a5..8dab46b 100644 --- a/content/renderer/fetchers/resource_fetcher_browsertest.cc +++ b/content/renderer/fetchers/resource_fetcher_browsertest.cc
@@ -151,9 +151,7 @@ std::unique_ptr<FetcherDelegate> delegate(new FetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse(); @@ -172,9 +170,7 @@ std::unique_ptr<FetcherDelegate> delegate(new FetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse(); @@ -193,9 +189,7 @@ std::unique_ptr<FetcherDelegate> delegate(new FetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse(); @@ -213,9 +207,7 @@ std::unique_ptr<FetcherDelegate> delegate(new FetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse(); @@ -235,9 +227,7 @@ std::unique_ptr<FetcherDelegate> delegate(new FetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); fetcher->SetTimeout(base::TimeDelta()); @@ -258,9 +248,7 @@ std::unique_ptr<EvilFetcherDelegate> delegate(new EvilFetcherDelegate); std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); fetcher->SetTimeout(base::TimeDelta()); delegate->SetFetcher(fetcher.release()); @@ -280,9 +268,7 @@ fetcher->SetMethod("POST"); fetcher->SetBody(kBody); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse(); @@ -301,9 +287,7 @@ std::unique_ptr<ResourceFetcher> fetcher(ResourceFetcher::Create(url)); fetcher->SetHeader("header", kHeader); fetcher->Start(frame, WebURLRequest::kRequestContextInternal, - RenderFrame::FromWebFrame(frame) - ->GetDefaultURLLoaderFactoryGetter() - ->GetNetworkLoaderFactory(), + RenderFrame::FromWebFrame(frame)->GetURLLoaderFactory(url), TRAFFIC_ANNOTATION_FOR_TESTS, delegate->NewCallback()); delegate->WaitForResponse();
diff --git a/content/renderer/loader/request_extra_data.cc b/content/renderer/loader/request_extra_data.cc index a18495c..7abe21b 100644 --- a/content/renderer/loader/request_extra_data.cc +++ b/content/renderer/loader/request_extra_data.cc
@@ -7,7 +7,6 @@ #include "content/common/service_worker/service_worker_types.h" #include "content/public/common/resource_request.h" #include "content/public/common/service_worker_modes.h" -#include "third_party/WebKit/common/page/page_visibility_state.mojom.h" using blink::WebString; @@ -32,7 +31,8 @@ } void RequestExtraData::CopyToResourceRequest(ResourceRequest* request) const { - request->visibility_state = visibility_state_; + request->is_prerendering = + visibility_state_ == blink::mojom::PageVisibilityState::kPrerender; request->render_frame_id = render_frame_id_; request->is_main_frame = is_main_frame_;
diff --git a/content/renderer/loader/sync_load_context.cc b/content/renderer/loader/sync_load_context.cc index 7fa320b..573f362c 100644 --- a/content/renderer/loader/sync_load_context.cc +++ b/content/renderer/loader/sync_load_context.cc
@@ -80,7 +80,7 @@ response_->request_time = info.request_time; response_->response_time = info.response_time; response_->load_timing = info.load_timing; - response_->devtools_info = info.devtools_info; + response_->raw_request_response_info = info.raw_request_response_info; response_->download_file_path = info.download_file_path; response_->socket_address = info.socket_address; }
diff --git a/content/renderer/loader/web_url_loader_impl.cc b/content/renderer/loader/web_url_loader_impl.cc index fefce106..a95025da 100644 --- a/content/renderer/loader/web_url_loader_impl.cc +++ b/content/renderer/loader/web_url_loader_impl.cc
@@ -93,7 +93,7 @@ namespace { -using HeadersVector = ResourceDevToolsInfo::HeadersVector; +using HeadersVector = network::HttpRawRequestResponseInfo::HeadersVector; class KeepAliveHandleWithChildProcessReference { public: @@ -1183,25 +1183,27 @@ response->SetLoadTiming(timing); } - if (info.devtools_info.get()) { + if (info.raw_request_response_info.get()) { WebHTTPLoadInfo load_info; - load_info.SetHTTPStatusCode(info.devtools_info->http_status_code); - load_info.SetHTTPStatusText( - WebString::FromLatin1(info.devtools_info->http_status_text)); + load_info.SetHTTPStatusCode( + info.raw_request_response_info->http_status_code); + load_info.SetHTTPStatusText(WebString::FromLatin1( + info.raw_request_response_info->http_status_text)); - load_info.SetRequestHeadersText( - WebString::FromLatin1(info.devtools_info->request_headers_text)); - load_info.SetResponseHeadersText( - WebString::FromLatin1(info.devtools_info->response_headers_text)); - const HeadersVector& request_headers = info.devtools_info->request_headers; + load_info.SetRequestHeadersText(WebString::FromLatin1( + info.raw_request_response_info->request_headers_text)); + load_info.SetResponseHeadersText(WebString::FromLatin1( + info.raw_request_response_info->response_headers_text)); + const HeadersVector& request_headers = + info.raw_request_response_info->request_headers; for (HeadersVector::const_iterator it = request_headers.begin(); it != request_headers.end(); ++it) { load_info.AddRequestHeader(WebString::FromLatin1(it->first), WebString::FromLatin1(it->second)); } const HeadersVector& response_headers = - info.devtools_info->response_headers; + info.raw_request_response_info->response_headers; for (HeadersVector::const_iterator it = response_headers.begin(); it != response_headers.end(); ++it) { load_info.AddResponseHeader(WebString::FromLatin1(it->first),
diff --git a/content/renderer/media/mock_peer_connection_impl.cc b/content/renderer/media/mock_peer_connection_impl.cc index 69dcf141e..b771f5c4 100644 --- a/content/renderer/media/mock_peer_connection_impl.cc +++ b/content/renderer/media/mock_peer_connection_impl.cc
@@ -155,6 +155,11 @@ NOTIMPLEMENTED(); } +std::vector<webrtc::RtpSource> FakeRtpReceiver::GetSources() const { + NOTIMPLEMENTED(); + return std::vector<webrtc::RtpSource>(); +} + const char MockPeerConnectionImpl::kDummyOffer[] = "dummy offer"; const char MockPeerConnectionImpl::kDummyAnswer[] = "dummy answer";
diff --git a/content/renderer/media/mock_peer_connection_impl.h b/content/renderer/media/mock_peer_connection_impl.h index 80955156..5fefcc6 100644 --- a/content/renderer/media/mock_peer_connection_impl.h +++ b/content/renderer/media/mock_peer_connection_impl.h
@@ -191,6 +191,7 @@ webrtc::RtpParameters GetParameters() const override; bool SetParameters(const webrtc::RtpParameters& parameters) override; void SetObserver(webrtc::RtpReceiverObserverInterface* observer) override; + std::vector<webrtc::RtpSource> GetSources() const override; private: rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track_;
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 3c6f2fa..0ef75ca 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -7042,6 +7042,15 @@ OnSetAccessibilityMode(new_mode); } +mojom::URLLoaderFactory* RenderFrameImpl::GetURLLoaderFactory( + const GURL& request_url) { + if (base::FeatureList::IsEnabled(features::kNetworkService)) { + return GetSubresourceLoaderFactories().GetFactoryForRequest(request_url); + } + + return GetDefaultURLLoaderFactoryGetter()->GetFactoryForURL(request_url); +} + blink::WebPlugin* RenderFrameImpl::GetWebPluginForFind() { if (frame_->GetDocument().IsPluginDocument()) return frame_->GetDocument().To<WebPluginDocument>().Plugin();
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index d7fbee8..da65f207 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -492,11 +492,9 @@ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner( blink::TaskType task_type) override; int GetEnabledBindings() const override; - // Returns non-null. - // It is invalid to call this in an incomplete env where - // RenderThreadImpl::current() returns nullptr (e.g. in some tests). - ChildURLLoaderFactoryGetter* GetDefaultURLLoaderFactoryGetter() override; void SetAccessibilityModeForTest(ui::AXMode new_mode) override; + mojom::URLLoaderFactory* GetURLLoaderFactory( + const GURL& request_url) override; // blink::mojom::EngagementClient implementation: void SetEngagementLevel(const url::Origin& origin, @@ -854,6 +852,12 @@ void ScrollFocusedEditableElementIntoRect(const gfx::Rect& rect); void DidChangeVisibleViewport(); + // Returns non-null. + // It is invalid to call this in an incomplete env where + // RenderThreadImpl::current() returns nullptr (e.g. in some tests). + // TODO(kinuko) We can remove this when network service is the only path. + ChildURLLoaderFactoryGetter* GetDefaultURLLoaderFactoryGetter(); + protected: explicit RenderFrameImpl(CreateParams params);
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 4cc50a0..8387597d 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1708,6 +1708,7 @@ "//services/file:lib", "//services/file/public/interfaces", "//services/metrics/public/interfaces", + "//services/network/public/cpp", "//services/network/public/interfaces:interfaces", "//services/proxy_resolver/:lib", "//services/service_manager/public/cpp:service_test_support",
diff --git a/device/BUILD.gn b/device/BUILD.gn index 2d16a92..4b13da7 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn
@@ -74,6 +74,7 @@ "test/run_all_unittests.cc", "u2f/u2f_apdu_unittest.cc", "u2f/u2f_ble_connection_unittest.cc", + "u2f/u2f_ble_device_unittest.cc", "u2f/u2f_ble_frames_unittest.cc", "u2f/u2f_discovery_unittest.cc", "u2f/u2f_message_unittest.cc",
diff --git a/device/u2f/BUILD.gn b/device/u2f/BUILD.gn index 4186098..b8ed68e 100644 --- a/device/u2f/BUILD.gn +++ b/device/u2f/BUILD.gn
@@ -13,10 +13,14 @@ "u2f_apdu_response.h", "u2f_ble_connection.cc", "u2f_ble_connection.h", + "u2f_ble_device.cc", + "u2f_ble_device.h", "u2f_ble_discovery.cc", "u2f_ble_discovery.h", "u2f_ble_frames.cc", "u2f_ble_frames.h", + "u2f_ble_transaction.cc", + "u2f_ble_transaction.h", "u2f_ble_uuids.cc", "u2f_ble_uuids.h", "u2f_command_type.h", @@ -68,6 +72,8 @@ testonly = true sources = [ + "mock_u2f_ble_connection.cc", + "mock_u2f_ble_connection.h", "mock_u2f_device.cc", "mock_u2f_device.h", "mock_u2f_discovery.cc",
diff --git a/device/u2f/mock_u2f_ble_connection.cc b/device/u2f/mock_u2f_ble_connection.cc new file mode 100644 index 0000000..7610a02 --- /dev/null +++ b/device/u2f/mock_u2f_ble_connection.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 "device/u2f/mock_u2f_ble_connection.h" + +#include <utility> + +namespace device { + +MockU2fBleConnection::MockU2fBleConnection(std::string device_address) + : U2fBleConnection(std::move(device_address)) {} + +MockU2fBleConnection::~MockU2fBleConnection() = default; + +void MockU2fBleConnection::ReadControlPointLength( + ControlPointLengthCallback callback) { + ReadControlPointLengthPtr(&callback); +} + +void MockU2fBleConnection::ReadServiceRevisions( + ServiceRevisionsCallback callback) { + ReadServiceRevisionsPtr(&callback); +} + +void MockU2fBleConnection::WriteControlPoint(const std::vector<uint8_t>& data, + WriteCallback callback) { + WriteControlPointPtr(data, &callback); +} + +void MockU2fBleConnection::WriteServiceRevision( + ServiceRevision service_revision, + WriteCallback callback) { + WriteServiceRevisionPtr(service_revision, &callback); +} + +} // namespace device
diff --git a/device/u2f/mock_u2f_ble_connection.h b/device/u2f/mock_u2f_ble_connection.h new file mode 100644 index 0000000..c73a618 --- /dev/null +++ b/device/u2f/mock_u2f_ble_connection.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 DEVICE_U2F_MOCK_U2F_BLE_CONNECTION_H_ +#define DEVICE_U2F_MOCK_U2F_BLE_CONNECTION_H_ + +#include <string> +#include <vector> + +#include "device/u2f/u2f_ble_connection.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace device { + +class MockU2fBleConnection : public U2fBleConnection { + public: + explicit MockU2fBleConnection(std::string device_address); + ~MockU2fBleConnection() override; + + MOCK_METHOD0(Connect, void()); + // GMock cannot mock a method taking a move-only type. + // TODO(https://crbug.com/729950): Remove these workarounds once support for + // move-only types is added to GMock. + MOCK_METHOD1(ReadControlPointLengthPtr, void(ControlPointLengthCallback* cb)); + MOCK_METHOD1(ReadServiceRevisionsPtr, void(ServiceRevisionsCallback* cb)); + MOCK_METHOD2(WriteControlPointPtr, + void(const std::vector<uint8_t>& data, WriteCallback* cb)); + MOCK_METHOD2(WriteServiceRevisionPtr, + void(ServiceRevision service_revision, WriteCallback* cb)); + + void ReadControlPointLength(ControlPointLengthCallback cb) override; + void ReadServiceRevisions(ServiceRevisionsCallback cb) override; + void WriteControlPoint(const std::vector<uint8_t>& data, + WriteCallback cb) override; + void WriteServiceRevision(ServiceRevision service_revision, + WriteCallback cb) override; + + ConnectionStatusCallback& connection_status_callback() { + return connection_status_callback_; + } + + ReadCallback& read_callback() { return read_callback_; } + + private: + ConnectionStatusCallback connection_status_callback_; + ReadCallback read_callback_; +}; + +} // namespace device + +#endif // DEVICE_U2F_MOCK_U2F_BLE_CONNECTION_H_
diff --git a/device/u2f/u2f_ble_connection.cc b/device/u2f/u2f_ble_connection.cc index d6b4f33b..8275f9c 100644 --- a/device/u2f/u2f_ble_connection.cc +++ b/device/u2f/u2f_ble_connection.cc
@@ -72,6 +72,9 @@ } // namespace +U2fBleConnection::U2fBleConnection(std::string device_address) + : address_(std::move(device_address)), weak_factory_(this) {} + U2fBleConnection::U2fBleConnection( std::string device_address, ConnectionStatusCallback connection_status_callback, @@ -80,8 +83,6 @@ connection_status_callback_(std::move(connection_status_callback)), read_callback_(std::move(read_callback)), weak_factory_(this) { - BluetoothAdapterFactory::GetAdapter( - base::Bind(&U2fBleConnection::OnGetAdapter, weak_factory_.GetWeakPtr())); DCHECK(!address_.empty()); } @@ -90,6 +91,11 @@ adapter_->RemoveObserver(this); } +void U2fBleConnection::Connect() { + BluetoothAdapterFactory::GetAdapter( + base::Bind(&U2fBleConnection::OnGetAdapter, weak_factory_.GetWeakPtr())); +} + void U2fBleConnection::ReadControlPointLength( ControlPointLengthCallback callback) { const BluetoothRemoteGattService* u2f_service = GetU2fService();
diff --git a/device/u2f/u2f_ble_connection.h b/device/u2f/u2f_ble_connection.h index a524ae7..eba9f85 100644 --- a/device/u2f/u2f_ble_connection.h +++ b/device/u2f/u2f_ble_connection.h
@@ -67,11 +67,16 @@ const std::string& address() const { return address_; } - void ReadControlPointLength(ControlPointLengthCallback callback); - void ReadServiceRevisions(ServiceRevisionsCallback callback); - void WriteControlPoint(const std::vector<uint8_t>& data, WriteCallback); - void WriteServiceRevision(ServiceRevision service_revision, - WriteCallback callback); + virtual void Connect(); + virtual void ReadControlPointLength(ControlPointLengthCallback callback); + virtual void ReadServiceRevisions(ServiceRevisionsCallback callback); + virtual void WriteControlPoint(const std::vector<uint8_t>& data, + WriteCallback callback); + virtual void WriteServiceRevision(ServiceRevision service_revision, + WriteCallback callback); + + protected: + explicit U2fBleConnection(std::string device_address); private: // BluetoothAdapter::Observer:
diff --git a/device/u2f/u2f_ble_connection_unittest.cc b/device/u2f/u2f_ble_connection_unittest.cc index 25defc8..eab914b 100644 --- a/device/u2f/u2f_ble_connection_unittest.cc +++ b/device/u2f/u2f_ble_connection_unittest.cc
@@ -432,6 +432,7 @@ U2fBleConnection connection(device_address, base::BindRepeating(connect_do_nothing), base::BindRepeating(read_do_nothing)); + connection.Connect(); EXPECT_EQ(device_address, connection.address()); AddU2Device(device_address); @@ -447,6 +448,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_FALSE(result); } @@ -461,6 +463,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(do_nothing)); + connection.Connect(); EXPECT_TRUE(connection_status_callback.WaitForResult()); } @@ -471,6 +474,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_FALSE(result); @@ -490,6 +494,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_TRUE(result); @@ -508,6 +513,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), read_callback.GetCallback()); + connection.Connect(); EXPECT_TRUE(connection_status_callback.WaitForResult()); std::vector<uint8_t> payload = ToByteVector("foo"); @@ -529,6 +535,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(read_do_nothing)); + connection.Connect(); EXPECT_TRUE(connection_status_callback.WaitForResult()); TestReadControlPointLengthCallback length_callback; @@ -565,6 +572,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(read_do_nothing)); + connection.Connect(); EXPECT_TRUE(connection_status_callback.WaitForResult()); TestReadServiceRevisionsCallback revisions_callback; @@ -664,6 +672,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(read_do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_TRUE(result); @@ -689,6 +698,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(read_do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_TRUE(result); @@ -735,6 +745,7 @@ U2fBleConnection connection(device_address, connection_status_callback.GetCallback(), base::BindRepeating(do_nothing)); + connection.Connect(); bool result = connection_status_callback.WaitForResult(); EXPECT_TRUE(result);
diff --git a/device/u2f/u2f_ble_device.cc b/device/u2f/u2f_ble_device.cc new file mode 100644 index 0000000..db320d8 --- /dev/null +++ b/device/u2f/u2f_ble_device.cc
@@ -0,0 +1,180 @@ +// 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 "device/u2f/u2f_ble_device.h" + +#include "base/bind.h" +#include "base/strings/string_piece.h" +#include "device/u2f/u2f_apdu_command.h" +#include "device/u2f/u2f_ble_frames.h" +#include "device/u2f/u2f_ble_transaction.h" + +namespace device { + +U2fBleDevice::U2fBleDevice(std::string address) : weak_factory_(this) { + connection_ = std::make_unique<U2fBleConnection>( + std::move(address), + base::BindRepeating(&U2fBleDevice::OnConnectionStatus, + base::Unretained(this)), + base::BindRepeating(&U2fBleDevice::OnStatusMessage, + base::Unretained(this))); + Transition(); +} + +U2fBleDevice::U2fBleDevice(std::unique_ptr<U2fBleConnection> connection) + : connection_(std::move(connection)), weak_factory_(this) {} + +U2fBleDevice::~U2fBleDevice() = default; + +void U2fBleDevice::SendPing(std::vector<uint8_t> data, + MessageCallback callback) { + pending_frames_.emplace( + U2fBleFrame(U2fCommandType::CMD_PING, std::move(data)), + base::BindOnce( + [](MessageCallback callback, base::Optional<U2fBleFrame> frame) { + std::move(callback).Run( + frame ? U2fReturnCode::SUCCESS : U2fReturnCode::FAILURE, + frame ? frame->data() : std::vector<uint8_t>()); + }, + std::move(callback))); + Transition(); +} + +// static +std::string U2fBleDevice::GetId(base::StringPiece address) { + return std::string("ble:").append(address.begin(), address.end()); +} + +void U2fBleDevice::TryWink(WinkCallback callback) { + // U2F over BLE does not support winking. + std::move(callback).Run(); +} + +std::string U2fBleDevice::GetId() const { + return GetId(connection_->address()); +} + +U2fBleConnection::ConnectionStatusCallback +U2fBleDevice::GetConnectionStatusCallbackForTesting() { + return base::BindRepeating(&U2fBleDevice::OnConnectionStatus, + base::Unretained(this)); +} + +U2fBleConnection::ReadCallback U2fBleDevice::GetReadCallbackForTesting() { + return base::BindRepeating(&U2fBleDevice::OnStatusMessage, + base::Unretained(this)); +} + +void U2fBleDevice::TransitionForTesting() { + Transition(); +} + +void U2fBleDevice::DeviceTransact(std::unique_ptr<U2fApduCommand> command, + DeviceCallback callback) { + pending_frames_.emplace( + U2fBleFrame(U2fCommandType::CMD_MSG, command->GetEncodedCommand()), + base::BindOnce( + [](DeviceCallback callback, base::Optional<U2fBleFrame> frame) { + std::move(callback).Run( + frame.has_value(), + frame ? U2fApduResponse::CreateFromMessage(frame->data()) + : nullptr); + }, + std::move(callback))); + Transition(); +} + +base::WeakPtr<U2fDevice> U2fBleDevice::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +void U2fBleDevice::Transition() { + switch (state_) { + case State::INIT: + StartTimeout(); + connection_->Connect(); + break; + case State::CONNECTED: + StartTimeout(); + connection_->ReadControlPointLength(base::BindOnce( + &U2fBleDevice::OnReadControlPointLength, base::Unretained(this))); + break; + case State::READY: + if (!pending_frames_.empty()) { + U2fBleFrame frame; + FrameCallback callback; + std::tie(frame, callback) = std::move(pending_frames_.front()); + pending_frames_.pop(); + SendRequestFrame(std::move(frame), std::move(callback)); + } + break; + case State::BUSY: + break; + case State::DEVICE_ERROR: + auto self = GetWeakPtr(); + // Executing callbacks may free |this|. Check |self| first. + while (self && !pending_frames_.empty()) { + // Respond to any pending frames. + FrameCallback cb = std::move(pending_frames_.front().second); + pending_frames_.pop(); + std::move(cb).Run(base::nullopt); + } + break; + } +} + +void U2fBleDevice::OnConnectionStatus(bool success) { + StopTimeout(); + state_ = success ? State::CONNECTED : State::DEVICE_ERROR; + Transition(); +} + +void U2fBleDevice::OnReadControlPointLength(base::Optional<uint16_t> length) { + StopTimeout(); + if (length) { + transaction_.emplace(connection_.get(), *length); + state_ = State::READY; + } else { + state_ = State::DEVICE_ERROR; + } + Transition(); +} + +void U2fBleDevice::OnStatusMessage(std::vector<uint8_t> data) { + if (transaction_) + transaction_->OnResponseFragment(std::move(data)); +} + +void U2fBleDevice::SendRequestFrame(U2fBleFrame frame, FrameCallback callback) { + state_ = State::BUSY; + transaction_->WriteRequestFrame( + std::move(frame), + base::BindOnce(&U2fBleDevice::OnResponseFrame, base::Unretained(this), + std::move(callback))); +} + +void U2fBleDevice::OnResponseFrame(FrameCallback callback, + base::Optional<U2fBleFrame> frame) { + state_ = frame ? State::READY : State::DEVICE_ERROR; + auto self = GetWeakPtr(); + std::move(callback).Run(std::move(frame)); + // Executing callbacks may free |this|. Check |self| first. + if (self) + Transition(); +} + +void U2fBleDevice::StartTimeout() { + timer_.Start(FROM_HERE, U2fDevice::kDeviceTimeout, this, + &U2fBleDevice::OnTimeout); +} + +void U2fBleDevice::StopTimeout() { + timer_.Stop(); +} + +void U2fBleDevice::OnTimeout() { + state_ = State::DEVICE_ERROR; +} + +} // namespace device
diff --git a/device/u2f/u2f_ble_device.h b/device/u2f/u2f_ble_device.h new file mode 100644 index 0000000..225e201 --- /dev/null +++ b/device/u2f/u2f_ble_device.h
@@ -0,0 +1,91 @@ +// 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 DEVICE_U2F_U2F_BLE_DEVICE_H_ +#define DEVICE_U2F_U2F_BLE_DEVICE_H_ + +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include "base/containers/queue.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/optional.h" +#include "base/strings/string_piece.h" +#include "base/timer/timer.h" +#include "device/u2f/u2f_ble_connection.h" +#include "device/u2f/u2f_ble_transaction.h" +#include "device/u2f/u2f_device.h" + +namespace device { + +class U2fApduCommand; +class U2fBleFrame; + +class U2fBleDevice : public U2fDevice { + public: + using FrameCallback = U2fBleTransaction::FrameCallback; + explicit U2fBleDevice(std::string address); + explicit U2fBleDevice(std::unique_ptr<U2fBleConnection> connection); + ~U2fBleDevice() override; + + void SendPing(std::vector<uint8_t> data, MessageCallback callback); + static std::string GetId(base::StringPiece address); + + // U2fDevice: + void TryWink(WinkCallback callback) override; + std::string GetId() const override; + + U2fBleConnection::ConnectionStatusCallback + GetConnectionStatusCallbackForTesting(); + U2fBleConnection::ReadCallback GetReadCallbackForTesting(); + void TransitionForTesting(); + + protected: + // U2fDevice: + void DeviceTransact(std::unique_ptr<U2fApduCommand> command, + DeviceCallback callback) override; + base::WeakPtr<U2fDevice> GetWeakPtr() override; + + private: + // INIT --> CONNECTED --> READY <--> BUSY. + // DEVICE_ERROR persists. + enum class State { INIT, CONNECTED, READY, BUSY, DEVICE_ERROR }; + + void Transition(); + + void OnConnectionStatus(bool success); + void OnStatusMessage(std::vector<uint8_t> data); + + void ReadControlPointLength(); + void OnReadControlPointLength(base::Optional<uint16_t> length); + + void SendPendingRequestFrame(); + void SendRequestFrame(U2fBleFrame frame, FrameCallback callback); + void OnResponseFrame(FrameCallback callback, + base::Optional<U2fBleFrame> frame); + + void StartTimeout(); + void StopTimeout(); + void OnTimeout(); + + State state_ = State::INIT; + base::OneShotTimer timer_; + + std::unique_ptr<U2fBleConnection> connection_; + uint16_t control_point_length_ = 0; + + base::queue<std::pair<U2fBleFrame, FrameCallback>> pending_frames_; + base::Optional<U2fBleTransaction> transaction_; + + base::WeakPtrFactory<U2fBleDevice> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(U2fBleDevice); +}; + +} // namespace device + +#endif // DEVICE_U2F_U2F_BLE_DEVICE_H_
diff --git a/device/u2f/u2f_ble_device_unittest.cc b/device/u2f/u2f_ble_device_unittest.cc new file mode 100644 index 0000000..d375be803 --- /dev/null +++ b/device/u2f/u2f_ble_device_unittest.cc
@@ -0,0 +1,154 @@ +// 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 "device/u2f/u2f_ble_device.h" + +#include "base/optional.h" +#include "base/run_loop.h" +#include "base/test/scoped_task_environment.h" +#include "device/bluetooth/test/bluetooth_test.h" +#include "device/u2f/mock_u2f_ble_connection.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace device { + +using ::testing::_; +using ::testing::Invoke; +using ::testing::Test; + +namespace { + +class TestMessageCallback { + public: + void OnMessage(U2fReturnCode code, const std::vector<uint8_t>& data) { + result_ = std::make_pair(code, data); + run_loop_->Quit(); + } + + const std::pair<U2fReturnCode, std::vector<uint8_t>>& WaitForResult() { + run_loop_->Run(); + run_loop_.emplace(); + return result_; + } + + U2fDevice::MessageCallback GetCallback() { + return base::BindRepeating(&TestMessageCallback::OnMessage, + base::Unretained(this)); + } + + private: + std::pair<U2fReturnCode, std::vector<uint8_t>> result_; + base::Optional<base::RunLoop> run_loop_{base::in_place}; +}; + +} // namespace + +class U2fBleDeviceTest : public Test { + public: + U2fBleDeviceTest() { + auto connection = std::make_unique<MockU2fBleConnection>( + BluetoothTestBase::kTestDeviceAddress1); + connection_ = connection.get(); + device_ = std::make_unique<U2fBleDevice>(std::move(connection)); + connection_->connection_status_callback() = + device_->GetConnectionStatusCallbackForTesting(); + connection_->read_callback() = device_->GetReadCallbackForTesting(); + } + + U2fBleDevice* device() { return device_.get(); } + MockU2fBleConnection* connection() { return connection_; } + + void ConnectWithLength(uint16_t length) { + EXPECT_CALL(*connection(), Connect()).WillOnce(Invoke([this] { + connection()->connection_status_callback().Run(true); + })); + + EXPECT_CALL(*connection(), ReadControlPointLengthPtr(_)) + .WillOnce(Invoke([length](auto* cb) { std::move(*cb).Run(length); })); + + device()->TransitionForTesting(); + } + + protected: + base::test::ScopedTaskEnvironment scoped_task_environment_{ + base::test::ScopedTaskEnvironment::MainThreadType::MOCK_TIME}; + + private: + MockU2fBleConnection* connection_; + std::unique_ptr<U2fBleDevice> device_; +}; + +TEST_F(U2fBleDeviceTest, ConnectionFailureTest) { + EXPECT_CALL(*connection(), Connect()).WillOnce(Invoke([this] { + connection()->connection_status_callback().Run(false); + })); + device()->TransitionForTesting(); +} + +TEST_F(U2fBleDeviceTest, SendPingTest_Failure_Callback) { + ConnectWithLength(20); + + EXPECT_CALL(*connection(), WriteControlPointPtr(_, _)) + .WillOnce(Invoke( + [this](const auto& data, auto* cb) { std::move(*cb).Run(false); })); + + TestMessageCallback callback; + device()->SendPing({'T', 'E', 'S', 'T'}, callback.GetCallback()); + + EXPECT_EQ(std::make_pair(U2fReturnCode::FAILURE, std::vector<uint8_t>()), + callback.WaitForResult()); +} + +TEST_F(U2fBleDeviceTest, SendPingTest_Failure_Timeout) { + ConnectWithLength(20); + + EXPECT_CALL(*connection(), WriteControlPointPtr(_, _)) + .WillOnce(Invoke([this](const auto& data, auto* cb) { + scoped_task_environment_.FastForwardBy(U2fDevice::kDeviceTimeout); + })); + + TestMessageCallback callback; + device()->SendPing({'T', 'E', 'S', 'T'}, callback.GetCallback()); + + EXPECT_EQ(std::make_pair(U2fReturnCode::FAILURE, std::vector<uint8_t>()), + callback.WaitForResult()); +} + +TEST_F(U2fBleDeviceTest, SendPingTest) { + ConnectWithLength(20); + + const std::vector<uint8_t> ping_data = {'T', 'E', 'S', 'T'}; + EXPECT_CALL(*connection(), WriteControlPointPtr(_, _)) + .WillOnce(Invoke([this](const auto& data, auto* cb) { + auto almost_time_out = + U2fDevice::kDeviceTimeout - base::TimeDelta::FromMicroseconds(1); + scoped_task_environment_.FastForwardBy(almost_time_out); + connection()->read_callback().Run(data); + std::move(*cb).Run(true); + })); + + TestMessageCallback callback; + device()->SendPing(ping_data, callback.GetCallback()); + EXPECT_EQ(std::make_pair(U2fReturnCode::SUCCESS, ping_data), + callback.WaitForResult()); +} + +TEST_F(U2fBleDeviceTest, StaticGetIdTest) { + std::string address = BluetoothTestBase::kTestDeviceAddress1; + EXPECT_EQ("ble:" + address, U2fBleDevice::GetId(address)); +} + +TEST_F(U2fBleDeviceTest, TryWinkTest) { + base::RunLoop run_loop; + device()->TryWink(run_loop.QuitClosure()); + run_loop.Run(); +} + +TEST_F(U2fBleDeviceTest, GetIdTest) { + EXPECT_EQ(std::string("ble:") + BluetoothTestBase::kTestDeviceAddress1, + device()->GetId()); +} + +} // namespace device
diff --git a/device/u2f/u2f_ble_discovery.cc b/device/u2f/u2f_ble_discovery.cc index 117dcd3c8..cc27079 100644 --- a/device/u2f/u2f_ble_discovery.cc +++ b/device/u2f/u2f_ble_discovery.cc
@@ -16,48 +16,11 @@ #include "device/bluetooth/bluetooth_discovery_session.h" #include "device/bluetooth/bluetooth_uuid.h" #include "device/u2f/u2f_apdu_command.h" +#include "device/u2f/u2f_ble_device.h" #include "device/u2f/u2f_ble_uuids.h" -#include "device/u2f/u2f_device.h" namespace device { -namespace { - -// TODO(crbug/763303): Remove this once a U2fDevice for BLE is implemented. -class U2fFakeBleDevice : public U2fDevice { - public: - static std::string GetId(base::StringPiece address) { - std::string result = "ble:"; - result.append(address.data(), address.size()); - return result; - } - - explicit U2fFakeBleDevice(base::StringPiece address) - : id_(GetId(address)), weak_factory_(this) {} - - ~U2fFakeBleDevice() override = default; - - void TryWink(WinkCallback callback) override {} - std::string GetId() const override { return id_; } - - protected: - void DeviceTransact(std::unique_ptr<U2fApduCommand> command, - DeviceCallback callback) override { - std::move(callback).Run(false, nullptr); - } - - base::WeakPtr<U2fDevice> GetWeakPtr() override { - return weak_factory_.GetWeakPtr(); - } - - private: - std::string id_; - - base::WeakPtrFactory<U2fFakeBleDevice> weak_factory_; -}; - -} // namespace - U2fBleDiscovery::U2fBleDiscovery() : weak_factory_(this) {} U2fBleDiscovery::~U2fBleDiscovery() { @@ -108,7 +71,7 @@ for (BluetoothDevice* device : adapter_->GetDevices()) { if (base::ContainsKey(device->GetUUIDs(), U2fServiceUUID())) { VLOG(2) << "U2F BLE device: " << device->GetAddress(); - AddDevice(std::make_unique<U2fFakeBleDevice>(device->GetAddress())); + AddDevice(std::make_unique<U2fBleDevice>(device->GetAddress())); } } @@ -145,7 +108,7 @@ BluetoothDevice* device) { if (base::ContainsKey(device->GetUUIDs(), U2fServiceUUID())) { VLOG(2) << "Discovered U2F BLE device: " << device->GetAddress(); - AddDevice(std::make_unique<U2fFakeBleDevice>(device->GetAddress())); + AddDevice(std::make_unique<U2fBleDevice>(device->GetAddress())); } }
diff --git a/device/u2f/u2f_ble_frames.cc b/device/u2f/u2f_ble_frames.cc index 0c30d22..73a0372 100644 --- a/device/u2f/u2f_ble_frames.cc +++ b/device/u2f/u2f_ble_frames.cc
@@ -49,7 +49,7 @@ } std::pair<U2fBleFrameInitializationFragment, - std::vector<U2fBleFrameContinuationFragment>> + base::queue<U2fBleFrameContinuationFragment>> U2fBleFrame::ToFragments(size_t max_fragment_size) const { DCHECK_LE(data_.size(), std::numeric_limits<uint16_t>::max()); DCHECK_GE(max_fragment_size, 3u); @@ -65,7 +65,7 @@ U2fBleFrameInitializationFragment initial_fragment( command_, data_view.size(), data_view.first(init_fragment_size)); - std::vector<U2fBleFrameContinuationFragment> other_fragments; + base::queue<U2fBleFrameContinuationFragment> other_fragments; data_view = data_view.subspan(init_fragment_size); while (!data_view.empty()) { @@ -73,8 +73,8 @@ const size_t cont_fragment_size = std::min(max_fragment_size - 1, data_view.size()); // High bit must stay cleared. - other_fragments.emplace_back(data_view.first(cont_fragment_size), - other_fragments.size() & 0x7F); + other_fragments.emplace(data_view.first(cont_fragment_size), + other_fragments.size() & 0x7F); data_view = data_view.subspan(cont_fragment_size); }
diff --git a/device/u2f/u2f_ble_frames.h b/device/u2f/u2f_ble_frames.h index 972cf417e..c40efc5 100644 --- a/device/u2f/u2f_ble_frames.h +++ b/device/u2f/u2f_ble_frames.h
@@ -10,6 +10,7 @@ #include <utility> #include <vector> +#include "base/containers/queue.h" #include "base/containers/span.h" #include "base/macros.h" #include "device/u2f/u2f_command_type.h" @@ -77,7 +78,7 @@ // The |max_fragment_size| parameter ought to be at least 3. The resulting // fragments' binary sizes will not exceed this value. std::pair<U2fBleFrameInitializationFragment, - std::vector<U2fBleFrameContinuationFragment>> + base::queue<U2fBleFrameContinuationFragment>> ToFragments(size_t max_fragment_size) const; private: @@ -99,12 +100,13 @@ class U2fBleFrameFragment { public: base::span<const uint8_t> fragment() const { return fragment_; } + virtual size_t Serialize(std::vector<uint8_t>* buffer) const = 0; protected: U2fBleFrameFragment(); explicit U2fBleFrameFragment(base::span<const uint8_t> fragment); U2fBleFrameFragment(const U2fBleFrameFragment& frame); - ~U2fBleFrameFragment(); + virtual ~U2fBleFrameFragment(); private: base::span<const uint8_t> fragment_; @@ -127,7 +129,7 @@ U2fCommandType command() const { return command_; } uint16_t data_length() const { return data_length_; } - size_t Serialize(std::vector<uint8_t>* buffer) const; + size_t Serialize(std::vector<uint8_t>* buffer) const override; private: U2fCommandType command_ = U2fCommandType::UNDEFINED; @@ -147,7 +149,7 @@ uint8_t sequence() const { return sequence_; } - size_t Serialize(std::vector<uint8_t>* buffer) const; + size_t Serialize(std::vector<uint8_t>* buffer) const override; private: uint8_t sequence_ = 0;
diff --git a/device/u2f/u2f_ble_frames_fuzzer.cc b/device/u2f/u2f_ble_frames_fuzzer.cc index e5ce2dd..f74d1c7 100644 --- a/device/u2f/u2f_ble_frames_fuzzer.cc +++ b/device/u2f/u2f_ble_frames_fuzzer.cc
@@ -46,8 +46,9 @@ auto fragments = frame.ToFragments(20); device::U2fBleFrameAssembler assembler(fragments.first); - for (const auto& fragment : fragments.second) { - assembler.AddFragment(fragment); + while (!fragments.second.empty()) { + assembler.AddFragment(fragments.second.front()); + fragments.second.pop(); } auto result_frame = std::move(*assembler.GetFrame());
diff --git a/device/u2f/u2f_ble_frames_unittest.cc b/device/u2f/u2f_ble_frames_unittest.cc index 6d7a15a..62ccae0 100644 --- a/device/u2f/u2f_ble_frames_unittest.cc +++ b/device/u2f/u2f_ble_frames_unittest.cc
@@ -77,8 +77,9 @@ static_cast<size_t>(fragments.first.data_length())); U2fBleFrameAssembler assembler(fragments.first); - for (const auto& fragment : fragments.second) { - ASSERT_TRUE(assembler.AddFragment(fragment)); + while (!fragments.second.empty()) { + ASSERT_TRUE(assembler.AddFragment(fragments.second.front())); + fragments.second.pop(); } EXPECT_TRUE(assembler.IsDone()); @@ -96,13 +97,13 @@ auto fragments = frame.ToFragments(20); ASSERT_EQ(1u, fragments.second.size()); - fragments.second[0] = - U2fBleFrameContinuationFragment(fragments.second[0].fragment(), 51); + fragments.second.front() = + U2fBleFrameContinuationFragment(fragments.second.front().fragment(), 51); U2fBleFrameAssembler assembler(fragments.first); EXPECT_FALSE(assembler.IsDone()); EXPECT_FALSE(assembler.GetFrame()); - EXPECT_FALSE(assembler.AddFragment(fragments.second[0])); + EXPECT_FALSE(assembler.AddFragment(fragments.second.front())); EXPECT_FALSE(assembler.IsDone()); EXPECT_FALSE(assembler.GetFrame()); }
diff --git a/device/u2f/u2f_ble_transaction.cc b/device/u2f/u2f_ble_transaction.cc new file mode 100644 index 0000000..1cb5902c --- /dev/null +++ b/device/u2f/u2f_ble_transaction.cc
@@ -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. + +#include "device/u2f/u2f_ble_transaction.h" + +#include <utility> + +#include "device/u2f/u2f_ble_connection.h" +#include "device/u2f/u2f_device.h" + +namespace device { + +U2fBleTransaction::U2fBleTransaction(U2fBleConnection* connection, + uint16_t control_point_length) + : connection_(connection), + control_point_length_(control_point_length), + weak_factory_(this) { + buffer_.reserve(control_point_length_); +} + +U2fBleTransaction::~U2fBleTransaction() = default; + +void U2fBleTransaction::WriteRequestFrame(U2fBleFrame request_frame, + FrameCallback callback) { + DCHECK(!request_frame_ && callback_.is_null()); + request_frame_ = std::move(request_frame); + callback_ = std::move(callback); + + U2fBleFrameInitializationFragment request_init_fragment; + std::tie(request_init_fragment, request_cont_fragments_) = + request_frame_->ToFragments(control_point_length_); + WriteRequestFragment(request_init_fragment); +} + +void U2fBleTransaction::WriteRequestFragment( + const U2fBleFrameFragment& fragment) { + buffer_.clear(); + fragment.Serialize(&buffer_); + // A weak pointer is required, since this call might time out. If that + // happens, the current U2fBleTransaction could be destroyed. + connection_->WriteControlPoint( + buffer_, base::BindOnce(&U2fBleTransaction::OnRequestFragmentWritten, + weak_factory_.GetWeakPtr())); + // WriteRequestFragment() expects an invocation of OnRequestFragmentWritten() + // soon after. + StartTimeout(); +} + +void U2fBleTransaction::OnRequestFragmentWritten(bool success) { + StopTimeout(); + if (!success) { + OnError(); + return; + } + + if (request_cont_fragments_.empty()) { + // The transaction wrote the full request frame. A response should follow + // soon after. + StartTimeout(); + return; + } + + auto next_request_fragment = std::move(request_cont_fragments_.front()); + request_cont_fragments_.pop(); + WriteRequestFragment(next_request_fragment); +} + +void U2fBleTransaction::OnResponseFragment(std::vector<uint8_t> data) { + StopTimeout(); + if (!response_frame_assembler_) { + U2fBleFrameInitializationFragment fragment; + if (!U2fBleFrameInitializationFragment::Parse(data, &fragment)) { + DLOG(ERROR) << "Malformed Frame Initialization Fragment"; + OnError(); + return; + } + + response_frame_assembler_.emplace(fragment); + } else { + U2fBleFrameContinuationFragment fragment; + if (!U2fBleFrameContinuationFragment::Parse(data, &fragment)) { + DLOG(ERROR) << "Malformed Frame Continuation Fragment"; + OnError(); + return; + } + + response_frame_assembler_->AddFragment(fragment); + } + + if (!response_frame_assembler_->IsDone()) { + // Expect the next reponse fragment to arrive soon. + StartTimeout(); + return; + } + + U2fBleFrame frame = std::move(*response_frame_assembler_->GetFrame()); + response_frame_assembler_.reset(); + ProcessResponseFrame(std::move(frame)); +} + +void U2fBleTransaction::ProcessResponseFrame(U2fBleFrame response_frame) { + if (response_frame.command() == request_frame_->command()) { + request_frame_.reset(); + std::move(callback_).Run(std::move(response_frame)); + return; + } + + if (response_frame.command() == U2fCommandType::CMD_KEEPALIVE) { + DVLOG(2) << "CMD_KEEPALIVE: " + << static_cast<uint8_t>(response_frame.GetKeepaliveCode()); + // Expect another reponse frame soon. + StartTimeout(); + return; + } + + DCHECK_EQ(response_frame.command(), U2fCommandType::CMD_ERROR); + DLOG(ERROR) << "CMD_ERROR: " + << static_cast<uint8_t>(response_frame.GetErrorCode()); + OnError(); +} + +void U2fBleTransaction::StartTimeout() { + timer_.Start(FROM_HERE, U2fDevice::kDeviceTimeout, this, + &U2fBleTransaction::OnError); +} + +void U2fBleTransaction::StopTimeout() { + timer_.Stop(); +} + +void U2fBleTransaction::OnError() { + request_frame_.reset(); + request_cont_fragments_ = {}; + response_frame_assembler_.reset(); + std::move(callback_).Run(base::nullopt); +} + +} // namespace device
diff --git a/device/u2f/u2f_ble_transaction.h b/device/u2f/u2f_ble_transaction.h new file mode 100644 index 0000000..29861e20 --- /dev/null +++ b/device/u2f/u2f_ble_transaction.h
@@ -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. + +#ifndef DEVICE_U2F_U2F_BLE_TRANSACTION_H_ +#define DEVICE_U2F_U2F_BLE_TRANSACTION_H_ + +#include <memory> +#include <vector> + +#include "base/containers/queue.h" +#include "base/memory/weak_ptr.h" +#include "base/optional.h" +#include "base/timer/timer.h" +#include "device/u2f/u2f_ble_frames.h" + +namespace device { + +class U2fBleConnection; + +// This class encapsulates logic related to a single U2F BLE request and +// response. U2fBleTransaction is owned by U2fBleDevice, which is the only class +// that should make use of this class. +class U2fBleTransaction { + public: + using FrameCallback = base::OnceCallback<void(base::Optional<U2fBleFrame>)>; + + U2fBleTransaction(U2fBleConnection* connection, + uint16_t control_point_length); + ~U2fBleTransaction(); + + void WriteRequestFrame(U2fBleFrame request_frame, FrameCallback callback); + void OnResponseFragment(std::vector<uint8_t> data); + + private: + void WriteRequestFragment(const U2fBleFrameFragment& fragment); + void OnRequestFragmentWritten(bool success); + void ProcessResponseFrame(U2fBleFrame response_frame); + + void StartTimeout(); + void StopTimeout(); + void OnError(); + + U2fBleConnection* connection_; + uint16_t control_point_length_; + + base::Optional<U2fBleFrame> request_frame_; + FrameCallback callback_; + + base::queue<U2fBleFrameContinuationFragment> request_cont_fragments_; + base::Optional<U2fBleFrameAssembler> response_frame_assembler_; + + std::vector<uint8_t> buffer_; + base::OneShotTimer timer_; + + base::WeakPtrFactory<U2fBleTransaction> weak_factory_; +}; + +} // namespace device + +#endif // DEVICE_U2F_U2F_BLE_TRANSACTION_H_
diff --git a/device/u2f/u2f_device.cc b/device/u2f/u2f_device.cc index 1a51edc..d1880d4 100644 --- a/device/u2f/u2f_device.cc +++ b/device/u2f/u2f_device.cc
@@ -12,7 +12,9 @@ namespace device { -U2fDevice::U2fDevice() : channel_id_(kBroadcastChannel), capabilities_(0) {} +constexpr base::TimeDelta U2fDevice::kDeviceTimeout; + +U2fDevice::U2fDevice() = default; U2fDevice::~U2fDevice() = default;
diff --git a/device/u2f/u2f_device.h b/device/u2f/u2f_device.h index d6177ad..25ea2a58 100644 --- a/device/u2f/u2f_device.h +++ b/device/u2f/u2f_device.h
@@ -36,6 +36,9 @@ std::unique_ptr<U2fApduResponse> response)>; using WinkCallback = base::OnceCallback<void()>; + static constexpr auto kDeviceTimeout = base::TimeDelta::FromSeconds(3); + + U2fDevice(); virtual ~U2fDevice(); // Raw messages parameters are defined by the specification at @@ -54,21 +57,12 @@ virtual std::string GetId() const = 0; protected: - static constexpr uint8_t kWinkCapability = 0x01; - static constexpr uint8_t kLockCapability = 0x02; - static constexpr uint32_t kBroadcastChannel = 0xffffffff; - - U2fDevice(); - // Pure virtual function defined by each device type, implementing // the device communication transaction. virtual void DeviceTransact(std::unique_ptr<U2fApduCommand> command, DeviceCallback callback) = 0; virtual base::WeakPtr<U2fDevice> GetWeakPtr() = 0; - uint32_t channel_id_; - uint8_t capabilities_; - private: void OnRegisterComplete(MessageCallback callback, bool success,
diff --git a/device/u2f/u2f_hid_device.cc b/device/u2f/u2f_hid_device.cc index dd67474..29d2397 100644 --- a/device/u2f/u2f_hid_device.cc +++ b/device/u2f/u2f_hid_device.cc
@@ -27,9 +27,7 @@ U2fHidDevice::U2fHidDevice(device::mojom::HidDeviceInfoPtr device_info, device::mojom::HidManager* hid_manager) - : U2fDevice(), - state_(State::INIT), - hid_manager_(hid_manager), + : hid_manager_(hid_manager), device_info_(std::move(device_info)), weak_factory_(this) {} @@ -328,8 +326,7 @@ std::move(callback))); // Setup timeout task for 3 seconds base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, timeout_callback_.callback(), - base::TimeDelta::FromMilliseconds(3000)); + FROM_HERE, timeout_callback_.callback(), kDeviceTimeout); } void U2fHidDevice::OnTimeout(DeviceCallback callback) {
diff --git a/device/u2f/u2f_hid_device.h b/device/u2f/u2f_hid_device.h index 5e279545..2307e38c 100644 --- a/device/u2f/u2f_hid_device.h +++ b/device/u2f/u2f_hid_device.h
@@ -43,6 +43,10 @@ FRIEND_TEST_ALL_PREFIXES(U2fHidDeviceTest, TestConnectionFailure); FRIEND_TEST_ALL_PREFIXES(U2fHidDeviceTest, TestDeviceError); + static constexpr uint8_t kWinkCapability = 0x01; + static constexpr uint8_t kLockCapability = 0x02; + static constexpr uint32_t kBroadcastChannel = 0xffffffff; + // Internal state machine states enum class State { INIT, CONNECTED, BUSY, IDLE, DEVICE_ERROR }; @@ -96,7 +100,10 @@ std::unique_ptr<U2fApduResponse> response); base::WeakPtr<U2fDevice> GetWeakPtr() override; - State state_; + uint32_t channel_id_ = kBroadcastChannel; + uint8_t capabilities_ = 0; + State state_ = State::INIT; + base::CancelableOnceClosure timeout_callback_; std::queue<std::pair<std::unique_ptr<U2fApduCommand>, DeviceCallback>> pending_transactions_;
diff --git a/google_apis/gaia/gaia_auth_fetcher.h b/google_apis/gaia/gaia_auth_fetcher.h index 0c4ae11c..e339fc4 100644 --- a/google_apis/gaia/gaia_auth_fetcher.h +++ b/google_apis/gaia/gaia_auth_fetcher.h
@@ -284,11 +284,6 @@ static const char kClientLoginToOAuth2CookiePartCodePrefix[]; static const int kClientLoginToOAuth2CookiePartCodePrefixLength; - // Process the results of a ClientLogin fetch. - void OnClientLoginFetched(const std::string& data, - const net::URLRequestStatus& status, - int response_code); - void OnIssueAuthTokenFetched(const std::string& data, const net::URLRequestStatus& status, int response_code); @@ -414,7 +409,7 @@ GURL deprecated_client_login_to_oauth2_gurl_; std::string request_body_; - std::string requested_service_; // Currently tracked for IssueAuthToken only. + std::string requested_service_; // Currently tracked for IssueAuthToken only. bool fetch_pending_ = false; bool fetch_token_from_auth_code_ = false;
diff --git a/ios/PRESUBMIT.py b/ios/PRESUBMIT.py index 896409b..eb6f23d 100644 --- a/ios/PRESUBMIT.py +++ b/ios/PRESUBMIT.py
@@ -8,8 +8,43 @@ for more details about the presubmit API built into depot_tools. """ +import os + TODO_PATTERN = r'TO[D]O\(([^\)]*)\)' CRBUG_PATTERN = r'crbug\.com/\d+$' +ARC_COMPILE_GUARD = '''\ +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif +''' + +def _CheckARCCompilationGuard(input_api, output_api): + """ Checks whether new objc files have proper ARC compile guards.""" + files_without_headers = [] + for f in input_api.AffectedFiles(): + if f.Action() != 'A': + continue + + _, ext = os.path.splitext(f.LocalPath()) + if ext not in ('.m', '.mm'): + continue + + if ARC_COMPILE_GUARD not in f.NewContents(): + files_without_headers.append(f.LocalPath()) + + if not files_without_headers: + return [] + + plural_suffix = '' if len(files_without_headers) == 1 else 's' + error_message = '\n'.join([ + 'Found new Objective-C implementation file%(plural)s without compile' + ' guard%(plural)s. Please use the following compile guard' + ':' % {'plural': plural_suffix}, + ARC_COMPILE_GUARD, + ] + files_without_headers) + '\n' + + return [output_api.PresubmitError(error_message)] + def _CheckBugInToDo(input_api, output_api): """ Checks whether TODOs in ios code are identified by a bug number.""" @@ -40,6 +75,7 @@ def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CheckBugInToDo(input_api, output_api)) + results.extend(_CheckARCCompilationGuard(input_api, output_api)) return results def PostUploadHook(cl, change, output_api):
diff --git a/ios/PRESUBMIT_test.py b/ios/PRESUBMIT_test.py index e50ff3d..f8d2935 100644 --- a/ios/PRESUBMIT_test.py +++ b/ios/PRESUBMIT_test.py
@@ -11,6 +11,48 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import PRESUBMIT_test_mocks +class CheckARCCompilationGuardTest(unittest.TestCase): + """Test the _CheckARCCompilationGuard presubmit check.""" + + def testGoodImplementationFiles(self): + """Test that .m and .mm files with a guard don't raise any errors.""" + text = "foobar \n" + PRESUBMIT.ARC_COMPILE_GUARD + mock_input = PRESUBMIT_test_mocks.MockInputApi() + mock_input.files = [ + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', text), + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', text), + ] + mock_output = PRESUBMIT_test_mocks.MockOutputApi() + errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output) + self.assertEqual(len(errors), 0) + + def testBadImplementationFiles(self): + """Test that .m and .mm files without a guard raise an error.""" + text = "foobar \n" + mock_input = PRESUBMIT_test_mocks.MockInputApi() + mock_input.files = [ + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', text), + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', text), + ] + mock_output = PRESUBMIT_test_mocks.MockOutputApi() + errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output) + self.assertEqual(len(errors), 1) + self.assertEqual('error', errors[0].type) + self.assertTrue('ios/path/foo_controller.m' in errors[0].message) + self.assertTrue('ios/path/foo_controller.mm' in errors[0].message) + + def testOtherFiles(self): + """Test that other files without a guard don't raise errors.""" + text = "foobar \n" + mock_input = PRESUBMIT_test_mocks.MockInputApi() + mock_input.files = [ + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.h', text), + PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.cc', text), + PRESUBMIT_test_mocks.MockFile('ios/path/BUILD.gn', text), + ] + mock_output = PRESUBMIT_test_mocks.MockOutputApi() + errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output) + self.assertEqual(len(errors), 0) class CheckTODOFormatTest(unittest.TestCase): """Test the _CheckBugInToDo presubmit check."""
diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn index 4e594159..abc845d 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn
@@ -202,6 +202,7 @@ "//ios/chrome/browser/ui/stack_view", "//ios/chrome/browser/ui/tab_switcher", "//ios/chrome/browser/ui/tabs", + "//ios/chrome/browser/ui/toolbar/clean:toolbar_ui", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/webui:webui_internal", "//ios/chrome/browser/upgrade",
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index 87d48bee..623e0d7 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -132,6 +132,7 @@ #import "ios/chrome/browser/ui/signin_interaction/signin_interaction_coordinator.h" #import "ios/chrome/browser/ui/stack_view/stack_view_controller.h" #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h" +#import "ios/chrome/browser/ui/toolbar/clean/omnibox_focuser.h" #include "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/top_view_controller.h" @@ -2163,7 +2164,7 @@ }; case FOCUS_OMNIBOX: return ^{ - [self.currentBVC focusOmnibox]; + [self.currentBVC.dispatcher focusOmnibox]; }; default: return nil;
diff --git a/ios/chrome/browser/autofill/form_suggestion_label.h b/ios/chrome/browser/autofill/form_suggestion_label.h index bebf177..11dfaa0 100644 --- a/ios/chrome/browser/autofill/form_suggestion_label.h +++ b/ios/chrome/browser/autofill/form_suggestion_label.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" @class FormSuggestion; @protocol FormSuggestionViewClient;
diff --git a/ios/chrome/browser/crash_report/crash_report_background_uploader.mm b/ios/chrome/browser/crash_report/crash_report_background_uploader.mm index 9258c76..8766157 100644 --- a/ios/chrome/browser/crash_report/crash_report_background_uploader.mm +++ b/ios/chrome/browser/crash_report/crash_report_background_uploader.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/mac/scoped_block.h" -#include "base/mac/scoped_nsobject.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h"
diff --git a/ios/chrome/browser/crash_report/crash_report_multi_parameter.mm b/ios/chrome/browser/crash_report/crash_report_multi_parameter.mm index 61df079..3648e129 100644 --- a/ios/chrome/browser/crash_report/crash_report_multi_parameter.mm +++ b/ios/chrome/browser/crash_report/crash_report_multi_parameter.mm
@@ -8,7 +8,6 @@ #include "base/json/json_writer.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h" #import "ios/chrome/browser/crash_report/breakpad_helper.h" @@ -25,7 +24,7 @@ } @implementation CrashReportMultiParameter { - base::scoped_nsobject<NSString> crashReportKey_; + NSString* crashReportKey_; std::unique_ptr<base::DictionaryValue> dictionary_; } @@ -38,7 +37,7 @@ if ((self = [super init])) { DCHECK([key length] && ([key length] <= kMaximumBreakpadValueSize)); dictionary_.reset(new base::DictionaryValue()); - crashReportKey_.reset([key copy]); + crashReportKey_ = [key copy]; } return self; }
diff --git a/ios/chrome/browser/device_sharing/device_sharing_manager.mm b/ios/chrome/browser/device_sharing/device_sharing_manager.mm index 5449d181..299519b 100644 --- a/ios/chrome/browser/device_sharing/device_sharing_manager.mm +++ b/ios/chrome/browser/device_sharing/device_sharing_manager.mm
@@ -6,7 +6,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #import "components/handoff/handoff_manager.h" #include "components/handoff/pref_names_ios.h" #include "components/prefs/pref_change_registrar.h" @@ -29,7 +28,7 @@ std::unique_ptr<PrefChangeRegistrar> _browserStatePrefChangeRegistrar; // Responsible for maintaining all state related to the Handoff feature. - base::scoped_nsobject<HandoffManager> _handoffManager; + HandoffManager* _handoffManager; } // If handoff is enabled for the active browser state, then this method ensures @@ -76,12 +75,12 @@ _browserState && _browserState->GetPrefs()->GetBoolean(prefs::kIosHandoffToOtherDevices); if (!handoffEnabled) { - _handoffManager.reset(); + _handoffManager = nil; return; } if (!_handoffManager) - _handoffManager.reset([[self class] createHandoffManager]); + _handoffManager = [[self class] createHandoffManager]; } + (HandoffManager*)createHandoffManager { @@ -101,7 +100,7 @@ @implementation DeviceSharingManager (TestingOnly) - (HandoffManager*)handoffManager { - return _handoffManager.get(); + return _handoffManager; } @end
diff --git a/ios/chrome/browser/find_in_page/find_tab_helper.h b/ios/chrome/browser/find_in_page/find_tab_helper.h index 18b3195a..3c04d8e 100644 --- a/ios/chrome/browser/find_in_page/find_tab_helper.h +++ b/ios/chrome/browser/find_in_page/find_tab_helper.h
@@ -8,7 +8,6 @@ #include <Foundation/Foundation.h> #include "base/ios/block_types.h" -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "ios/web/public/web_state/web_state_observer.h" #import "ios/web/public/web_state/web_state_user_data.h" @@ -85,7 +84,7 @@ void WebStateDestroyed(web::WebState* web_state) override; // The ObjC find in page controller. - base::scoped_nsobject<FindInPageController> controller_; + FindInPageController* controller_; DISALLOW_COPY_AND_ASSIGN(FindTabHelper); };
diff --git a/ios/chrome/browser/find_in_page/find_tab_helper.mm b/ios/chrome/browser/find_in_page/find_tab_helper.mm index 69ef677..118f55a 100644 --- a/ios/chrome/browser/find_in_page/find_tab_helper.mm +++ b/ios/chrome/browser/find_in_page/find_tab_helper.mm
@@ -29,9 +29,9 @@ web::WebState* web_state, id<FindInPageControllerDelegate> controller_delegate) { web_state->AddObserver(this); - controller_.reset([[FindInPageController alloc] - initWithWebState:web_state - delegate:controller_delegate]); + controller_ = + [[FindInPageController alloc] initWithWebState:web_state + delegate:controller_delegate]; } FindTabHelper::~FindTabHelper() {} @@ -40,14 +40,14 @@ FindInPageCompletionBlock completion) { [controller_ findStringInPage:search_term completionHandler:^{ - FindInPageModel* model = controller_.get().findInPageModel; + FindInPageModel* model = controller_.findInPageModel; completion(model); }]; } void FindTabHelper::ContinueFinding(FindDirection direction, FindInPageCompletionBlock completion) { - FindInPageModel* model = controller_.get().findInPageModel; + FindInPageModel* model = controller_.findInPageModel; if (direction == FORWARD) { [controller_ findNextStringInPageWithCompletionHandler:^{ @@ -70,7 +70,7 @@ } FindInPageModel* FindTabHelper::GetFindResult() const { - return controller_.get().findInPageModel; + return controller_.findInPageModel; } bool FindTabHelper::CurrentPageSupportsFindInPage() const { @@ -78,11 +78,11 @@ } bool FindTabHelper::IsFindUIActive() const { - return controller_.get().findInPageModel.enabled; + return controller_.findInPageModel.enabled; } void FindTabHelper::SetFindUIActive(bool active) { - controller_.get().findInPageModel.enabled = active; + controller_.findInPageModel.enabled = active; } void FindTabHelper::PersistSearchTerm() {
diff --git a/ios/chrome/browser/geolocation/location_manager_unittest.mm b/ios/chrome/browser/geolocation/location_manager_unittest.mm index 2b2ca9b..f77ddb97 100644 --- a/ios/chrome/browser/geolocation/location_manager_unittest.mm +++ b/ios/chrome/browser/geolocation/location_manager_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/geolocation/location_manager.h" -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/geolocation/CLLocation+OmniboxGeolocation.h" #import "ios/chrome/browser/geolocation/location_manager+Testing.h" #import "ios/public/provider/chrome/browser/geolocation_updater_provider.h" @@ -28,12 +27,12 @@ void SetUp() override { PlatformTest::SetUp(); - mock_geolocation_updater_.reset( - [OCMockObject mockForProtocol:@protocol(GeolocationUpdater)]); + mock_geolocation_updater_ = + [OCMockObject mockForProtocol:@protocol(GeolocationUpdater)]; // Set up LocationManager with a mock GeolocationUpdater. - location_manager_.reset([[LocationManager alloc] init]); - [location_manager_ setGeolocationUpdater:mock_geolocation_updater_.get()]; + location_manager_ = [[LocationManager alloc] init]; + [location_manager_ setGeolocationUpdater:mock_geolocation_updater_]; } void TearDown() override { @@ -42,8 +41,8 @@ PlatformTest::TearDown(); } - base::scoped_nsobject<id> mock_geolocation_updater_; - base::scoped_nsobject<LocationManager> location_manager_; + id mock_geolocation_updater_; + LocationManager* location_manager_; }; // Verifies that -[LocationManager startUpdatingLocation] calls @@ -60,7 +59,7 @@ [[mock_geolocation_updater_ expect] setEnabled:YES]; [location_manager_ startUpdatingLocation]; - EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_.get()); + EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_); } // Verifies that -[LocationManager startUpdatingLocation] calls @@ -69,13 +68,12 @@ TEST_F(LocationManagerTest, StartUpdatingLocationStaleCurrentLocation) { // Set up to return a stale mock CLLocation from -[GeolocationUpdater // currentLocation]. - base::scoped_nsobject<id> mock_location( - [OCMockObject mockForClass:[CLLocation class]]); + id mock_location = [OCMockObject mockForClass:[CLLocation class]]; BOOL yes = YES; [[[mock_location expect] andReturnValue:OCMOCK_VALUE(yes)] cr_shouldRefresh]; - [[[mock_geolocation_updater_ expect] - andReturn:mock_location.get()] currentLocation]; + [[[mock_geolocation_updater_ expect] andReturn:mock_location] + currentLocation]; // Also expect the call to -[GeolocationUpdater isEnabled]; BOOL no = NO; @@ -85,8 +83,8 @@ [[mock_geolocation_updater_ expect] setEnabled:YES]; [location_manager_ startUpdatingLocation]; - EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_.get()); - EXPECT_OCMOCK_VERIFY(mock_location.get()); + EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_); + EXPECT_OCMOCK_VERIFY(mock_location); } // Verifies that -[LocationManager startUpdatingLocation] does not call @@ -95,17 +93,16 @@ TEST_F(LocationManagerTest, StartUpdatingLocationFreshCurrentLocation) { // Set up to return a fresh mock CLLocation from -[GeolocationUpdater // currentLocation]. - base::scoped_nsobject<id> mock_location( - [OCMockObject mockForClass:[CLLocation class]]); + id mock_location = [OCMockObject mockForClass:[CLLocation class]]; BOOL no = NO; [[[mock_location expect] andReturnValue:OCMOCK_VALUE(no)] cr_shouldRefresh]; - [[[mock_geolocation_updater_ expect] - andReturn:mock_location.get()] currentLocation]; + [[[mock_geolocation_updater_ expect] andReturn:mock_location] + currentLocation]; [location_manager_ startUpdatingLocation]; - EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_.get()); - EXPECT_OCMOCK_VERIFY(mock_location.get()); + EXPECT_OCMOCK_VERIFY(mock_geolocation_updater_); + EXPECT_OCMOCK_VERIFY(mock_location); } } // namespace
diff --git a/ios/chrome/browser/geolocation/omnibox_geolocation_local_state_unittest.mm b/ios/chrome/browser/geolocation/omnibox_geolocation_local_state_unittest.mm index 0dab769..ccca57d 100644 --- a/ios/chrome/browser/geolocation/omnibox_geolocation_local_state_unittest.mm +++ b/ios/chrome/browser/geolocation/omnibox_geolocation_local_state_unittest.mm
@@ -7,7 +7,6 @@ #include <memory> #include <string> -#include "base/mac/scoped_nsobject.h" #include "components/prefs/testing_pref_service.h" #include "ios/chrome/browser/geolocation/location_manager.h" #include "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" @@ -25,14 +24,14 @@ class OmniboxGeolocationLocalStateTest : public PlatformTest { protected: OmniboxGeolocationLocalStateTest() { - location_manager_.reset([[LocationManager alloc] init]); - local_state_.reset([[OmniboxGeolocationLocalState alloc] - initWithLocationManager:location_manager_]); + location_manager_ = [[LocationManager alloc] init]; + local_state_ = [[OmniboxGeolocationLocalState alloc] + initWithLocationManager:location_manager_]; } IOSChromeScopedTestingLocalState scoped_local_state_; - base::scoped_nsobject<LocationManager> location_manager_; - base::scoped_nsobject<OmniboxGeolocationLocalState> local_state_; + LocationManager* location_manager_; + OmniboxGeolocationLocalState* local_state_; }; TEST_F(OmniboxGeolocationLocalStateTest, LastAuthorizationAlertVersion) {
diff --git a/ios/chrome/browser/infobars/infobar.h b/ios/chrome/browser/infobars/infobar.h index a106a88..8702c95 100644 --- a/ios/chrome/browser/infobars/infobar.h +++ b/ios/chrome/browser/infobars/infobar.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "components/infobars/core/infobar.h" #import "ios/chrome/browser/ui/infobars/infobar_view_delegate.h" @@ -46,7 +45,7 @@ void InfoBarDidCancel() override; void InfoBarButtonDidPress(NSUInteger button_id) override; - base::scoped_nsobject<InfoBarController> controller_; + InfoBarController* controller_; DISALLOW_COPY_AND_ASSIGN(InfoBarIOS); };
diff --git a/ios/chrome/browser/infobars/infobar.mm b/ios/chrome/browser/infobars/infobar.mm index f8ef44d..e82721d 100644 --- a/ios/chrome/browser/infobars/infobar.mm +++ b/ios/chrome/browser/infobars/infobar.mm
@@ -27,11 +27,11 @@ InfoBarIOS::~InfoBarIOS() { DCHECK(controller_); [controller_ detachView]; - controller_.reset(); + controller_ = nil; } void InfoBarIOS::SetController(InfoBarController* controller) { - controller_.reset(controller); + controller_ = controller; } void InfoBarIOS::Layout(CGRect container_bounds) {
diff --git a/ios/chrome/browser/infobars/infobar_container_ios.h b/ios/chrome/browser/infobars/infobar_container_ios.h index 2acd8fef..e4c7cfd 100644 --- a/ios/chrome/browser/infobars/infobar_container_ios.h +++ b/ios/chrome/browser/infobars/infobar_container_ios.h
@@ -9,7 +9,6 @@ #include <stddef.h> -#include "base/mac/scoped_nsobject.h" #include "base/macros.h" @class InfoBarContainerView; @@ -38,7 +37,7 @@ void PlatformSpecificInfoBarStateChanged(bool is_animating) override; private: - base::scoped_nsobject<InfoBarContainerView> container_view_; + InfoBarContainerView* container_view_; InfoBarContainer::Delegate* delegate_; DISALLOW_COPY_AND_ASSIGN(InfoBarContainerIOS);
diff --git a/ios/chrome/browser/infobars/infobar_container_ios.mm b/ios/chrome/browser/infobars/infobar_container_ios.mm index 9293c94..7d9182dd 100644 --- a/ios/chrome/browser/infobars/infobar_container_ios.mm +++ b/ios/chrome/browser/infobars/infobar_container_ios.mm
@@ -41,7 +41,7 @@ infobars::InfoBarContainer::Delegate* delegate) : InfoBarContainer(delegate), delegate_(delegate) { DCHECK(delegate); - container_view_.reset([[InfoBarContainerView alloc] init]); + container_view_ = [[InfoBarContainerView alloc] init]; [container_view_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin]; }
diff --git a/ios/chrome/browser/net/retryable_url_fetcher_unittest.mm b/ios/chrome/browser/net/retryable_url_fetcher_unittest.mm index 011e587e6..05acad0 100644 --- a/ios/chrome/browser/net/retryable_url_fetcher_unittest.mm +++ b/ios/chrome/browser/net/retryable_url_fetcher_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/net/retryable_url_fetcher.h" -#import "base/mac/scoped_nsobject.h" #include "base/message_loop/message_loop.h" #import "base/strings/sys_string_conversions.h" #include "ios/web/public/test/test_web_thread.h" @@ -71,7 +70,7 @@ protected: void SetUp() override { PlatformTest::SetUp(); - test_delegate_.reset([[TestRetryableURLFetcherDelegate alloc] init]); + test_delegate_ = [[TestRetryableURLFetcherDelegate alloc] init]; io_thread_.reset( new web::TestWebThread(web::WebThread::IO, &message_loop_)); } @@ -79,17 +78,16 @@ net::TestURLFetcherFactory factory_; std::unique_ptr<web::TestWebThread> io_thread_; base::MessageLoop message_loop_; - base::scoped_nsobject<TestRetryableURLFetcherDelegate> test_delegate_; + TestRetryableURLFetcherDelegate* test_delegate_; }; TEST_F(RetryableURLFetcherTest, TestResponse200) { scoped_refptr<net::URLRequestContextGetter> request_context_getter = new net::TestURLRequestContextGetter(message_loop_.task_runner()); - base::scoped_nsobject<RetryableURLFetcher> retryableFetcher( - [[RetryableURLFetcher alloc] - initWithRequestContextGetter:request_context_getter.get() - delegate:test_delegate_.get() - backoffPolicy:nil]); + RetryableURLFetcher* retryableFetcher = [[RetryableURLFetcher alloc] + initWithRequestContextGetter:request_context_getter.get() + delegate:test_delegate_ + backoffPolicy:nil]; [retryableFetcher startFetch]; // Manually calls the delegate. @@ -106,11 +104,10 @@ TEST_F(RetryableURLFetcherTest, TestResponse404) { scoped_refptr<net::URLRequestContextGetter> request_context_getter = new net::TestURLRequestContextGetter(message_loop_.task_runner()); - base::scoped_nsobject<RetryableURLFetcher> retryableFetcher( - [[RetryableURLFetcher alloc] - initWithRequestContextGetter:request_context_getter.get() - delegate:test_delegate_.get() - backoffPolicy:nil]); + RetryableURLFetcher* retryableFetcher = [[RetryableURLFetcher alloc] + initWithRequestContextGetter:request_context_getter.get() + delegate:test_delegate_ + backoffPolicy:nil]; [retryableFetcher startFetch]; // Manually calls the delegate. @@ -129,13 +126,12 @@ TEST_F(RetryableURLFetcherTest, TestFailingURLNoRetry) { scoped_refptr<net::URLRequestContextGetter> request_context_getter = new net::TestURLRequestContextGetter(message_loop_.task_runner()); - base::scoped_nsobject<TestFailingURLFetcherDelegate> failing_delegate( - [[TestFailingURLFetcherDelegate alloc] init]); - base::scoped_nsobject<RetryableURLFetcher> retryable_fetcher( - [[RetryableURLFetcher alloc] - initWithRequestContextGetter:request_context_getter.get() - delegate:failing_delegate.get() - backoffPolicy:nil]); + TestFailingURLFetcherDelegate* failing_delegate = + [[TestFailingURLFetcherDelegate alloc] init]; + RetryableURLFetcher* retryable_fetcher = [[RetryableURLFetcher alloc] + initWithRequestContextGetter:request_context_getter.get() + delegate:failing_delegate + backoffPolicy:nil]; [retryable_fetcher startFetch]; // |failing_delegate| does not have URL to fetch, so a fetcher should never
diff --git a/ios/chrome/browser/passwords/js_password_manager.mm b/ios/chrome/browser/passwords/js_password_manager.mm index 09f89a5..371ab3b 100644 --- a/ios/chrome/browser/passwords/js_password_manager.mm +++ b/ios/chrome/browser/passwords/js_password_manager.mm
@@ -44,8 +44,9 @@ - (void)extractForm:(NSString*)formName completionHandler:(void (^)(NSString*))completionHandler { DCHECK(completionHandler); - NSString* extra = [NSString - stringWithFormat:@"__gCrWeb.getPasswordForm(%@)", JSONEscape(formName)]; + NSString* extra = + [NSString stringWithFormat:@"__gCrWeb.getPasswordFormDataAsString(%@)", + JSONEscape(formName)]; [self evaluateExtraScript:extra completionHandler:completionHandler]; }
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm index a7b72223..2aaed06 100644 --- a/ios/chrome/browser/passwords/password_controller.mm +++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -471,10 +471,6 @@ didSubmitDocumentWithFormNamed:(const std::string&)formName userInitiated:(BOOL)userInitiated isMainFrame:(BOOL)isMainFrame { - if (!isMainFrame) { - // Saving from iframes is not implemented. - return; - } DCHECK_EQ(webState_, webState); __weak PasswordController* weakSelf = self; // This code is racing against the new page loading and will not get the @@ -485,8 +481,15 @@ PasswordController* strongSelf = weakSelf; if (strongSelf && ![strongSelf isWebStateDestroyed] && strongSelf.passwordManager) { - strongSelf.passwordManager->OnPasswordFormSubmitted( - strongSelf.passwordManagerDriver, form); + if (isMainFrame) { + strongSelf.passwordManager->OnPasswordFormSubmitted( + strongSelf.passwordManagerDriver, form); + } else { + // Show a save prompt immediately because for iframes it is very hard to + // figure out correctness of password forms submission. + strongSelf.passwordManager->OnPasswordFormSubmittedNoChecks( + strongSelf.passwordManagerDriver, form); + } } }; [self extractSubmittedPasswordForm:formName
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index aa7e9fa4..bfc7516f 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -1541,3 +1541,51 @@ testing::Mock::VerifyAndClearExpectations(&log_manager); } } + +// Tests that a touchend event from a button which contains in a password form +// works as a submission indicator for this password form. +TEST_F(PasswordControllerTest, SavingFromSameOriginIframe) { + // Use a mock LogManager to detect that OnInPageNavigation has been + // called. TODO(crbug.com/598672): this is a hack, we should modularize the + // code better to allow proper unit-testing. + MockLogManager log_manager; + EXPECT_CALL(*weak_client_, GetLogManager()) + .WillRepeatedly(Return(&log_manager)); + EXPECT_CALL(log_manager, IsLoggingActive()).WillRepeatedly(Return(true)); + const char kExpectedMessage[] = + "Message: \"PasswordManager::OnInPageNavigation\"\n"; + + // The standard pattern is to use a __block variable WaitUntilCondition but + // __block variable can't be captured in C++ lambda, so as workaround it's + // used normal variable |get_logins_called| and pointer on it is used in a + // block. + bool expected_message_logged = false; + bool* p_expected_message_logged = &expected_message_logged; + + EXPECT_CALL(log_manager, LogSavePasswordProgress(kExpectedMessage)) + .WillOnce(testing::Invoke( + [&expected_message_logged](const std::string& message) { + expected_message_logged = true; + })); + + EXPECT_CALL(log_manager, + LogSavePasswordProgress(testing::Ne(kExpectedMessage))) + .Times(testing::AnyNumber()); + + LoadHtml(@"<iframe id='frame1'></iframe>"); + ExecuteJavaScript( + @"document.getElementById('frame1').contentDocument.body.innerHTML = " + "'<form id=\"form1\">" + "<input type=\"text\" name=\"text\" value=\"user1\" id=\"id2\">" + "<input type=\"password\" name=\"password\" value=\"pw1\" id=\"id2\">" + "<input type=\"submit\" id=\"submit_input\"/>" + "</form>'"); + ExecuteJavaScript( + @"document.getElementById('frame1').contentDocument.getElementById('" + @"submit_input').click();"); + + // Wait until expected message is called. + EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool() { + return *p_expected_message_logged; + })); +}
diff --git a/ios/chrome/browser/passwords/resources/password_controller.js b/ios/chrome/browser/passwords/resources/password_controller.js index 28993a3..03ed8b3f 100644 --- a/ios/chrome/browser/passwords/resources/password_controller.js +++ b/ios/chrome/browser/passwords/resources/password_controller.js
@@ -136,13 +136,33 @@ return null; } + /** + * Returns the password form with the given |identifier| as a JSON string + * from the frame |win| and all its same-origin subframes. + * @param {Window} The window in which to look for forms. + * @param {string} identifier The name of the form to extract. + * @return {Element} The password form. + */ + var getPasswordFormElement_ = function(win, identifier) { + var el = win.__gCrWeb.common.getFormElementFromIdentifier(identifier); + if (el) + return el; + var frames = getSameOriginFrames_(win); + for (var i = 0; i < frames.length; ++i) { + el = getPasswordFormElement_(frames[i], identifier); + if (el) + return el; + } + return null; + } + /** - * Returns the password form with the given |name| as a JSON string. + * Returns the password form with the given |identifier| as a JSON string. * @param {string} name The name of the form to extract. * @return {string} The password form. */ - __gCrWeb['getPasswordForm'] = function(name) { - var el = __gCrWeb.common.getFormElementFromIdentifier(name); + __gCrWeb['getPasswordFormDataAsString'] = function(identifier) { + var el = getPasswordFormElement_(window, identifier); if (!el) return 'noPasswordsFound'; var formData = __gCrWeb.getPasswordFormData(el);
diff --git a/ios/chrome/browser/payments/ios_payment_instrument.h b/ios/chrome/browser/payments/ios_payment_instrument.h index 4d81b429..954ecd5 100644 --- a/ios/chrome/browser/payments/ios_payment_instrument.h +++ b/ios/chrome/browser/payments/ios_payment_instrument.h
@@ -10,7 +10,6 @@ #include <map> #include <string> -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/string16.h" #include "components/payments/core/payment_instrument.h" @@ -73,7 +72,7 @@ std::string method_name_; GURL universal_link_; std::string app_name_; - base::scoped_nsobject<UIImage> icon_image_; + UIImage* icon_image_; id<PaymentRequestUIDelegate> payment_request_ui_delegate_;
diff --git a/ios/chrome/browser/share_extension/share_extension_service.mm b/ios/chrome/browser/share_extension/share_extension_service.mm index bbb587bc..f1f35ce 100644 --- a/ios/chrome/browser/share_extension/share_extension_service.mm +++ b/ios/chrome/browser/share_extension/share_extension_service.mm
@@ -4,7 +4,6 @@ #include "ios/chrome/browser/share_extension/share_extension_service.h" -#include "base/mac/scoped_nsobject.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/reading_list/core/reading_list_model.h" #include "ios/chrome/browser/share_extension/share_extension_item_receiver.h"
diff --git a/ios/chrome/browser/signin/authentication_service.h b/ios/chrome/browser/signin/authentication_service.h index ef41241..7356cac4c 100644 --- a/ios/chrome/browser/signin/authentication_service.h +++ b/ios/chrome/browser/signin/authentication_service.h
@@ -9,7 +9,6 @@ #include <vector> #import "base/ios/block_types.h" -#include "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" #include "components/keyed_service/core/keyed_service.h" @@ -196,10 +195,10 @@ bool is_reloading_credentials_; // Map between account IDs and their associated MDM error. - std::map<std::string, base::scoped_nsobject<NSDictionary>> cached_mdm_infos_; + std::map<std::string, NSDictionary*> cached_mdm_infos_; - base::scoped_nsobject<id> foreground_observer_; - base::scoped_nsobject<id> background_observer_; + id foreground_observer_; + id background_observer_; ScopedObserver<ios::ChromeIdentityService, ios::ChromeIdentityService::Observer>
diff --git a/ios/chrome/browser/signin/authentication_service.mm b/ios/chrome/browser/signin/authentication_service.mm index 1ab210c..ce9dd2a 100644 --- a/ios/chrome/browser/signin/authentication_service.mm +++ b/ios/chrome/browser/signin/authentication_service.mm
@@ -123,20 +123,20 @@ OnApplicationEnterForeground(); NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; - foreground_observer_.reset([center - addObserverForName:UIApplicationWillEnterForegroundNotification - object:nil - queue:nil - usingBlock:^(NSNotification* notification) { - OnApplicationEnterForeground(); - }]); - background_observer_.reset([center - addObserverForName:UIApplicationDidEnterBackgroundNotification - object:nil - queue:nil - usingBlock:^(NSNotification* notification) { - OnApplicationEnterBackground(); - }]); + foreground_observer_ = + [center addObserverForName:UIApplicationWillEnterForegroundNotification + object:nil + queue:nil + usingBlock:^(NSNotification* notification) { + OnApplicationEnterForeground(); + }]; + background_observer_ = + [center addObserverForName:UIApplicationDidEnterBackgroundNotification + object:nil + queue:nil + usingBlock:^(NSNotification* notification) { + OnApplicationEnterBackground(); + }]; identity_service_observer_.Add( ios::GetChromeBrowserProvider()->GetChromeIdentityService()); @@ -187,8 +187,7 @@ ProfileOAuth2TokenServiceIOSDelegate* token_service_delegate = static_cast<ProfileOAuth2TokenServiceIOSDelegate*>( token_service_->GetDelegate()); - std::map<std::string, base::scoped_nsobject<NSDictionary>> cached_mdm_infos( - cached_mdm_infos_); + std::map<std::string, NSDictionary*> cached_mdm_infos(cached_mdm_infos_); cached_mdm_infos_.clear(); for (const auto& cached_mdm_info : cached_mdm_infos) { token_service_delegate->AddOrUpdateAccount(cached_mdm_info.first); @@ -413,7 +412,7 @@ return nil; } - return it->second.get(); + return it->second; } bool AuthenticationService::HasCachedMDMErrorForIdentity( @@ -489,8 +488,8 @@ } }; if (identity_service->HandleMDMNotification(identity, user_info, callback)) { - cached_mdm_infos_[ChromeIdentityToAccountID(browser_state_, identity)] - .reset(user_info); + cached_mdm_infos_[ChromeIdentityToAccountID(browser_state_, identity)] = + user_info; return true; } return false;
diff --git a/ios/chrome/browser/signin/authentication_service_fake.h b/ios/chrome/browser/signin/authentication_service_fake.h index 68e16650..bce1e42b 100644 --- a/ios/chrome/browser/signin/authentication_service_fake.h +++ b/ios/chrome/browser/signin/authentication_service_fake.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/signin/authentication_service.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity.h"
diff --git a/ios/chrome/browser/signin/authentication_service_unittest.mm b/ios/chrome/browser/signin/authentication_service_unittest.mm index e0090b6..a68cbaf 100644 --- a/ios/chrome/browser/signin/authentication_service_unittest.mm +++ b/ios/chrome/browser/signin/authentication_service_unittest.mm
@@ -220,8 +220,8 @@ void SetCachedMDMInfo(ChromeIdentity* identity, NSDictionary* user_info) { authentication_service_ - ->cached_mdm_infos_[base::SysNSStringToUTF8([identity gaiaID])] - .reset(user_info); + ->cached_mdm_infos_[base::SysNSStringToUTF8([identity gaiaID])] = + user_info; } bool HasCachedMDMInfo(ChromeIdentity* identity) {
diff --git a/ios/chrome/browser/signin/browser_state_data_remover.h b/ios/chrome/browser/signin/browser_state_data_remover.h index 6902424..e57bb85 100644 --- a/ios/chrome/browser/signin/browser_state_data_remover.h +++ b/ios/chrome/browser/signin/browser_state_data_remover.h
@@ -6,7 +6,6 @@ #define IOS_CHROME_BROWSER_SIGNIN_BROWSER_STATE_DATA_REMOVER_H_ #include "base/ios/block_types.h" -#include "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" namespace ios { @@ -47,7 +46,7 @@ bool reading_list_cleaned); ios::ChromeBrowserState* browser_state_; - base::scoped_nsprotocol<ProceduralBlock> callback_; + ProceduralBlock callback_; IOSChromeBrowsingDataRemover::CallbackSubscription callback_subscription_; std::unique_ptr<reading_list::ReadingListRemoverHelper> reading_list_remover_helper_;
diff --git a/ios/chrome/browser/signin/browser_state_data_remover.mm b/ios/chrome/browser/signin/browser_state_data_remover.mm index 6fdfe8f..712b01e 100644 --- a/ios/chrome/browser/signin/browser_state_data_remover.mm +++ b/ios/chrome/browser/signin/browser_state_data_remover.mm
@@ -51,7 +51,7 @@ void BrowserStateDataRemover::RemoveBrowserStateData(ProceduralBlock callback) { DCHECK(!callback_); - callback_.reset([callback copy]); + callback_ = [callback copy]; ClearBrowsingDataCommand* command = [[ClearBrowsingDataCommand alloc] initWithBrowserState:browser_state_ @@ -96,7 +96,7 @@ } if (callback_) - callback_.get()(); + callback_(); base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); }
diff --git a/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm b/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm index 9ef744f9..d78181f3 100644 --- a/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm +++ b/ios/chrome/browser/signin/gaia_auth_fetcher_ios.mm
@@ -287,19 +287,19 @@ return nil; } if (!web_view_) { - web_view_.reset(BuildWKWebView()); - navigation_delegate_.reset( - [[GaiaAuthFetcherNavigationDelegate alloc] initWithBridge:this]); + web_view_ = BuildWKWebView(); + navigation_delegate_ = + [[GaiaAuthFetcherNavigationDelegate alloc] initWithBridge:this]; [web_view_ setNavigationDelegate:navigation_delegate_]; } - return web_view_.get(); + return web_view_; } void GaiaAuthFetcherIOSBridge::ResetWKWebView() { [web_view_ setNavigationDelegate:nil]; [web_view_ stopLoading]; - web_view_.reset(); - navigation_delegate_.reset(); + web_view_ = nil; + navigation_delegate_ = nil; } WKWebView* GaiaAuthFetcherIOSBridge::BuildWKWebView() {
diff --git a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h index a009310..766549c 100644 --- a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h +++ b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_private.h
@@ -7,7 +7,6 @@ #import <WebKit/WebKit.h> -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "components/signin/ios/browser/active_state_manager.h" @@ -100,9 +99,9 @@ Request request_; // Navigation delegate of |web_view_| that informs the bridge of relevant // navigation events. - base::scoped_nsobject<GaiaAuthFetcherNavigationDelegate> navigation_delegate_; + GaiaAuthFetcherNavigationDelegate* navigation_delegate_; // Web view used to do the network requests. - base::scoped_nsobject<WKWebView> web_view_; + WKWebView* web_view_; DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcherIOSBridge); };
diff --git a/ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.mm b/ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.mm index 80cfc7ac4..3bc677c 100644 --- a/ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.mm +++ b/ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.mm
@@ -10,10 +10,6 @@ @implementation FakeSnapshotGeneratorDelegate -- (UIImage*)defaultSnapshotImage { - return nil; -} - - (BOOL)canTakeSnapshotForWebState:(web::WebState*)webState { return YES; }
diff --git a/ios/chrome/browser/snapshots/snapshot_generator.h b/ios/chrome/browser/snapshots/snapshot_generator.h index dfc0442..74709ef 100644 --- a/ios/chrome/browser/snapshots/snapshot_generator.h +++ b/ios/chrome/browser/snapshots/snapshot_generator.h
@@ -58,6 +58,9 @@ // Requests deletion of the current page snapshot from disk and memory. - (void)removeSnapshot; +// Returns an image to use as replacement of a missing snapshot. ++ (UIImage*)defaultSnapshotImage; + // The SnapshotGenerator delegate. @property(nonatomic, weak) id<SnapshotGeneratorDelegate> delegate;
diff --git a/ios/chrome/browser/snapshots/snapshot_generator.mm b/ios/chrome/browser/snapshots/snapshot_generator.mm index 3c19901..e5796c9 100644 --- a/ios/chrome/browser/snapshots/snapshot_generator.mm +++ b/ios/chrome/browser/snapshots/snapshot_generator.mm
@@ -191,7 +191,7 @@ // Return default snapshot without caching it if the generation failed. if (!snapshot) - return [_delegate defaultSnapshotImage]; + return [[self class] defaultSnapshotImage]; UIImage* snapshotToCache = snapshot; if (!visibleFrameOnly) { @@ -254,6 +254,23 @@ [self.snapshotCache removeImageWithSessionID:_snapshotSessionId]; } ++ (UIImage*)defaultSnapshotImage { + static UIImage* defaultSnapshotImage = nil; + if (!defaultSnapshotImage) { + CGRect frame = CGRectMake(0, 0, 2, 2); + UIGraphicsBeginImageContext(frame.size); + [[UIColor whiteColor] setFill]; + CGContextFillRect(UIGraphicsGetCurrentContext(), frame); + + UIImage* result = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + defaultSnapshotImage = + [result stretchableImageWithLeftCapWidth:1 topCapHeight:1]; + } + return defaultSnapshotImage; +} + #pragma mark - Private methods - (UIImage*)generateSnapshotForView:(UIView*)view
diff --git a/ios/chrome/browser/snapshots/snapshot_generator_delegate.h b/ios/chrome/browser/snapshots/snapshot_generator_delegate.h index 101d986..1c39be3 100644 --- a/ios/chrome/browser/snapshots/snapshot_generator_delegate.h +++ b/ios/chrome/browser/snapshots/snapshot_generator_delegate.h
@@ -17,9 +17,6 @@ // Protocol for the SnapshotGenerator's delegate. @protocol SnapshotGeneratorDelegate -// Returns the default image to return when the snapshot cannot be generated. -- (UIImage*)defaultSnapshotImage; - // Returns whether it is possible to capture a snapshot for |webState|. - (BOOL)canTakeSnapshotForWebState:(web::WebState*)webState;
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper.h b/ios/chrome/browser/snapshots/snapshot_tab_helper.h index 990b4ab..5caef5f 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper.h +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper.h
@@ -62,6 +62,9 @@ // Requests deletion of the current page snapshot from disk and memory. void RemoveSnapshot(); + // Returns an image to use as replacement of a missing snapshot. + static UIImage* GetDefaultSnapshotImage(); + private: SnapshotTabHelper(web::WebState* web_state, NSString* session_id);
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper.mm b/ios/chrome/browser/snapshots/snapshot_tab_helper.mm index 65cf3eb..d89b518 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper.mm +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper.mm
@@ -139,6 +139,11 @@ [snapshot_generator_ removeSnapshot]; } +// static +UIImage* SnapshotTabHelper::GetDefaultSnapshotImage() { + return [SnapshotGenerator defaultSnapshotImage]; +} + SnapshotTabHelper::SnapshotTabHelper(web::WebState* web_state, NSString* session_id) : web_state_(web_state) {
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm index 4856dbe..b5dece45 100644 --- a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm +++ b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm
@@ -28,13 +28,10 @@ using ui::test::uiimage_utils::UIImageWithSizeAndSolidColor; // SnapshotGeneratorDelegate used to test SnapshotTabHelper by allowing to -// set a default snapshot image, control whether capturing a snapshot is -// possible and to count the number of snapshot generated. +// count the number of snapshot generated and control whether capturing a +// snapshot is possible. @interface TabHelperSnapshotGeneratorDelegate : FakeSnapshotGeneratorDelegate -// Initialize the delegate with the default snapshot image. -- (instancetype)initWithDefaultSnapshotImage:(UIImage*)defaultSnapshotImage; - // Returns the number of times a snapshot was captured (count the number of // calls to -willUpdateSnapshotForWebState:). @property(nonatomic, readonly) NSUInteger snapshotTakenCount; @@ -45,26 +42,13 @@ @end -@implementation TabHelperSnapshotGeneratorDelegate { - UIImage* _defaultSnapshotImage; -} +@implementation TabHelperSnapshotGeneratorDelegate @synthesize snapshotTakenCount = _snapshotTakenCount; @synthesize canTakeSnapshot = _canTakeSnapshot; -- (instancetype)initWithDefaultSnapshotImage:(UIImage*)defaultSnapshotImage { - if ((self = [super init])) { - _defaultSnapshotImage = defaultSnapshotImage; - } - return self; -} - #pragma mark - SnapshotGeneratorDelegate -- (UIImage*)defaultSnapshotImage { - return _defaultSnapshotImage; -} - - (BOOL)canTakeSnapshotForWebState:(web::WebState*)webState { return !_canTakeSnapshot; } @@ -112,10 +96,7 @@ // Create the SnapshotTabHelper with a fake delegate. snapshot_session_id_ = [[NSUUID UUID] UUIDString]; - delegate_ = [[TabHelperSnapshotGeneratorDelegate alloc] - initWithDefaultSnapshotImage:UIImageWithSizeAndSolidColor( - kDefaultSnapshotSize, - [UIColor blueColor])]; + delegate_ = [[TabHelperSnapshotGeneratorDelegate alloc] init]; SnapshotTabHelper::CreateForWebState(&web_state_, snapshot_session_id_); SnapshotTabHelper::FromWebState(&web_state_)->SetDelegate(delegate_); } @@ -205,7 +186,8 @@ run_loop.Run(); ASSERT_TRUE(snapshot); - EXPECT_TRUE(UIImagesAreEqual(snapshot, [delegate_ defaultSnapshotImage])); + EXPECT_TRUE( + UIImagesAreEqual(snapshot, SnapshotTabHelper::GetDefaultSnapshotImage())); EXPECT_EQ(delegate_.snapshotTakenCount, 0u); } @@ -229,7 +211,8 @@ run_loop.Run(); ASSERT_TRUE(snapshot); - EXPECT_TRUE(UIImagesAreEqual(snapshot, [delegate_ defaultSnapshotImage])); + EXPECT_TRUE( + UIImagesAreEqual(snapshot, SnapshotTabHelper::GetDefaultSnapshotImage())); EXPECT_EQ(delegate_.snapshotTakenCount, 0u); } @@ -298,8 +281,8 @@ run_loop.Run(); ASSERT_TRUE(snapshot); - EXPECT_TRUE( - UIImagesAreEqual(snapshot, GreyImage([delegate_ defaultSnapshotImage]))); + EXPECT_TRUE(UIImagesAreEqual( + snapshot, GreyImage(SnapshotTabHelper::GetDefaultSnapshotImage()))); EXPECT_EQ(delegate_.snapshotTakenCount, 0u); } @@ -322,8 +305,8 @@ run_loop.Run(); ASSERT_TRUE(snapshot); - EXPECT_TRUE( - UIImagesAreEqual(snapshot, GreyImage([delegate_ defaultSnapshotImage]))); + EXPECT_TRUE(UIImagesAreEqual( + snapshot, GreyImage(SnapshotTabHelper::GetDefaultSnapshotImage()))); EXPECT_EQ(delegate_.snapshotTakenCount, 0u); }
diff --git a/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm b/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm index 7e862f5..a8bc542a 100644 --- a/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm +++ b/ios/chrome/browser/ssl/ios_captive_portal_blocking_page.mm
@@ -82,7 +82,12 @@ void IOSCaptivePortalBlockingPage::AfterShow() {} void IOSCaptivePortalBlockingPage::OnDontProceed() { - DCHECK(!callback_.is_null()); + // It's possible that callback_ may not exist if the user clicks "Proceed" + // followed by pressing the back button before the interstitial is hidden. + // In that case the certificate will still be treated as allowed. + if (callback_.is_null()) + return; + callback_.Run(false); callback_.Reset(); }
diff --git a/ios/chrome/browser/ssl/ios_ssl_error_handler.h b/ios/chrome/browser/ssl/ios_ssl_error_handler.h index 86a6e9fc..4cce3fca 100644 --- a/ios/chrome/browser/ssl/ios_ssl_error_handler.h +++ b/ios/chrome/browser/ssl/ios_ssl_error_handler.h
@@ -73,11 +73,6 @@ // state. static void LogCaptivePortalResult( captive_portal::CaptivePortalResult result); - // Called on interstitial dismissal. - static void InterstitialWasDismissed( - web::WebState* web_state, - const base::Callback<void(bool)>& callback, - bool proceed); // The WebState associated with this error handler. web::WebState* const web_state_ = nullptr;
diff --git a/ios/chrome/browser/ssl/ios_ssl_error_handler.mm b/ios/chrome/browser/ssl/ios_ssl_error_handler.mm index ab3273a..26146c4 100644 --- a/ios/chrome/browser/ssl/ios_ssl_error_handler.mm +++ b/ios/chrome/browser/ssl/ios_ssl_error_handler.mm
@@ -132,12 +132,9 @@ overridable_ ? security_interstitials::SSLErrorUI::SOFT_OVERRIDE_ENABLED : security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT; // SSLBlockingPage deletes itself when it's dismissed. - auto dismissal_callback( - base::Bind(&IOSSSLErrorHandler::InterstitialWasDismissed, - base::Unretained(web_state_), callback_)); IOSSSLBlockingPage* page = new IOSSSLBlockingPage( web_state_, cert_error_, ssl_info_, request_url_, options_mask, - base::Time::NowFromSystemTime(), dismissal_callback); + base::Time::NowFromSystemTime(), callback_); page->Show(); // Once an interstitial is displayed, no need to keep the handler around. // This is the equivalent of "delete this". @@ -147,11 +144,8 @@ void IOSSSLErrorHandler::ShowCaptivePortalInterstitial( const GURL& landing_url) { // IOSCaptivePortalBlockingPage deletes itself when it's dismissed. - auto dismissal_callback( - base::Bind(&IOSSSLErrorHandler::InterstitialWasDismissed, - base::Unretained(web_state_), callback_)); IOSCaptivePortalBlockingPage* page = new IOSCaptivePortalBlockingPage( - web_state_, request_url_, landing_url, dismissal_callback); + web_state_, request_url_, landing_url, callback_); page->Show(); // Once an interstitial is displayed, no need to keep the handler around. // This is the equivalent of "delete this". @@ -195,11 +189,3 @@ static_cast<int>(status), static_cast<int>(CaptivePortalStatus::COUNT)); } - -// static -void IOSSSLErrorHandler::InterstitialWasDismissed( - web::WebState* web_state, - const base::Callback<void(bool)>& callback, - bool proceed) { - callback.Run(proceed); -}
diff --git a/ios/chrome/browser/tabs/legacy_tab_helper.h b/ios/chrome/browser/tabs/legacy_tab_helper.h index fe61b242..44af881 100644 --- a/ios/chrome/browser/tabs/legacy_tab_helper.h +++ b/ios/chrome/browser/tabs/legacy_tab_helper.h
@@ -5,7 +5,6 @@ #ifndef IOS_CHROME_BROWSER_TABS_LEGACY_TAB_HELPER_H_ #define IOS_CHROME_BROWSER_TABS_LEGACY_TAB_HELPER_H_ -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #import "ios/web/public/web_state/web_state_user_data.h" @@ -25,7 +24,7 @@ ~LegacyTabHelper() override; // The Tab instance associated with the WebState. - base::scoped_nsobject<Tab> tab_; + Tab* tab_; DISALLOW_COPY_AND_ASSIGN(LegacyTabHelper); };
diff --git a/ios/chrome/browser/tabs/legacy_tab_helper.mm b/ios/chrome/browser/tabs/legacy_tab_helper.mm index bd13c3c2..d1c7d7d 100644 --- a/ios/chrome/browser/tabs/legacy_tab_helper.mm +++ b/ios/chrome/browser/tabs/legacy_tab_helper.mm
@@ -26,7 +26,7 @@ Tab* LegacyTabHelper::GetTabForWebState(web::WebState* web_state) { DCHECK(web_state); LegacyTabHelper* tab_helper = LegacyTabHelper::FromWebState(web_state); - return tab_helper ? tab_helper->tab_.get() : nil; + return tab_helper ? tab_helper->tab_ : nil; } LegacyTabHelper::~LegacyTabHelper() = default;
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm index 83bff99..288ffa97 100644 --- a/ios/chrome/browser/tabs/tab.mm +++ b/ios/chrome/browser/tabs/tab.mm
@@ -934,7 +934,7 @@ } - (CGFloat)headerHeightForWebController:(CRWWebController*)webController { - return [self.tabHeadersDelegate headerHeightForTab:self]; + return [self.tabHeadersDelegate tabHeaderHeightForTab:self]; } - (void)webStateDidChangeVisibleSecurityState:(web::WebState*)webState { @@ -1014,7 +1014,7 @@ } // Update page placeholder image. - _pagePlaceholder.image = [CRWWebController defaultSnapshotImage]; + _pagePlaceholder.image = SnapshotTabHelper::GetDefaultSnapshotImage(); [self getPlaceholderOverlayImageWithCompletionHandler:^(UIImage* image) { _pagePlaceholder.image = image; }]; @@ -1040,10 +1040,6 @@ #pragma mark - SnapshotGeneratorDelegate -- (UIImage*)defaultSnapshotImage { - return [CRWWebController defaultSnapshotImage]; -} - - (BOOL)canTakeSnapshotForWebState:(web::WebState*)webState { DCHECK_EQ(_webStateImpl, webState); return !PagePlaceholderTabHelper::FromWebState(webState) @@ -1056,7 +1052,7 @@ return [self.tabSnapshottingDelegate snapshotEdgeInsetsForTab:self]; if (self.tabHeadersDelegate) { - CGFloat headerHeight = [self.tabHeadersDelegate headerHeightForTab:self]; + CGFloat headerHeight = [self.tabHeadersDelegate tabHeaderHeightForTab:self]; return UIEdgeInsetsMake(headerHeight, 0.0, 0.0, 0.0); }
diff --git a/ios/chrome/browser/tabs/tab_headers_delegate.h b/ios/chrome/browser/tabs/tab_headers_delegate.h index d888494..d4775d3 100644 --- a/ios/chrome/browser/tabs/tab_headers_delegate.h +++ b/ios/chrome/browser/tabs/tab_headers_delegate.h
@@ -12,7 +12,7 @@ @protocol TabHeadersDelegate // Called to retrieve the height of the header view above |tab|. -- (CGFloat)headerHeightForTab:(Tab*)tab; +- (CGFloat)tabHeaderHeightForTab:(Tab*)tab; @end
diff --git a/ios/chrome/browser/test/perf_test_with_bvc_ios.h b/ios/chrome/browser/test/perf_test_with_bvc_ios.h index 84bed43..3bbed74 100644 --- a/ios/chrome/browser/test/perf_test_with_bvc_ios.h +++ b/ios/chrome/browser/test/perf_test_with_bvc_ios.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #include "ios/chrome/test/base/perf_test_ios.h" #include "ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_provider.h" @@ -51,12 +50,12 @@ std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; std::unique_ptr<TestChromeBrowserState> incognito_chrome_browser_state_; - base::scoped_nsobject<TabModel> tab_model_; - base::scoped_nsobject<TabModel> otr_tab_model_; + TabModel* tab_model_; + TabModel* otr_tab_model_; - base::scoped_nsobject<BrowserViewControllerDependencyFactory> bvc_factory_; - base::scoped_nsobject<BrowserViewController> bvc_; - base::scoped_nsobject<UIWindow> window_; + BrowserViewControllerDependencyFactory* bvc_factory_; + BrowserViewController* bvc_; + UIWindow* window_; }; #endif // IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_
diff --git a/ios/chrome/browser/test/perf_test_with_bvc_ios.mm b/ios/chrome/browser/test/perf_test_with_bvc_ios.mm index 2f4209a..b9cf160 100644 --- a/ios/chrome/browser/test/perf_test_with_bvc_ios.mm +++ b/ios/chrome/browser/test/perf_test_with_bvc_ios.mm
@@ -97,30 +97,29 @@ // Tab models. The off-the-record (OTR) tab model is required for the stack // view controller, which is created in OpenStackView(). - tab_model_.reset([[TabModel alloc] - initWithSessionWindow:session.sessionWindows[0] - sessionService:[SessionServiceIOS sharedService] - browserState:chrome_browser_state_.get()]); - otr_tab_model_.reset([[TabModel alloc] + tab_model_ = + [[TabModel alloc] initWithSessionWindow:session.sessionWindows[0] + sessionService:[SessionServiceIOS sharedService] + browserState:chrome_browser_state_.get()]; + otr_tab_model_ = [[TabModel alloc] initWithSessionWindow:session.sessionWindows[0] sessionService:[SessionServiceIOS sharedService] browserState:chrome_browser_state_ - ->GetOffTheRecordChromeBrowserState()]); + ->GetOffTheRecordChromeBrowserState()]; // Create the browser view controller with its testing factory. - bvc_factory_.reset([[BrowserViewControllerDependencyFactory alloc] + bvc_factory_ = [[BrowserViewControllerDependencyFactory alloc] initWithBrowserState:chrome_browser_state_.get() - webStateList:[tab_model_ webStateList]]); - bvc_.reset([[BrowserViewController alloc] + webStateList:[tab_model_ webStateList]]; + bvc_ = [[BrowserViewController alloc] initWithTabModel:tab_model_ browserState:chrome_browser_state_.get() dependencyFactory:bvc_factory_ - applicationCommandEndpoint:nil]); + applicationCommandEndpoint:nil]; [bvc_ setActive:YES]; // Create a real window to give to the browser view controller. - window_.reset( - [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]); + window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [window_ makeKeyAndVisible]; [window_ addSubview:[bvc_ view]]; [[bvc_ view] setFrame:[[UIScreen mainScreen] bounds]]; @@ -132,14 +131,14 @@ // Documented example of how to clear out the browser view controller // and its associated data. - window_.reset(); + window_ = nil; [bvc_ browserStateDestroyed]; [bvc_ shutdown]; - bvc_.reset(); - bvc_factory_.reset(); - tab_model_.reset(); + bvc_ = nil; + bvc_factory_ = nil; + tab_model_ = nil; [otr_tab_model_ browserStateDestroyed]; - otr_tab_model_.reset(); + otr_tab_model_ = nil; // The base class |TearDown| method calls the run loop so the // NSAutoreleasePool can drain. This needs to be done before
diff --git a/ios/chrome/browser/translate/chrome_ios_translate_client.mm b/ios/chrome/browser/translate/chrome_ios_translate_client.mm index 05af57e2..27af683 100644 --- a/ios/chrome/browser/translate/chrome_ios_translate_client.mm +++ b/ios/chrome/browser/translate/chrome_ios_translate_client.mm
@@ -249,6 +249,8 @@ web_state_->RemoveObserver(this); web_state_ = nullptr; + [language_selection_handler_ dismissLanguageSelector]; + // Translation process can be interrupted. // Destroying the TranslateManager now guarantees that it never has to deal // with nullptr WebState.
diff --git a/ios/chrome/browser/translate/language_selection_handler.h b/ios/chrome/browser/translate/language_selection_handler.h index 61283b5..c47bc4f6 100644 --- a/ios/chrome/browser/translate/language_selection_handler.h +++ b/ios/chrome/browser/translate/language_selection_handler.h
@@ -20,6 +20,10 @@ - (void)showLanguageSelectorWithContext:(LanguageSelectionContext*)context delegate:(id<LanguageSelectionDelegate>)delegate; +// Tells the handler to stop displaying the language selector, telling the +// delegate no selection was made. +- (void)dismissLanguageSelector; + @end #endif // IOS_CHROME_BROWSER_TRANSLATE_LANGUAGE_SELECTION_HANDLER_H_
diff --git a/ios/chrome/browser/translate/translate_egtest.mm b/ios/chrome/browser/translate/translate_egtest.mm index 029cb76..76fd13d 100644 --- a/ios/chrome/browser/translate/translate_egtest.mm +++ b/ios/chrome/browser/translate/translate_egtest.mm
@@ -687,7 +687,7 @@ [[EarlGrey selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( switchLabel)] - assertWithMatcher:grey_notNil()]; + assertWithMatcher:grey_sufficientlyVisible()]; // Toggle "Always Translate" and check the preference. [[EarlGrey @@ -859,17 +859,25 @@ client->GetTranslateManager()->PageTranslated( "es", "en", translate::TranslateErrors::NONE); + // The infobar is presented with an animation. Wait for the "Done" button + // to become visibile before considering the animation as complete. + [ChromeEarlGrey + waitForElementWithMatcherSufficientlyVisible: + chrome_test_util::ButtonWithAccessibilityLabelId(IDS_DONE)]; + // Assert that the infobar is visible. [[EarlGrey selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( - IDS_DONE)] assertWithMatcher:grey_notNil()]; + IDS_DONE)] + assertWithMatcher:grey_sufficientlyVisible()]; [[EarlGrey selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( IDS_TRANSLATE_INFOBAR_REVERT)] - assertWithMatcher:grey_notNil()]; + assertWithMatcher:grey_sufficientlyVisible()]; [[EarlGrey selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId( - IDS_CLOSE)] assertWithMatcher:grey_notNil()]; + IDS_CLOSE)] + assertWithMatcher:grey_sufficientlyVisible()]; } @end
diff --git a/ios/chrome/browser/ui/BUILD.gn b/ios/chrome/browser/ui/BUILD.gn index 6683d8d..56782b6 100644 --- a/ios/chrome/browser/ui/BUILD.gn +++ b/ios/chrome/browser/ui/BUILD.gn
@@ -353,6 +353,7 @@ "//ios/chrome/browser/ui/tabs/requirements", "//ios/chrome/browser/ui/toolbar:toolbar_ui", "//ios/chrome/browser/ui/toolbar:toolbar_ui_broadcasting_util", + "//ios/chrome/browser/ui/toolbar/clean:toolbar_ui", "//ios/chrome/browser/ui/toolbar/public:toolbar_base_feature", "//ios/chrome/browser/ui/tools_menu", "//ios/chrome/browser/ui/tools_menu:configuration",
diff --git a/ios/chrome/browser/ui/activity_services/activity_service_controller.mm b/ios/chrome/browser/ui/activity_services/activity_service_controller.mm index 661ba8d..15afc07 100644 --- a/ios/chrome/browser/ui/activity_services/activity_service_controller.mm +++ b/ios/chrome/browser/ui/activity_services/activity_service_controller.mm
@@ -386,7 +386,8 @@ - (void)showErrorAlert:(int)titleMessageId message:(int)messageId { NSString* title = l10n_util::GetNSString(titleMessageId); NSString* message = l10n_util::GetNSString(messageId); - [presentationProvider_ showErrorAlertWithStringTitle:title message:message]; + [presentationProvider_ showActivityServiceErrorAlertWithStringTitle:title + message:message]; } - (void)showSnackbar:(NSString*)text {
diff --git a/ios/chrome/browser/ui/activity_services/activity_service_controller_unittest.mm b/ios/chrome/browser/ui/activity_services/activity_service_controller_unittest.mm index 225c6cd4..4f29fff 100644 --- a/ios/chrome/browser/ui/activity_services/activity_service_controller_unittest.mm +++ b/ios/chrome/browser/ui/activity_services/activity_service_controller_unittest.mm
@@ -144,8 +144,8 @@ _activityServiceDidEndPresentingWasCalled = YES; } -- (void)showErrorAlertWithStringTitle:(NSString*)title - message:(NSString*)message { +- (void)showActivityServiceErrorAlertWithStringTitle:(NSString*)title + message:(NSString*)message { _latestErrorAlertTitle = [title copy]; _latestErrorAlertMessage = [message copy]; }
diff --git a/ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h b/ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h index 9c1bc948..952b5d75 100644 --- a/ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h +++ b/ios/chrome/browser/ui/activity_services/requirements/activity_service_presentation.h
@@ -20,8 +20,8 @@ // Asks the implementor to show an error alert with the given |title| and // |message|. -- (void)showErrorAlertWithStringTitle:(NSString*)title - message:(NSString*)message; +- (void)showActivityServiceErrorAlertWithStringTitle:(NSString*)title + message:(NSString*)message; @end
diff --git a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm index 4d9d77a..c711b1a 100644 --- a/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm +++ b/ios/chrome/browser/ui/authentication/signin_earlgrey_utils.mm
@@ -30,6 +30,7 @@ + (void)checkSigninPromoVisibleWithMode:(SigninPromoViewMode)mode closeButton:(BOOL)closeButton { + [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[EarlGrey selectElementWithMatcher:grey_allOf( grey_accessibilityID(kSigninPromoViewId),
diff --git a/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm b/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm index 4cf2078a..08efc5f 100644 --- a/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm +++ b/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm
@@ -6,7 +6,6 @@ #include <string> -#import "base/mac/scoped_nsobject.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/image_util.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -44,8 +43,7 @@ UIImage* image = StretchableImageFromUIImage([UIImage imageNamed:imageName], 0, 0); - base::scoped_nsobject<UIImageView> imageView( - [[UIImageView alloc] initWithImage:image]); + UIImageView* imageView = [[UIImageView alloc] initWithImage:image]; [imageView setTranslatesAutoresizingMaskIntoConstraints:NO]; [imageView setFrame:kDefaultAccessorySeparatorRect];
diff --git a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h index 5636a40f..2268307 100644 --- a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h +++ b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.h
@@ -5,7 +5,6 @@ #ifndef IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ #define IOS_CHROME_BROWSER_UI_AUTOFILL_CARD_UNMASK_PROMPT_VIEW_BRIDGE_H_ -#include "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "components/autofill/core/browser/ui/card_unmask_prompt_view.h" @@ -42,7 +41,7 @@ void DeleteSelf(); protected: - base::scoped_nsobject<CardUnmaskPromptViewController> view_controller_; + CardUnmaskPromptViewController* view_controller_; private: // The controller |this| queries for logic and state.
diff --git a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.mm b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.mm index e734c70a..e7cecd9 100644 --- a/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.mm +++ b/ios/chrome/browser/ui/autofill/card_unmask_prompt_view_bridge.mm
@@ -64,8 +64,8 @@ } void CardUnmaskPromptViewBridge::Show() { - view_controller_.reset( - [[CardUnmaskPromptViewController alloc] initWithBridge:this]); + view_controller_ = + [[CardUnmaskPromptViewController alloc] initWithBridge:this]; [view_controller_ setModalPresentationStyle:UIModalPresentationFormSheet]; [view_controller_ setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.mm index fec1f55..2df364a 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.mm
@@ -81,9 +81,6 @@ SigninPresenter, UIGestureRecognizerDelegate> -// The app bar for the bookmarks. -@property(nonatomic, strong) MDCAppBar* appBar; - @end @implementation BookmarkHomeViewController
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_protected.h b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_protected.h index b4b09d3..58de2fd3 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_protected.h +++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_protected.h
@@ -26,6 +26,7 @@ @class BookmarkPanelView; @class BookmarkPromoController; @class BookmarkTableView; +@class MDCAppBar; typedef NS_ENUM(NSInteger, BookmarksContextBarState) { BookmarksContextBarNone, // No state. @@ -51,10 +52,10 @@ @property(nonatomic, assign) ios::ChromeBrowserState* browserState; // The main view showing all the bookmarks. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkCollectionView* folderView; -// The main view showing all the bookmarks. (Used only when the flag -// kBookmarkNewGeneration is enabled) +// The main view showing all the bookmarks. @property(nonatomic, strong) BookmarkTableView* bookmarksTableView; // The view controller used to pick a folder in which to move the selected @@ -65,24 +66,31 @@ @property(nonatomic, weak) id<UrlLoader> loader; // The menu with all the folders. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkMenuView* menuView; // The navigation bar sits on top of the main content. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkNavigationBar* navigationBar; -// The context bar at the bottom of the bookmarks. (Used only when the flag -// kBookmarkNewGeneration is enabled) +// The app bar for the bookmarks. +@property(nonatomic, strong) MDCAppBar* appBar; + +// The context bar at the bottom of the bookmarks. @property(nonatomic, strong) BookmarkContextBar* contextBar; // At any point in time, there is exactly one collection view whose view is part // of the view hierarchy. This property determines what data is visible in the // collection view. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkMenuItem* primaryMenuItem; // This view holds a content view, and a menu view. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkPanelView* panelView; // Either the menu or the primaryView can scrollToTop. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, assign) BOOL scrollToTop; // This view is created and used if the model is not fully loaded yet by the @@ -100,6 +108,7 @@ // The layout code in this class relies on the assumption that the editingBar // has the same frame as the navigationBar. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) BookmarkEditingBar* editingBar; // The view controller to present when editing the current folder. @@ -110,19 +119,19 @@ @property(nonatomic, strong) BookmarkPromoController* bookmarkPromoController; // Whether the panel view can be brought into view and hidden by swipe gesture. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, assign) BOOL sideSwipingPossible; // The action sheet coordinator used when trying to edit a single bookmark. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. @property(nonatomic, strong) ActionSheetCoordinator* actionSheetCoordinator; // The current state of the context bar UI. @property(nonatomic, assign) BookmarksContextBarState contextBarState; // When the view is first shown on the screen, this property represents the -// cached value of the y of the content offset of the folder view. This +// cached value of the y of the content offset of the table view. This // property is set to nil after it is used. -// In the new UI, this value represents the visible row position of the cached -// UI stack. @property(nonatomic, strong) NSNumber* cachedContentPosition; // This method should be called at most once in the life-cycle of the class. @@ -131,6 +140,7 @@ - (void)loadBookmarkViews; // Returns the width of the menu. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. - (CGFloat)menuWidth; // This method is called if the view needs to be loaded and the model is not @@ -139,30 +149,37 @@ // Updates the property 'primaryMenuItem'. // Updates the UI to reflect the new state of 'primaryMenuItem'. +// TODO(crbug.com/753599): Remove this property when clean up old bookmarks. - (void)updatePrimaryMenuItem:(BookmarkMenuItem*)menuItem animated:(BOOL)animated; // Caches the position in the collection view. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)cachePosition; // Whether the back button on the navigation bar should be shown. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (BOOL)shouldShowBackButtonOnNavigationBar; #pragma mark - Subclass overrides // Creates and returns actionSheetCoordinator. MUST // be overridden by subclass. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (ActionSheetCoordinator*)createActionSheetCoordinatorOnView:(UIView*)view; // Shows the editing bar, this method MUST be overridden by subclass to // tailor the behaviour according to device. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)showEditingBarAnimated:(BOOL)animated; // Hides the editing bar, this method MUST be overridden by subclass to // tailor the behaviour according to device. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)hideEditingBarAnimated:(BOOL)animated; // Returns the frame for editingBar, MUST be overridden by subclass. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (CGRect)editingBarFrame; #pragma mark - Navigation bar. @@ -176,12 +193,14 @@ // (2)The primary view has type folder, and the relevant folder has changed. // (3)The interface orientation changes. // (4)viewWillAppear, as the interface orientation may have changed. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)updateNavigationBarAnimated:(BOOL)animated orientation:(UIInterfaceOrientation)orientation; #pragma mark - Edit // This method updates the property, and resets the edit nodes. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)setEditing:(BOOL)editing animated:(BOOL)animated; // Instaneously updates the shadow of the edit bar. @@ -191,6 +210,7 @@ // (3)The primary view's collection view is scrolled. // (2) is not necessary right now, as it is only possible to switch primary // views when |editing| is NO. When |editing| is NO, the shadow is never shown. +// TODO(crbug.com/753599): Remove this method when clean up old bookmarks. - (void)updateEditBarShadow; @end
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_unittest.mm b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_unittest.mm index ac73681..cdc717e 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_unittest.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h" #include "base/test/scoped_feature_list.h" +#include "components/bookmarks/browser/bookmark_model.h" #include "ios/chrome/browser/bookmarks/bookmark_new_generation_features.h" #import "ios/chrome/browser/browser_state/test_chrome_browser_state.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller_protected.h" @@ -20,27 +21,28 @@ TEST_F(BookmarkHomeViewControllerTest, LoadBookmarks) { @autoreleasepool { - // TODO(crbug.com/782551): Write this unittest for the new bookmark. + // TODO(crbug.com/753599): Remove scoped feature list when clean up old + // bookmarks. base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature(kBookmarkNewGeneration); + scoped_feature_list.InitAndEnableFeature(kBookmarkNewGeneration); BookmarkHomeViewController* controller = [[BookmarkHomeViewController alloc] initWithLoader:nil browserState:chrome_browser_state_.get() dispatcher:nil]; - EXPECT_EQ(nil, controller.menuView); - EXPECT_EQ(nil, controller.panelView); - EXPECT_EQ(nil, controller.folderView); + EXPECT_EQ(nil, controller.appBar); + EXPECT_EQ(nil, controller.contextBar); + EXPECT_EQ(nil, controller.bookmarksTableView); [controller view]; + [controller setRootNode:_bookmarkModel->mobile_node()]; [controller loadBookmarkViews]; EXPECT_NE(nil, controller); - EXPECT_NE(nil, controller.navigationBar); - EXPECT_NE(nil, controller.menuView); - EXPECT_NE(nil, controller.panelView); - EXPECT_NE(nil, controller.folderView); + EXPECT_NE(nil, controller.appBar); + EXPECT_NE(nil, controller.contextBar); + EXPECT_NE(nil, controller.bookmarksTableView); } }
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_table_view.mm b/ios/chrome/browser/ui/bookmarks/bookmark_table_view.mm index 1c9756d..3c58d71 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmark_table_view.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmark_table_view.mm
@@ -38,14 +38,43 @@ namespace { // Minimal acceptable favicon size, in points. -CGFloat kMinFaviconSizePt = 16; +const CGFloat kMinFaviconSizePt = 16.0; + +// Desired favicon size, in points. +const CGFloat kDesiredFaviconSizePt = 32.0; // Cell height, in points. -CGFloat kCellHeightPt = 56.0; +const CGFloat kCellHeightPt = 56.0; -// Minimium spacing between keyboard and the titleText when creating new folder. -CGFloat keyboardSpacing = 16.0; -} +// Minimium spacing between keyboard and the titleText when creating new folder, +// in points. +const CGFloat kKeyboardSpacing = 16.0; + +// Max number of favicon download requests in the lifespan of this tableView. +const NSUInteger kMaxDownloadFaviconCount = 50; + +// NetworkTrafficAnnotationTag for fetching favicon from a Google server. +const net::NetworkTrafficAnnotationTag kTrafficAnnotation = + net::DefineNetworkTrafficAnnotation("bookmarks_get_large_icon", R"( + semantics { + sender: "Bookmarks" + description: + "Sends a request to a Google server to retrieve the favicon bitmap " + "for a bookmark." + trigger: + "A request can be sent if Chrome does not have a favicon for a " + "bookmark." + data: "Page URL and desired icon size." + destination: GOOGLE_OWNED_SERVICE + } + policy { + cookies_allowed: NO + setting: "This feature cannot be disabled by settings." + policy_exception_justification: "Not implemented." + } + )"); + +} // namespace using bookmarks::BookmarkNode; @@ -117,6 +146,10 @@ // to nil once the editing completes. Corresponds to |_editingFolderNode|. @property(nonatomic, weak) BookmarkTableCell* editingFolderCell; +// Counts the number of favicon download requests from Google server in the +// lifespan of this tableView. +@property(nonatomic, assign) NSUInteger faviconDownloadCount; + @end @implementation BookmarkTableView @@ -132,6 +165,7 @@ @synthesize presenter = _presenter; @synthesize addingNewFolder = _addingNewFolder; @synthesize editingFolderCell = _editingFolderCell; +@synthesize faviconDownloadCount = _faviconDownloadCount; - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState delegate:(id<BookmarkTableViewDelegate>)delegate @@ -400,7 +434,13 @@ cell.textDelegate = self; }); } - [self loadFaviconAtIndexPath:indexPath]; + + // Cancel previous load attempts. + [self cancelLoadingFaviconAtIndexPath:indexPath]; + // Load the favicon from cache. If not found, try fetching it from a Google + // Server. + [self loadFaviconAtIndexPath:indexPath continueToGoogleServer:YES]; + return cell; } @@ -586,7 +626,8 @@ return; } - [self loadFaviconAtIndexPath:indexPath]; + // Get the favicon from cache directly. (no need to fetch from server) + [self loadFaviconAtIndexPath:indexPath continueToGoogleServer:NO]; } #pragma mark - Sections @@ -827,7 +868,7 @@ withImage:(UIImage*)image backgroundColor:(UIColor*)backgroundColor textColor:(UIColor*)textColor - fallbackText:(NSString*)text { + fallbackText:(NSString*)fallbackText { BookmarkTableCell* cell = [self.tableView cellForRowAtIndexPath:indexPath]; if (!cell) { return; @@ -836,12 +877,42 @@ if (image) { [cell setImage:image]; } else { - [cell setPlaceholderText:text + [cell setPlaceholderText:fallbackText textColor:textColor backgroundColor:backgroundColor]; } } +- (void)updateCellAtIndexPath:(NSIndexPath*)indexPath + withLargeIconResult:(const favicon_base::LargeIconResult&)result + fallbackText:(NSString*)fallbackText { + UIImage* favIcon = nil; + UIColor* backgroundColor = nil; + UIColor* textColor = nil; + + if (result.bitmap.is_valid()) { + scoped_refptr<base::RefCountedMemory> data = result.bitmap.bitmap_data; + favIcon = [UIImage + imageWithData:[NSData dataWithBytes:data->front() length:data->size()]]; + fallbackText = nil; + // Update the time when the icon was last requested - postpone thus the + // automatic eviction of the favicon from the favicon database. + IOSChromeLargeIconServiceFactory::GetForBrowserState(self.browserState) + ->TouchIconFromGoogleServer(result.bitmap.icon_url); + } else if (result.fallback_icon_style) { + backgroundColor = + skia::UIColorFromSkColor(result.fallback_icon_style->background_color); + textColor = + skia::UIColorFromSkColor(result.fallback_icon_style->text_color); + } + + [self updateCellAtIndexPath:indexPath + withImage:favIcon + backgroundColor:backgroundColor + textColor:textColor + fallbackText:fallbackText]; +} + // Cancels all async loads of favicons. Subclasses should call this method when // the bookmark model is going through significant changes, then manually call // loadFaviconAtIndexPath: for everything that needs to be loaded; or @@ -856,60 +927,73 @@ } // Asynchronously loads favicon for given index path. The loads are cancelled -// upon cell reuse automatically. -- (void)loadFaviconAtIndexPath:(NSIndexPath*)indexPath { +// upon cell reuse automatically. When the favicon is not found in cache, try +// loading it from a Google server if |continueToGoogleServer| is YES, +// otherwise, use the fall back icon style. +- (void)loadFaviconAtIndexPath:(NSIndexPath*)indexPath + continueToGoogleServer:(BOOL)continueToGoogleServer { const bookmarks::BookmarkNode* node = [self nodeAtIndexPath:indexPath]; if (node->is_folder()) { return; } - // Cancel previous load attempts. - [self cancelLoadingFaviconAtIndexPath:indexPath]; + CGFloat scale = [UIScreen mainScreen].scale; + CGFloat desiredFaviconSizeInPixel = scale * kDesiredFaviconSizePt; + CGFloat minFaviconSizeInPixel = scale * kMinFaviconSizePt; // Start loading a favicon. __weak BookmarkTableView* weakSelf = self; GURL blockURL(node->url()); - void (^faviconBlock)(const favicon_base::LargeIconResult&) = - ^(const favicon_base::LargeIconResult& result) { - BookmarkTableView* strongSelf = weakSelf; - if (!strongSelf) { - return; - } - UIImage* favIcon = nil; - UIColor* backgroundColor = nil; - UIColor* textColor = nil; - NSString* fallbackText = nil; - if (result.bitmap.is_valid()) { - scoped_refptr<base::RefCountedMemory> data = - result.bitmap.bitmap_data; - favIcon = [UIImage imageWithData:[NSData dataWithBytes:data->front() - length:data->size()]]; - } else if (result.fallback_icon_style) { - backgroundColor = skia::UIColorFromSkColor( - result.fallback_icon_style->background_color); - textColor = - skia::UIColorFromSkColor(result.fallback_icon_style->text_color); + NSString* fallbackText = + base::SysUTF16ToNSString(favicon::GetFallbackIconText(blockURL)); + void (^faviconLoadedFromCacheBlock)(const favicon_base::LargeIconResult&) = ^( + const favicon_base::LargeIconResult& result) { + BookmarkTableView* strongSelf = weakSelf; + if (!strongSelf) { + return; + } + // TODO(crbug.com/697329) When fetching icon from server to replace existing + // cache is allowed, fetch icon from server here when cached icon is smaller + // than the desired size. + if (!result.bitmap.is_valid() && continueToGoogleServer && + strongSelf.faviconDownloadCount < kMaxDownloadFaviconCount) { + void (^faviconLoadedFromServerBlock)( + favicon_base::GoogleFaviconServerRequestStatus status) = + ^(const favicon_base::GoogleFaviconServerRequestStatus status) { + if (status == + favicon_base::GoogleFaviconServerRequestStatus::SUCCESS) { + BookmarkTableView* strongSelf = weakSelf; + // GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache + // is not cancellable. So need to check if node has been changed + // before proceeding to favicon update. + if (!strongSelf || + [strongSelf nodeAtIndexPath:indexPath] != node) { + return; + } + // Favicon should be ready in cache now. Fetch it again. + [strongSelf loadFaviconAtIndexPath:indexPath + continueToGoogleServer:NO]; + } + }; // faviconLoadedFromServerBlock - fallbackText = - base::SysUTF16ToNSString(favicon::GetFallbackIconText(blockURL)); - } - - [strongSelf updateCellAtIndexPath:indexPath - withImage:favIcon - backgroundColor:backgroundColor - textColor:textColor - fallbackText:fallbackText]; - }; - - CGFloat scale = [UIScreen mainScreen].scale; - CGFloat preferredSize = scale * [BookmarkTableCell preferredImageSize]; - CGFloat minSize = scale * kMinFaviconSizePt; + strongSelf.faviconDownloadCount++; + IOSChromeLargeIconServiceFactory::GetForBrowserState(self.browserState) + ->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache( + node->url(), minFaviconSizeInPixel, desiredFaviconSizeInPixel, + /*may_page_url_be_private=*/true, kTrafficAnnotation, + base::BindBlockArc(faviconLoadedFromServerBlock)); + } + [strongSelf updateCellAtIndexPath:indexPath + withLargeIconResult:result + fallbackText:fallbackText]; + }; // faviconLoadedFromCacheBlock base::CancelableTaskTracker::TaskId taskId = IOSChromeLargeIconServiceFactory::GetForBrowserState(self.browserState) - ->GetLargeIconOrFallbackStyle(node->url(), minSize, preferredSize, - base::BindBlockArc(faviconBlock), - &_faviconTaskTracker); + ->GetLargeIconOrFallbackStyle( + node->url(), minFaviconSizeInPixel, desiredFaviconSizeInPixel, + base::BindBlockArc(faviconLoadedFromCacheBlock), + &_faviconTaskTracker); _faviconLoadTasks[IntegerPair(indexPath.section, indexPath.item)] = taskId; } @@ -955,7 +1039,7 @@ [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].origin.y; CGFloat tableBottom = CGRectGetMaxY([self convertRect:self.tableView.frame toView:nil]); - CGFloat shiftY = tableBottom - keyboardTop + keyboardSpacing; + CGFloat shiftY = tableBottom - keyboardTop + kKeyboardSpacing; if (shiftY >= 0) { UIEdgeInsets previousContentInsets = self.tableView.contentInset;
diff --git a/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm b/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm index 56c32713..91ff1039 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm
@@ -1201,8 +1201,7 @@ // Tests the tapping on the secondary button of sign-in promo view in a warm // state makes the sign-in sheet appear, and the promo still appears after // dismissing the sheet. -// TODO(crbug.com/796618): Reenable this test. -- (void)DISABLED_testSignInPromoWithWarmStateUsingSecondaryButton { +- (void)testSignInPromoWithWarmStateUsingSecondaryButton { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndDisableFeature(kBookmarkNewGeneration);
diff --git a/ios/chrome/browser/ui/bookmarks/bookmarks_new_generation_egtest.mm b/ios/chrome/browser/ui/bookmarks/bookmarks_new_generation_egtest.mm index 642a328..576b37ad 100644 --- a/ios/chrome/browser/ui/bookmarks/bookmarks_new_generation_egtest.mm +++ b/ios/chrome/browser/ui/bookmarks/bookmarks_new_generation_egtest.mm
@@ -1985,8 +1985,7 @@ // Tests the tapping on the primary button of sign-in promo view in a warm // state makes the confirmaiton sheet appear, and the promo still appears after // dismissing the sheet. -// TODO(crbug.com/796618): Reenable this test. -- (void)DISABLED_testSignInPromoWithWarmStateUsingPrimaryButton { +- (void)testSignInPromoWithWarmStateUsingPrimaryButton { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeature(kBookmarkNewGeneration); @@ -2000,10 +1999,8 @@ // Check that promo is visible. [BookmarksNewGenTestCase verifyPromoAlreadySeen:NO]; - [[EarlGrey - selectElementWithMatcher:grey_allOf(SecondarySignInButton(), - grey_sufficientlyVisible(), nil)] - assertWithMatcher:grey_notNil()]; + [SigninEarlGreyUtils + checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState]; // Tap the Sign in button. [[EarlGrey @@ -2019,10 +2016,8 @@ uppercaseString])] performAction:grey_tap()]; // Check that the bookmarks UI reappeared and the cell is still here. - [[EarlGrey - selectElementWithMatcher:grey_allOf(SecondarySignInButton(), - grey_sufficientlyVisible(), nil)] - assertWithMatcher:grey_notNil()]; + [SigninEarlGreyUtils + checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState]; [BookmarksNewGenTestCase verifyPromoAlreadySeen:NO]; } @@ -2030,8 +2025,7 @@ // Tests the tapping on the secondary button of sign-in promo view in a warm // state makes the sign-in sheet appear, and the promo still appears after // dismissing the sheet. -// TODO(crbug.com/796618): Reenable this test. -- (void)DISABLED_testSignInPromoWithWarmStateUsingSecondaryButton { +- (void)testSignInPromoWithWarmStateUsingSecondaryButton { base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndEnableFeature(kBookmarkNewGeneration);
diff --git a/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.h b/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.h index 949400e..19182f78 100644 --- a/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.h +++ b/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.h
@@ -41,9 +41,6 @@ - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; -// Returns the preferred image size for favicons. -+ (CGFloat)preferredImageSize; - // Identifier for -[UITableView registerClass:forCellWithReuseIdentifier:]. + (NSString*)reuseIdentifier;
diff --git a/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.mm b/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.mm index c593c0a..774c7a2a 100644 --- a/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.mm +++ b/ios/chrome/browser/ui/bookmarks/cells/bookmark_table_cell.mm
@@ -15,8 +15,8 @@ #endif namespace { -// Preferred image size in points. -const CGFloat kBookmarkTableCellDefaultImageSize = 16.0; +// Image size, in points. +const CGFloat kBookmarkTableCellImageSize = 16.0; // Padding in table cell. const CGFloat kBookmarkTableCellImagePadding = 16.0; @@ -69,10 +69,10 @@ _iconView = iconView; [_iconView setHidden:NO]; [_iconView.widthAnchor - constraintEqualToConstant:kBookmarkTableCellDefaultImageSize] + constraintEqualToConstant:kBookmarkTableCellImageSize] .active = YES; [_iconView.heightAnchor - constraintEqualToConstant:kBookmarkTableCellDefaultImageSize] + constraintEqualToConstant:kBookmarkTableCellImageSize] .active = YES; // Create placeholder label. @@ -81,10 +81,10 @@ _placeholderLabel.font = [MDCTypography captionFont]; [_placeholderLabel setHidden:YES]; [_placeholderLabel.widthAnchor - constraintEqualToConstant:kBookmarkTableCellDefaultImageSize] + constraintEqualToConstant:kBookmarkTableCellImageSize] .active = YES; [_placeholderLabel.heightAnchor - constraintEqualToConstant:kBookmarkTableCellDefaultImageSize] + constraintEqualToConstant:kBookmarkTableCellImageSize] .active = YES; // Create stack view. @@ -187,10 +187,6 @@ return @"BookmarkTableCellIdentifier"; } -+ (CGFloat)preferredImageSize { - return kBookmarkTableCellDefaultImageSize; -} - - (void)setImage:(UIImage*)image { [self.iconView setHidden:NO]; [self.placeholderLabel setHidden:YES]; @@ -207,7 +203,6 @@ self.placeholderLabel.backgroundColor = backgroundColor; self.placeholderLabel.textColor = textColor; self.placeholderLabel.text = text; - [self.placeholderLabel sizeToFit]; } #pragma mark - Layout
diff --git a/ios/chrome/browser/ui/browser_view_controller.h b/ios/chrome/browser/ui/browser_view_controller.h index 95615fd9..a4bed45 100644 --- a/ios/chrome/browser/ui/browser_view_controller.h +++ b/ios/chrome/browser/ui/browser_view_controller.h
@@ -136,9 +136,6 @@ // and dismissal animations of the Voice Search UI. |originView| can be nil. - (void)startVoiceSearchWithOriginView:(UIView*)originView; -// Focuses the omnibox. -- (void)focusOmnibox; - // Dismisses all presented views, excluding the omnibox if |dismissOmnibox| is // NO, then calls |completion|. - (void)clearPresentedStateWithCompletion:(ProceduralBlock)completion
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm index 2ade742..2c65ecee 100644 --- a/ios/chrome/browser/ui/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -409,10 +409,10 @@ LegacyFullscreenControllerDelegate, InfobarContainerStateDelegate, KeyCommandsPlumbing, - NetExportTabHelperDelegate, MainContentUI, ManageAccountsDelegate, MFMailComposeViewControllerDelegate, + NetExportTabHelperDelegate, NewTabPageControllerObserver, OverscrollActionsControllerDelegate, PageInfoPresentation, @@ -422,10 +422,10 @@ QRScannerPresenting, RepostFormTabHelperDelegate, SideSwipeControllerDelegate, + SigninPresenter, SKStoreProductViewControllerDelegate, SnapshotOverlayProvider, StoreKitLauncher, - SigninPresenter, TabDialogDelegate, TabHeadersDelegate, TabHistoryPresentation, @@ -434,7 +434,7 @@ TabStripPresentation, ToolsMenuConfigurationProvider, UIGestureRecognizerDelegate, - UpgradeCenterClientProtocol, + UpgradeCenterClient, VoiceSearchBarDelegate, VoiceSearchBarOwner, WebStatePrinter> { @@ -687,6 +687,12 @@ // Vertical offset for fullscreen toolbar. @property(nonatomic, strong) NSLayoutConstraint* toolbarOffsetConstraint; +// Y-dimension offset for placement of the header. +@property(nonatomic, readonly) CGFloat headerOffset; + +// Height of the header view for the tab model's current tab. +@property(nonatomic, readonly) CGFloat headerHeight; + // BVC initialization: // If the BVC is initialized with a valid browser state & tab model immediately, // the path is straightforward: functionality is enabled, and the UI is built @@ -746,8 +752,6 @@ - (void)installDelegatesForTab:(Tab*)tab; // Remove delegates from the provided |tab|. - (void)uninstallDelegatesForTab:(Tab*)tab; -// Closes the current tab, with animation if applicable. -- (void)closeCurrentTab; // Show the bookmarks page. - (void)showAllBookmarks; // Shows a panel within the New Tab Page. @@ -869,42 +873,17 @@ // Called with the results of saving a picture in the photo album. If error is // nil the save succeeded. - (void)finishSavingImageWithError:(NSError*)error; -// Provides a view that encompasses currently displayed infobar(s) or nil -// if no infobar is presented. -- (UIView*)infoBarOverlayViewForTab:(Tab*)tab; -// Returns a vertical infobar offset relative to the tab content. -- (CGFloat)infoBarOverlayYOffsetForTab:(Tab*)tab; -// Provides a view that encompasses the voice search bar if it's displayed or -// nil if the voice search bar isn't displayed. -- (UIView*)voiceSearchOverlayViewForTab:(Tab*)tab; -// Returns a vertical voice search bar offset relative to the tab content. -- (CGFloat)voiceSearchOverlayYOffsetForTab:(Tab*)tab; // Lazily instantiates |_voiceSearchController|. - (void)ensureVoiceSearchControllerCreated; // Lazily instantiates |_voiceSearchBar| and adds it to the view. - (void)ensureVoiceSearchBarCreated; // Shows/hides the voice search bar. - (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated; -// The LogoAnimationControllerOwner to be used for the next logo transition -// animation. -- (id<LogoAnimationControllerOwner>)currentLogoAnimationControllerOwner; // Returns the footer view if one exists (e.g. the voice search bar). - (UIView*)footerView; -// Returns the height of the header view for the tab model's current tab. -- (CGFloat)headerHeight; // Sets the frame for the headers. - (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers atOffset:(CGFloat)headerOffset; -// Returns the y coordinate for the footer's frame when animating the footer -// in/out of fullscreen. -- (CGFloat)footerYForHeaderOffset:(CGFloat)headerOffset; -// Called when the animation for setting the header view's offset is finished. -// |completed| should indicate if the animation finished completely or was -// interrupted. |offset| should indicate the header offset after the animation. -// |dragged| should indicate if the header moved due to the user dragging. -- (void)fullScreenController:(LegacyFullscreenController*)controller - headerAnimationCompleted:(BOOL)completed - offset:(CGFloat)offset; // Performs a search with the image at the given url. The referrer is used to // download the image. - (void)searchByImageAtURL:(const GURL&)url @@ -916,7 +895,7 @@ // Record the last tap point based on the |originPoint| (if any) passed in // |command|. - (void)setLastTapPoint:(OpenNewTabCommand*)command; -// Get return the last stored |_lastTapPoint| if it's been set within the past +// Returns the last stored |_lastTapPoint| if it's been set within the past // second. - (CGPoint)lastTapPoint; // Store the tap CGPoint in |_lastTapPoint| and the current timestamp. @@ -934,25 +913,28 @@ @end @implementation BrowserViewController - +// Public synthesized propeties. @synthesize contentArea = _contentArea; @synthesize typingShield = _typingShield; @synthesize active = _active; +// Private synthesized properties @synthesize visible = _visible; @synthesize viewVisible = _viewVisible; @synthesize broadcasting = _broadcasting; @synthesize dismissingModal = _dismissingModal; @synthesize hideStatusBar = _hideStatusBar; @synthesize activityOverlayCoordinator = _activityOverlayCoordinator; -@synthesize presenting = _presenting; @synthesize foregroundTabWasAddedCompletionBlock = _foregroundTabWasAddedCompletionBlock; -@synthesize tabTipBubblePresenter = _tabTipBubblePresenter; -@synthesize incognitoTabTipBubblePresenter = _incognitoTabTipBubblePresenter; @synthesize recentTabsCoordinator = _recentTabsCoordinator; @synthesize tabStripCoordinator = _tabStripCoordinator; @synthesize tabStripView = _tabStripView; +@synthesize tabTipBubblePresenter = _tabTipBubblePresenter; +@synthesize incognitoTabTipBubblePresenter = _incognitoTabTipBubblePresenter; @synthesize toolbarOffsetConstraint = _toolbarOffsetConstraint; +// DialogPresenterDelegate property +@synthesize dialogPresenterDelegateIsPresenting = + _dialogPresenterDelegateIsPresenting; #pragma mark - Object lifecycle @@ -1032,14 +1014,7 @@ DCHECK(_isShutdown) << "-shutdown must be called before dealloc."; } -#pragma mark - Accessibility - -- (BOOL)accessibilityPerformEscape { - [self dismissPopups]; - return YES; -} - -#pragma mark - Properties +#pragma mark - Public Properties - (id<ApplicationCommands, BrowserCommands, @@ -1101,27 +1076,19 @@ [self setNeedsStatusBarAppearanceUpdate]; } -- (void)setPrimary:(BOOL)primary { - [_model setPrimary:primary]; - if (primary) { - [self updateDialogPresenterActiveState]; - [self updateBroadcastState]; - } else { - self.dialogPresenter.active = false; - } -} - - (BOOL)isPlayingTTS { return _voiceSearchController && _voiceSearchController->IsPlayingAudio(); } +- (TabModel*)tabModel { + return _model; +} + - (ios::ChromeBrowserState*)browserState { return _browserState; } -- (TabModel*)tabModel { - return _model; -} +#pragma mark - Private Properties - (SideSwipeController*)sideSwipeController { if (!_sideSwipeController) { @@ -1241,7 +1208,7 @@ } - (BOOL)isToolbarOnScreen { - return [self headerHeight] - [self currentHeaderOffset] > 0; + return self.headerHeight - [self currentHeaderOffset] > 0; } - (void)setInNewTabAnimation:(BOOL)inNewTabAnimation { @@ -1274,7 +1241,27 @@ [self setNeedsStatusBarAppearanceUpdate]; } -#pragma mark - IBActions +- (CGFloat)headerOffset { + if (IsIPadIdiom()) + return StatusBarHeight(); + return 0.0; +} + +- (CGFloat)headerHeight { + return [self headerHeightForTab:[_model currentTab]]; +} + +#pragma mark - Public methods + +- (void)setPrimary:(BOOL)primary { + [_model setPrimary:primary]; + if (primary) { + [self updateDialogPresenterActiveState]; + [self updateBroadcastState]; + } else { + self.dialogPresenter.active = false; + } +} - (void)shieldWasTapped:(id)sender { [_toolbarCoordinator cancelOmniboxEdit]; @@ -1291,7 +1278,183 @@ [self presentNewIncognitoTabTipBubbleOnInitialized]; } -#pragma mark - UIViewController methods +- (void)browserStateDestroyed { + [self setActive:NO]; + [_paymentRequestManager close]; + _paymentRequestManager = nil; + [_toolbarCoordinator browserStateDestroyed]; + [_model browserStateDestroyed]; + + // Disconnect child coordinators. + [_activityServiceCoordinator disconnect]; + [_qrScannerCoordinator disconnect]; + [_tabHistoryCoordinator disconnect]; + [_pageInfoCoordinator disconnect]; + [_externalSearchCoordinator disconnect]; + [self.tabStripCoordinator stop]; + self.tabStripCoordinator = nil; + self.tabStripView = nil; + + _browserState = nullptr; + [_dispatcher stopDispatchingToTarget:self]; + _dispatcher = nil; +} + +- (Tab*)addSelectedTabWithURL:(const GURL&)url + transition:(ui::PageTransition)transition { + return [self addSelectedTabWithURL:url + atIndex:[_model count] + transition:transition]; +} + +- (Tab*)addSelectedTabWithURL:(const GURL&)url + atIndex:(NSUInteger)position + transition:(ui::PageTransition)transition { + return [self addSelectedTabWithURL:url + atIndex:position + transition:transition + tabAddedCompletion:nil]; +} + +- (Tab*)addSelectedTabWithURL:(const GURL&)url + atIndex:(NSUInteger)position + transition:(ui::PageTransition)transition + tabAddedCompletion:(ProceduralBlock)tabAddedCompletion { + return [self addSelectedTabWithURL:url + postData:NULL + atIndex:position + transition:transition + tabAddedCompletion:tabAddedCompletion]; +} + +- (void)expectNewForegroundTab { + _expectingForegroundTab = YES; +} + +- (void)startVoiceSearchWithOriginView:(UIView*)originView { + _voiceSearchButton = originView; + // Delay Voice Search until new tab animations have finished. + if (self.inNewTabAnimation) { + _startVoiceSearchAfterNewTabAnimation = YES; + return; + } + + // Keyboard shouldn't overlay the ecoutez window, so dismiss find in page and + // dismiss the keyboard. + [self closeFindInPage]; + [[_model currentTab].webController dismissKeyboard]; + + // Ensure that voice search objects are created. + [self ensureVoiceSearchControllerCreated]; + [self ensureVoiceSearchBarCreated]; + + // Present voice search. + [_voiceSearchBar prepareToPresentVoiceSearch]; + _voiceSearchController->StartRecognition(self, [_model currentTab]); + [_toolbarCoordinator cancelOmniboxEdit]; +} + +- (void)clearPresentedStateWithCompletion:(ProceduralBlock)completion + dismissOmnibox:(BOOL)dismissOmnibox { + [_activityServiceCoordinator cancelShare]; + [_bookmarkInteractionController dismissBookmarkModalControllerAnimated:NO]; + [_bookmarkInteractionController dismissSnackbar]; + if (dismissOmnibox) { + [_toolbarCoordinator cancelOmniboxEdit]; + } + [_dialogPresenter cancelAllDialogs]; + [self.dispatcher hidePageInfo]; + [self.tabTipBubblePresenter dismissAnimated:NO]; + [self.incognitoTabTipBubblePresenter dismissAnimated:NO]; + if (_voiceSearchController) + _voiceSearchController->DismissMicPermissionsHelp(); + + Tab* currentTab = [_model currentTab]; + [currentTab dismissModals]; + + if (currentTab) { + auto* findHelper = FindTabHelper::FromWebState(currentTab.webState); + if (findHelper) { + findHelper->StopFinding(^{ + [self updateFindBar:NO shouldFocus:NO]; + }); + } + } + + [_paymentRequestManager cancelRequest]; + [_printController dismissAnimated:YES]; + _printController = nil; + [self.dispatcher dismissToolsMenu]; + [_contextMenuCoordinator stop]; + [self dismissRateThisAppDialog]; + + if (self.presentedViewController) { + // Dismisses any other modal controllers that may be present, e.g. Recent + // Tabs. + // + // Note that currently, some controllers like the bookmark ones were already + // dismissed (in this example in -dismissBookmarkModalControllerAnimated:), + // but are still reported as the presentedViewController. Calling + // |dismissViewControllerAnimated:completion:| again would dismiss the BVC + // itself, so instead check the value of |self.dismissingModal| and only + // call dismiss if one of the above calls has not already triggered a + // dismissal. + // + // To ensure the completion is called, nil is passed to the call to dismiss, + // and the completion is called explicitly below. + if (!TabSwitcherPresentsBVCEnabled() || !self.dismissingModal) { + [self dismissViewControllerAnimated:NO completion:nil]; + } + // Dismissed controllers will be so after a delay. Queue the completion + // callback after that. + if (completion) { + dispatch_after( + dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), + dispatch_get_main_queue(), ^{ + completion(); + }); + } + } else if (completion) { + // If no view controllers are presented, we should be ok with dispatching + // the completion block directly. + dispatch_async(dispatch_get_main_queue(), completion); + } +} + +- (UIView<TabStripFoldAnimation>*)tabStripPlaceholderView { + return [self.tabStripCoordinator placeholderView]; +} + +- (void)shutdown { + DCHECK(!_isShutdown); + _isShutdown = YES; + [self.tabStripCoordinator stop]; + self.tabStripCoordinator = nil; + [_toolbarCoordinator stop]; + _toolbarCoordinator = nil; + self.tabStripView = nil; + _infoBarContainer = nil; + _readingListMenuNotifier = nil; + _bookmarkModelBridge.reset(); + [_model removeObserver:self]; + [[UpgradeCenter sharedInstance] unregisterClient:self]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [_toolbarCoordinator setToolbarDelegate:nil]; + if (_voiceSearchController) + _voiceSearchController->SetDelegate(nil); + [_rateThisAppDialog setDelegate:nil]; + [_model closeAllTabs]; + [_paymentRequestManager setActiveWebState:nullptr]; +} + +#pragma mark - NSObject + +- (BOOL)accessibilityPerformEscape { + [self dismissPopups]; + return YES; +} + +#pragma mark - UIViewController // Perform additional set up after loading the view, typically from a nib. - (void)viewDidLoad { @@ -1531,11 +1694,12 @@ [super dismissViewControllerAnimated:flag completion:^{ BrowserViewController* strongSelf = weakSelf; - [strongSelf setDismissingModal:NO]; - [strongSelf setPresenting:NO]; + strongSelf.dismissingModal = NO; + strongSelf.dialogPresenterDelegateIsPresenting = + NO; if (completion) completion(); - [[strongSelf dialogPresenter] tryToPresent]; + [strongSelf.dialogPresenter tryToPresent]; }]; } @@ -1588,9 +1752,9 @@ } } - self.presenting = YES; - if ([_sideSwipeController inSwipe]) { - [_sideSwipeController resetContentView]; + self.dialogPresenterDelegateIsPresenting = YES; + if ([self.sideSwipeController inSwipe]) { + [self.sideSwipeController resetContentView]; } [super presentViewController:viewControllerToPresent @@ -1603,7 +1767,8 @@ self.presentedViewController.beingDismissed) { // Don't rotate while a presentation or dismissal animation is occurring. return NO; - } else if (_sideSwipeController && ![_sideSwipeController shouldAutorotate]) { + } else if (_sideSwipeController && + ![self.sideSwipeController shouldAutorotate]) { // Don't auto rotate if side swipe controller view says not to. return NO; } else { @@ -1611,6 +1776,11 @@ } } +- (UIStatusBarStyle)preferredStatusBarStyle { + return (IsIPadIdiom() || _isOffTheRecord) ? UIStatusBarStyleLightContent + : UIStatusBarStyleDefault; +} + #pragma mark - Notification handling - (void)registerForNotifications { @@ -1904,28 +2074,6 @@ } } -- (void)browserStateDestroyed { - [self setActive:NO]; - [_paymentRequestManager close]; - _paymentRequestManager = nil; - [_toolbarCoordinator browserStateDestroyed]; - [_model browserStateDestroyed]; - - // Disconnect child coordinators. - [_activityServiceCoordinator disconnect]; - [_qrScannerCoordinator disconnect]; - [_tabHistoryCoordinator disconnect]; - [_pageInfoCoordinator disconnect]; - [_externalSearchCoordinator disconnect]; - [self.tabStripCoordinator stop]; - self.tabStripCoordinator = nil; - self.tabStripView = nil; - - _browserState = nullptr; - [_dispatcher stopDispatchingToTarget:self]; - _dispatcher = nil; -} - - (void)installFakeStatusBar { CGFloat statusBarHeight = StatusBarHeight(); CGRect statusBarFrame = @@ -1967,7 +2115,7 @@ dispatcher:self.dispatcher browserState:_browserState]; - _sideSwipeController.toolbarInteractionHandler = _toolbarCoordinator; + self.sideSwipeController.toolbarInteractionHandler = _toolbarCoordinator; _toolbarCoordinator.tabModel = _model; [_toolbarCoordinator @@ -2116,7 +2264,7 @@ - (void)setUpViewLayout:(BOOL)initialLayout { DCHECK([self isViewLoaded]); CGFloat widthOfView = CGRectGetWidth([self view].bounds); - CGFloat minY = [self headerOffset]; + CGFloat minY = self.headerOffset; // Update the fake toolbar background height. CGRect fakeStatusBarFrame = _fakeStatusBarView.frame; @@ -2177,10 +2325,10 @@ [infoBarContainerView setFrame:infoBarFrame]; // Attach the typing shield to the content area but have it hidden. - [_typingShield setFrame:[_contentArea frame]]; + [self.typingShield setFrame:[_contentArea frame]]; if (initialLayout) { - [[self view] insertSubview:_typingShield aboveSubview:_contentArea]; - [_typingShield setHidden:YES]; + [[self view] insertSubview:self.typingShield aboveSubview:_contentArea]; + [self.typingShield setHidden:YES]; } } @@ -2451,6 +2599,96 @@ return CGPointEqualToPoint(scrollOffset, CGPointZero); } +- (NSArray<HeaderDefinition*>*)headerViews { + NSMutableArray<HeaderDefinition*>* results = [[NSMutableArray alloc] init]; + if (![self isViewLoaded]) + return results; + + if (!IsIPadIdiom()) { + if (_toolbarCoordinator.toolbarViewController.view) { + [results addObject:[HeaderDefinition + definitionWithView:_toolbarCoordinator + .toolbarViewController.view + headerBehaviour:Hideable + heightAdjustment:0.0 + inset:0.0]]; + } + } else { + if (self.tabStripView) { + [results addObject:[HeaderDefinition definitionWithView:self.tabStripView + headerBehaviour:Hideable + heightAdjustment:0.0 + inset:0.0]]; + } + if (_toolbarCoordinator.toolbarViewController.view) { + [results addObject:[HeaderDefinition + definitionWithView:_toolbarCoordinator + .toolbarViewController.view + headerBehaviour:Hideable + heightAdjustment:0.0 + inset:0.0]]; + } + if ([_findBarController view]) { + [results addObject:[HeaderDefinition + definitionWithView:[_findBarController view] + headerBehaviour:Overlap + heightAdjustment:0.0 + inset:kIPadFindBarOverlap]]; + } + } + return [results copy]; +} + +- (UIView*)footerView { + return _voiceSearchBar; +} + +- (CGFloat)headerHeightForTab:(Tab*)tab { + id nativeController = [self nativeControllerForTab:tab]; + if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] && + [nativeController respondsToSelector:@selector(toolbarHeight)] && + [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) { + // On iPhone, don't add any header height for ToolbarOwner native + // controllers when they're displaying their own toolbar. + return 0; + } + + NSArray<HeaderDefinition*>* views = [self headerViews]; + + CGFloat height = self.headerOffset; + for (HeaderDefinition* header in views) { + if (header.view && header.behaviour == Hideable) { + height += CGRectGetHeight([header.view frame]) - + header.heightAdjustement - header.inset; + } + } + + return height - StatusBarHeight(); +} + +- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers + atOffset:(CGFloat)headerOffset { + CGFloat height = self.headerOffset; + for (HeaderDefinition* header in headers) { + CGFloat yOrigin = height - headerOffset - header.inset; + // Make sure the toolbarView's constraints are also updated. Leaving the + // -setFrame call to minimize changes in this CL -- otherwise the way + // toolbar_view manages it's alpha changes would also need to be updated. + // TODO(crbug.com/778822): This can be cleaned up when the new fullscreen + // is enabled. + if (IsSafeAreaCompatibleToolbarEnabled() && + header.view == _toolbarCoordinator.toolbarViewController.view && + !IsIPadIdiom()) { + self.toolbarOffsetConstraint.constant = yOrigin; + } + CGRect frame = [header.view frame]; + frame.origin.y = yOrigin; + [header.view setFrame:frame]; + if (header.behaviour != Overlap) + height += CGRectGetHeight(frame); + } +} + #pragma mark - Tap handling - (void)setLastTapPoint:(OpenNewTabCommand*)command { @@ -2478,17 +2716,6 @@ _lastTapTime = CACurrentMediaTime(); } -- (BOOL)addTabIfNoTabWithNormalBrowserState { - if (![_model count]) { - if (!_isOffTheRecord) { - [self addSelectedTabWithURL:GURL(kChromeUINewTabURL) - transition:ui::PAGE_TRANSITION_TYPED]; - return YES; - } - } - return NO; -} - #pragma mark - Tab creation and selection // Called when either a tab finishes loading or when a tab with finished content @@ -2510,33 +2737,6 @@ tabAddedCompletion:nil]; } -- (Tab*)addSelectedTabWithURL:(const GURL&)url - transition:(ui::PageTransition)transition { - return [self addSelectedTabWithURL:url - atIndex:[_model count] - transition:transition]; -} - -- (Tab*)addSelectedTabWithURL:(const GURL&)url - atIndex:(NSUInteger)position - transition:(ui::PageTransition)transition { - return [self addSelectedTabWithURL:url - atIndex:position - transition:transition - tabAddedCompletion:nil]; -} - -- (Tab*)addSelectedTabWithURL:(const GURL&)url - atIndex:(NSUInteger)position - transition:(ui::PageTransition)transition - tabAddedCompletion:(ProceduralBlock)tabAddedCompletion { - return [self addSelectedTabWithURL:url - postData:NULL - atIndex:position - transition:transition - tabAddedCompletion:tabAddedCompletion]; -} - - (Tab*)addSelectedTabWithURL:(const GURL&)URL postData:(TemplateURLRef::PostContent*)postData atIndex:(NSUInteger)position @@ -2591,15 +2791,11 @@ return web::GetWebClient()->IsAppSpecificURL(visibleItem->GetURL()); } -- (void)expectNewForegroundTab { - _expectingForegroundTab = YES; -} - - (UIImageView*)pageOpenCloseAnimationView { CGRect frame = [_contentArea bounds]; - frame.size.height = frame.size.height - [self headerHeight]; - frame.origin.y = [self headerHeight]; + frame.size.height = frame.size.height - self.headerHeight; + frame.origin.y = self.headerHeight; UIImageView* pageView = [[UIImageView alloc] initWithFrame:frame]; CGPoint center = CGPointMake(CGRectGetMidX(frame), CGRectGetMidY(frame)); @@ -2744,32 +2940,6 @@ } } -- (UIView<TabStripFoldAnimation>*)tabStripPlaceholderView { - return [self.tabStripCoordinator placeholderView]; -} - -- (void)shutdown { - DCHECK(!_isShutdown); - _isShutdown = YES; - [self.tabStripCoordinator stop]; - self.tabStripCoordinator = nil; - [_toolbarCoordinator stop]; - _toolbarCoordinator = nil; - self.tabStripView = nil; - _infoBarContainer = nil; - _readingListMenuNotifier = nil; - _bookmarkModelBridge.reset(); - [_model removeObserver:self]; - [[UpgradeCenter sharedInstance] unregisterClient:self]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_toolbarCoordinator setToolbarDelegate:nil]; - if (_voiceSearchController) - _voiceSearchController->SetDelegate(nil); - [_rateThisAppDialog setDelegate:nil]; - [_model closeAllTabs]; - [_paymentRequestManager setActiveWebState:nullptr]; -} - #pragma mark - SnapshotOverlayProvider methods - (NSArray*)snapshotOverlaysForTab:(Tab*)tab { @@ -2796,8 +2966,10 @@ return overlays; } -#pragma mark - +#pragma mark - SnapshotOverlayProvider helpers +// Provides a view that encompasses currently displayed infobar(s) or nil +// if no infobar is presented. - (UIView*)infoBarOverlayViewForTab:(Tab*)tab { if (IsIPadIdiom()) { // Not using overlays on iPad because the content is pushed down by @@ -2818,6 +2990,7 @@ return nil; } +// Returns a vertical infobar offset relative to the tab content. - (CGFloat)infoBarOverlayYOffsetForTab:(Tab*)tab { if (tab != [_model currentTab] || !_infoBarContainer) { // There is no UI representation for non-current tabs or there is @@ -2835,6 +3008,8 @@ } } +// Provides a view that encompasses the voice search bar if it's displayed or +// nil if the voice search bar isn't displayed. - (UIView*)voiceSearchOverlayViewForTab:(Tab*)tab { Tab* currentTab = [_model currentTab]; if (tab && tab == currentTab && tab.isVoiceSearchResultsTab && @@ -2844,6 +3019,7 @@ return nil; } +// Returns a vertical voice search bar offset relative to the tab content. - (CGFloat)voiceSearchOverlayYOffsetForTab:(Tab*)tab { if (tab != [_model currentTab] || [_voiceSearchBar isHidden]) { // There is no UI representation for non-current tabs or there is @@ -2856,6 +3032,8 @@ } } +#pragma mark - Voice Search + - (void)ensureVoiceSearchControllerCreated { if (!_voiceSearchController) { VoiceSearchProvider* provider = @@ -2903,27 +3081,6 @@ _voiceSearchBar.hidden = !show; } -- (id<LogoAnimationControllerOwner>)currentLogoAnimationControllerOwner { - Protocol* ownerProtocol = @protocol(LogoAnimationControllerOwner); - if ([_voiceSearchBar conformsToProtocol:ownerProtocol] && - self.shouldShowVoiceSearchBar) { - // Use |_voiceSearchBar| for VoiceSearch results tab and dismissal - // animations. - return static_cast<id<LogoAnimationControllerOwner>>(_voiceSearchBar); - } - id currentNativeController = - [self nativeControllerForTab:self.tabModel.currentTab]; - Protocol* possibleOwnerProtocol = - @protocol(LogoAnimationControllerOwnerOwner); - if ([currentNativeController conformsToProtocol:possibleOwnerProtocol] && - [currentNativeController logoAnimationControllerOwner]) { - // If the current native controller is showing a GLIF view (e.g. the NTP - // when there is no doodle), use that GLIFControllerOwner. - return [currentNativeController logoAnimationControllerOwner]; - } - return nil; -} - #pragma mark - PassKitDialogProvider methods - (void)presentPassKitDialog:(NSData*)data { @@ -2953,11 +3110,6 @@ } } -- (UIStatusBarStyle)preferredStatusBarStyle { - return (IsIPadIdiom() || _isOffTheRecord) ? UIStatusBarStyleLightContent - : UIStatusBarStyleDefault; -} - #pragma mark - PasswordControllerDelegate methods - (BOOL)displaySignInNotification:(UIViewController*)viewController @@ -3246,87 +3398,16 @@ #pragma mark - LegacyFullscreenControllerDelegate methods +// TODO(crbug.com/798064): Remove these methods and their helpers once the +// fullscreen migration is complete. - (void)redrawHeader { for (HeaderDefinition* header in self.headerViews) { [header.view setNeedsLayout]; } } -- (CGFloat)headerOffset { - if (IsIPadIdiom()) - return StatusBarHeight(); - return 0.0; -} - -- (NSArray<HeaderDefinition*>*)headerViews { - NSMutableArray<HeaderDefinition*>* results = [[NSMutableArray alloc] init]; - if (![self isViewLoaded]) - return results; - - if (!IsIPadIdiom()) { - if (_toolbarCoordinator.toolbarViewController.view) { - [results addObject:[HeaderDefinition - definitionWithView:_toolbarCoordinator - .toolbarViewController.view - headerBehaviour:Hideable - heightAdjustment:0.0 - inset:0.0]]; - } - } else { - if (self.tabStripView) { - [results addObject:[HeaderDefinition definitionWithView:self.tabStripView - headerBehaviour:Hideable - heightAdjustment:0.0 - inset:0.0]]; - } - if (_toolbarCoordinator.toolbarViewController.view) { - [results addObject:[HeaderDefinition - definitionWithView:_toolbarCoordinator - .toolbarViewController.view - headerBehaviour:Hideable - heightAdjustment:0.0 - inset:0.0]]; - } - if ([_findBarController view]) { - [results addObject:[HeaderDefinition - definitionWithView:[_findBarController view] - headerBehaviour:Overlap - heightAdjustment:0.0 - inset:kIPadFindBarOverlap]]; - } - } - return [results copy]; -} - -- (UIView*)footerView { - return _voiceSearchBar; -} - -- (CGFloat)headerHeight { - return [self headerHeightForTab:[_model currentTab]]; -} - -- (CGFloat)headerHeightForTab:(Tab*)tab { - id nativeController = [self nativeControllerForTab:tab]; - if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] && - [nativeController respondsToSelector:@selector(toolbarHeight)] && - [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) { - // On iPhone, don't add any header height for ToolbarOwner native - // controllers when they're displaying their own toolbar. - return 0; - } - - NSArray<HeaderDefinition*>* views = [self headerViews]; - - CGFloat height = [self headerOffset]; - for (HeaderDefinition* header in views) { - if (header.view && header.behaviour == Hideable) { - height += CGRectGetHeight([header.view frame]) - - header.heightAdjustement - header.inset; - } - } - - return height - StatusBarHeight(); +- (CGFloat)headerHeightForLegacyFullscreen { + return self.headerHeight; } - (BOOL)isTabWithIDCurrent:(NSString*)sessionID { @@ -3341,57 +3422,16 @@ // Prerender tab does not have a toolbar, return |headerHeight| as promised by // API documentation. if (_insertedTabWasPrerenderedTab) - return [self headerHeight]; + return self.headerHeight; UIView* topHeader = headers[0].view; - return -(topHeader.frame.origin.y - [self headerOffset]); -} - -- (CGFloat)footerYForHeaderOffset:(CGFloat)headerOffset { - UIView* footer = [self footerView]; - CGFloat headerHeight = [self headerHeight]; - if (!footer || headerHeight == 0) - return 0.0; - - CGFloat footerHeight = CGRectGetHeight(footer.frame); - CGFloat offset = headerOffset * footerHeight / headerHeight; - return std::ceil(CGRectGetHeight(self.view.bounds) - footerHeight + offset); -} - -- (void)fullScreenController:(LegacyFullscreenController*)controller - headerAnimationCompleted:(BOOL)completed - offset:(CGFloat)offset { - if (completed) - [controller setToolbarInsetsForHeaderOffset:offset]; -} - -- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers - atOffset:(CGFloat)headerOffset { - CGFloat height = [self headerOffset]; - for (HeaderDefinition* header in headers) { - CGFloat yOrigin = height - headerOffset - header.inset; - // Make sure the toolbarView's constraints are also updated. Leaving the - // -setFrame call to minimize changes in this CL -- otherwise the way - // toolbar_view manages it's alpha changes would also need to be updated. - // TODO(crbug.com/778822): This can be cleaned up when the new fullscreen - // is enabled. - if (IsSafeAreaCompatibleToolbarEnabled() && - header.view == _toolbarCoordinator.toolbarViewController.view && - !IsIPadIdiom()) { - self.toolbarOffsetConstraint.constant = yOrigin; - } - CGRect frame = [header.view frame]; - frame.origin.y = yOrigin; - [header.view setFrame:frame]; - if (header.behaviour != Overlap) - height += CGRectGetHeight(frame); - } + return -(topHeader.frame.origin.y - self.headerOffset); } - (void)fullScreenController:(LegacyFullscreenController*)fullScreenController drawHeaderViewFromOffset:(CGFloat)headerOffset animate:(BOOL)animate { - if ([_sideSwipeController inSwipe]) + if ([self.sideSwipeController inSwipe]) return; CGRect footerFrame = CGRectZero; @@ -3432,7 +3472,7 @@ changeTopContentPadding:(BOOL)changeTopContentPadding scrollingToOffset:(CGFloat)contentOffset { DCHECK(webViewProxy); - if ([_sideSwipeController inSwipe]) + if ([self.sideSwipeController inSwipe]) return; CGRect footerFrame; @@ -3467,13 +3507,34 @@ completion:completion]; } -#pragma mark - VoiceSearchBarOwner +#pragma mark - LegacyFullscreenControllerDelegate helpers -- (id<VoiceSearchBar>)voiceSearchBar { - return _voiceSearchBar; +// Returns the y coordinate for the footer's frame when animating the footer +// in/out of fullscreen. +- (CGFloat)footerYForHeaderOffset:(CGFloat)headerOffset { + UIView* footer = [self footerView]; + CGFloat headerHeight = [self headerHeight]; + if (!footer || headerHeight == 0) + return 0.0; + + CGFloat footerHeight = CGRectGetHeight(footer.frame); + CGFloat offset = headerOffset * footerHeight / headerHeight; + return std::ceil(CGRectGetHeight(self.view.bounds) - footerHeight + offset); +} + +// Called when the animation for setting the header view's offset is finished. +// |completed| should indicate if the animation finished completely or was +// interrupted. |offset| should indicate the header offset after the animation. +// |dragged| should indicate if the header moved due to the user dragging. +- (void)fullScreenController:(LegacyFullscreenController*)controller + headerAnimationCompleted:(BOOL)completed + offset:(CGFloat)offset { + if (completed) + [controller setToolbarInsetsForHeaderOffset:offset]; } #pragma mark - Install OverScrollActionController method. + - (void)setOverScrollActionControllerToStaticNativeContent: (StaticHtmlNativeContent*)nativeContent { if (!IsIPadIdiom()) { @@ -3527,13 +3588,13 @@ - (CGFloat)overscrollActionsControllerHeaderInset: (OverscrollActionsController*)controller { if (controller == [[[self tabModel] currentTab] overscrollActionsController]) - return [self headerHeight]; + return self.headerHeight; else return 0; } - (CGFloat)overscrollHeaderHeight { - return [self headerHeight] + StatusBarHeight(); + return self.headerHeight + StatusBarHeight(); } #pragma mark - TabSnapshottingDelegate methods. @@ -3546,7 +3607,7 @@ return UIEdgeInsetsMake(headerHeight, 0.0, 0.0, 0.0); } -#pragma mark - NewTabPageObserver methods. +#pragma mark - NewTabPageControllerObserver methods. - (void)selectedPanelDidChange { [self updateToolbar]; @@ -3554,6 +3615,8 @@ #pragma mark - CRWNativeContentProvider methods +// TODO(crbug.com/725241): This method is deprecated and should be removed by +// switching to DidFinishnavigation. - (id<CRWNativeContent>)controllerForURL:(const GURL&)url withError:(NSError*)error isPost:(BOOL)isPost { @@ -4152,10 +4215,6 @@ WindowOpenDisposition::CURRENT_TAB); } -- (void)focusOmnibox { - [_toolbarCoordinator focusOmnibox]; -} - #pragma mark - MainContentUI - (MainContentUIState*)mainContentUIState { @@ -4175,8 +4234,6 @@ editingText:![self isFirstResponder]]; } -#pragma mark - - // Induce an intentional crash in the browser process. - (void)induceBrowserCrash { CHECK(false); @@ -4186,6 +4243,8 @@ CHECK(true); } +#pragma mark - UrlLoader (public protocol) + - (void)loadURL:(const GURL&)url referrer:(const web::Referrer&)referrer transition:(ui::PageTransition)transition @@ -4393,14 +4452,14 @@ [[NSNotificationCenter defaultCenter] postNotificationName:kLocationBarBecomesFirstResponderNotification object:nil]; - [_sideSwipeController setEnabled:NO]; + [self.sideSwipeController setEnabled:NO]; if ([[_model currentTab].webController wantsKeyboardShield]) { - [[self view] insertSubview:_typingShield aboveSubview:_contentArea]; - [_typingShield setAlpha:0.0]; - [_typingShield setHidden:NO]; + [[self view] insertSubview:self.typingShield aboveSubview:_contentArea]; + [self.typingShield setAlpha:0.0]; + [self.typingShield setHidden:NO]; [UIView animateWithDuration:0.3 animations:^{ - [_typingShield setAlpha:1.0]; + [self.typingShield setAlpha:1.0]; }]; } [[OmniboxGeolocationController sharedInstance] @@ -4411,22 +4470,22 @@ if (!_locationBarHasFocus) return; // TODO(crbug.com/244366): This should not be necessary. _locationBarHasFocus = NO; - [_sideSwipeController setEnabled:YES]; + [self.sideSwipeController setEnabled:YES]; [[NSNotificationCenter defaultCenter] postNotificationName:kLocationBarResignsFirstResponderNotification object:nil]; [UIView animateWithDuration:0.3 animations:^{ - [_typingShield setAlpha:0.0]; + [self.typingShield setAlpha:0.0]; } completion:^(BOOL finished) { // This can happen if one quickly resigns the omnibox and then taps // on the omnibox again during this animation. If the animation is // interrupted and the toolbar controller is first responder, it's safe - // to assume the |_typingShield| shouldn't be hidden here. + // to assume |self.typingShield| shouldn't be hidden here. if (!finished && [_toolbarCoordinator isOmniboxFirstResponder]) return; - [_typingShield setHidden:YES]; + [self.typingShield setHidden:YES]; }]; [[OmniboxGeolocationController sharedInstance] locationBarDidResignFirstResponder:_browserState]; @@ -4459,7 +4518,7 @@ CGRect frame = [_contentArea frame]; if (!fullScreen) { // Changing the origin here is unnecessary, it's set in page_animation_util. - frame.size.height -= [self headerHeight]; + frame.size.height -= self.headerHeight; } CGFloat shortAxis = frame.size.width; @@ -4479,7 +4538,7 @@ return card; } -#pragma mark - Tools Menu Configuration delegate +#pragma mark - ToolsMenuConfigurationProvider - (void)prepareForToolsMenuPresentationByCoordinator: (ToolsMenuCoordinator*)coordinator { @@ -4624,7 +4683,7 @@ UMA_HISTOGRAM_TIMES("Toolbar.Menu.NewTabPresentationDuration", timeDelta); } if (command.shouldFocusOmnibox) { - [weakSelf focusOmnibox]; + [weakSelf.dispatcher focusOmnibox]; } }; @@ -4864,8 +4923,6 @@ [[_model currentTab] reloadWithUserAgentType:web::UserAgentType::MOBILE]; } -#pragma mark - Command Handling - - (void)closeCurrentTab { Tab* currentTab = [_model currentTab]; NSUInteger tabIndex = [_model indexOfTab:currentTab]; @@ -4892,73 +4949,6 @@ } } -- (void)clearPresentedStateWithCompletion:(ProceduralBlock)completion - dismissOmnibox:(BOOL)dismissOmnibox { - [_activityServiceCoordinator cancelShare]; - [_bookmarkInteractionController dismissBookmarkModalControllerAnimated:NO]; - [_bookmarkInteractionController dismissSnackbar]; - if (dismissOmnibox) { - [_toolbarCoordinator cancelOmniboxEdit]; - } - [_dialogPresenter cancelAllDialogs]; - [self.dispatcher hidePageInfo]; - [self.tabTipBubblePresenter dismissAnimated:NO]; - [self.incognitoTabTipBubblePresenter dismissAnimated:NO]; - if (_voiceSearchController) - _voiceSearchController->DismissMicPermissionsHelp(); - - Tab* currentTab = [_model currentTab]; - [currentTab dismissModals]; - - if (currentTab) { - auto* findHelper = FindTabHelper::FromWebState(currentTab.webState); - if (findHelper) { - findHelper->StopFinding(^{ - [self updateFindBar:NO shouldFocus:NO]; - }); - } - } - - [_paymentRequestManager cancelRequest]; - [_printController dismissAnimated:YES]; - _printController = nil; - [self.dispatcher dismissToolsMenu]; - [_contextMenuCoordinator stop]; - [self dismissRateThisAppDialog]; - - if (self.presentedViewController) { - // Dismisses any other modal controllers that may be present, e.g. Recent - // Tabs. - // - // Note that currently, some controllers like the bookmark ones were already - // dismissed (in this example in -dismissBookmarkModalControllerAnimated:), - // but are still reported as the presentedViewController. Calling - // |dismissViewControllerAnimated:completion:| again would dismiss the BVC - // itself, so instead check the value of |self.dismissingModal| and only - // call dismiss if one of the above calls has not already triggered a - // dismissal. - // - // To ensure the completion is called, nil is passed to the call to dismiss, - // and the completion is called explicitly below. - if (!TabSwitcherPresentsBVCEnabled() || !self.dismissingModal) { - [self dismissViewControllerAnimated:NO completion:nil]; - } - // Dismissed controllers will be so after a delay. Queue the completion - // callback after that. - if (completion) { - dispatch_after( - dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), - dispatch_get_main_queue(), ^{ - completion(); - }); - } - } else if (completion) { - // If no view controllers are presented, we should be ok with dispatching - // the completion block directly. - dispatch_async(dispatch_get_main_queue(), completion); - } -} - #pragma mark - Find Bar - (void)hideFindBarWithAnimation:(BOOL)animate { @@ -5046,33 +5036,10 @@ } } -- (void)startVoiceSearchWithOriginView:(UIView*)originView { - _voiceSearchButton = originView; - // Delay Voice Search until new tab animations have finished. - if (self.inNewTabAnimation) { - _startVoiceSearchAfterNewTabAnimation = YES; - return; - } - - // Keyboard shouldn't overlay the ecoutez window, so dismiss find in page and - // dismiss the keyboard. - [self closeFindInPage]; - [[_model currentTab].webController dismissKeyboard]; - - // Ensure that voice search objects are created. - [self ensureVoiceSearchControllerCreated]; - [self ensureVoiceSearchBarCreated]; - - // Present voice search. - [_voiceSearchBar prepareToPresentVoiceSearch]; - _voiceSearchController->StartRecognition(self, [_model currentTab]); - [_toolbarCoordinator cancelOmniboxEdit]; -} - #pragma mark - ToolbarOwner - (CGFloat)toolbarHeight { - return [self headerHeight]; + return self.headerHeight; } - (CGRect)toolbarFrame { @@ -5126,6 +5093,10 @@ infobars::InfoBarManager* infoBarManager = InfoBarManagerImpl::FromWebState(newTab.webState); _infoBarContainer->ChangeInfoBarManager(infoBarManager); + + // Dismiss the language selector, if any; this is a no-op when there's + // no language selector presented. + [_languageSelectionCoordinator dismissLanguageSelector]; } [self updateVoiceSearchBarVisibilityAnimated:NO]; @@ -5205,7 +5176,7 @@ [_toolbarCoordinator setTabCount:[_model count]]; } -#pragma mark - Upgrade Detection +#pragma mark - UpgradeCenterClient - (void)showUpgrade:(UpgradeCenter*)center { // Add an infobar on all the open tabs. @@ -5261,7 +5232,7 @@ return (![hitView isDescendantOfView:_contentArea]) ? NO : YES; } -#pragma mark - SideSwipeController Delegate Methods +#pragma mark - SideSwipeControllerDelegate - (void)sideSwipeViewDismissAnimationDidEnd:(UIView*)sideSwipeView { DCHECK(!IsIPadIdiom()); @@ -5275,14 +5246,18 @@ // Reset horizontal stack view. [sideSwipeView removeFromSuperview]; - [_sideSwipeController setInSwipe:NO]; + [self.sideSwipeController setInSwipe:NO]; [_infoBarContainer->view() setHidden:NO]; } -- (UIView*)contentView { +- (UIView*)sideSwipeContentView { return _contentArea; } +- (void)sideSwipeRedisplayTab:(Tab*)tab { + [self displayTab:tab isNewSelection:YES]; +} + - (BOOL)preventSideSwipe { if ([_toolbarCoordinator isShowingToolsMenu]) return YES; @@ -5310,6 +5285,10 @@ } } +- (CGFloat)headerHeightForSideSwipe { + return self.headerHeight; +} + - (BOOL)verifyToolbarViewPlacementInView:(UIView*)views { BOOL seenToolbar = NO; BOOL seenInfoBarContainer = NO; @@ -5395,7 +5374,7 @@ [self.dispatcher showSnackbarMessage:message]; } -#pragma mark - Show Mail Composer methods +#pragma mark - NetExportTabHelperDelegate - (void)netExportTabHelper:(NetExportTabHelper*)tabHelper showMailComposerWithContext:(ShowMailComposerContext*)context { @@ -5439,13 +5418,15 @@ [self dismissViewControllerAnimated:YES completion:nil]; } -#pragma mark - StoreKitLauncher methods +#pragma mark - SKStoreProductViewControllerDelegate - (void)productViewControllerDidFinish: (SKStoreProductViewController*)viewController { [self dismissViewControllerAnimated:YES completion:nil]; } +#pragma mark - StoreKitLauncher methods + - (void)openAppStore:(NSString*)appId { if (![appId length]) return; @@ -5464,7 +5445,7 @@ [self.dialogPresenter cancelDialogForWebState:tab.webState]; } -#pragma mark - FKFeedbackPromptDelegate methods +#pragma mark - AppRatingPromptDelegate - (void)userTappedRateApp:(UIView*)view { base::RecordAction(base::UserMetricsAction("IOSRateThisAppRateChosen")); @@ -5482,6 +5463,12 @@ _rateThisAppDialog = nil; } +#pragma mark - VoiceSearchBarOwner + +- (id<VoiceSearchBar>)voiceSearchBar { + return _voiceSearchBar; +} + #pragma mark - VoiceSearchBarDelegate - (BOOL)isTTSEnabledForVoiceSearchBar:(id<VoiceSearchBar>)voiceSearchBar { @@ -5507,18 +5494,48 @@ return [self currentLogoAnimationControllerOwner]; } -#pragma mark - ActivityService Providers +#pragma mark - VoiceSearchPresenter helpers + +// The LogoAnimationControllerOwner to be used for the next logo transition +// animation. +- (id<LogoAnimationControllerOwner>)currentLogoAnimationControllerOwner { + Protocol* ownerProtocol = @protocol(LogoAnimationControllerOwner); + if ([_voiceSearchBar conformsToProtocol:ownerProtocol] && + self.shouldShowVoiceSearchBar) { + // Use |_voiceSearchBar| for VoiceSearch results tab and dismissal + // animations. + return static_cast<id<LogoAnimationControllerOwner>>(_voiceSearchBar); + } + id currentNativeController = + [self nativeControllerForTab:self.tabModel.currentTab]; + Protocol* possibleOwnerProtocol = + @protocol(LogoAnimationControllerOwnerOwner); + if ([currentNativeController conformsToProtocol:possibleOwnerProtocol] && + [currentNativeController logoAnimationControllerOwner]) { + // If the current native controller is showing a GLIF view (e.g. the NTP + // when there is no doodle), use that GLIFControllerOwner. + return [currentNativeController logoAnimationControllerOwner]; + } + return nil; +} + +#pragma mark - ActivityServicePresentation - (void)presentActivityServiceViewController:(UIViewController*)controller { [self presentViewController:controller animated:YES completion:nil]; } - (void)activityServiceDidEndPresenting { - self.presenting = NO; + self.dialogPresenterDelegateIsPresenting = NO; [self.dialogPresenter tryToPresent]; } -#pragma mark - QRScanner Requirements +- (void)showActivityServiceErrorAlertWithStringTitle:(NSString*)title + message:(NSString*)message { + [self showErrorAlertWithStringTitle:title message:message]; +} + +#pragma mark - QRScannerPresenting - (void)presentQRScannerViewController:(UIViewController*)controller { [self presentViewController:controller animated:YES completion:nil]; @@ -5530,7 +5547,13 @@ [self dismissViewControllerAnimated:YES completion:completion]; } -#pragma mark - TabHistoryPresenter +#pragma mark - TabHeadersDelegate + +- (CGFloat)tabHeaderHeightForTab:(Tab*)tab { + return [self headerHeightForTab:tab]; +} + +#pragma mark - TabHistoryPresentation - (UIView*)viewForTabHistoryPresentation { return self.view; @@ -5570,7 +5593,7 @@ - (void)printWebState:(web::WebState*)webState { if (webState == [_model currentTab].webState) - [self printTab]; + [self.dispatcher printTab]; } #pragma mark - RepostFormTabHelperDelegate @@ -5607,7 +5630,7 @@ // TODO(crbug.com/256655): Move the origin.y below to -setUpViewLayout. // because the CGPointZero above will break reset the offset, but it's not // clear what removing that will do. - tabStripFrame.origin.y = [self headerOffset]; + tabStripFrame.origin.y = self.headerOffset; tabStripFrame.size.width = CGRectGetWidth([self view].bounds); [self.tabStripView setFrame:tabStripFrame]; [[self view] addSubview:tabStripView];
diff --git a/ios/chrome/browser/ui/collection_view/collection_view_controller_test.h b/ios/chrome/browser/ui/collection_view/collection_view_controller_test.h index bf935a44..48c3c20 100644 --- a/ios/chrome/browser/ui/collection_view/collection_view_controller_test.h +++ b/ios/chrome/browser/ui/collection_view/collection_view_controller_test.h
@@ -9,7 +9,6 @@ #include "base/compiler_specific.h" #import "base/ios/block_types.h" -#import "base/mac/scoped_nsobject.h" #import "ios/chrome/test/block_cleanup_test.h" #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h" @@ -122,7 +121,7 @@ void DeleteItem(int section, int item, ProceduralBlock completion_block); private: - base::scoped_nsobject<CollectionViewController> controller_; + CollectionViewController* controller_; }; #endif // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_COLLECTION_VIEW_CONTROLLER_TEST_H_
diff --git a/ios/chrome/browser/ui/collection_view/collection_view_controller_test.mm b/ios/chrome/browser/ui/collection_view/collection_view_controller_test.mm index 7f979e2..001e70e 100644 --- a/ios/chrome/browser/ui/collection_view/collection_view_controller_test.mm +++ b/ios/chrome/browser/ui/collection_view/collection_view_controller_test.mm
@@ -28,13 +28,13 @@ void CollectionViewControllerTest::TearDown() { // Delete the controller before deleting other test variables, such as a // profile, to ensure things are cleaned up in the same order as in Chrome. - controller_.reset(); + controller_ = nil; BlockCleanupTest::TearDown(); } void CollectionViewControllerTest::CreateController() { DCHECK(!controller_); - controller_.reset(InstantiateController()); + controller_ = InstantiateController(); // Force the model to be loaded. [controller_ loadModel]; // Force the collectionView to be built. @@ -44,19 +44,19 @@ CollectionViewController* CollectionViewControllerTest::controller() { if (!controller_) CreateController(); - return controller_.get(); + return controller_; } void CollectionViewControllerTest::ResetController() { - controller_.reset(); + controller_ = nil; } void CollectionViewControllerTest::CheckController() { EXPECT_TRUE([controller_ view]); EXPECT_TRUE([controller_ collectionView]); EXPECT_TRUE([controller_ collectionViewModel]); - EXPECT_EQ(controller_.get(), [controller_ collectionView].dataSource); - EXPECT_EQ(controller_.get(), [controller_ collectionView].delegate); + EXPECT_EQ(controller_, [controller_ collectionView].dataSource); + EXPECT_EQ(controller_, [controller_ collectionView].delegate); } int CollectionViewControllerTest::NumberOfSections() {
diff --git a/ios/chrome/browser/ui/context_menu/context_menu_coordinator.mm b/ios/chrome/browser/ui/context_menu/context_menu_coordinator.mm index 2906dbe..f849c50b 100644 --- a/ios/chrome/browser/ui/context_menu/context_menu_coordinator.mm +++ b/ios/chrome/browser/ui/context_menu/context_menu_coordinator.mm
@@ -6,7 +6,6 @@ #import <UIKit/UIKit.h> -#import "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" #include "ui/base/l10n/l10n_util.h" #include "ui/strings/grit/ui_strings.h" @@ -18,7 +17,7 @@ @interface ContextMenuCoordinator () { // Coordinator handling the alert. - base::scoped_nsobject<ActionSheetCoordinator> _alertCoordinator; + ActionSheetCoordinator* _alertCoordinator; } @end @@ -30,12 +29,12 @@ self = [super initWithBaseViewController:viewController browserState:nullptr]; if (self) { CGRect rect = CGRectMake(params.location.x, params.location.y, 1.0, 1.0); - _alertCoordinator.reset([[ActionSheetCoordinator alloc] + _alertCoordinator = [[ActionSheetCoordinator alloc] initWithBaseViewController:viewController title:params.menu_title message:nil rect:rect - view:params.view]); + view:params.view]; } return self; }
diff --git a/ios/chrome/browser/ui/dialogs/dialog_presenter.h b/ios/chrome/browser/ui/dialogs/dialog_presenter.h index fc939cb..a775823 100644 --- a/ios/chrome/browser/ui/dialogs/dialog_presenter.h +++ b/ios/chrome/browser/ui/dialogs/dialog_presenter.h
@@ -97,7 +97,7 @@ willShowDialogForWebState:(web::WebState*)webState; // Whether the delegate is presenting another View Controller. -@property(nonatomic, assign) BOOL presenting; +@property(nonatomic, assign) BOOL dialogPresenterDelegateIsPresenting; @end
diff --git a/ios/chrome/browser/ui/dialogs/dialog_presenter.mm b/ios/chrome/browser/ui/dialogs/dialog_presenter.mm index 479680ef..59aa7b7 100644 --- a/ios/chrome/browser/ui/dialogs/dialog_presenter.mm +++ b/ios/chrome/browser/ui/dialogs/dialog_presenter.mm
@@ -9,7 +9,6 @@ #include "base/containers/circular_deque.h" #import "base/ios/block_types.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" @@ -36,8 +35,7 @@ // |_dialogCoordinatorsForWebStates|. base::circular_deque<web::WebState*> _queuedWebStates; // A map associating queued webStates with their coordinators. - std::map<web::WebState*, base::scoped_nsobject<AlertCoordinator>> - _dialogCoordinatorsForWebStates; + std::map<web::WebState*, AlertCoordinator*> _dialogCoordinatorsForWebStates; } // The delegate passed on initialization. @@ -353,7 +351,8 @@ return; // The active TabModel can't be changed while a JavaScript dialog is shown. DCHECK(!self.showingDialog); - if (_active && !_queuedWebStates.empty() && !self.delegate.presenting) + if (_active && !_queuedWebStates.empty() && + !self.delegate.dialogPresenterDelegateIsPresenting) [self showNextDialog]; } @@ -384,10 +383,10 @@ DCHECK_NE(webState, self.presentedDialogWebState); DCHECK(!_dialogCoordinatorsForWebStates[webState]); _queuedWebStates.push_back(webState); - _dialogCoordinatorsForWebStates[webState] = - base::scoped_nsobject<AlertCoordinator>(coordinator); + _dialogCoordinatorsForWebStates[webState] = coordinator; - if (self.active && !self.showingDialog && !self.delegate.presenting) + if (self.active && !self.showingDialog && + !self.delegate.dialogPresenterDelegateIsPresenting) [self showNextDialog]; } @@ -413,7 +412,8 @@ self.presentedDialogWebState = nil; self.presentedDialogCoordinator = nil; self.blockingConfirmationCoordinator = nil; - if (!_queuedWebStates.empty() && !self.delegate.presenting) + if (!_queuedWebStates.empty() && + !self.delegate.dialogPresenterDelegateIsPresenting) [self showNextDialog]; }
diff --git a/ios/chrome/browser/ui/dialogs/dialog_presenter_unittest.mm b/ios/chrome/browser/ui/dialogs/dialog_presenter_unittest.mm index f1505972..3ca03db 100644 --- a/ios/chrome/browser/ui/dialogs/dialog_presenter_unittest.mm +++ b/ios/chrome/browser/ui/dialogs/dialog_presenter_unittest.mm
@@ -52,7 +52,8 @@ @end @implementation TestDialogPresenterDelegate -@synthesize presenting = _presenting; +@synthesize dialogPresenterDelegateIsPresenting = + _dialogPresenterDelegateIsPresenting; - (std::vector<web::WebState*>)presentedWebStates { return _presentedWebStates; @@ -196,7 +197,7 @@ TEST_F(DialogPresenterTest, DelegatePresenting) { // Tests that the dialog is not shown if the delegate is presenting. DialogPresenterTestWebState webState1; - delegate().presenting = YES; + delegate().dialogPresenterDelegateIsPresenting = YES; [presenter() runJavaScriptAlertPanelWithMessage:@"" requestURL:GURL() webState:&webState1 @@ -206,7 +207,7 @@ EXPECT_EQ(0U, delegate().presentedWebStates.size()); // The delegate is not presenting anymore, the dialog is not shown yet. - delegate().presenting = NO; + delegate().dialogPresenterDelegateIsPresenting = NO; EXPECT_EQ(0U, delegate().presentedWebStates.size()); // Notify the presenter that it can present.
diff --git a/ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h b/ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h index cacd2104..f338ef9 100644 --- a/ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h +++ b/ios/chrome/browser/ui/dialogs/java_script_dialog_presenter_impl.h
@@ -5,7 +5,6 @@ #ifndef IOS_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_DIALOG_PRESENTER_IMPL_H_ #define IOS_CHROME_BROWSER_UI_DIALOGS_JAVA_SCRIPT_DIALOG_PRESENTER_IMPL_H_ -#import "base/mac/scoped_nsobject.h" #include "ios/web/public/java_script_dialog_presenter.h" @class AlertCoordinator; @@ -38,7 +37,7 @@ private: // The underlying DialogPresenter handling the dialog UI. - base::scoped_nsobject<DialogPresenter> dialog_presenter_; + DialogPresenter* dialog_presenter_; DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogPresenterImpl); };
diff --git a/ios/chrome/browser/ui/external_file_controller.h b/ios/chrome/browser/ui/external_file_controller.h index 20290bb..13e27c0 100644 --- a/ios/chrome/browser/ui/external_file_controller.h +++ b/ios/chrome/browser/ui/external_file_controller.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/native_content_controller.h" namespace web {
diff --git a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.h b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.h index dec711c..7ab1890 100644 --- a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.h +++ b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.h
@@ -47,7 +47,7 @@ // Called to retrieve the current height of the header. Only called from // -setHeaderVisible:, so that method needs to be explicitly called when the // height changes. -- (CGFloat)headerHeight; +- (CGFloat)headerHeightForLegacyFullscreen; // Tests if the session ID matches the current tab. - (BOOL)isTabWithIDCurrent:(NSString*)sessionID;
diff --git a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.mm b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.mm index 9af86174..118a1345 100644 --- a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.mm +++ b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.mm
@@ -332,7 +332,7 @@ } - (CGFloat)headerHeight { - return [self.delegate headerHeight]; + return [self.delegate headerHeightForLegacyFullscreen]; } - (CGFloat)topContentInsetCausedByHeader {
diff --git a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller_unittest.mm b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller_unittest.mm index b47424b..ccabd048 100644 --- a/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller_unittest.mm +++ b/ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller_unittest.mm
@@ -65,7 +65,7 @@ return currentPosition_; } -- (CGFloat)headerHeight { +- (CGFloat)headerHeightForLegacyFullscreen { return kHeaderHeight; }
diff --git a/ios/chrome/browser/ui/history/BUILD.gn b/ios/chrome/browser/ui/history/BUILD.gn index c5729a9..84e7069 100644 --- a/ios/chrome/browser/ui/history/BUILD.gn +++ b/ios/chrome/browser/ui/history/BUILD.gn
@@ -82,6 +82,7 @@ } source_set("history_base_feature") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "history_base_feature.h", "history_base_feature.mm",
diff --git a/ios/chrome/browser/ui/history/history_base_feature.mm b/ios/chrome/browser/ui/history/history_base_feature.mm index 73b44485..65cfd7b 100644 --- a/ios/chrome/browser/ui/history/history_base_feature.mm +++ b/ios/chrome/browser/ui/history/history_base_feature.mm
@@ -4,5 +4,9 @@ #import "ios/chrome/browser/ui/history/history_base_feature.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + const base::Feature kHistoryBatchUpdatesFilter{ "HistoryBatchUpdatesFilter", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/ui/key_commands_provider.h b/ios/chrome/browser/ui/key_commands_provider.h index aae5e20..4cc8e751 100644 --- a/ios/chrome/browser/ui/key_commands_provider.h +++ b/ios/chrome/browser/ui/key_commands_provider.h
@@ -9,6 +9,7 @@ #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/toolbar/clean/omnibox_focuser.h" @protocol KeyCommandsPlumbing<NSObject> @@ -40,20 +41,19 @@ // Called to reopen the last closed tab. - (void)reopenClosedTab; -// Called to focus the omnibox. -- (void)focusOmnibox; - @end // Handles the keyboard commands registration and handling for the // BrowserViewController. @interface KeyCommandsProvider : NSObject -- (NSArray*)keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer - baseViewController:(UIViewController*)baseViewController - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher - editingText:(BOOL)editingText; +- (NSArray*) +keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer + baseViewController:(UIViewController*)baseViewController + dispatcher: + (id<ApplicationCommands, BrowserCommands, OmniboxFocuser>) + dispatcher + editingText:(BOOL)editingText; @end
diff --git a/ios/chrome/browser/ui/key_commands_provider.mm b/ios/chrome/browser/ui/key_commands_provider.mm index 55c564c7..5246f8f 100644 --- a/ios/chrome/browser/ui/key_commands_provider.mm +++ b/ios/chrome/browser/ui/key_commands_provider.mm
@@ -19,14 +19,17 @@ @implementation KeyCommandsProvider -- (NSArray*)keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer - baseViewController:(UIViewController*)baseViewController - dispatcher: - (id<ApplicationCommands, BrowserCommands>)dispatcher - editingText:(BOOL)editingText { +- (NSArray*) +keyCommandsForConsumer:(id<KeyCommandsPlumbing>)consumer + baseViewController:(UIViewController*)baseViewController + dispatcher: + (id<ApplicationCommands, BrowserCommands, OmniboxFocuser>) + dispatcher + editingText:(BOOL)editingText { __weak id<KeyCommandsPlumbing> weakConsumer = consumer; __weak UIViewController* weakBaseViewController = baseViewController; - __weak id<ApplicationCommands, BrowserCommands> weakDispatcher = dispatcher; + __weak id<ApplicationCommands, BrowserCommands, OmniboxFocuser> + weakDispatcher = dispatcher; // Block to have the tab model open the tab at |index|, if there is one. void (^focusTab)(NSUInteger) = ^(NSUInteger index) { @@ -117,7 +120,7 @@ title:l10n_util::GetNSStringWithFixup( IDS_IOS_KEYBOARD_OPEN_LOCATION) action:^{ - [weakConsumer focusOmnibox]; + [weakDispatcher focusOmnibox]; }], [UIKeyCommand cr_keyCommandWithInput:@"w" modifierFlags:UIKeyModifierCommand
diff --git a/ios/chrome/browser/ui/key_commands_provider_unittest.mm b/ios/chrome/browser/ui/key_commands_provider_unittest.mm index 246fb4e6..4a6e58b 100644 --- a/ios/chrome/browser/ui/key_commands_provider_unittest.mm +++ b/ios/chrome/browser/ui/key_commands_provider_unittest.mm
@@ -24,7 +24,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands> dispatcher = nil; + id<ApplicationCommands, BrowserCommands, OmniboxFocuser> dispatcher = nil; [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; EXPECT_NE(nil, [provider keyCommandsForConsumer:mockConsumer @@ -37,7 +37,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands> dispatcher = nil; + id<ApplicationCommands, BrowserCommands, OmniboxFocuser> dispatcher = nil; [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; @@ -53,7 +53,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands> dispatcher = nil; + id<ApplicationCommands, BrowserCommands, OmniboxFocuser> dispatcher = nil; // No tabs. [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; @@ -78,7 +78,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands> dispatcher = nil; + id<ApplicationCommands, BrowserCommands, OmniboxFocuser> dispatcher = nil; // Not editing text. [[[mockConsumer expect] andReturnUnsignedInteger:1] tabsCount];
diff --git a/ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h b/ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h index 33197be..6149eff 100644 --- a/ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h +++ b/ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h
@@ -49,7 +49,7 @@ // modifierFlags:UIKeyModifierCommand // title:@"New Tab" // action:^{ -// base::scoped_nsobject<Foo> strongSelf([weakSelf retain]); +// Foo* strongSelf = weakSelf; // if (!strongSelf) // return; // [strongSelf openNewTab];
diff --git a/ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm b/ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm index 3aa9a28..5d0b5bc8 100644 --- a/ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm +++ b/ios/chrome/browser/ui/keyboard/UIKeyCommand+ChromeTest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h" -#include "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h"
diff --git a/ios/chrome/browser/ui/keyboard_commands_egtest.mm b/ios/chrome/browser/ui/keyboard_commands_egtest.mm index d50d858..3f9537cc 100644 --- a/ios/chrome/browser/ui/keyboard_commands_egtest.mm +++ b/ios/chrome/browser/ui/keyboard_commands_egtest.mm
@@ -144,24 +144,21 @@ } // Tests that keyboard commands are not registered when the Bookmarks UI is -// shown on iPhone and registered on iPad. +// shown. - (void)testKeyboardCommandsNotRegistered_BookmarksPresented { - // TODO(crbug.com/782551): Rewrite this test for the new Bookmarks UI. + // TODO(crbug.com/753599): Remove scoped feature list when clean up old + // bookmarks. base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature(kBookmarkNewGeneration); + scoped_feature_list.InitAndEnableFeature(kBookmarkNewGeneration); // Open Bookmarks [ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI tapToolsMenuButton:chrome_test_util::BookmarksMenuButton()]; - if (IsIPadIdiom()) { - [self verifyKeyboardCommandsAreRegistered]; - } else { - [self verifyNoKeyboardCommandsAreRegistered]; + [self verifyNoKeyboardCommandsAreRegistered]; - [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Exit")] - performAction:grey_tap()]; - } + [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] + performAction:grey_tap()]; } // Tests that keyboard commands are not registered when the Recent Tabs UI is
diff --git a/ios/chrome/browser/ui/location_bar/BUILD.gn b/ios/chrome/browser/ui/location_bar/BUILD.gn new file mode 100644 index 0000000..e67076ab --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/BUILD.gn
@@ -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. + +source_set("location_bar") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ + "location_bar_coordinator.h", + "location_bar_coordinator.mm", + "location_bar_mediator.h", + "location_bar_mediator.mm", + "location_bar_view.h", + "location_bar_view.mm", + "location_bar_view_controller.h", + "location_bar_view_controller.mm", + ] + deps = [ + "//base", + "//components/omnibox/browser", + "//components/strings", + "//components/toolbar", + "//ios/chrome/app/strings", + "//ios/chrome/app/theme", + "//ios/chrome/browser", + "//ios/chrome/browser/browser_state:browser_state", + "//ios/chrome/browser/ui", + "//ios/chrome/browser/ui/commands", + "//ios/chrome/browser/ui/omnibox:omnibox", + "//ios/chrome/browser/ui/omnibox:omnibox_internal", + "//ios/chrome/browser/ui/toolbar/clean:toolbar_components_ui", + "//ios/chrome/browser/ui/toolbar/keyboard_assist:keyboard_assist", + "//ios/chrome/browser/ui/toolbar/public", + "//ios/chrome/browser/ui/toolbar/public:toolbar_base_feature", + "//ios/chrome/common:timing", + "//ios/third_party/material_components_ios", + "//ios/third_party/material_roboto_font_loader_ios", + "//skia", + "//third_party/google_toolbox_for_mac", + "//ui/base", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + "//url", + ] + libs = [ + "CoreText.framework", + "MobileCoreServices.framework", + "QuartzCore.framework", + "UIKit.framework", + ] + allow_circular_includes_from = + [ "//ios/chrome/browser/ui/omnibox:omnibox_internal" ] +} + +source_set("unit_tests") { + configs += [ "//build/config/compiler:enable_arc" ] + testonly = true + sources = [ + "location_bar_coordinator_unittest.mm", + ] + deps = [ + ":location_bar", + "//base", + "//base/test:test_support", + "//ios/chrome/app/strings", + "//ios/chrome/browser", + "//ios/chrome/browser/browser_state:test_support", + "//testing/gtest", + "//ui/base", + ] +}
diff --git a/ios/chrome/browser/ui/location_bar/OWNERS b/ios/chrome/browser/ui/location_bar/OWNERS new file mode 100644 index 0000000..f783b7d --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/OWNERS
@@ -0,0 +1,6 @@ +stkhapugin@chromium.org + +# COMPONENT: UI>Browser>Omnibox + +# TEAM: ios-directory-owners@chromium.org +# OS: iOS
diff --git a/ios/chrome/browser/ui/location_bar/README.md b/ios/chrome/browser/ui/location_bar/README.md new file mode 100644 index 0000000..bdc5967 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/README.md
@@ -0,0 +1,9 @@ +The location bar is the control that shows the URL and icons related to the +current location. It is presented as a white rectangle with the omnibox and some +buttons in the toolbar. + +The location bar consists of: +- security indicator +- omnibox text field +- voice search input button +- bookmark "star" button (iPad only)
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h new file mode 100644 index 0000000..535ec18a --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h
@@ -0,0 +1,34 @@ +// 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_LOCATION_BAR_LOCATION_BAR_COORDINATOR_H_ +#define IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_COORDINATOR_H_ + +#import <UIKit/UIKit.h> + +#include "ios/chrome/browser/ui/location_bar/location_bar_view.h" + +namespace ios { +class ChromeBrowserState; +} +@protocol ApplicationCommands; +@protocol BrowserCommands; + +@interface LocationBarCoordinator : NSObject + +// LocationBarView containing the omnibox. +@property(nonatomic, strong) LocationBarView* locationBarView; +// Weak reference to ChromeBrowserState; +@property(nonatomic, assign) ios::ChromeBrowserState* browserState; +// The dispatcher for this view controller. +@property(nonatomic, weak) id<ApplicationCommands, BrowserCommands> dispatcher; + +// Start this coordinator. +- (void)start; +// Stop this coordinator. +- (void)stop; + +@end + +#endif // IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm new file mode 100644 index 0000000..1e8fd64 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm
@@ -0,0 +1,75 @@ +// 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/location_bar/location_bar_coordinator.h" + +#include "base/memory/ptr_util.h" +#include "components/strings/grit/components_strings.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h" +#import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_delegate.h" +#import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_views.h" +#import "ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.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 + +@interface LocationBarCoordinator () +// Object taking care of adding the accessory views to the keyboard. +@property(nonatomic, strong) + ToolbarAssistiveKeyboardDelegateImpl* keyboardDelegate; +@end + +@implementation LocationBarCoordinator +@synthesize locationBarView = _locationBarView; +@synthesize keyboardDelegate = _keyboardDelegate; +@synthesize browserState = _browserState; +@synthesize dispatcher = dispatcher; + +- (void)start { + BOOL isIncognito = self.browserState->IsOffTheRecord(); + + UIColor* textColor = + isIncognito + ? [UIColor whiteColor] + : [UIColor colorWithWhite:0 alpha:[MDCTypography body1FontOpacity]]; + UIColor* tintColor = isIncognito ? textColor : nil; + self.locationBarView = + [[LocationBarView alloc] initWithFrame:CGRectZero + font:[MDCTypography subheadFont] + textColor:textColor + tintColor:tintColor]; + SetA11yLabelAndUiAutomationName(self.locationBarView.textField, + IDS_ACCNAME_LOCATION, @"Address"); + self.locationBarView.incognito = isIncognito; + self.locationBarView.textField.incognito = isIncognito; + if (isIncognito) { + [_locationBarView.textField + setSelectedTextBackgroundColor:[UIColor colorWithWhite:1 alpha:0.1]]; + [_locationBarView.textField + setPlaceholderTextColor:[UIColor colorWithWhite:1 alpha:0.5]]; + } else if (!IsIPadIdiom()) { + // Set placeholder text color to match fakebox placeholder text color when + // on iPhone. + UIColor* placeholderTextColor = + [UIColor colorWithWhite:kiPhoneOmniboxPlaceholderColorBrightness + alpha:1.0]; + [_locationBarView.textField setPlaceholderTextColor:placeholderTextColor]; + } + + self.keyboardDelegate = [[ToolbarAssistiveKeyboardDelegateImpl alloc] init]; + self.keyboardDelegate.dispatcher = self.dispatcher; + self.keyboardDelegate.omniboxTextField = self.locationBarView.textField; + ConfigureAssistiveKeyboardViews(self.locationBarView.textField, kDotComTLD, + self.keyboardDelegate); +} + +- (void)stop { + self.locationBarView = nil; +} + +@end
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm b/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm new file mode 100644 index 0000000..7f25fb5 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator_unittest.mm
@@ -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 "ios/chrome/browser/ui/location_bar/location_bar_coordinator.h" + +#include <memory> + +#include "base/test/scoped_task_environment.h" +#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" +#include "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +class LocationBarCoordinatorTest : public PlatformTest { + protected: + void SetUp() override { + PlatformTest::SetUp(); + + base::test::ScopedTaskEnvironment task_environment; + TestChromeBrowserState::Builder test_cbs_builder; + browser_state_ = test_cbs_builder.Build(); + + coordinator_ = [[LocationBarCoordinator alloc] init]; + coordinator_.browserState = browser_state_.get(); + } + + LocationBarCoordinator* coordinator_; + std::unique_ptr<TestChromeBrowserState> browser_state_; +}; + +TEST_F(LocationBarCoordinatorTest, Starts) { + EXPECT_TRUE(coordinator_.locationBarView == nil); + [coordinator_ start]; + EXPECT_TRUE(coordinator_.locationBarView != nil); +} + +TEST_F(LocationBarCoordinatorTest, Stops) { + EXPECT_TRUE(coordinator_.locationBarView == nil); + [coordinator_ start]; + EXPECT_TRUE(coordinator_.locationBarView != nil); + [coordinator_ stop]; + EXPECT_TRUE(coordinator_.locationBarView == nil); +} + +} // namespace
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_mediator.h b/ios/chrome/browser/ui/location_bar/location_bar_mediator.h new file mode 100644 index 0000000..f1df6a9 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_mediator.h
@@ -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. + +#ifndef IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_MEDIATOR_H_ +#define IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_MEDIATOR_H_ + +#import <UIKit/UIKit.h> + +@interface LocationBarMediator : NSObject + +@end + +#endif // IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_MEDIATOR_H_
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_mediator.mm b/ios/chrome/browser/ui/location_bar/location_bar_mediator.mm new file mode 100644 index 0000000..8b6e8f5 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_mediator.mm
@@ -0,0 +1,12 @@ +// 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/location_bar/location_bar_mediator.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation LocationBarMediator +@end
diff --git a/ios/chrome/browser/ui/omnibox/location_bar_view.h b/ios/chrome/browser/ui/location_bar/location_bar_view.h similarity index 92% rename from ios/chrome/browser/ui/omnibox/location_bar_view.h rename to ios/chrome/browser/ui/location_bar/location_bar_view.h index 9960083d..5387896 100644 --- a/ios/chrome/browser/ui/omnibox/location_bar_view.h +++ b/ios/chrome/browser/ui/location_bar/location_bar_view.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_VIEW_H_ -#define IOS_CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_VIEW_H_ +#ifndef IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_VIEW_H_ +#define IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_VIEW_H_ #import <UIKit/UIKit.h> @@ -63,4 +63,4 @@ @end -#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_VIEW_H_ +#endif // IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_VIEW_H_
diff --git a/ios/chrome/browser/ui/omnibox/location_bar_view.mm b/ios/chrome/browser/ui/location_bar/location_bar_view.mm similarity index 99% rename from ios/chrome/browser/ui/omnibox/location_bar_view.mm rename to ios/chrome/browser/ui/location_bar/location_bar_view.mm index 00e1911..65e99eb 100644 --- a/ios/chrome/browser/ui/omnibox/location_bar_view.mm +++ b/ios/chrome/browser/ui/location_bar/location_bar_view.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/chrome/browser/ui/omnibox/location_bar_view.h" +#import "ios/chrome/browser/ui/location_bar/location_bar_view.h" #import "ios/chrome/browser/ui/animation_util.h" #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h"
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_view_controller.h b/ios/chrome/browser/ui/location_bar/location_bar_view_controller.h new file mode 100644 index 0000000..0ed5167 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_view_controller.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_LOCATION_BAR_LOCATION_BAR_VIEW_CONTROLLER_H_ +#define IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_VIEW_CONTROLLER_H_ + +#import <UIKit/UIKit.h> + +@class LocationBarView; + +// The view controller displaying the location bar. +@interface LocationBarViewController : UIViewController + +@end + +#endif // IOS_CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_view_controller.mm b/ios/chrome/browser/ui/location_bar/location_bar_view_controller.mm new file mode 100644 index 0000000..cea0be6 --- /dev/null +++ b/ios/chrome/browser/ui/location_bar/location_bar_view_controller.mm
@@ -0,0 +1,12 @@ +// 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/location_bar/location_bar_view_controller.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@implementation LocationBarViewController +@end
diff --git a/ios/chrome/browser/ui/network_activity_indicator_manager.mm b/ios/chrome/browser/ui/network_activity_indicator_manager.mm index 2990a41..70e452e 100644 --- a/ios/chrome/browser/ui/network_activity_indicator_manager.mm +++ b/ios/chrome/browser/ui/network_activity_indicator_manager.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" #include "base/threading/thread_checker.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -15,7 +14,7 @@ #endif @interface NetworkActivityIndicatorManager () { - base::scoped_nsobject<NSMutableDictionary> _groupCounts; + NSMutableDictionary* _groupCounts; NSUInteger _totalCount; base::ThreadChecker _threadChecker; } @@ -33,7 +32,7 @@ - (instancetype)init { self = [super init]; if (self) { - _groupCounts.reset([[NSMutableDictionary alloc] init]); + _groupCounts = [[NSMutableDictionary alloc] init]; _totalCount = 0; } return self;
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm b/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm index 3b1d22b..67829c0 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_controller_unittest.mm
@@ -151,8 +151,8 @@ } } +// TODO(crbug.com/753599): Remove this test when clean up old bookmarks. TEST_F(NewTabPageControllerTest, SelectBookmarkPanel) { - // TODO(crbug.com/782551): Rewrite this unittest for the new bookmark. if (base::FeatureList::IsEnabled(kBookmarkNewGeneration)) { return; }
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_egtest.mm b/ios/chrome/browser/ui/ntp/new_tab_page_egtest.mm index d8561f3..e584a1c21 100644 --- a/ios/chrome/browser/ui/ntp/new_tab_page_egtest.mm +++ b/ios/chrome/browser/ui/ntp/new_tab_page_egtest.mm
@@ -96,7 +96,7 @@ // Tests that all items are accessible on the bookmarks page. - (void)testAccessibilityOnBookmarks { - // TODO(crbug.com/782551): Rewrite this test for the new Bookmarks UI. + // TODO(crbug.com/753599): Remove this test when clean up old bookmarks. base::test::ScopedFeatureList scoped_feature_list; scoped_feature_list.InitAndDisableFeature(kBookmarkNewGeneration);
diff --git a/ios/chrome/browser/ui/omnibox/BUILD.gn b/ios/chrome/browser/ui/omnibox/BUILD.gn index cc4ef11..0481967 100644 --- a/ios/chrome/browser/ui/omnibox/BUILD.gn +++ b/ios/chrome/browser/ui/omnibox/BUILD.gn
@@ -42,8 +42,6 @@ "image_retriever.h", "location_bar_controller_impl.h", "location_bar_controller_impl.mm", - "location_bar_view.h", - "location_bar_view.mm", "omnibox_popup_mediator.h", "omnibox_popup_mediator.mm", "omnibox_popup_positioner.h",
diff --git a/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm b/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm index d2703a8b..19d3f72 100644 --- a/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm +++ b/ios/chrome/browser/ui/omnibox/location_bar_controller_impl.mm
@@ -23,8 +23,8 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #import "ios/chrome/browser/ui/fullscreen/scoped_fullscreen_disabler.h" +#import "ios/chrome/browser/ui/location_bar/location_bar_view.h" #include "ios/chrome/browser/ui/omnibox/location_bar_delegate.h" -#import "ios/chrome/browser/ui/omnibox/location_bar_view.h" #include "ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h" #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h" #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h index 3c1b9d80..551964e 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "components/omnibox/browser/omnibox_popup_view.h" #import "ios/chrome/browser/ui/omnibox/omnibox_popup_mediator.h" @@ -57,14 +56,12 @@ void OnMatchSelectedForDeletion(const AutocompleteMatch& match) override; void OnScroll() override; - void SetMediator(OmniboxPopupMediator* mediator) { - mediator_.reset(mediator); - } + void SetMediator(OmniboxPopupMediator* mediator) { mediator_ = mediator; } private: std::unique_ptr<OmniboxPopupModel> model_; OmniboxPopupViewSuggestionsDelegate* delegate_; // weak - base::scoped_nsobject<OmniboxPopupMediator> mediator_; + OmniboxPopupMediator* mediator_; }; #endif // IOS_CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_POPUP_VIEW_IOS_H_
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h index b6921a3..b8388be 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h
@@ -8,7 +8,6 @@ #import <UIKit/UIKit.h> #include <memory> -#include "base/mac/scoped_nsobject.h" #include "components/omnibox/browser/omnibox_view.h" #include "components/toolbar/toolbar_model.h" #include "ios/chrome/browser/ui/omnibox/omnibox_popup_provider.h" @@ -178,13 +177,13 @@ ios::ChromeBrowserState* browser_state_; - base::scoped_nsobject<OmniboxTextFieldIOS> field_; - base::scoped_nsobject<OmniboxTextFieldPasteDelegate> paste_delegate_; + OmniboxTextFieldIOS* field_; + OmniboxTextFieldPasteDelegate* paste_delegate_; WebOmniboxEditController* controller_; // weak, owns us LeftImageProvider* left_image_provider_; // weak State state_before_change_; - base::scoped_nsobject<NSString> marked_text_before_change_; + NSString* marked_text_before_change_; NSRange current_selection_; NSRange old_selection_; @@ -199,7 +198,7 @@ BOOL use_strikethrough_workaround_; // Bridges delegate method calls from |field_| to C++ land. - base::scoped_nsobject<AutocompleteTextFieldDelegate> field_delegate_; + AutocompleteTextFieldDelegate* field_delegate_; // Temporary pointer to the attributed display string, stored as color and // other emphasis attributes are applied by the superclass.
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm index 31b64a4..45d21c1a 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm
@@ -24,7 +24,6 @@ #include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.h" -#import "ios/chrome/browser/ui/omnibox/location_bar_view.h" #include "ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.h" #include "ios/chrome/browser/ui/omnibox/omnibox_util.h" #include "ios/chrome/browser/ui/omnibox/web_omnibox_edit_controller.h" @@ -174,11 +173,11 @@ attributing_display_string_(nil), popup_provider_(nullptr) { DCHECK(field_); - field_delegate_.reset( - [[AutocompleteTextFieldDelegate alloc] initWithEditView:this]); + field_delegate_ = + [[AutocompleteTextFieldDelegate alloc] initWithEditView:this]; if (@available(iOS 11.0, *)) { - paste_delegate_.reset([[OmniboxTextFieldPasteDelegate alloc] init]); + paste_delegate_ = [[OmniboxTextFieldPasteDelegate alloc] init]; [field_ setPasteDelegate:paste_delegate_]; } @@ -287,7 +286,7 @@ void OmniboxViewIOS::OnBeforePossibleChange() { GetState(&state_before_change_); - marked_text_before_change_.reset([[field_ markedText] copy]); + marked_text_before_change_ = [[field_ markedText] copy]; } bool OmniboxViewIOS::OnAfterPossibleChange(bool allow_keyword_ui_change) {
diff --git a/ios/chrome/browser/ui/omnibox/truncating_attributed_label.h b/ios/chrome/browser/ui/omnibox/truncating_attributed_label.h index b4255671..a1ad1b6 100644 --- a/ios/chrome/browser/ui/omnibox/truncating_attributed_label.h +++ b/ios/chrome/browser/ui/omnibox/truncating_attributed_label.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" typedef enum { OmniboxPopupTruncatingTail = 0x1,
diff --git a/ios/chrome/browser/ui/open_in_controller.h b/ios/chrome/browser/ui/open_in_controller.h index 8adeaf5..04446fb 100644 --- a/ios/chrome/browser/ui/open_in_controller.h +++ b/ios/chrome/browser/ui/open_in_controller.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" #import "ios/chrome/browser/ui/open_in_toolbar.h" #include "url/gurl.h"
diff --git a/ios/chrome/browser/ui/page_info/page_info_view_controller.h b/ios/chrome/browser/ui/page_info/page_info_view_controller.h index 8986aa2..b757e53 100644 --- a/ios/chrome/browser/ui/page_info/page_info_view_controller.h +++ b/ios/chrome/browser/ui/page_info/page_info_view_controller.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "base/memory/weak_ptr.h" #include "ios/chrome/browser/ui/page_info/page_info_model_observer.h"
diff --git a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm index 6a50a4e0..f224797d 100644 --- a/ios/chrome/browser/ui/page_info/page_info_view_controller.mm +++ b/ios/chrome/browser/ui/page_info/page_info_view_controller.mm
@@ -132,7 +132,7 @@ // If the window is animating closed when this is called, the // animation could be holding the last reference to |controller_| // (and thus |this|). Pin it until the task is completed. - base::scoped_nsobject<PageInfoViewController> keep_alive(controller_); + NS_VALID_UNTIL_END_OF_SCOPE PageInfoViewController* keep_alive = controller_; [controller_ performLayout]; }
diff --git a/ios/chrome/browser/ui/payments/full_card_requester.mm b/ios/chrome/browser/ui/payments/full_card_requester.mm index 8a8afd5..e2c0a33 100644 --- a/ios/chrome/browser/ui/payments/full_card_requester.mm +++ b/ios/chrome/browser/ui/payments/full_card_requester.mm
@@ -25,8 +25,8 @@ // autofill::CardUnmaskPromptView: void Show() override { - view_controller_.reset( - [[CardUnmaskPromptViewController alloc] initWithBridge:this]); + view_controller_ = + [[CardUnmaskPromptViewController alloc] initWithBridge:this]; [view_controller_ setModalPresentationStyle:UIModalPresentationFormSheet]; [view_controller_ setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
diff --git a/ios/chrome/browser/ui/presenters/contained_presenter.h b/ios/chrome/browser/ui/presenters/contained_presenter.h index 13ddf83d..1bb4fc6f 100644 --- a/ios/chrome/browser/ui/presenters/contained_presenter.h +++ b/ios/chrome/browser/ui/presenters/contained_presenter.h
@@ -21,6 +21,10 @@ // The delegate object which will be told about presentation events. @property(nonatomic, weak) id<ContainedPresenterDelegate> delegate; +// It's an error to call any of the following methods when +// |presentedViewController| is nil. It's the responsibility of the object that +// owns an implementation of this protocol to ensure that doesn't happen. + // Prepares the view controllers for presentation. The presented view controller // should become a child of the base view controller. - (void)prepareForPresentation;
diff --git a/ios/chrome/browser/ui/presenters/vertical_animation_container.mm b/ios/chrome/browser/ui/presenters/vertical_animation_container.mm index a5d598a1..36e5ff5 100644 --- a/ios/chrome/browser/ui/presenters/vertical_animation_container.mm +++ b/ios/chrome/browser/ui/presenters/vertical_animation_container.mm
@@ -32,6 +32,8 @@ @synthesize presentedConstraints = _presentedConstraints; - (void)prepareForPresentation { + DCHECK(self.presentedViewController); + [self.baseViewController addChildViewController:self.presentedViewController]; [self.baseViewController.view addSubview:self.presentedViewController.view]; @@ -95,6 +97,10 @@ } - (void)dismissAnimated:(BOOL)animated { + DCHECK(self.presentedViewController); + // If animated, the base view controller must still be in the view hierarchy. + DCHECK(!animated || self.baseViewController.view.superview); + // No-op if already dismissed. if (self.dismissedConstraints[0].active) return; @@ -118,10 +124,12 @@ animations:animations completion:completion]; } else { - // Just execute everything synchronously if the dismissal isn't animated. - // Note that just using an animation duration of 0 in -animateWithDuration: - // will still call the completion block asynchronously. - animations(); + // Just execute the completion block synchronously if the dismissal isn't + // animated. |animations| isn't called because (a) -cleanupAfterDismissal + // removes the presented view controller from the view hierarchy, and (b) + // in some contexts a non-animated dismissal may occur when the base view + // controller is no longer on screen, and the constraint activation in + // |animations| will crash. completion(YES); } }
diff --git a/ios/chrome/browser/ui/safe_mode/safe_mode_coordinator_unittest.mm b/ios/chrome/browser/ui/safe_mode/safe_mode_coordinator_unittest.mm index 8521362..91c43fbc 100644 --- a/ios/chrome/browser/ui/safe_mode/safe_mode_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/safe_mode/safe_mode_coordinator_unittest.mm
@@ -6,7 +6,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -19,11 +18,11 @@ TEST_F(SafeModeCoordinatorTest, RootVC) { // Expect that starting a safe mode coordinator will populate the root view // controller. - base::scoped_nsobject<UIWindow> window( - [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]); + UIWindow* window = + [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; EXPECT_TRUE([window rootViewController] == nil); - base::scoped_nsobject<SafeModeCoordinator> safe_mode_coordinator( - [[SafeModeCoordinator alloc] initWithWindow:window]); + SafeModeCoordinator* safe_mode_coordinator = + [[SafeModeCoordinator alloc] initWithWindow:window]; [safe_mode_coordinator start]; EXPECT_FALSE([window rootViewController] == nil); }
diff --git a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.h b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.h index 7edc874..9d99406 100644 --- a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.h +++ b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/compiler_specific.h" -#import "base/mac/scoped_nsobject.h" #include "components/keyed_service/core/keyed_service.h" #include "components/sync/engine/cycle/sync_cycle_snapshot.h" #include "google_apis/gaia/google_service_auth_error.h" @@ -57,8 +56,8 @@ // Dummy navigation stack for testing self-removal. // Only valid when SetUpNavigationController has been called. - base::scoped_nsobject<UIViewController> dummy_controller_; - base::scoped_nsobject<UINavigationController> nav_controller_; + UIViewController* dummy_controller_; + UINavigationController* nav_controller_; }; #endif // IOS_CHROME_BROWSER_UI_SETTINGS_PASSPHRASE_COLLECTION_VIEW_CONTROLLER_TEST_H_
diff --git a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm index 88a4771..de141a38 100644 --- a/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm +++ b/ios/chrome/browser/ui/settings/passphrase_collection_view_controller_test.mm
@@ -104,10 +104,10 @@ void PassphraseCollectionViewControllerTest::SetUpNavigationController( UIViewController* test_controller) { - dummy_controller_.reset([[UIViewController alloc] init]); - nav_controller_.reset([[SettingsNavigationController alloc] + dummy_controller_ = [[UIViewController alloc] init]; + nav_controller_ = [[SettingsNavigationController alloc] initWithRootViewController:dummy_controller_ browserState:chrome_browser_state_.get() - delegate:nil]); + delegate:nil]; [nav_controller_ pushViewController:test_controller animated:NO]; }
diff --git a/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.h b/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.h index 455bc76..b0a75ab0 100644 --- a/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.h +++ b/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/string16.h" #include "components/infobars/core/confirm_infobar_delegate.h" @@ -62,7 +61,6 @@ SyncSetupService::SyncServiceState error_state_; base::string16 message_; base::string16 button_text_; - base::scoped_nsobject<GenericChromeCommand> command_; id<SyncPresenter> presenter_; DISALLOW_COPY_AND_ASSIGN(SyncErrorInfoBarDelegate);
diff --git a/ios/chrome/browser/ui/side_swipe/BUILD.gn b/ios/chrome/browser/ui/side_swipe/BUILD.gn index b2f17a3..246ba61 100644 --- a/ios/chrome/browser/ui/side_swipe/BUILD.gn +++ b/ios/chrome/browser/ui/side_swipe/BUILD.gn
@@ -35,7 +35,7 @@ "//ios/chrome/browser/ui/tabs/requirements", "//ios/chrome/browser/web", "//ios/chrome/common", - "//ios/web", + "//ios/web/public", "//ui/base", "//url", ]
diff --git a/ios/chrome/browser/ui/side_swipe/DEPS b/ios/chrome/browser/ui/side_swipe/DEPS index f363547..94d0c0ba 100644 --- a/ios/chrome/browser/ui/side_swipe/DEPS +++ b/ios/chrome/browser/ui/side_swipe/DEPS
@@ -3,9 +3,4 @@ "^side_swipe_controller\.h$": [ "+ios/web/web_state/ui/crw_swipe_recognizer_provider.h", ], - - # TODO(crbug.com/620939): Remove these exceptions. - "^card_side_swipe_view\.mm$": [ - "+ios/web/web_state/ui/crw_web_controller.h", - ], }
diff --git a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h index e3fce97f..93adeac 100644 --- a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h +++ b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/side_swipe/side_swipe_controller.h" @class SideSwipeGestureRecognizer; @@ -15,9 +14,9 @@ @class TabModel; @interface SwipeView : UIView { - base::scoped_nsobject<UIImageView> image_; - base::scoped_nsobject<UIImageView> shadowView_; - base::scoped_nsobject<UIImageView> toolbarHolder_; + UIImageView* image_; + UIImageView* shadowView_; + UIImageView* toolbarHolder_; } @end @@ -26,8 +25,8 @@ UISwipeGestureRecognizerDirection direction_; // Card views currently displayed. - base::scoped_nsobject<SwipeView> leftCard_; - base::scoped_nsobject<SwipeView> rightCard_; + SwipeView* leftCard_; + SwipeView* rightCard_; // Most recent touch location. CGPoint currentPoint_; @@ -39,7 +38,7 @@ __weak TabModel* model_; // The image view containing the background image. - base::scoped_nsobject<UIImageView> backgroundView_; + UIImageView* backgroundView_; } @property(nonatomic, weak) id<SideSwipeControllerDelegate> delegate;
diff --git a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm index 37b0297..b29236c 100644 --- a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm +++ b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm
@@ -25,7 +25,6 @@ #import "ios/chrome/browser/ui/util/constraints_ui_util.h" #import "ios/chrome/browser/web/page_placeholder_tab_helper.h" #include "ios/chrome/grit/ios_theme_resources.h" -#import "ios/web/web_state/ui/crw_web_controller.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -67,15 +66,15 @@ if (self) { _topMargin = topMargin; - image_.reset([[UIImageView alloc] initWithFrame:CGRectZero]); + image_ = [[UIImageView alloc] initWithFrame:CGRectZero]; [image_ setClipsToBounds:YES]; [image_ setContentMode:UIViewContentModeScaleAspectFill]; [self addSubview:image_]; - toolbarHolder_.reset([[UIImageView alloc] initWithFrame:CGRectZero]); + toolbarHolder_ = [[UIImageView alloc] initWithFrame:CGRectZero]; [self addSubview:toolbarHolder_]; - shadowView_.reset([[UIImageView alloc] initWithFrame:self.bounds]); + shadowView_ = [[UIImageView alloc] initWithFrame:self.bounds]; [shadowView_ setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; [self addSubview:shadowView_]; @@ -190,10 +189,10 @@ InstallBackgroundInView(background); - rightCard_.reset( - [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); - leftCard_.reset( - [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]); + rightCard_ = + [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]; + leftCard_ = + [[SwipeView alloc] initWithFrame:CGRectZero topMargin:topMargin]; [rightCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; [leftCard_ setTranslatesAutoresizingMaskIntoConstraints:NO]; [self addSubview:rightCard_]; @@ -272,7 +271,7 @@ if (PagePlaceholderTabHelper::FromWebState(tab.webState) ->will_add_placeholder_for_next_navigation() && !ios::device_util::IsSingleCoreDevice()) { - [card setImage:[CRWWebController defaultSnapshotImage]]; + [card setImage:SnapshotTabHelper::GetDefaultSnapshotImage()]; dispatch_async(priorityQueue, ^{ UIImage* greyImage = [self smallGreyImage:image]; dispatch_async(dispatch_get_main_queue(), ^{
diff --git a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.h b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.h index 44981ff..8a000a7b 100644 --- a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.h +++ b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.h
@@ -45,10 +45,9 @@ // Called when the horizontal stack view is done and should be removed. - (void)sideSwipeViewDismissAnimationDidEnd:(UIView*)sideSwipeView; // Returns the main content view. -- (UIView*)contentView; -// Makes |tab| the currently visible tab, displaying its view. Calls -// -selectedTabChanged on the toolbar only if |newSelection| is YES. -- (void)displayTab:(Tab*)tab isNewSelection:(BOOL)newSelection; +- (UIView*)sideSwipeContentView; +// Makes |tab| the currently visible tab, displaying its view. +- (void)sideSwipeRedisplayTab:(Tab*)tab; // Check the invariant of "toolbar in front of infobar container which // is in front of content area." This DCHECK happens if addSubview and/or // insertSubview messed up the view ordering earlier. @@ -57,7 +56,7 @@ // search bar. - (void)updateAccessoryViewsForSideSwipeWithVisibility:(BOOL)visible; // Returns the height of the header view for the tab model's current tab. -- (CGFloat)headerHeight; +- (CGFloat)headerHeightForSideSwipe; // Returns |YES| if side swipe should be blocked from initiating, such as when // voice search is up, or if the tools menu is enabled. - (BOOL)preventSideSwipe;
diff --git a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm index d48d14c5..6f346214 100644 --- a/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm +++ b/ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm
@@ -248,7 +248,7 @@ // Otherwise, only allow contentView touches with |swipeGestureRecognizer_|. CGRect contentViewFrame = - CGRectInset([[swipeDelegate_ contentView] frame], -1, -1); + CGRectInset([[swipeDelegate_ sideSwipeContentView] frame], -1, -1); if (CGRectContainsPoint(contentViewFrame, location)) { if (![gesture isEqual:swipeGestureRecognizer_]) { return NO; @@ -389,7 +389,7 @@ ->CancelPlaceholderForNextNavigation(); // Redisplay the view if it was in overlay preview mode. - [swipeDelegate_ displayTab:[model_ currentTab] isNewSelection:YES]; + [swipeDelegate_ sideSwipeRedisplayTab:[model_ currentTab]]; [self.tabStripDelegate setHighlightsSelectedTab:NO]; [self deleteGreyCache]; [[NSNotificationCenter defaultCenter] @@ -434,7 +434,7 @@ BOOL canNavigate = currentContentProvider_ != nil; CGRect gestureBounds = gesture.view.bounds; - CGFloat headerHeight = [swipeDelegate_ headerHeight]; + CGFloat headerHeight = [swipeDelegate_ headerHeightForSideSwipe]; CGRect navigationFrame = CGRectMake(CGRectGetMinX(gestureBounds), CGRectGetMinY(gestureBounds) + headerHeight, @@ -447,7 +447,7 @@ canNavigate:canNavigate image:[currentContentProvider_ paneIcon] rotateForward:[currentContentProvider_ rotateForwardIcon]]; - [pageSideSwipeView_ setTargetView:[swipeDelegate_ contentView]]; + [pageSideSwipeView_ setTargetView:[swipeDelegate_ sideSwipeContentView]]; [gesture.view insertSubview:pageSideSwipeView_ belowSubview:[self.toolbarInteractionHandler toolbarView]]; @@ -491,7 +491,7 @@ inSwipe_ = YES; - CGRect frame = [[swipeDelegate_ contentView] frame]; + CGRect frame = [[swipeDelegate_ sideSwipeContentView] frame]; // Add horizontal stack view controller. CGFloat headerHeight = @@ -529,7 +529,7 @@ [gesture.view addSubview:tabSideSwipeView_]; // Remove content area so it doesn't receive any pan events. - [[swipeDelegate_ contentView] removeFromSuperview]; + [[swipeDelegate_ sideSwipeContentView] removeFromSuperview]; } [tabSideSwipeView_ handleHorizontalPan:gesture]; @@ -537,11 +537,11 @@ - (void)addCurtainWithCompletionHandler:(ProceduralBlock)completionHandler { if (!curtain_) { - curtain_ = - [[UIView alloc] initWithFrame:[swipeDelegate_ contentView].bounds]; + curtain_ = [[UIView alloc] + initWithFrame:[swipeDelegate_ sideSwipeContentView].bounds]; [curtain_ setBackgroundColor:[UIColor whiteColor]]; } - [[swipeDelegate_ contentView] addSubview:curtain_]; + [[swipeDelegate_ sideSwipeContentView] addSubview:curtain_]; // Fallback in case load takes a while. 3 seconds is a balance between how // long it can take a web view to clear the previous page image, and what @@ -552,9 +552,9 @@ } - (void)resetContentView { - CGRect frame = [swipeDelegate_ contentView].frame; + CGRect frame = [swipeDelegate_ sideSwipeContentView].frame; frame.origin.x = 0; - [swipeDelegate_ contentView].frame = frame; + [swipeDelegate_ sideSwipeContentView].frame = frame; } - (void)dismissCurtainWithCompletionHandler:(ProceduralBlock)completionHandler {
diff --git a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm index 948bfed..c3a2248 100644 --- a/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm +++ b/ios/chrome/browser/ui/signin_interaction/signin_interaction_controller_egtest.mm
@@ -461,13 +461,12 @@ [SigninEarlGreyUtils assertSignedOut]; } -// Opens the sign in screen from the bookmarks and then cancel it by opening a -// new tab. Ensures that the sign in screen is correctly dismissed. +// Opens the sign in screen from the bookmarks and then cancel it by tapping on +// done. Ensures that the sign in screen is correctly dismissed. // Regression test for crbug.com/596029. - (void)testSignInCancelFromBookmarks { - // TODO(crbug.com/782551): Rewrite this test for the new Bookmarks UI. base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndDisableFeature(kBookmarkNewGeneration); + scoped_feature_list.InitAndEnableFeature(kBookmarkNewGeneration); ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( @@ -476,20 +475,6 @@ // Open Bookmarks and tap on Sign In promo button. [ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI tapToolsMenuButton:chrome_test_util::BookmarksMenuButton()]; - - if (!IsIPadIdiom()) { - // Opens the bookmark manager sidebar on handsets. - [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Menu")] - performAction:grey_tap()]; - } - - // Selects the top level folder (Sign In promo is only shown there). - NSString* topLevelFolderTitle = @"Mobile Bookmarks"; - id<GREYMatcher> all_bookmarks_matcher = - grey_allOf(grey_kindOfClass(NSClassFromString(@"BookmarkMenuCell")), - grey_descendant(grey_text(topLevelFolderTitle)), nil); - [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] - performAction:grey_tap()]; [ChromeEarlGreyUI tapSettingsMenuButton:SecondarySignInButton()]; // Assert sign-in screen was shown. @@ -508,29 +493,14 @@ // this will fail. [ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI tapToolsMenuButton:chrome_test_util::BookmarksMenuButton()]; - if (!IsIPadIdiom()) { - [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Menu")] - performAction:grey_tap()]; - } - [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] - performAction:grey_tap()]; [ChromeEarlGreyUI tapSettingsMenuButton:SecondarySignInButton()]; [[EarlGrey selectElementWithMatcher:signin_matcher] assertWithMatcher:grey_sufficientlyVisible()]; // Close sign-in screen and Bookmarks. TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); - if (IsIPadIdiom()) { - // Switch back to the Home Panel. This is to prevent Bookmarks Panel, which - // has an infinite spinner, from appearing in the coming tests and causing - // timeouts. - [chrome_test_util::GetCurrentNewTabPageController() - selectPanel:ntp_home::HOME_PANEL]; - [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; - } else { - [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] - performAction:grey_tap()]; - } + [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] + performAction:grey_tap()]; } @end
diff --git a/ios/chrome/browser/ui/stack_view/BUILD.gn b/ios/chrome/browser/ui/stack_view/BUILD.gn index 159d4da..a86115b 100644 --- a/ios/chrome/browser/ui/stack_view/BUILD.gn +++ b/ios/chrome/browser/ui/stack_view/BUILD.gn
@@ -66,7 +66,7 @@ "//ios/chrome/browser/ui/tools_menu/public", "//ios/chrome/common", "//ios/third_party/material_components_ios", - "//ios/web", + "//ios/web/public", "//net", "//ui/base", "//ui/gfx",
diff --git a/ios/chrome/browser/ui/stack_view/DEPS b/ios/chrome/browser/ui/stack_view/DEPS deleted file mode 100644 index 149a370..0000000 --- a/ios/chrome/browser/ui/stack_view/DEPS +++ /dev/null
@@ -1,6 +0,0 @@ -specific_include_rules = { - # TODO(crbug.com/621250): Remove this exception. - "^card_set\.mm$": [ - "+ios/web/web_state/ui/crw_web_controller.h", - ], -}
diff --git a/ios/chrome/browser/ui/stack_view/card_set.mm b/ios/chrome/browser/ui/stack_view/card_set.mm index 34652bf..c6041bc 100644 --- a/ios/chrome/browser/ui/stack_view/card_set.mm +++ b/ios/chrome/browser/ui/stack_view/card_set.mm
@@ -16,7 +16,6 @@ #import "ios/chrome/browser/ui/stack_view/page_animation_util.h" #import "ios/chrome/browser/ui/stack_view/stack_card.h" #include "ios/chrome/browser/ui/ui_util.h" -#import "ios/web/web_state/ui/crw_web_controller.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -511,7 +510,7 @@ [view setImage:image]; }); if (!view.image) - [view setImage:[CRWWebController defaultSnapshotImage]]; + [view setImage:SnapshotTabHelper::GetDefaultSnapshotImage()]; view.closeButtonSide = self.closeButtonSide; return view;
diff --git a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.h b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.h index ca23b74d..d81eb09 100644 --- a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.h +++ b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager.h
@@ -8,7 +8,6 @@ #import <CoreGraphics/CoreGraphics.h> #import <Foundation/Foundation.h> -#include "base/mac/scoped_nsobject.h" @class StackCard;
diff --git a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager_unittest.mm b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager_unittest.mm index a942b6f..4fe73f1a 100644 --- a/ios/chrome/browser/ui/stack_view/card_stack_layout_manager_unittest.mm +++ b/ios/chrome/browser/ui/stack_view/card_stack_layout_manager_unittest.mm
@@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/ui/rtl_geometry.h" #import "ios/chrome/browser/ui/stack_view/card_stack_layout_manager.h" +#include "base/macros.h" +#include "ios/chrome/browser/ui/rtl_geometry.h" #import "ios/chrome/browser/ui/stack_view/stack_card.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h index ce364c3..14933041 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h +++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_model.h
@@ -9,7 +9,6 @@ #include <string> #include "base/ios/block_types.h" -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/sync/synced_sessions_bridge.h" #import "ios/chrome/browser/tabs/tab_model_observer.h" #import "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions.h"
diff --git a/ios/chrome/browser/ui/tabs/tab_view.h b/ios/chrome/browser/ui/tabs/tab_view.h index 1138695..242fac61 100644 --- a/ios/chrome/browser/ui/tabs/tab_view.h +++ b/ios/chrome/browser/ui/tabs/tab_view.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/tabs/tab.h" #import "ios/chrome/browser/ui/tabs/tab_view_delegate.h"
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn index 5d8a0b2..7d540e70 100644 --- a/ios/chrome/browser/ui/toolbar/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -77,6 +77,7 @@ "//ios/chrome/browser/ui/history", "//ios/chrome/browser/ui/history_popup/requirements", "//ios/chrome/browser/ui/keyboard", + "//ios/chrome/browser/ui/location_bar", "//ios/chrome/browser/ui/ntp", "//ios/chrome/browser/ui/ntp:modal_ntp", "//ios/chrome/browser/ui/omnibox",
diff --git a/ios/chrome/browser/ui/toolbar/clean/BUILD.gn b/ios/chrome/browser/ui/toolbar/clean/BUILD.gn index 9f75bdd6..99d8f1a 100644 --- a/ios/chrome/browser/ui/toolbar/clean/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/clean/BUILD.gn
@@ -37,6 +37,7 @@ "//ios/chrome/browser/ui/fullscreen", "//ios/chrome/browser/ui/fullscreen:new_fullscreen", "//ios/chrome/browser/ui/history_popup/requirements", + "//ios/chrome/browser/ui/location_bar", "//ios/chrome/browser/ui/omnibox", "//ios/chrome/browser/ui/omnibox:omnibox_internal", "//ios/chrome/browser/ui/omnibox/popup",
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm index 8555bd3..0a88910 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
@@ -26,10 +26,10 @@ #import "ios/chrome/browser/ui/fullscreen/fullscreen_controller_factory.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_ui_updater.h" +#import "ios/chrome/browser/ui/location_bar/location_bar_coordinator.h" #include "ios/chrome/browser/ui/omnibox/location_bar_controller.h" #include "ios/chrome/browser/ui/omnibox/location_bar_controller_impl.h" #include "ios/chrome/browser/ui/omnibox/location_bar_delegate.h" -#include "ios/chrome/browser/ui/omnibox/location_bar_view.h" #import "ios/chrome/browser/ui/omnibox/omnibox_popup_positioner.h" #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h" #import "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h" @@ -40,8 +40,6 @@ #import "ios/chrome/browser/ui/toolbar/clean/toolbar_style.h" #import "ios/chrome/browser/ui/toolbar/clean/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h" -#import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_delegate.h" -#import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_views.h" #import "ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h" #include "ios/chrome/browser/ui/toolbar/toolbar_model_ios.h" #import "ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h" @@ -52,7 +50,6 @@ #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/common/material_timing.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" -#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h" #import "ios/web/public/web_state/web_state.h" @@ -72,12 +69,6 @@ @property(nonatomic, strong) ToolbarViewController* toolbarViewController; // The mediator owned by this coordinator. @property(nonatomic, strong) ToolbarMediator* mediator; -// LocationBarView containing the omnibox. At some point, this property and the -// |_locationBar| should become a LocationBarCoordinator. -@property(nonatomic, strong) LocationBarView* locationBarView; -// Object taking care of adding the accessory views to the keyboard. -@property(nonatomic, strong) - ToolbarAssistiveKeyboardDelegateImpl* keyboardDelegate; // Whether this coordinator has been started. @property(nonatomic, assign) BOOL started; // Button observer for the ToolsMenu button. @@ -85,6 +76,9 @@ ToolsMenuButtonObserverBridge* toolsMenuButtonObserverBridge; // Coordinator for the omnibox popup. @property(nonatomic, strong) OmniboxPopupCoordinator* omniboxPopupCoordinator; +// The coordinator for the location bar in the toolbar. +@property(nonatomic, strong) LocationBarCoordinator* locationBarCoordinator; + @end @implementation ToolbarCoordinator @@ -92,8 +86,6 @@ @synthesize browserState = _browserState; @synthesize buttonUpdater = _buttonUpdater; @synthesize dispatcher = _dispatcher; -@synthesize keyboardDelegate = _keyboardDelegate; -@synthesize locationBarView = _locationBarView; @synthesize mediator = _mediator; @synthesize omniboxPopupCoordinator = _omniboxPopupCoordinator; @synthesize started = _started; @@ -101,6 +93,7 @@ @synthesize toolsMenuButtonObserverBridge = _toolsMenuButtonObserverBridge; @synthesize URLLoader = _URLLoader; @synthesize webStateList = _webStateList; +@synthesize locationBarCoordinator = _locationBarCoordinator; - (instancetype)init { if ((self = [super init])) { @@ -135,45 +128,17 @@ self.started = YES; BOOL isIncognito = self.browserState->IsOffTheRecord(); + + self.locationBarCoordinator = [[LocationBarCoordinator alloc] init]; + self.locationBarCoordinator.browserState = self.browserState; + self.locationBarCoordinator.dispatcher = self.dispatcher; + [self.locationBarCoordinator start]; + // TODO(crbug.com/785253): Move this to the LocationBarCoordinator once it is // created. - UIColor* textColor = - isIncognito - ? [UIColor whiteColor] - : [UIColor colorWithWhite:0 alpha:[MDCTypography body1FontOpacity]]; - UIColor* tintColor = isIncognito ? textColor : nil; - self.locationBarView = - [[LocationBarView alloc] initWithFrame:CGRectZero - font:[MDCTypography subheadFont] - textColor:textColor - tintColor:tintColor]; - - SetA11yLabelAndUiAutomationName(self.locationBarView.textField, - IDS_ACCNAME_LOCATION, @"Address"); _locationBar = base::MakeUnique<LocationBarControllerImpl>( - self.locationBarView, self.browserState, self, self.dispatcher); - self.locationBarView.incognito = isIncognito; - self.locationBarView.textField.incognito = isIncognito; - if (isIncognito) { - [_locationBarView.textField - setSelectedTextBackgroundColor:[UIColor colorWithWhite:1 alpha:0.1]]; - [_locationBarView.textField - setPlaceholderTextColor:[UIColor colorWithWhite:1 alpha:0.5]]; - } else if (!IsIPadIdiom()) { - // Set placeholder text color to match fakebox placeholder text color when - // on iPhone. - UIColor* placeholderTextColor = - [UIColor colorWithWhite:kiPhoneOmniboxPlaceholderColorBrightness - alpha:1.0]; - [_locationBarView.textField setPlaceholderTextColor:placeholderTextColor]; - } - - self.keyboardDelegate = [[ToolbarAssistiveKeyboardDelegateImpl alloc] init]; - self.keyboardDelegate.dispatcher = self.dispatcher; - self.keyboardDelegate.omniboxTextField = self.locationBarView.textField; - ConfigureAssistiveKeyboardViews(self.locationBarView.textField, kDotComTLD, - self.keyboardDelegate); - + self.locationBarCoordinator.locationBarView, self.browserState, self, + self.dispatcher); self.omniboxPopupCoordinator = _locationBar->CreatePopupCoordinator(self); [self.omniboxPopupCoordinator start]; // End of TODO(crbug.com/785253):. @@ -189,7 +154,8 @@ buttonFactory:factory buttonUpdater:self.buttonUpdater omniboxFocuser:self]; - self.toolbarViewController.locationBarView = self.locationBarView; + self.toolbarViewController.locationBarView = + self.locationBarCoordinator.locationBarView; self.toolbarViewController.dispatcher = self.dispatcher; if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { @@ -223,7 +189,7 @@ // The popup has to be destroyed before the location bar. [self.omniboxPopupCoordinator stop]; _locationBar.reset(); - self.locationBarView = nil; + [self.locationBarCoordinator stop]; [self stopObservingTTSNotifications]; if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) { @@ -266,19 +232,19 @@ // Don't do anything for a live non-ntp tab. if (webState == [self getWebState] && !isNTP) { - [_locationBarView setHidden:NO]; + [self.locationBarCoordinator.locationBarView setHidden:NO]; return; } self.viewController.view.hidden = NO; - [_locationBarView setHidden:YES]; + [self.locationBarCoordinator.locationBarView setHidden:YES]; [self.mediator updateConsumerForWebState:webState]; [self.toolbarViewController updateForSideSwipeSnapshotOnNTP:isNTP]; } - (void)resetToolbarAfterSideSwipeSnapshot { [self.mediator updateConsumerForWebState:[self getWebState]]; - [_locationBarView setHidden:NO]; + [self.locationBarCoordinator.locationBarView setHidden:NO]; [self.toolbarViewController resetAfterSideSwipeSnapshot]; } @@ -303,7 +269,8 @@ } - (BOOL)isOmniboxFirstResponder { - return [_locationBarView.textField isFirstResponder]; + return + [self.locationBarCoordinator.locationBarView.textField isFirstResponder]; } - (BOOL)showingOmniboxPopup { @@ -395,7 +362,7 @@ #pragma mark - OmniboxFocuser - (void)focusOmnibox { - [_locationBarView.textField becomeFirstResponder]; + [self.locationBarCoordinator.locationBarView.textField becomeFirstResponder]; } - (void)cancelOmniboxEdit { @@ -450,14 +417,16 @@ [self loadURLForQuery:result]; } else { [self focusOmnibox]; - [_locationBarView.textField insertTextWhileEditing:result]; + [self.locationBarCoordinator.locationBarView.textField + insertTextWhileEditing:result]; // The call to |setText| shouldn't be needed, but without it the "Go" button // of the keyboard is disabled. - [_locationBarView.textField setText:result]; + [self.locationBarCoordinator.locationBarView.textField setText:result]; // Notify the accessibility system to start reading the new contents of the // Omnibox. - UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, - _locationBarView.textField); + UIAccessibilityPostNotification( + UIAccessibilityScreenChangedNotification, + self.locationBarCoordinator.locationBarView.textField); } } @@ -569,7 +538,8 @@ animations:^{ }]; - [self.locationBarView addExpandOmniboxAnimations:animator]; + [self.locationBarCoordinator.locationBarView + addExpandOmniboxAnimations:animator]; [self.toolbarViewController addToolbarExpansionAnimations:animator]; [animator startAnimation]; @@ -589,7 +559,8 @@ curve:UIViewAnimationCurveEaseInOut animations:^{ }]; - [self.locationBarView addContractOmniboxAnimations:animator]; + [self.locationBarCoordinator.locationBarView + addContractOmniboxAnimations:animator]; [self.toolbarViewController addToolbarContractionAnimations:animator]; [animator startAnimation]; }
diff --git a/ios/chrome/browser/ui/toolbar/test_toolbar_model_ios.h b/ios/chrome/browser/ui/toolbar/test_toolbar_model_ios.h index 18153d4..d9c7adc 100644 --- a/ios/chrome/browser/ui/toolbar/test_toolbar_model_ios.h +++ b/ios/chrome/browser/ui/toolbar/test_toolbar_model_ios.h
@@ -9,7 +9,6 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" #include "components/toolbar/test_toolbar_model.h" #include "ios/chrome/browser/ui/toolbar/toolbar_model_ios.h"
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_controller.h b/ios/chrome/browser/ui/toolbar/toolbar_controller.h index 11f8de6..89412a4 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_controller.h +++ b/ios/chrome/browser/ui/toolbar/toolbar_controller.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#import "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/activity_services/requirements/activity_service_positioner.h" #import "ios/chrome/browser/ui/bubble/bubble_view_anchor_point_provider.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_ui_element.h"
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h index 2f45dd3..58259dc5 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h +++ b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h
@@ -5,7 +5,6 @@ #ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_IOS_H_ #define IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_IOS_H_ -#include "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "components/toolbar/toolbar_model_delegate.h"
diff --git a/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h b/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h index 01b9b6e..52ac187 100644 --- a/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h +++ b/ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> -#import "base/mac/scoped_nsobject.h" #include "components/reading_list/ios/reading_list_model_bridge_observer.h" @class ToolbarToolsMenuButton;
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm index 3a57d56..5303d65 100644 --- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -46,10 +46,10 @@ #import "ios/chrome/browser/ui/commands/start_voice_search_command.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #import "ios/chrome/browser/ui/image_util.h" +#include "ios/chrome/browser/ui/location_bar/location_bar_view.h" #include "ios/chrome/browser/ui/omnibox/location_bar_controller.h" #include "ios/chrome/browser/ui/omnibox/location_bar_controller_impl.h" #include "ios/chrome/browser/ui/omnibox/location_bar_delegate.h" -#include "ios/chrome/browser/ui/omnibox/location_bar_view.h" #import "ios/chrome/browser/ui/omnibox/omnibox_popup_presenter.h" #include "ios/chrome/browser/ui/omnibox/omnibox_popup_view_ios.h" #include "ios/chrome/browser/ui/omnibox/omnibox_view_ios.h"
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm index ee9599c..0c4ab2c 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" -#import "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/experimental_flags.h" #import "ios/chrome/browser/ui/tools_menu/public/tools_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" @@ -21,10 +20,9 @@ protected: void SetUp() override { PlatformTest::SetUp(); - configuration_.reset([[ToolsMenuConfiguration alloc] - initWithDisplayView:nil - baseViewController:nil]); - controller_.reset([[ToolsMenuViewController alloc] init]); + configuration_ = [[ToolsMenuConfiguration alloc] initWithDisplayView:nil + baseViewController:nil]; + controller_ = [[ToolsMenuViewController alloc] init]; } // Returns tools menu view item by IDC value, null if not exit. @@ -37,8 +35,8 @@ return nullptr; } - base::scoped_nsobject<ToolsMenuConfiguration> configuration_; - base::scoped_nsobject<ToolsMenuViewController> controller_; + ToolsMenuConfiguration* configuration_; + ToolsMenuViewController* controller_; }; // Tests that "Request Desktop Site" is visible and enabled, and @@ -46,7 +44,7 @@ // whose user agent type is NONE. TEST_F(ToolsMenuViewControllerTest, TestUserAgentTypeNONE) { [configuration_ setUserAgentType:web::UserAgentType::NONE]; - [controller_ initializeMenuWithConfiguration:configuration_.get()]; + [controller_ initializeMenuWithConfiguration:configuration_]; ToolsMenuViewItem* desktop_item = GetToolsMenuViewItemWithTag(TOOLS_REQUEST_DESKTOP_SITE); @@ -63,7 +61,7 @@ // uses MOBILE user agent. TEST_F(ToolsMenuViewControllerTest, TestUserAgentTypeMOBILE) { [configuration_ setUserAgentType:web::UserAgentType::MOBILE]; - [controller_ initializeMenuWithConfiguration:configuration_.get()]; + [controller_ initializeMenuWithConfiguration:configuration_]; ToolsMenuViewItem* desktop_item = GetToolsMenuViewItemWithTag(TOOLS_REQUEST_DESKTOP_SITE); @@ -82,7 +80,7 @@ // is invisible. TEST_F(ToolsMenuViewControllerTest, TestUserAgentTypeDESKTOP) { [configuration_ setUserAgentType:web::UserAgentType::DESKTOP]; - [controller_ initializeMenuWithConfiguration:configuration_.get()]; + [controller_ initializeMenuWithConfiguration:configuration_]; ToolsMenuViewItem* desktop_item = GetToolsMenuViewItemWithTag(TOOLS_REQUEST_DESKTOP_SITE);
diff --git a/ios/chrome/browser/ui/translate/language_selection_coordinator.mm b/ios/chrome/browser/ui/translate/language_selection_coordinator.mm index de283589..657cd51 100644 --- a/ios/chrome/browser/ui/translate/language_selection_coordinator.mm +++ b/ios/chrome/browser/ui/translate/language_selection_coordinator.mm
@@ -101,6 +101,14 @@ [self start]; } +- (void)dismissLanguageSelector { + if (!self.started) + return; + + [self.selectionDelegate languageSelectorClosedWithoutSelection]; + [self.presenter dismissAnimated:NO]; +} + #pragma mark - LanguageSelectionViewControllerDelegate - (void)languageSelectedAtIndex:(int)index {
diff --git a/ios/chrome/browser/ui/voice/text_to_speech_player.mm b/ios/chrome/browser/ui/voice/text_to_speech_player.mm index ade4fa44..e4d23c1 100644 --- a/ios/chrome/browser/ui/voice/text_to_speech_player.mm +++ b/ios/chrome/browser/ui/voice/text_to_speech_player.mm
@@ -7,7 +7,6 @@ #import <AVFoundation/AVFoundation.h> #import <UIKit/UIKit.h> -#import "base/mac/scoped_nsobject.h" #import "ios/chrome/browser/ui/voice/text_to_speech_player+subclassing.h" #import "ios/chrome/browser/ui/voice/voice_search_notification_names.h" @@ -17,9 +16,9 @@ @interface TextToSpeechPlayer ()<AVAudioPlayerDelegate> { // The audio data to be played. - base::scoped_nsobject<NSData> _audioData; + NSData* _audioData; // The AVAudioPlayer playing TTS audio data. - base::scoped_nsobject<AVAudioPlayer> _player; + AVAudioPlayer* _player; // Whether playback has finished. BOOL _playbackFinished; } @@ -69,7 +68,7 @@ - (void)prepareToPlayAudioData:(NSData*)audioData { if (self.playingAudio) [self cancelPlayback]; - _audioData.reset(audioData); + _audioData = audioData; [[NSNotificationCenter defaultCenter] postNotificationName:kTTSAudioReadyForPlaybackNotification object:self]; @@ -80,7 +79,7 @@ if (self.playingAudio || !self.readyForPlayback) return; // Create the AVAudioPlayer and initiate playback. - _player.reset([[AVAudioPlayer alloc] initWithData:_audioData error:nil]); + _player = [[AVAudioPlayer alloc] initWithData:_audioData error:nil]; [_player setMeteringEnabled:YES]; [_player setDelegate:self]; [_player setNumberOfLoops:0]; @@ -90,7 +89,7 @@ postNotificationName:kTTSWillStartPlayingNotification object:self]; } else { - _player.reset(); + _player = nil; } } @@ -121,9 +120,9 @@ return; _playbackFinished = YES; [_player stop]; - _audioData.reset(); + _audioData = nil; [_player setDelegate:nil]; - _player.reset(); + _player = nil; if (sendNotification) { [[NSNotificationCenter defaultCenter] postNotificationName:kTTSDidStopPlayingNotification
diff --git a/ios/chrome/browser/upgrade/upgrade_center.h b/ios/chrome/browser/upgrade/upgrade_center.h index 3c0b600..2ab02a00 100644 --- a/ios/chrome/browser/upgrade/upgrade_center.h +++ b/ios/chrome/browser/upgrade/upgrade_center.h
@@ -16,7 +16,7 @@ class InfoBarManager; } -@protocol UpgradeCenterClientProtocol +@protocol UpgradeCenterClient // This is expected to call -addInfoBarToHelper:forTabId: for each tab to place // the infobars in the UI. The client must not unregister itself while in this @@ -33,11 +33,11 @@ // Registers a client and a |dispatcher| for the UpgradeCenter. Client and // |dispatcher| are not retained, unregisterClient: must be called before // the object goes away. -- (void)registerClient:(id<UpgradeCenterClientProtocol>)client +- (void)registerClient:(id<UpgradeCenterClient>)client withDispatcher:(id<ApplicationCommands>)dispatcher; // Unregisters a client. -- (void)unregisterClient:(id<UpgradeCenterClientProtocol>)client; +- (void)unregisterClient:(id<UpgradeCenterClient>)client; // Clients should call this method when -showUpgrade: is called or when a new // tab is created. The infobar will not be created if it already exists or if
diff --git a/ios/chrome/browser/upgrade/upgrade_center.mm b/ios/chrome/browser/upgrade/upgrade_center.mm index 70a1ff4..c0d9a45 100644 --- a/ios/chrome/browser/upgrade/upgrade_center.mm +++ b/ios/chrome/browser/upgrade/upgrade_center.mm
@@ -218,7 +218,7 @@ upgradeInfoBarDelegates_; // Stores the clients of the upgrade center. These objectiveC objects are not // retained. - __strong NSHashTable<id<UpgradeCenterClientProtocol>>* clients_; + __strong NSHashTable<id<UpgradeCenterClient>>* clients_; #if DCHECK_IS_ON() BOOL inCallback_; #endif @@ -290,7 +290,7 @@ [self showUpgradeInfoBars]; } -- (void)registerClient:(id<UpgradeCenterClientProtocol>)client +- (void)registerClient:(id<UpgradeCenterClient>)client withDispatcher:(id<ApplicationCommands>)dispatcher { [clients_ addObject:client]; self.dispatcher = dispatcher; @@ -298,7 +298,7 @@ [client showUpgrade:self]; } -- (void)unregisterClient:(id<UpgradeCenterClientProtocol>)client { +- (void)unregisterClient:(id<UpgradeCenterClient>)client { #if DCHECK_IS_ON() DCHECK(!inCallback_); #endif @@ -381,7 +381,7 @@ inCallback_ = YES; #endif upgradeInfoBarIsVisible_ = YES; - for (id<UpgradeCenterClientProtocol> upgradeClient in clients_) + for (id<UpgradeCenterClient> upgradeClient in clients_) [upgradeClient showUpgrade:self]; #if DCHECK_IS_ON() inCallback_ = NO;
diff --git a/ios/chrome/browser/upgrade/upgrade_center_unittest.mm b/ios/chrome/browser/upgrade/upgrade_center_unittest.mm index 02acf81..619d8f7 100644 --- a/ios/chrome/browser/upgrade/upgrade_center_unittest.mm +++ b/ios/chrome/browser/upgrade/upgrade_center_unittest.mm
@@ -28,7 +28,7 @@ } // namespace -@interface FakeUpgradeCenterClient : NSObject<UpgradeCenterClientProtocol> +@interface FakeUpgradeCenterClient : NSObject<UpgradeCenterClient> - (instancetype)initWithTest:(UpgradeCenterTest*)test; @end
diff --git a/ios/chrome/browser/voice/text_to_speech_listener_unittest.mm b/ios/chrome/browser/voice/text_to_speech_listener_unittest.mm index 0c632f5..e35f9626 100644 --- a/ios/chrome/browser/voice/text_to_speech_listener_unittest.mm +++ b/ios/chrome/browser/voice/text_to_speech_listener_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/chrome/browser/voice/text_to_speech_listener.h" -#import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/web_state.h" #include "ios/web/public/test/web_test_with_web_state.h" #include "testing/gtest/include/gtest/gtest.h" @@ -26,7 +25,7 @@ @interface TestTTSListenerDelegate : NSObject<TextToSpeechListenerDelegate> { // Backing objects for properties of the same name. - base::scoped_nsobject<NSData> _expectedAudioData; + NSData* _expectedAudioData; } // The expected audio data to be returned by the TextToSpeechListener. @@ -42,7 +41,7 @@ @synthesize audioDataReceived = _audioDataReceived; - (void)setExpectedAudioData:(NSData*)expectedAudioData { - _expectedAudioData.reset(expectedAudioData); + _expectedAudioData = expectedAudioData; } - (NSData*)expectedAudioData { @@ -72,9 +71,9 @@ public: void SetUp() override { web::WebTestWithWebState::SetUp(); - delegate_.reset([[TestTTSListenerDelegate alloc] init]); - listener_.reset([[TextToSpeechListener alloc] initWithWebState:web_state() - delegate:delegate_]); + delegate_ = [[TestTTSListenerDelegate alloc] init]; + listener_ = [[TextToSpeechListener alloc] initWithWebState:web_state() + delegate:delegate_]; } void TestExtraction(NSString* html, NSData* expected_audio_data) { @@ -86,8 +85,8 @@ } private: - base::scoped_nsobject<TestTTSListenerDelegate> delegate_; - base::scoped_nsobject<TextToSpeechListener> listener_; + TestTTSListenerDelegate* delegate_; + TextToSpeechListener* listener_; }; TEST_F(TextToSpeechListenerTest, ValidAudioDataTest) {
diff --git a/ios/chrome/browser/voice/voice_search_url_rewriter.mm b/ios/chrome/browser/voice/voice_search_url_rewriter.mm index b7bdcbe..0ff3565 100644 --- a/ios/chrome/browser/voice/voice_search_url_rewriter.mm +++ b/ios/chrome/browser/voice/voice_search_url_rewriter.mm
@@ -6,7 +6,6 @@ #import <Foundation/Foundation.h> -#import "base/mac/scoped_nsobject.h" #import "base/strings/sys_string_conversions.h" #include "components/google/core/browser/google_util.h" #include "components/prefs/pref_service.h"
diff --git a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h index 2a8cbed9..7251b40 100644 --- a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h +++ b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.h
@@ -9,7 +9,6 @@ #include <memory> -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" class WebStateList; @@ -36,7 +35,7 @@ id<NSFastEnumeration> GetFastEnumeration(); private: - base::scoped_nsprotocol<id<NSFastEnumeration>> fast_enumeration_; + id<NSFastEnumeration> fast_enumeration_; DISALLOW_COPY_AND_ASSIGN(WebStateListFastEnumerationHelper); };
diff --git a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.mm b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.mm index c45a67f2..b433894 100644 --- a/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.mm +++ b/ios/chrome/browser/web_state_list/web_state_list_fast_enumeration_helper.mm
@@ -140,12 +140,11 @@ WebStateListFastEnumerationHelper::~WebStateListFastEnumerationHelper() { WebStateListFastEnumeration* fast_enumeration = - base::mac::ObjCCastStrict<WebStateListFastEnumeration>( - fast_enumeration_.get()); + base::mac::ObjCCastStrict<WebStateListFastEnumeration>(fast_enumeration_); [fast_enumeration shutdown]; - fast_enumeration_.reset(); + fast_enumeration_ = nil; } id<NSFastEnumeration> WebStateListFastEnumerationHelper::GetFastEnumeration() { - return fast_enumeration_.get(); + return fast_enumeration_; }
diff --git a/ios/chrome/common/app_group/app_group_metrics_client.mm b/ios/chrome/common/app_group/app_group_metrics_client.mm index 4883f30..b6675b04 100644 --- a/ios/chrome/common/app_group/app_group_metrics_client.mm +++ b/ios/chrome/common/app_group/app_group_metrics_client.mm
@@ -5,7 +5,6 @@ #include "ios/chrome/common/app_group/app_group_metrics_client.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" #include "ios/chrome/common/app_group/app_group_constants.h" #include "ios/chrome/common/app_group/app_group_metrics.h"
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index f8edd04..5195beb 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -200,6 +200,7 @@ "//ios/chrome/browser/ui/icons:unit_tests", "//ios/chrome/browser/ui/infobars:unit_tests", "//ios/chrome/browser/ui/keyboard:unit_tests", + "//ios/chrome/browser/ui/location_bar:unit_tests", "//ios/chrome/browser/ui/main:unit_tests", "//ios/chrome/browser/ui/main_content:unit_tests", "//ios/chrome/browser/ui/ntp:unit_tests",
diff --git a/ios/chrome/test/block_cleanup_test.mm b/ios/chrome/test/block_cleanup_test.mm index 5b35057..2eb0963 100644 --- a/ios/chrome/test/block_cleanup_test.mm +++ b/ios/chrome/test/block_cleanup_test.mm
@@ -7,7 +7,6 @@ #import "ios/chrome/test/block_cleanup_test.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #import "base/mac/foundation_util.h" void BlockCleanupTest::SetUp() { @@ -32,8 +31,8 @@ void BlockCleanupTest::SpinRunLoop(NSTimeInterval cleanup_time) { NSDate* cleanup_start = [NSDate date]; while (fabs([cleanup_start timeIntervalSinceNow]) < cleanup_time) { - base::scoped_nsobject<NSDate> beforeDate( - [[NSDate alloc] initWithTimeIntervalSinceNow:cleanup_time]); + NSDate* beforeDate = + [[NSDate alloc] initWithTimeIntervalSinceNow:cleanup_time]; [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:beforeDate]; }
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index 0355a43c..6f07d59 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -104,6 +104,10 @@ // Waits for the bookmark internal state to be done loading. If it does not // happen within a timeout, a GREYAssert is induced. + (void)waitForBookmarksToFinishLoading; + +// Waits for the matcher to return an element that is sufficiently visible. ++ (void)waitForElementWithMatcherSufficientlyVisible:(id<GREYMatcher>)matcher; + @end #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index d9af059..55e2fe2f 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -9,7 +9,6 @@ #include "base/format_macros.h" #include "base/mac/foundation_util.h" -#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #include "components/strings/grit/components_strings.h" @@ -243,4 +242,20 @@ }), @"Bookmark model did not load"); } + ++ (void)waitForElementWithMatcherSufficientlyVisible:(id<GREYMatcher>)matcher { + GREYCondition* condition = [GREYCondition + conditionWithName:@"Wait for element with matcher sufficiently visible" + block:^BOOL { + NSError* error = nil; + [[EarlGrey selectElementWithMatcher:matcher] + assertWithMatcher:grey_sufficientlyVisible() + error:&error]; + return error == nil; + }]; + GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout], + @"Failed waiting for element with matcher %@ to become visible", + matcher); +} + @end
diff --git a/ios/net/cookies/cookie_store_ios.mm b/ios/net/cookies/cookie_store_ios.mm index ae9fe03..2d65a736 100644 --- a/ios/net/cookies/cookie_store_ios.mm +++ b/ios/net/cookies/cookie_store_ios.mm
@@ -15,7 +15,6 @@ #include "base/logging.h" #import "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" #include "base/memory/weak_ptr.h"
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm index f3ad4f2..e0f33e8 100644 --- a/ios/net/crn_http_protocol_handler.mm +++ b/ios/net/crn_http_protocol_handler.mm
@@ -14,7 +14,6 @@ #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" #include "base/memory/ref_counted.h" @@ -210,10 +209,10 @@ std::unique_ptr<char, base::FreeDeleter> read_buffer_; int read_buffer_size_; scoped_refptr<WrappedIOBuffer> read_buffer_wrapper_; - base::scoped_nsobject<NSMutableURLRequest> request_; - base::scoped_nsobject<NSURLSessionTask> task_; + NSMutableURLRequest* request_; + NSURLSessionTask* task_; // Stream delegate to read the HTTPBodyStream. - base::scoped_nsobject<CRWHTTPStreamDelegate> stream_delegate_; + CRWHTTPStreamDelegate* stream_delegate_; // Vector of readers used to accumulate a POST data stream. std::vector<std::unique_ptr<UploadElementReader>> post_data_readers_; @@ -238,8 +237,8 @@ // from the absoluteString of the original URL, because mutableCopy only // shallowly copies the request, and just retains the non-threadsafe NSURL. thread_checker_.DetachFromThread(); - task_.reset(); - request_.reset([request mutableCopy]); + task_ = nil; + request_ = [request mutableCopy]; // Will allocate read buffer with size |kIOBufferMinSize|. AllocateReadBuffer(0); [request_ setURL:request.URL]; @@ -247,7 +246,7 @@ HttpProtocolHandlerCore::HttpProtocolHandlerCore(NSURLSessionTask* task) : HttpProtocolHandlerCore([task currentRequest]) { - task_.reset(task); + task_ = task; } void HttpProtocolHandlerCore::HandleStreamEvent(NSStream* stream, @@ -329,7 +328,7 @@ // Stash the original URL in case we need to report it in an error. [request_ setURL:new_nsurl]; - if (stream_delegate_.get()) + if (stream_delegate_) StopListeningStream([request_ HTTPBodyStream]); // TODO(droger): See if we can share some code with URLRequest::Redirect() in @@ -355,7 +354,7 @@ // the inclusion of a multipart Content-Type header in GET can cause // problems with some servers: // http://code.google.com/p/chromium/issues/detail?id=843 - StripPostSpecificHeaders(request_.get()); + StripPostSpecificHeaders(request_); } } @@ -375,7 +374,7 @@ // Don't use |request_| or |response| anymore, as the client may be using them // on another thread and they are not re-entrant. As |request_| is mutable, it // is also important that it is not modified. - request_.reset(nil); + request_ = nil; request->Cancel(); DCHECK_EQ(net_request_, request); StopNetRequest(); @@ -703,8 +702,8 @@ if ([request_ HTTPBodyStream]) { NSInputStream* input_stream = [request_ HTTPBodyStream]; - stream_delegate_.reset( - [[CRWHTTPStreamDelegate alloc] initWithHttpProtocolHandlerCore:this]); + stream_delegate_ = + [[CRWHTTPStreamDelegate alloc] initWithHttpProtocolHandlerCore:this]; [input_stream setDelegate:stream_delegate_]; [input_stream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; @@ -748,7 +747,7 @@ auto metrics = std::make_unique<net::MetricsDelegate::Metrics>(); metrics->response_end_time = base::Time::Now(); - metrics->task = task_; + metrics->task.reset(task_); metrics->response_info = net_request_->response_info(); net_request_->GetLoadTimingInfo(&metrics->load_timing_info); @@ -757,7 +756,7 @@ delete net_request_; net_request_ = nullptr; - if (stream_delegate_.get()) + if (stream_delegate_) StopListeningStream([request_ HTTPBodyStream]); } @@ -765,11 +764,11 @@ DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(stream); DCHECK(stream_delegate_); - DCHECK([stream delegate] == stream_delegate_.get()); + DCHECK([stream delegate] == stream_delegate_); [stream setDelegate:nil]; [stream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - stream_delegate_.reset(nil); + stream_delegate_ = nil; // Close the stream if needed. switch ([stream streamStatus]) { case NSStreamStatusOpening: @@ -915,7 +914,7 @@ // NSURLRequest. @implementation CRNHTTPProtocolHandler { scoped_refptr<net::HttpProtocolHandlerCore> _core; - base::scoped_nsprotocol<id<CRNHTTPProtocolHandlerProxy>> _protocolProxy; + id<CRNHTTPProtocolHandlerProxy> _protocolProxy; __weak NSThread* _clientThread; BOOL _supportedURL; NSURLSessionTask* _task; @@ -992,8 +991,7 @@ _clientThread = [NSThread currentThread]; if (g_metrics_delegate) { - g_metrics_delegate->OnStartNetRequest( - base::scoped_nsobject<NSURLSessionTask>(_task)); + g_metrics_delegate->OnStartNetRequest(_task); } // The closure passed to PostTask must to retain the _protocolProxy @@ -1010,13 +1008,13 @@ - (id<CRNHTTPProtocolHandlerProxy>)getProtocolHandlerProxy { DCHECK_EQ([NSThread currentThread], _clientThread); - if (!_protocolProxy.get()) { - _protocolProxy.reset([[CRNHTTPProtocolHandlerProxyWithClientThread alloc] + if (!_protocolProxy) { + _protocolProxy = [[CRNHTTPProtocolHandlerProxyWithClientThread alloc] initWithProtocol:self clientThread:_clientThread - runLoopMode:[[NSRunLoop currentRunLoop] currentMode]]); + runLoopMode:[[NSRunLoop currentRunLoop] currentMode]]; } - return _protocolProxy.get(); + return _protocolProxy; } - (scoped_refptr<net::HttpProtocolHandlerCore>)getCore { @@ -1037,7 +1035,7 @@ - (void)stopLoading { [self cancelRequest]; - _protocolProxy.reset(); + _protocolProxy = nil; } @end
diff --git a/ios/net/crn_http_protocol_handler_proxy_with_client_thread.mm b/ios/net/crn_http_protocol_handler_proxy_with_client_thread.mm index ed1e684..586e887 100644 --- a/ios/net/crn_http_protocol_handler_proxy_with_client_thread.mm +++ b/ios/net/crn_http_protocol_handler_proxy_with_client_thread.mm
@@ -7,7 +7,6 @@ #include <stddef.h> #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #include "base/time/time.h" #import "ios/net/protocol_handler_util.h" #include "net/base/auth.h" @@ -34,9 +33,9 @@ // the usual task posting functions. __weak NSThread* _clientThread; // The run loop modes to use when posting tasks to |clientThread_|. - base::scoped_nsobject<NSArray> _runLoopModes; + NSArray* _runLoopModes; // The request URL. - base::scoped_nsobject<NSString> _url; + NSString* _url; // The creation time of the request. base::Time _creationTime; // |requestComplete_| is used in debug to check that the client is not called @@ -70,16 +69,16 @@ DCHECK(clientThread); if ((self = [super init])) { _protocol = protocol; - _url.reset([[[[protocol request] URL] absoluteString] copy]); + _url = [[[[protocol request] URL] absoluteString] copy]; _creationTime = base::Time::Now(); _clientThread = clientThread; // Use the common run loop mode in addition to the client thread mode, in // hope that our tasks are executed even if the client thread changes mode // later on. if ([mode isEqualToString:NSRunLoopCommonModes]) - _runLoopModes.reset(@[ NSRunLoopCommonModes ]); + _runLoopModes = @[ NSRunLoopCommonModes ]; else - _runLoopModes.reset(@[ mode, NSRunLoopCommonModes ]); + _runLoopModes = @[ mode, NSRunLoopCommonModes ]; _queuedBlocks = [[NSMutableArray alloc] init]; } return self;
diff --git a/ios/net/crn_http_url_response.mm b/ios/net/crn_http_url_response.mm index ebf2aeb..9e2b159e 100644 --- a/ios/net/crn_http_url_response.mm +++ b/ios/net/crn_http_url_response.mm
@@ -4,14 +4,13 @@ #import "ios/net/crn_http_url_response.h" -#include "base/mac/scoped_nsobject.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif @interface CRNHTTPURLResponse () { - base::scoped_nsobject<NSString> _cr_HTTPVersion; + NSString* _cr_HTTPVersion; } @end @@ -30,7 +29,7 @@ HTTPVersion:HTTPVersion headerFields:headerFields]; if (self) { - _cr_HTTPVersion.reset([HTTPVersion copy]); + _cr_HTTPVersion = [HTTPVersion copy]; } return self; }
diff --git a/ios/net/protocol_handler_util.mm b/ios/net/protocol_handler_util.mm index 4735b27..1a5d75d 100644 --- a/ios/net/protocol_handler_util.mm +++ b/ios/net/protocol_handler_util.mm
@@ -8,7 +8,6 @@ #include "base/base64.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/sys_string_conversions.h" #include "base/time/time.h"
diff --git a/ios/public/provider/chrome/browser/external_search/BUILD.gn b/ios/public/provider/chrome/browser/external_search/BUILD.gn index bfb45b4..ff8696ec 100644 --- a/ios/public/provider/chrome/browser/external_search/BUILD.gn +++ b/ios/public/provider/chrome/browser/external_search/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("external_search") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "external_search_provider.h", "external_search_provider.mm", @@ -14,6 +15,7 @@ } source_set("test_support") { + configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "test_external_search_provider.h",
diff --git a/ios/public/provider/chrome/browser/external_search/external_search_provider.mm b/ios/public/provider/chrome/browser/external_search/external_search_provider.mm index 53747d1a..34e57a34 100644 --- a/ios/public/provider/chrome/browser/external_search/external_search_provider.mm +++ b/ios/public/provider/chrome/browser/external_search/external_search_provider.mm
@@ -4,6 +4,10 @@ #import "ios/public/provider/chrome/browser/external_search/external_search_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + bool ExternalSearchProvider::IsExternalSearchEnabled() { return false; }
diff --git a/ios/public/provider/chrome/browser/external_search/test_external_search_provider.mm b/ios/public/provider/chrome/browser/external_search/test_external_search_provider.mm index d16cf64..bf8f842 100644 --- a/ios/public/provider/chrome/browser/external_search/test_external_search_provider.mm +++ b/ios/public/provider/chrome/browser/external_search/test_external_search_provider.mm
@@ -4,6 +4,10 @@ #import "ios/public/provider/chrome/browser/external_search/test_external_search_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + bool TestExternalSearchProvider::IsExternalSearchEnabled() { return true; }
diff --git a/ios/public/provider/chrome/browser/signin/BUILD.gn b/ios/public/provider/chrome/browser/signin/BUILD.gn index 8820007..d6d697d 100644 --- a/ios/public/provider/chrome/browser/signin/BUILD.gn +++ b/ios/public/provider/chrome/browser/signin/BUILD.gn
@@ -23,6 +23,7 @@ } source_set("test_support") { + configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "fake_chrome_identity.h",
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm index 9cf89972..ed108d9 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity.mm
@@ -4,21 +4,22 @@ #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" -#import "base/mac/scoped_nsobject.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif @implementation FakeChromeIdentity { - base::scoped_nsobject<NSString> _userEmail; - base::scoped_nsobject<NSString> _gaiaID; - base::scoped_nsobject<NSString> _userFullName; - base::scoped_nsobject<NSString> _hashedGaiaID; + NSString* _userEmail; + NSString* _gaiaID; + NSString* _userFullName; + NSString* _hashedGaiaID; } + (FakeChromeIdentity*)identityWithEmail:(NSString*)email gaiaID:(NSString*)gaiaID name:(NSString*)name { return - [[[FakeChromeIdentity alloc] initWithEmail:email gaiaID:gaiaID name:name] - autorelease]; + [[FakeChromeIdentity alloc] initWithEmail:email gaiaID:gaiaID name:name]; } - (instancetype)initWithEmail:(NSString*)email @@ -26,11 +27,10 @@ name:(NSString*)name { self = [super init]; if (self) { - _userEmail.reset([email copy]); - _gaiaID.reset([gaiaID copy]); - _userFullName.reset([name copy]); - _hashedGaiaID.reset( - [[NSString stringWithFormat:@"%@_hashID", name] retain]); + _userEmail = [email copy]; + _gaiaID = [gaiaID copy]; + _userFullName = [name copy]; + _hashedGaiaID = [NSString stringWithFormat:@"%@_hashID", name]; } return self; }
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h index 32c81ef..20804d5 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h
@@ -12,7 +12,7 @@ : ChromeIdentityInteractionManager // Fake identity that will be returned by the add account method. -@property(nonatomic, assign) ChromeIdentity* fakeIdentity; +@property(nonatomic, weak) ChromeIdentity* fakeIdentity; @end
diff --git a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm index 93de808..08e53188 100644 --- a/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm +++ b/ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.mm
@@ -5,21 +5,24 @@ #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h" #include "base/mac/scoped_block.h" -#include "base/mac/scoped_nsobject.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h" #include "ios/public/provider/chrome/browser/signin/signin_error_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + @interface FakeAddAccountViewController : UIViewController { - FakeChromeIdentityInteractionManager* _manager; // Weak. - base::scoped_nsobject<UIButton> _cancelButton; - base::scoped_nsobject<UIButton> _signInButton; + __weak FakeChromeIdentityInteractionManager* _manager; + UIButton* _cancelButton; + UIButton* _signInButton; } @end @interface FakeChromeIdentityInteractionManager () { - base::mac::ScopedBlock<SigninCompletionCallback> _completionCallback; - base::scoped_nsobject<UIViewController> _viewController; + SigninCompletionCallback _completionCallback; + UIViewController* _viewController; BOOL _isCanceling; } @@ -47,7 +50,6 @@ [_cancelButton removeTarget:self action:@selector(didTapCancel:) forControlEvents:UIControlEventTouchUpInside]; - [super dealloc]; } - (void)viewDidLoad { @@ -56,14 +58,14 @@ // Obnoxious color, this is a test screen. self.view.backgroundColor = [UIColor magentaColor]; - _signInButton.reset([[UIButton buttonWithType:UIButtonTypeCustom] retain]); + _signInButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_signInButton setTitle:@"Sign in" forState:UIControlStateNormal]; [_signInButton addTarget:self action:@selector(didTapSignIn:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:_signInButton]; - _cancelButton.reset([[UIButton buttonWithType:UIButtonTypeCustom] retain]); + _cancelButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_cancelButton setTitle:@"Cancel" forState:UIControlStateNormal]; [_cancelButton setAccessibilityIdentifier:@"cancel"]; [_cancelButton addTarget:self @@ -103,9 +105,9 @@ } - (void)addAccountWithCompletion:(SigninCompletionCallback)completion { - _completionCallback.reset(completion, base::scoped_policy::RETAIN); - _viewController.reset( - [[FakeAddAccountViewController alloc] initWithInteractionManager:self]); + _completionCallback = completion; + _viewController = + [[FakeAddAccountViewController alloc] initWithInteractionManager:self]; [self.delegate interactionManager:self presentViewController:_viewController animated:YES @@ -152,13 +154,13 @@ } - (void)runCompletionCallbackWithError:(NSError*)error { - _viewController.reset(); + _viewController = nil; if (_completionCallback) { // Ensure self is not destroyed in the callback. - base::scoped_nsobject<FakeChromeIdentityInteractionManager> strongSelf( - [self retain]); - _completionCallback.get()(error ? nil : _fakeIdentity, error); - _completionCallback.reset(); + NS_VALID_UNTIL_END_OF_SCOPE FakeChromeIdentityInteractionManager* + strongSelf = self; + _completionCallback(error ? nil : _fakeIdentity, error); + _completionCallback = nil; } }
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 5626c2714..dc2a3892 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
@@ -14,6 +14,10 @@ #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_interaction_manager.h" #include "ios/public/provider/chrome/browser/signin/signin_resources_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + using ::testing::_; using ::testing::Invoke; @@ -48,8 +52,8 @@ } @interface FakeAccountDetailsViewController : UIViewController { - ChromeIdentity* _identity; // Weak. - base::scoped_nsobject<UIButton> _removeAccountButton; + __weak ChromeIdentity* _identity; + UIButton* _removeAccountButton; } @end @@ -67,7 +71,6 @@ [_removeAccountButton removeTarget:self action:@selector(didTapRemoveAccount:) forControlEvents:UIControlEventTouchUpInside]; - [super dealloc]; } - (void)viewDidLoad { @@ -76,8 +79,7 @@ // Obnoxious color, this is a test screen. self.view.backgroundColor = [UIColor orangeColor]; - _removeAccountButton.reset( - [[UIButton buttonWithType:UIButtonTypeCustom] retain]); + _removeAccountButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_removeAccountButton setTitle:@"Remove account" forState:UIControlStateNormal]; [_removeAccountButton addTarget:self @@ -124,11 +126,10 @@ FakeChromeIdentityService::CreateAccountDetailsController( ChromeIdentity* identity, id<ChromeIdentityBrowserOpener> browser_opener) { - base::scoped_nsobject<UIViewController> accountDetailsViewController( - [[FakeAccountDetailsViewController alloc] initWithIdentity:identity]); - UINavigationController* navigationController = - [[[UINavigationController alloc] - initWithRootViewController:accountDetailsViewController] autorelease]; + UIViewController* accountDetailsViewController = + [[FakeAccountDetailsViewController alloc] initWithIdentity:identity]; + UINavigationController* navigationController = [[UINavigationController alloc] + initWithRootViewController:accountDetailsViewController]; return navigationController; } @@ -137,7 +138,7 @@ ios::ChromeBrowserState* browser_state, id<ChromeIdentityInteractionManagerDelegate> delegate) const { ChromeIdentityInteractionManager* manager = - [[[FakeChromeIdentityInteractionManager alloc] init] autorelease]; + [[FakeChromeIdentityInteractionManager alloc] init]; manager.delegate = delegate; return manager; } @@ -194,8 +195,7 @@ const std::string& client_secret, const std::set<std::string>& scopes, ios::AccessTokenCallback callback) { - base::mac::ScopedBlock<ios::AccessTokenCallback> safe_callback( - [callback copy]); + ios::AccessTokenCallback safe_callback = [callback copy]; NSError* error = nil; NSDictionary* user_info = nil; if (_fakeMDMError) { @@ -219,7 +219,7 @@ NSDate* expiresDate = [NSDate dateWithTimeIntervalSinceNow:expiration]; NSString* token = [expiresDate description]; - safe_callback.get()(token, expiresDate, error); + safe_callback(token, expiresDate, error); }); }
diff --git a/ios/public/provider/chrome/browser/signin/test_signin_resources_provider.mm b/ios/public/provider/chrome/browser/signin/test_signin_resources_provider.mm index 9024caf5..2e82643 100644 --- a/ios/public/provider/chrome/browser/signin/test_signin_resources_provider.mm +++ b/ios/public/provider/chrome/browser/signin/test_signin_resources_provider.mm
@@ -6,6 +6,10 @@ #import <UIKit/UIKit.h> +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + TestSigninResourcesProvider::TestSigninResourcesProvider() : default_avatar_([[UIImage alloc] init]) {}
diff --git a/ios/testing/ocmock_complex_type_helper.mm b/ios/testing/ocmock_complex_type_helper.mm index 16fbc1a2..677d300 100644 --- a/ios/testing/ocmock_complex_type_helper.mm +++ b/ios/testing/ocmock_complex_type_helper.mm
@@ -5,7 +5,6 @@ #import "ios/testing/ocmock_complex_type_helper.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #import "base/strings/sys_string_conversions.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -14,26 +13,26 @@ @implementation OCMockComplexTypeHelper { // Same as the superclass -representedObject, but retained. - base::scoped_nsobject<OCMockObject> _object; + OCMockObject* _object; // All the blocks registered by selector. - base::scoped_nsobject<NSMutableDictionary> _blocks; + NSMutableDictionary* _blocks; } #pragma mark - public methods. - (instancetype)initWithRepresentedObject:(id)object { if ((self = [super initWithRepresentedObject:object])) - _object.reset(object); + _object = object; return self; } - (void)onSelector:(SEL)selector callBlockExpectation:(id)block { if (!_blocks) - _blocks.reset([[NSMutableDictionary alloc] init]); + _blocks = [[NSMutableDictionary alloc] init]; NSString* key = NSStringFromSelector(selector); DCHECK(![_blocks objectForKey:key]) << "Only one expectation per signature"; - base::scoped_nsobject<id> value([block copy]); + id value = [block copy]; [_blocks setObject:value forKey:key]; }
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm index 7288a4b..c97daf5 100644 --- a/ios/web/browser_state_web_view_partition_inttest.mm +++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -8,7 +8,6 @@ #include <string> #include "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #import "base/test/ios/wait_util.h" #include "base/test/test_timeouts.h" @@ -108,8 +107,8 @@ void LoadTestWebPage(WKWebView* web_view) { DCHECK(web_view); - base::scoped_nsobject<TestNavigationDelegate> navigation_delegate( - [[TestNavigationDelegate alloc] init]); + TestNavigationDelegate* navigation_delegate = + [[TestNavigationDelegate alloc] init]; id old_navigation_delegate = web_view.navigationDelegate; web_view.navigationDelegate = navigation_delegate;
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm index bcc37bc..a84f919 100644 --- a/ios/web/navigation/crw_session_controller.mm +++ b/ios/web/navigation/crw_session_controller.mm
@@ -12,7 +12,6 @@ #include "base/format_macros.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/web/history_state_util.h"
diff --git a/ios/web/navigation/history_state_operations_inttest.mm b/ios/web/navigation/history_state_operations_inttest.mm index 71eaa2a..9f7ccc0 100644 --- a/ios/web/navigation/history_state_operations_inttest.mm +++ b/ios/web/navigation/history_state_operations_inttest.mm
@@ -405,7 +405,7 @@ // resets the page to a GET request. TEST_F(HistoryStateOperationsTest, ReplaceStatePostRequest) { // Add POST data to the current NavigationItem. - base::scoped_nsobject<NSData> post_data([NSData data]); + NSData* post_data = [NSData data]; static_cast<web::NavigationItemImpl*>(GetLastCommittedItem()) ->SetPostData(post_data); ASSERT_TRUE(GetLastCommittedItem()->HasPostData());
diff --git a/ios/web/net/cert_host_pair.cc b/ios/web/net/cert_host_pair.cc index badc7967..56d2ae7 100644 --- a/ios/web/net/cert_host_pair.cc +++ b/ios/web/net/cert_host_pair.cc
@@ -4,6 +4,8 @@ #include "ios/web/net/cert_host_pair.h" +#include <utility> + #include "net/cert/x509_certificate.h" namespace web { @@ -19,9 +21,7 @@ CertHostPair::~CertHostPair() {} bool CertHostPair::operator<(const CertHostPair& other) const { - if (host_ != other.host_) - return host_ < other.host_; - return net::SHA256HashValueLessThan()(cert_hash_, other.cert_hash_); + return std::tie(host_, cert_hash_) < std::tie(other.host_, other.cert_hash_); } } // web
diff --git a/ios/web/net/crw_ssl_status_updater.mm b/ios/web/net/crw_ssl_status_updater.mm index 7840caa4..0a5db1f5 100644 --- a/ios/web/net/crw_ssl_status_updater.mm +++ b/ios/web/net/crw_ssl_status_updater.mm
@@ -4,7 +4,6 @@ #import "ios/web/net/crw_ssl_status_updater.h" -#import "base/mac/scoped_nsobject.h" #import "base/strings/sys_string_conversions.h" #include "ios/web/navigation/navigation_manager_util.h" #import "ios/web/public/navigation_item.h"
diff --git a/ios/web/public/cert_policy.h b/ios/web/public/cert_policy.h index 212f26b5..21418ccd7 100644 --- a/ios/web/public/cert_policy.h +++ b/ios/web/public/cert_policy.h
@@ -46,8 +46,7 @@ private: // The set of fingerprints of allowed certificates. - std::map<net::SHA256HashValue, net::CertStatus, net::SHA256HashValueLessThan> - allowed_; + std::map<net::SHA256HashValue, net::CertStatus> allowed_; }; } // namespace web
diff --git a/ios/web/public/crw_session_certificate_policy_cache_storage_unittest.mm b/ios/web/public/crw_session_certificate_policy_cache_storage_unittest.mm index 1848624..7ef1cde 100644 --- a/ios/web/public/crw_session_certificate_policy_cache_storage_unittest.mm +++ b/ios/web/public/crw_session_certificate_policy_cache_storage_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/web/public/crw_session_certificate_policy_cache_storage.h" -#import "base/mac/scoped_nsobject.h" #include "net/cert/x509_certificate.h" #include "net/cert/x509_util.h" #include "net/test/cert_test_util.h" @@ -50,7 +49,7 @@ // Set up |cache_storage_|. scoped_refptr<net::X509Certificate> cert = net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); - base::scoped_nsobject<NSMutableSet> certs([[NSMutableSet alloc] init]); + NSMutableSet* certs = [[NSMutableSet alloc] init]; [certs addObject:[[CRWSessionCertificateStorage alloc] initWithCertificate:cert host:"test1.com" @@ -59,7 +58,7 @@ } protected: - base::scoped_nsobject<CRWSessionCertificatePolicyCacheStorage> cache_storage_; + CRWSessionCertificatePolicyCacheStorage* cache_storage_; }; // Tests that unarchiving CRWSessionCertificatePolicyCacheStorage data results @@ -67,7 +66,7 @@ TEST_F(CRWSessionCertificatePolicyCacheStorageTest, EncodeDecode) { NSData* data = [NSKeyedArchiver archivedDataWithRootObject:cache_storage_]; id decoded = [NSKeyedUnarchiver unarchiveObjectWithData:data]; - EXPECT_TRUE(CacheStoragesAreEqual(cache_storage_.get(), decoded)); + EXPECT_TRUE(CacheStoragesAreEqual(cache_storage_, decoded)); } using CRWSessionCertificateStorageTest = PlatformTest;
diff --git a/ios/web/public/test/fakes/test_web_state.h b/ios/web/public/test/fakes/test_web_state.h index 76a99c1..eb34d47 100644 --- a/ios/web/public/test/fakes/test_web_state.h +++ b/ios/web/public/test/fakes/test_web_state.h
@@ -82,7 +82,6 @@ void DidChangeVisibleSecurityState() override {} bool HasOpener() const override; void SetHasOpener(bool has_opener) override; - bool CanTakeSnapshot() const override; void TakeSnapshot(const SnapshotCallback& callback, CGSize target_size) const override;
diff --git a/ios/web/public/test/fakes/test_web_state.mm b/ios/web/public/test/fakes/test_web_state.mm index 587bbb8bf..c4b27ba 100644 --- a/ios/web/public/test/fakes/test_web_state.mm +++ b/ios/web/public/test/fakes/test_web_state.mm
@@ -312,10 +312,6 @@ has_opener_ = has_opener; } -bool TestWebState::CanTakeSnapshot() const { - return view_ != nil; -} - void TestWebState::TakeSnapshot(const SnapshotCallback& callback, CGSize target_size) const { callback.Run(gfx::Image([[UIImage alloc] init]));
diff --git a/ios/web/public/test/http_server_inttest.mm b/ios/web/public/test/http_server_inttest.mm index ffc9357..0fbae4ab 100644 --- a/ios/web/public/test/http_server_inttest.mm +++ b/ios/web/public/test/http_server_inttest.mm
@@ -7,7 +7,6 @@ #include <memory> #include <string> -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "ios/web/public/test/http_server/http_server.h" @@ -36,11 +35,11 @@ ASSERT_TRUE(server.IsRunning()); server.AddResponseProvider(std::move(provider)); - __block base::scoped_nsobject<NSString> page_result; + __block NSString* page_result; id completion_handler = ^(NSData* data, NSURLResponse* response, NSError* error) { - page_result.reset([[NSString alloc] - initWithData:data encoding:NSUTF8StringEncoding]); + page_result = + [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; }; NSURL* url = net::NSURLWithGURL(server.MakeUrl("http://whatever")); NSURLSessionDataTask* data_task =
diff --git a/ios/web/public/user_agent.mm b/ios/web/public/user_agent.mm index ac2a4dd..8419a25 100644 --- a/ios/web/public/user_agent.mm +++ b/ios/web/public/user_agent.mm
@@ -11,7 +11,6 @@ #include <sys/sysctl.h> #include <string> -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h"
diff --git a/ios/web/public/web_state/ui/crw_web_delegate.h b/ios/web/public/web_state/ui/crw_web_delegate.h index e6e9e94f..1ef77a0 100644 --- a/ios/web/public/web_state/ui/crw_web_delegate.h +++ b/ios/web/public/web_state/ui/crw_web_delegate.h
@@ -35,10 +35,6 @@ @optional -// Called when a placeholder image should be displayed instead of the WebView. -- (void)webController:(CRWWebController*)webController - retrievePlaceholderOverlayImage:(void (^)(UIImage*))block; - // Called to ask CRWWebDelegate if |CRWWebController| should open the given URL. // CRWWebDelegate can intercept the request by returning NO and processing URL // in its own way.
diff --git a/ios/web/public/web_state/web_state.h b/ios/web/public/web_state/web_state.h index 47b72e75..4fb4b58 100644 --- a/ios/web/public/web_state/web_state.h +++ b/ios/web/public/web_state/web_state.h
@@ -296,11 +296,6 @@ // Callback used to handle snapshots. The parameter is the snapshot image. typedef base::Callback<void(const gfx::Image&)> SnapshotCallback; - // Returns whether there is a view available to generate a snapshot. If - // this returns false, then TakeSnapshot will takes a snapshot of an empty - // view. - virtual bool CanTakeSnapshot() const = 0; - // Takes a snapshot of this WebState with |target_size|. |callback| is // asynchronously invoked after performing the snapshot. virtual void TakeSnapshot(const SnapshotCallback& callback,
diff --git a/ios/web/shell/app_delegate.mm b/ios/web/shell/app_delegate.mm index a404990..6e241c40 100644 --- a/ios/web/shell/app_delegate.mm +++ b/ios/web/shell/app_delegate.mm
@@ -6,7 +6,6 @@ #include <memory> -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "ios/web/public/app/web_main.h" #import "ios/web/public/web_client.h" @@ -46,8 +45,8 @@ static_cast<web::ShellWebClient*>(web::GetWebClient()); web::BrowserState* browserState = client->browser_state(); - base::scoped_nsobject<ViewController> controller( - [[ViewController alloc] initWithBrowserState:browserState]); + ViewController* controller = + [[ViewController alloc] initWithBrowserState:browserState]; self.window.rootViewController = controller; return YES; }
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm index 90dec6e..46c7710 100644 --- a/ios/web/shell/view_controller.mm +++ b/ios/web/shell/view_controller.mm
@@ -11,7 +11,6 @@ #include <memory> #include <utility> -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "ios/web/public/navigation_manager.h" #include "ios/web/public/referrer.h" @@ -106,9 +105,9 @@ action:@selector(forward)]; [forward setAccessibilityLabel:kWebShellForwardButtonAccessibilityLabel]; - base::scoped_nsobject<UITextField> field([[UITextField alloc] + UITextField* field = [[UITextField alloc] initWithFrame:CGRectMake(88, 6, CGRectGetWidth([_toolbarView frame]) - 98, - 31)]); + 31)]; [field setDelegate:self]; [field setBackground:[[UIImage imageNamed:@"textfield_background"] resizableImageWithCapInsets:UIEdgeInsetsMake(
diff --git a/ios/web/web_state/error_translation_util.mm b/ios/web/web_state/error_translation_util.mm index f8d2603..5efefde 100644 --- a/ios/web/web_state/error_translation_util.mm +++ b/ios/web/web_state/error_translation_util.mm
@@ -7,7 +7,6 @@ #include <CFNetwork/CFNetwork.h> #import "base/ios/ns_error_util.h" -#import "base/mac/scoped_nsobject.h" #include "net/base/net_errors.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/web_state/js/crw_js_injection_manager.mm b/ios/web/web_state/js/crw_js_injection_manager.mm index 9ef0c7e..7743c8c 100644 --- a/ios/web/web_state/js/crw_js_injection_manager.mm +++ b/ios/web/web_state/js/crw_js_injection_manager.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" #import "ios/web/web_state/js/page_script_util.h" @@ -20,7 +19,7 @@ @implementation CRWJSInjectionManager { // JS to inject into the page. This may be nil if it has been purged due to // low memory. - base::scoped_nsobject<NSString> _injectObject; + NSString* _injectObject; // An object the can receive JavaScript injection. __weak CRWJSInjectionReceiver* _receiver; } @@ -56,7 +55,7 @@ } - (void)lowMemoryWarning:(NSNotification*)notify { - _injectObject.reset(); + _injectObject = nil; } - (void)executeJavaScript:(NSString*)script @@ -78,8 +77,8 @@ - (NSString*)injectionContent { if (!_injectObject) - _injectObject.reset([[self staticInjectionContent] copy]); - return _injectObject.get(); + _injectObject = [[self staticInjectionContent] copy]; + return _injectObject; } - (NSString*)staticInjectionContent {
diff --git a/ios/web/web_state/js/crw_js_injection_receiver.mm b/ios/web/web_state/js/crw_js_injection_receiver.mm index 94ea7cbc3..532a98f 100644 --- a/ios/web/web_state/js/crw_js_injection_receiver.mm +++ b/ios/web/web_state/js/crw_js_injection_receiver.mm
@@ -5,7 +5,6 @@ #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" #import "ios/web/public/web_state/js/crw_js_injection_manager.h" @@ -19,7 +18,7 @@ // Map from a CRWJSInjectionManager class to its instance created for this // receiver. - base::scoped_nsobject<NSMutableDictionary> _managers; + NSMutableDictionary* _managers; } - (id)init { @@ -32,7 +31,7 @@ self = [super init]; if (self) { _evaluator = evaluator; - _managers.reset([[NSMutableDictionary alloc] init]); + _managers = [[NSMutableDictionary alloc] init]; } return self; } @@ -58,8 +57,8 @@ CRWJSInjectionManager* manager = [_managers objectForKey:jsInjectionManagerClass]; if (!manager) { - base::scoped_nsobject<CRWJSInjectionManager> newManager( - [[jsInjectionManagerClass alloc] initWithReceiver:self]); + CRWJSInjectionManager* newManager = + [[jsInjectionManagerClass alloc] initWithReceiver:self]; [_managers setObject:newManager forKey:jsInjectionManagerClass]; manager = newManager; } @@ -71,6 +70,6 @@ @implementation CRWJSInjectionReceiver (Testing) - (NSDictionary*)managers { - return _managers.get(); + return _managers; } @end
diff --git a/ios/web/web_state/js/crw_js_post_request_loader.mm b/ios/web/web_state/js/crw_js_post_request_loader.mm index 1ea0ac3..7e6ff4d 100644 --- a/ios/web/web_state/js/crw_js_post_request_loader.mm +++ b/ios/web/web_state/js/crw_js_post_request_loader.mm
@@ -5,7 +5,6 @@ #import "ios/web/web_state/js/crw_js_post_request_loader.h" #include "base/json/string_escape.h" -#import "base/mac/scoped_nsobject.h" #import "base/strings/sys_string_conversions.h" #import "ios/web/web_state/js/page_script_util.h" #import "ios/web/web_state/ui/crw_wk_script_message_router.h" @@ -32,7 +31,7 @@ } // namespace @interface CRWJSPOSTRequestLoader () { - base::scoped_nsobject<NSString> _requestScript; + NSString* _requestScript; } // JavaScript used to execute POST requests. Lazily instantiated. @@ -70,7 +69,7 @@ - (NSString*)requestScript { if (!_requestScript) { - _requestScript.reset([web::GetPageScript(@"post_request") copy]); + _requestScript = [web::GetPageScript(@"post_request") copy]; } return _requestScript; } @@ -122,7 +121,7 @@ - (void)handleMemoryWarning { // Request script can be recreated from file at any moment. - _requestScript.reset(); + _requestScript = nil; } - (NSString*)scriptToExecutePOSTRequest:(NSURLRequest*)request {
diff --git a/ios/web/web_state/js/crw_js_window_id_manager.mm b/ios/web/web_state/js/crw_js_window_id_manager.mm index 3da15fe6..f0362b7 100644 --- a/ios/web/web_state/js/crw_js_window_id_manager.mm +++ b/ios/web/web_state/js/crw_js_window_id_manager.mm
@@ -4,7 +4,6 @@ #import "ios/web/web_state/js/crw_js_window_id_manager.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/string_number_conversions.h" #include "base/strings/sys_string_conversions.h" #include "crypto/random.h" @@ -22,9 +21,9 @@ @interface CRWJSWindowIDManager () { // Web view used for script evaluation to inject window ID. - base::scoped_nsobject<WKWebView> _webView; + WKWebView* _webView; // Backs up property with the same name. - base::scoped_nsobject<NSString> _windowID; + NSString* _windowID; } // Returns a string of randomized ASCII characters. @@ -40,14 +39,14 @@ - (instancetype)initWithWebView:(WKWebView*)webView { if ((self = [super init])) { - _webView.reset(webView); - _windowID.reset([[self class] newUniqueKey]); + _webView = webView; + _windowID = [[self class] newUniqueKey]; } return self; } - (void)inject { - _windowID.reset([[self class] newUniqueKey]); + _windowID = [[self class] newUniqueKey]; NSString* script = [web::GetPageScript(@"window_id") stringByReplacingOccurrencesOfString:@"$(WINDOW_ID)" withString:_windowID];
diff --git a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm index ac1dcfc..59cd9a2 100644 --- a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm +++ b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm
@@ -376,12 +376,12 @@ scoped_observer_.Add(web_state()); // Stub out NativeContent objects. - provider_.reset([[TestNativeContentProvider alloc] init]); - content_.reset([[TestNativeContent alloc] initWithURL:GURL::EmptyGURL() - virtualURL:GURL::EmptyGURL()]); + provider_ = [[TestNativeContentProvider alloc] init]; + content_ = [[TestNativeContent alloc] initWithURL:GURL::EmptyGURL() + virtualURL:GURL::EmptyGURL()]; WebStateImpl* web_state_impl = reinterpret_cast<WebStateImpl*>(web_state()); - web_state_impl->GetWebController().nativeProvider = provider_.get(); + web_state_impl->GetWebController().nativeProvider = provider_; } void TearDown() override { @@ -390,9 +390,9 @@ } protected: - base::scoped_nsobject<TestNativeContentProvider> provider_; + TestNativeContentProvider* provider_; std::unique_ptr<StrictMock<PolicyDeciderMock>> decider_; - base::scoped_nsobject<TestNativeContent> content_; + TestNativeContent* content_; StrictMock<WebStateObserverMock> observer_; ScopedObserver<WebState, WebStateObserver> scoped_observer_; testing::InSequence callbacks_sequence_checker_; @@ -672,7 +672,7 @@ EXPECT_CALL(observer_, DidFinishNavigation(web_state(), _)) .WillOnce(VerifyNewNativePageFinishedContext(web_state(), url, &context)); EXPECT_CALL(observer_, DidStopLoading(web_state())); - [provider_ setController:content_.get() forURL:url]; + [provider_ setController:content_ forURL:url]; LoadUrl(url); } @@ -685,7 +685,7 @@ // navigations. EXPECT_CALL(observer_, DidFinishNavigation(web_state(), _)); EXPECT_CALL(observer_, DidStopLoading(web_state())); - [provider_ setController:content_.get() forURL:url]; + [provider_ setController:content_ forURL:url]; LoadUrl(url); // Reload native content.
diff --git a/ios/web/web_state/session_certificate_policy_cache_storage_builder_unittest.mm b/ios/web/web_state/session_certificate_policy_cache_storage_builder_unittest.mm index 97141d63..c51fcd3b 100644 --- a/ios/web/web_state/session_certificate_policy_cache_storage_builder_unittest.mm +++ b/ios/web/web_state/session_certificate_policy_cache_storage_builder_unittest.mm
@@ -4,7 +4,6 @@ #import "ios/web/web_state/session_certificate_policy_cache_storage_builder.h" -#import "base/mac/scoped_nsobject.h" #import "ios/web/public/crw_session_certificate_policy_cache_storage.h" #include "ios/web/public/test/test_web_thread_bundle.h" #import "ios/web/web_state/session_certificate_policy_cache_impl.h" @@ -53,12 +52,12 @@ net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem"); std::string host("test.com"); net::CertStatus status = net::CERT_STATUS_REVOKED; - base::scoped_nsobject<CRWSessionCertificateStorage> cert_storage( + CRWSessionCertificateStorage* cert_storage = [[CRWSessionCertificateStorage alloc] initWithCertificate:cert host:host - status:status]); - base::scoped_nsobject<CRWSessionCertificatePolicyCacheStorage> cache_storage( - [[CRWSessionCertificatePolicyCacheStorage alloc] init]); + status:status]; + CRWSessionCertificatePolicyCacheStorage* cache_storage = + [[CRWSessionCertificatePolicyCacheStorage alloc] init]; [cache_storage setCertificateStorages:[NSSet setWithObject:cert_storage]]; // Build the cert policy cache and verify its contents. web::SessionCertificatePolicyCacheStorageBuilder builder;
diff --git a/ios/web/web_state/ui/crw_generic_content_view.mm b/ios/web/web_state/ui/crw_generic_content_view.mm index 2cae6c1..315fe6a 100644 --- a/ios/web/web_state/ui/crw_generic_content_view.mm +++ b/ios/web/web_state/ui/crw_generic_content_view.mm
@@ -5,7 +5,6 @@ #import "ios/web/public/web_state/ui/crw_generic_content_view.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -15,9 +14,9 @@ // The size of the view's bounds at the last call to |-layoutSubviews|. CGSize _lastLayoutSize; // Backing objectect for |self.scrollView|. - base::scoped_nsobject<UIScrollView> _scrollView; + UIScrollView* _scrollView; // Backing object for |self.view|. - base::scoped_nsobject<UIView> _view; + UIView* _view; } @end @@ -29,8 +28,8 @@ if (self) { DCHECK(view); _lastLayoutSize = CGSizeZero; - _view.reset(view); - _scrollView.reset([[UIScrollView alloc] initWithFrame:CGRectZero]); + _view = view; + _scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; [self addSubview:_scrollView]; [_scrollView addSubview:_view]; [_scrollView setBackgroundColor:[_view backgroundColor]]; @@ -52,9 +51,9 @@ - (UIScrollView*)scrollView { if (!_scrollView) { - _scrollView.reset([[UIScrollView alloc] initWithFrame:CGRectZero]); + _scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; } - return _scrollView.get(); + return _scrollView; } - (CGFloat)topContentPadding { @@ -68,7 +67,7 @@ } - (UIView*)view { - return _view.get(); + return _view; } #pragma mark Layout
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h index b154faf..7acee44 100644 --- a/ios/web/web_state/ui/crw_web_controller.h +++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -106,9 +106,6 @@ // calling code must retain the ownership of |webState|. - (instancetype)initWithWebState:(web::WebStateImpl*)webState; -// Return an image to use as replacement of a missing snapshot. -+ (UIImage*)defaultSnapshotImage; - // Replaces the currently displayed content with |contentView|. The content // view will be dismissed for the next navigation. - (void)showTransientContentView:(CRWContentView*)contentView; @@ -154,9 +151,6 @@ // Methods for navigation and properties to interrogate state. - (void)reload; - (void)stopLoading; -// YES if the CRWWebController's view is deemed appropriate for saving in order -// to generate an overlay placeholder view. -- (BOOL)canUseViewForGeneratingOverlayPlaceholderView; // Loads the URL indicated by current session state. - (void)loadCurrentURL; @@ -184,10 +178,6 @@ // only checks on creation, such that the whole object needs to be rebuilt. - (void)requirePageReconstruction; -// Show overlay, don't reload web page. Used when the view will be -// visible only briefly (e.g., tablet side swipe). -- (void)setOverlayPreviewMode:(BOOL)overlayPreviewMode; - // Records the state (scroll position, form values, whatever can be harvested) // from the current page into the current session entry. - (void)recordStateInHistory;
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 6316835..dae9e08 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -311,8 +311,6 @@ NSMutableArray* _webViewToolbars; // Flag to say if browsing is enabled. BOOL _webUsageEnabled; - // Overlay view used instead of webView. - UIImageView* _placeholderOverlayView; // The touch tracking recognizer allowing us to decide if a navigation is // started by the user. CRWTouchTrackingRecognizer* _touchTrackingRecognizer; @@ -329,8 +327,6 @@ CFAbsoluteTime _lastTransferTimeInSeconds; // Default URL (about:blank). GURL _defaultURL; - // Show overlay view, don't reload web page. - BOOL _overlayPreviewMode; // Whether the web page is currently performing window.history.pushState or // window.history.replaceState // Set to YES on window.history.willChangeState message. To NO on @@ -493,11 +489,6 @@ + (BOOL)webControllerCanShow:(const GURL&)url; // Returns a lazily created CRWTouchTrackingRecognizer. - (CRWTouchTrackingRecognizer*)touchTrackingRecognizer; -// Shows placeholder overlay. -- (void)addPlaceholderOverlay; -// Removes placeholder overlay. -- (void)removePlaceholderOverlay; - // Creates a container view if it's not yet created. - (void)ensureContainerViewCreated; // Creates a web view if it's not yet created. @@ -524,12 +515,6 @@ - (GURL)webURLWithTrustLevel:(web::URLVerificationTrustLevel*)trustLevel; // Returns |YES| if |url| should be loaded in a native view. - (BOOL)shouldLoadURLInNativeView:(const GURL&)url; -// Causes the page to start loading immediately if there is a pending load; -// normally if the web view has been paged out, loads are started lazily the -// next time the view is displayed. This can be called to bypass the lazy -// behavior. This is equivalent to calling -view, but should be used when -// deliberately pre-triggering a load without displaying. -- (void)triggerPendingLoad; // Loads the request into the |webView|. - (WKNavigation*)loadRequest:(NSMutableURLRequest*)request; // Loads POST request with body in |_wkWebView| by constructing an HTML page @@ -907,12 +892,6 @@ // escaping would be sufficient. return net::GURLWithNSURL(net::NSURLWithGURL(url)); } - -// Leave snapshot overlay up unless page loads. -const NSTimeInterval kSnapshotOverlayDelay = 1.5; -// Transition to fade snapshot overlay. -const NSTimeInterval kSnapshotOverlayTransition = 0.5; - } // namespace @implementation CRWWebController @@ -1169,26 +1148,6 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; } -// TODO(crbug.com/661642): This code is shared with SnapshotManager. Remove this -// and add it as part of WebDelegate delegate API such that a default image is -// returned immediately. -+ (UIImage*)defaultSnapshotImage { - static UIImage* defaultImage = nil; - - if (!defaultImage) { - CGRect frame = CGRectMake(0, 0, 2, 2); - UIGraphicsBeginImageContext(frame.size); - [[UIColor whiteColor] setFill]; - CGContextFillRect(UIGraphicsGetCurrentContext(), frame); - - UIImage* result = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - defaultImage = [result stretchableImageWithLeftCapWidth:1 topCapHeight:1]; - } - return defaultImage; -} - - (CGPoint)scrollPosition { CGPoint position = CGPointMake(0.0, 0.0); if (!self.webScrollView) @@ -1352,10 +1311,6 @@ [list.backList indexOfObject:item] != NSNotFound; } -- (BOOL)canUseViewForGeneratingOverlayPlaceholderView { - return _containerView != nil; -} - - (UIView*)view { [self ensureContainerViewCreated]; DCHECK(_containerView); @@ -1857,8 +1812,13 @@ - (void)loadCurrentURLIfNecessary { if (_webProcessCrashed) { [self loadCurrentURL]; - } else { - [self triggerPendingLoad]; + } else if (!_containerView) { + [self ensureContainerViewCreated]; + + // TODO(crbug.com/796608): end the practice of calling |loadCurrentURL| + // when it is possible there is no current URL. If the call performs + // necessary initialization, break that out. + [self loadCurrentURL]; } } @@ -1874,33 +1834,6 @@ !_webStateImpl->HasWebUI(); } -- (void)triggerPendingLoad { - if (!_containerView) { - [self ensureContainerViewCreated]; - - // Is |currentUrl| a web scheme or native chrome scheme. - web::NavigationItem* item = self.currentNavItem; - const GURL currentNavigationURL = - item ? item->GetVirtualURL() : GURL::EmptyGURL(); - BOOL isChromeScheme = - web::GetWebClient()->IsAppSpecificURL(currentNavigationURL); - - // Don't immediately load the web page if in overlay mode. Always load if - // native. - if (isChromeScheme || !_overlayPreviewMode) { - // TODO(jimblackler): end the practice of calling |loadCurrentURL| when it - // is possible there is no current URL. If the call performs necessary - // initialization, break that out. - [self loadCurrentURL]; - } - - // Display overlay view until current url has finished loading or delay and - // then transition away. - if (_overlayPreviewMode && !isChromeScheme) - [self addPlaceholderOverlay]; - } -} - - (void)reload { // Clear last user interaction. // TODO(crbug.com/546337): Move to after the load commits, in the subclass @@ -1982,7 +1915,6 @@ - (void)loadCompleteWithSuccess:(BOOL)loadSuccess forNavigation:(WKNavigation*)navigation { - [self removePlaceholderOverlay]; // The webView may have been torn down (or replaced by a native view). Be // safe and do nothing if that's happened. if (_loadPhase != web::PAGE_LOADING) @@ -3223,77 +3155,6 @@ kMaximumDelayForUserInteractionInSeconds); } -#pragma mark Placeholder Overlay Methods - -- (void)addPlaceholderOverlay { - if (!_overlayPreviewMode) { - // Create |kSnapshotOverlayDelay| second timer to remove image with - // transition. - [self performSelector:@selector(removePlaceholderOverlay) - withObject:nil - afterDelay:kSnapshotOverlayDelay]; - } - - // Add overlay image. - _placeholderOverlayView = [[UIImageView alloc] init]; - CGRect frame = [self visibleFrame]; - [_placeholderOverlayView setFrame:frame]; - [_placeholderOverlayView - setAutoresizingMask:UIViewAutoresizingFlexibleWidth | - UIViewAutoresizingFlexibleHeight]; - [_placeholderOverlayView setContentMode:UIViewContentModeScaleAspectFill]; - [_containerView addSubview:_placeholderOverlayView]; - - id callback = ^(UIImage* image) { - [_placeholderOverlayView setImage:image]; - }; - [_delegate webController:self retrievePlaceholderOverlayImage:callback]; - - if (!_placeholderOverlayView.image) { - _placeholderOverlayView.image = [[self class] defaultSnapshotImage]; - } -} - -- (void)removePlaceholderOverlay { - if (!_placeholderOverlayView || _overlayPreviewMode) - return; - - [NSObject - cancelPreviousPerformRequestsWithTarget:self - selector:@selector( - removePlaceholderOverlay) - object:nil]; - // Remove overlay with transition. - [UIView animateWithDuration:kSnapshotOverlayTransition - animations:^{ - [_placeholderOverlayView setAlpha:0.0f]; - } - completion:^(BOOL finished) { - [_placeholderOverlayView removeFromSuperview]; - _placeholderOverlayView = nil; - }]; -} - -- (void)setOverlayPreviewMode:(BOOL)overlayPreviewMode { - _overlayPreviewMode = overlayPreviewMode; - - // If we were showing the preview, remove it. - if (!_overlayPreviewMode && _placeholderOverlayView) { - [self resetContainerView]; - // Reset |_placeholderOverlayView| directly instead of calling - // -removePlaceholderOverlay, which removes |_placeholderOverlayView| in an - // animation. - [_placeholderOverlayView removeFromSuperview]; - _placeholderOverlayView = nil; - // There are cases when resetting the contentView, above, may happen after - // the web view has been created. Re-add it here, rather than - // relying on a subsequent call to loadCurrentURLInWebView. - if (_webView) { - [[self view] addSubview:_webView]; - } - } -} - #pragma mark - #pragma mark Session Information
diff --git a/ios/web/web_state/ui/crw_web_view_proxy_impl.mm b/ios/web/web_state/ui/crw_web_view_proxy_impl.mm index bc81d69..8fca6168 100644 --- a/ios/web/web_state/ui/crw_web_view_proxy_impl.mm +++ b/ios/web/web_state/ui/crw_web_view_proxy_impl.mm
@@ -4,7 +4,6 @@ #import "ios/web/web_state/ui/crw_web_view_proxy_impl.h" -#import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/ui/crw_content_view.h" #import "ios/web/public/web_state/ui/crw_web_view_scroll_view_proxy.h" #import "ios/web/web_state/ui/crw_web_controller.h" @@ -69,10 +68,10 @@ @implementation CRWWebViewProxyImpl { __weak CRWWebController* _webController; - base::scoped_nsobject<NSMutableDictionary> _registeredInsets; + NSMutableDictionary* _registeredInsets; // The WebViewScrollViewProxy is a wrapper around the web view's // UIScrollView to give components access in a limited and controlled manner. - base::scoped_nsobject<CRWWebViewScrollViewProxy> _contentViewScrollViewProxy; + CRWWebViewScrollViewProxy* _contentViewScrollViewProxy; } @synthesize contentView = _contentView; @@ -80,15 +79,15 @@ self = [super init]; if (self) { DCHECK(webController); - _registeredInsets.reset([[NSMutableDictionary alloc] init]); + _registeredInsets = [[NSMutableDictionary alloc] init]; _webController = webController; - _contentViewScrollViewProxy.reset([[CRWWebViewScrollViewProxy alloc] init]); + _contentViewScrollViewProxy = [[CRWWebViewScrollViewProxy alloc] init]; } return self; } - (CRWWebViewScrollViewProxy*)scrollViewProxy { - return _contentViewScrollViewProxy.get(); + return _contentViewScrollViewProxy; } - (CGRect)bounds {
diff --git a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm index 6941cfb..7af7a2e 100644 --- a/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm +++ b/ios/web/web_state/ui/crw_web_view_scroll_view_proxy.mm
@@ -9,7 +9,6 @@ #include "base/auto_reset.h" #import "base/ios/crb_protocol_observers.h" #include "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -18,7 +17,7 @@ @interface CRWWebViewScrollViewProxy () { __weak UIScrollView* _scrollView; - base::scoped_nsobject<id> _observers; + id _observers; std::unique_ptr<UIScrollViewContentInsetAdjustmentBehavior> _pendingContentInsetAdjustmentBehavior API_AVAILABLE(ios(11.0)); } @@ -39,7 +38,7 @@ self = [super init]; if (self) { Protocol* protocol = @protocol(CRWWebViewScrollViewProxyObserver); - _observers.reset([CRBProtocolObservers observersWithProtocol:protocol]); + _observers = [CRBProtocolObservers observersWithProtocol:protocol]; } return self; }
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index 84aca54..ee4e098e 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -229,7 +229,6 @@ mojo::ScopedMessagePipeHandle interface_pipe) override; bool HasOpener() const override; void SetHasOpener(bool has_opener) override; - bool CanTakeSnapshot() const override; void TakeSnapshot(const SnapshotCallback& callback, CGSize target_size) const override; 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 9c3fe90..3e1a0f7 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -708,10 +708,6 @@ created_with_opener_ = has_opener; } -bool WebStateImpl::CanTakeSnapshot() const { - return [web_controller_ canUseViewForGeneratingOverlayPlaceholderView]; -} - void WebStateImpl::TakeSnapshot(const SnapshotCallback& callback, CGSize target_size) const { UIView* view = [web_controller_ view];
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index 82ba30f..fef4bc4 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -826,27 +826,4 @@ EXPECT_FALSE(observer->update_favicon_url_candidates_info()); } -// Tests that taking a snapshot after disabling web usage or adding an overlay -// will force the creation of the WebState's view. -TEST_F(WebStateImplTest, CanTakeSnapshot) { - // The view is lazily created, so taking a snapshot is not possible initially. - ASSERT_FALSE(web_state_->CanTakeSnapshot()); - - // Enabling overlay does not create the creation of the View. - [web_state_->GetWebController() setOverlayPreviewMode:YES]; - EXPECT_FALSE(web_state_->CanTakeSnapshot()); - - // Loading the page will create the view (and add the placeholder overlay). - [web_state_->GetWebController() loadCurrentURLIfNecessary]; - EXPECT_TRUE(web_state_->CanTakeSnapshot()); - - // Disabling the overlay will remove the view. - [web_state_->GetWebController() setOverlayPreviewMode:NO]; - EXPECT_FALSE(web_state_->CanTakeSnapshot()); - - // Loading the page will create the view again. - [web_state_->GetWebController() loadCurrentURLIfNecessary]; - EXPECT_TRUE(web_state_->CanTakeSnapshot()); -} - } // namespace web
diff --git a/ios/web/web_state/web_state_unittest.mm b/ios/web/web_state/web_state_unittest.mm index 88aa1cd6..729a5c5 100644 --- a/ios/web/web_state/web_state_unittest.mm +++ b/ios/web/web_state/web_state_unittest.mm
@@ -141,28 +141,6 @@ ASSERT_FALSE(navigation_manager->GetLastCommittedItem()); } -// Tests that taking a snapshot after disabling web usage or adding an overlay -// will force the creation of the WebState's view. -TEST_F(WebStateTest, CanTakeSnapshot) { - // The test fixture forces the creation of the view, so it is initially - // possible to take a snapshot. - ASSERT_TRUE(web_state()->CanTakeSnapshot()); - - // Taking snapshot after disabling web usage will cause a reload. - web_state()->SetWebUsageEnabled(false); - EXPECT_FALSE(web_state()->CanTakeSnapshot()); - - // Even after re-enabling web usage, taking a snapshot will create the - // WebState's view as it is lazily created. - web_state()->SetWebUsageEnabled(true); - EXPECT_FALSE(web_state()->CanTakeSnapshot()); - - // After re-creating the view, it is possible to take a snapshot without - // reloading. - web_state()->GetView(); - EXPECT_TRUE(web_state()->CanTakeSnapshot()); -} - // Tests that the snapshot method returns an image of a rendered html page. TEST_F(WebStateTest, Snapshot) { LoadHtml(
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm index c17a27c67..42ef565 100644 --- a/ios/web/webui/crw_web_ui_manager.mm +++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -9,7 +9,6 @@ #include "base/json/string_escape.h" #import "base/mac/bind_objc_block.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/stringprintf.h" @@ -133,9 +132,9 @@ GURL URL(resourceURL); [self fetchResourceWithURL:URL completionHandler:^(NSData* data) { - base::scoped_nsobject<NSString> resource( + NSString* resource = [[NSString alloc] initWithData:data - encoding:NSUTF8StringEncoding]); + encoding:NSUTF8StringEncoding]; completionHandler(resource, URL); }]; } @@ -144,8 +143,8 @@ - (void)loadWebUIPageForURL:(const GURL&)webUIURL completionHandler:(void (^)(NSString*))handler { - base::scoped_nsobject<CRWWebUIPageBuilder> pageBuilder( - [[CRWWebUIPageBuilder alloc] initWithDelegate:self]); + CRWWebUIPageBuilder* pageBuilder = + [[CRWWebUIPageBuilder alloc] initWithDelegate:self]; [pageBuilder buildWebUIPageForURL:webUIURL completionHandler:handler]; }
diff --git a/ios/web/webui/crw_web_ui_page_builder.mm b/ios/web/webui/crw_web_ui_page_builder.mm index 08310290..6533cb3 100644 --- a/ios/web/webui/crw_web_ui_page_builder.mm +++ b/ios/web/webui/crw_web_ui_page_builder.mm
@@ -10,7 +10,6 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -128,7 +127,7 @@ - (void)buildWebUIPageForHTML:(NSString*)HTML webUIURL:(const GURL&)pageURL completionHandler:(web::WebUIPageCompletion)completionHandler { - __block base::scoped_nsobject<NSMutableString> webUIHTML([HTML mutableCopy]); + __block NSMutableString* webUIHTML = [HTML mutableCopy]; NSSet* subresourceURLStrings = [self URLStringsFromHTML:webUIHTML]; __block NSUInteger pendingSubresourceCount = [subresourceURLStrings count]; if (!pendingSubresourceCount) {
diff --git a/ios/web_view/internal/signin/ios_web_view_signin_client.h b/ios/web_view/internal/signin/ios_web_view_signin_client.h index f98862d2..998927a1 100644 --- a/ios/web_view/internal/signin/ios_web_view_signin_client.h +++ b/ios/web_view/internal/signin/ios_web_view_signin_client.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/ios/weak_nsobject.h" #include "base/macros.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -89,7 +88,7 @@ scoped_refptr<TokenWebData> token_web_data_; // The CWVAuthenticationController associated with this service. - base::WeakNSObject<CWVAuthenticationController> authentication_controller_; + __weak CWVAuthenticationController* authentication_controller_; DISALLOW_COPY_AND_ASSIGN(IOSWebViewSigninClient); };
diff --git a/ios/web_view/internal/signin/ios_web_view_signin_client.mm b/ios/web_view/internal/signin/ios_web_view_signin_client.mm index c1101b1..cd58835 100644 --- a/ios/web_view/internal/signin/ios_web_view_signin_client.mm +++ b/ios/web_view/internal/signin/ios_web_view_signin_client.mm
@@ -122,11 +122,11 @@ void IOSWebViewSigninClient::SetAuthenticationController( CWVAuthenticationController* authentication_controller) { - DCHECK(!authentication_controller || !authentication_controller_.get()); - authentication_controller_.reset(authentication_controller); + DCHECK(!authentication_controller || !authentication_controller_); + authentication_controller_ = authentication_controller; } CWVAuthenticationController* IOSWebViewSigninClient::GetAuthenticationController() { - return authentication_controller_.get(); + return authentication_controller_; }
diff --git a/ios/web_view/internal/signin/web_view_profile_oauth2_token_service_ios_provider_impl.h b/ios/web_view/internal/signin/web_view_profile_oauth2_token_service_ios_provider_impl.h index db87094..586b7ca 100644 --- a/ios/web_view/internal/signin/web_view_profile_oauth2_token_service_ios_provider_impl.h +++ b/ios/web_view/internal/signin/web_view_profile_oauth2_token_service_ios_provider_impl.h
@@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "base/ios/weak_nsobject.h" #include "base/macros.h" #include "components/signin/ios/browser/profile_oauth2_token_service_ios_provider.h"
diff --git a/ios/web_view/internal/translate/web_view_translate_client.mm b/ios/web_view/internal/translate/web_view_translate_client.mm index 02d310f6..fea719e 100644 --- a/ios/web_view/internal/translate/web_view_translate_client.mm +++ b/ios/web_view/internal/translate/web_view_translate_client.mm
@@ -7,7 +7,6 @@ #include <vector> #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "components/infobars/core/infobar.h" #include "components/prefs/pref_service.h"
diff --git a/net/base/hash_value.cc b/net/base/hash_value.cc index 7a2dbd4..80d8eec 100644 --- a/net/base/hash_value.cc +++ b/net/base/hash_value.cc
@@ -22,12 +22,12 @@ // SHA256HashValues. struct SHA256ToHashValueComparator { bool operator()(const SHA256HashValue& lhs, const HashValue& rhs) const { - DCHECK_EQ(HASH_VALUE_SHA256, rhs.tag); + DCHECK_EQ(HASH_VALUE_SHA256, rhs.tag()); return memcmp(lhs.data, rhs.data(), rhs.size()) < 0; } bool operator()(const HashValue& lhs, const SHA256HashValue& rhs) const { - DCHECK_EQ(HASH_VALUE_SHA256, lhs.tag); + DCHECK_EQ(HASH_VALUE_SHA256, lhs.tag()); return memcmp(lhs.data(), rhs.data, lhs.size()) < 0; } }; @@ -43,7 +43,7 @@ bool HashValue::FromString(const base::StringPiece value) { base::StringPiece base64_str; if (value.starts_with("sha256/")) { - tag = HASH_VALUE_SHA256; + tag_ = HASH_VALUE_SHA256; base64_str = value.substr(7); } else { return false; @@ -61,26 +61,26 @@ std::string base64_str; base::Base64Encode(base::StringPiece(reinterpret_cast<const char*>(data()), size()), &base64_str); - switch (tag) { - case HASH_VALUE_SHA256: - return std::string("sha256/") + base64_str; - default: - NOTREACHED() << "Unknown HashValueTag " << tag; - return std::string("unknown/" + base64_str); + switch (tag_) { + case HASH_VALUE_SHA256: + return std::string("sha256/") + base64_str; } + + NOTREACHED() << "Unknown HashValueTag " << tag_; + return std::string("unknown/" + base64_str); } size_t HashValue::size() const { - switch (tag) { + switch (tag_) { case HASH_VALUE_SHA256: return sizeof(fingerprint.sha256.data); - default: - NOTREACHED() << "Unknown HashValueTag " << tag; - // While an invalid tag should not happen, return a non-zero length - // to avoid compiler warnings when the result of size() is - // used with functions like memset. - return sizeof(fingerprint.sha256.data); } + + NOTREACHED() << "Unknown HashValueTag " << tag_; + // While an invalid tag should not happen, return a non-zero length + // to avoid compiler warnings when the result of size() is + // used with functions like memset. + return sizeof(fingerprint.sha256.data); } unsigned char* HashValue::data() { @@ -88,13 +88,55 @@ } const unsigned char* HashValue::data() const { - switch (tag) { + switch (tag_) { case HASH_VALUE_SHA256: return fingerprint.sha256.data; - default: - NOTREACHED() << "Unknown HashValueTag " << tag; - return NULL; } + + NOTREACHED() << "Unknown HashValueTag " << tag_; + return nullptr; +} + +bool operator==(const HashValue& lhs, const HashValue& rhs) { + if (lhs.tag_ != rhs.tag_) + return false; + + switch (lhs.tag_) { + case HASH_VALUE_SHA256: + return lhs.fingerprint.sha256 == rhs.fingerprint.sha256; + } + + NOTREACHED(); + return false; +} + +bool operator!=(const HashValue& lhs, const HashValue& rhs) { + return !(lhs == rhs); +} + +bool operator<(const HashValue& lhs, const HashValue& rhs) { + if (lhs.tag_ != rhs.tag_) + return lhs.tag_ < rhs.tag_; + + switch (lhs.tag_) { + case HASH_VALUE_SHA256: + return lhs.fingerprint.sha256 < rhs.fingerprint.sha256; + } + + NOTREACHED(); + return false; +} + +bool operator>(const HashValue& lhs, const HashValue& rhs) { + return rhs < lhs; +} + +bool operator<=(const HashValue& lhs, const HashValue& rhs) { + return !(lhs > rhs); +} + +bool operator>=(const HashValue& lhs, const HashValue& rhs) { + return !(lhs < rhs); } bool IsSHA256HashInSortedArray(const HashValue& hash, @@ -108,7 +150,7 @@ const SHA256HashValue* list, size_t list_length) { for (const auto& hash : hashes) { - if (hash.tag != HASH_VALUE_SHA256) + if (hash.tag() != HASH_VALUE_SHA256) continue; if (IsSHA256HashInSortedArray(hash, list, list_length))
diff --git a/net/base/hash_value.h b/net/base/hash_value.h index 52732ebd..f01181d 100644 --- a/net/base/hash_value.h +++ b/net/base/hash_value.h
@@ -27,7 +27,23 @@ } inline bool operator!=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { - return !(lhs == rhs); + return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) != 0; +} + +inline bool operator<(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { + return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0; +} + +inline bool operator>(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { + return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) > 0; +} + +inline bool operator<=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { + return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) <= 0; +} + +inline bool operator>=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { + return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) >= 0; } enum HashValueTag { @@ -37,8 +53,8 @@ class NET_EXPORT HashValue { public: explicit HashValue(const SHA256HashValue& hash); - explicit HashValue(HashValueTag tag) : tag(tag) {} - HashValue() : tag(HASH_VALUE_SHA256) {} + explicit HashValue(HashValueTag tag) : tag_(tag) {} + HashValue() : tag_(HASH_VALUE_SHA256) {} // Serializes/Deserializes hashes in the form of // <hash-name>"/"<base64-hash-value> @@ -63,33 +79,26 @@ unsigned char* data(); const unsigned char* data() const; - HashValueTag tag; + HashValueTag tag() const { return tag_; } + + NET_EXPORT friend bool operator==(const HashValue& lhs, const HashValue& rhs); + NET_EXPORT friend bool operator!=(const HashValue& lhs, const HashValue& rhs); + NET_EXPORT friend bool operator<(const HashValue& lhs, const HashValue& rhs); + NET_EXPORT friend bool operator>(const HashValue& lhs, const HashValue& rhs); + NET_EXPORT friend bool operator<=(const HashValue& lhs, const HashValue& rhs); + NET_EXPORT friend bool operator>=(const HashValue& lhs, const HashValue& rhs); private: + HashValueTag tag_; + union { SHA256HashValue sha256; } fingerprint; }; -inline bool operator==(const HashValue& lhs, const HashValue& rhs) { - return lhs.tag == rhs.tag && memcmp(lhs.data(), rhs.data(), lhs.size()) == 0; -} - -inline bool operator!=(const HashValue& lhs, const HashValue& rhs) { - return !(lhs == rhs); -} - typedef std::vector<HashValue> HashValueVector; -class SHA256HashValueLessThan { - public: - bool operator()(const SHA256HashValue& lhs, - const SHA256HashValue& rhs) const { - return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) < 0; - } -}; - // IsSHA256HashInSortedArray returns true iff |hash| is in |array|, a sorted // array of SHA256 hashes. bool IsSHA256HashInSortedArray(const HashValue& hash,
diff --git a/net/cert/cert_verify_proc.cc b/net/cert/cert_verify_proc.cc index 732bbd61..181590b6 100644 --- a/net/cert/cert_verify_proc.cc +++ b/net/cert/cert_verify_proc.cc
@@ -671,7 +671,7 @@ // Defines kBlacklistedSPKIs. #include "net/cert/cert_verify_proc_blacklist.inc" for (const auto& hash : public_key_hashes) { - if (hash.tag != HASH_VALUE_SHA256) + if (hash.tag() != HASH_VALUE_SHA256) continue; if (std::binary_search(std::begin(kBlacklistedSPKIs), std::end(kBlacklistedSPKIs), hash, @@ -828,7 +828,7 @@ for (unsigned i = 0; i < arraysize(kLimits); ++i) { for (HashValueVector::const_iterator j = public_key_hashes.begin(); j != public_key_hashes.end(); ++j) { - if (j->tag == HASH_VALUE_SHA256 && + if (j->tag() == HASH_VALUE_SHA256 && memcmp(j->data(), kLimits[i].public_key, crypto::kSHA256Length) == 0) { if (dns_names.empty() && ip_addrs.empty()) {
diff --git a/net/cert/crl_set.cc b/net/cert/crl_set.cc index 1690bea..da71f4b 100644 --- a/net/cert/crl_set.cc +++ b/net/cert/crl_set.cc
@@ -95,16 +95,16 @@ } // static -CRLSet* CRLSet::EmptyCRLSetForTesting() { +scoped_refptr<CRLSet> CRLSet::EmptyCRLSetForTesting() { return ForTesting(false, NULL, "", "", {}); } -CRLSet* CRLSet::ExpiredCRLSetForTesting() { +scoped_refptr<CRLSet> CRLSet::ExpiredCRLSetForTesting() { return ForTesting(true, NULL, "", "", {}); } // static -CRLSet* CRLSet::ForTesting( +scoped_refptr<CRLSet> CRLSet::ForTesting( bool is_expired, const SHA256HashValue* issuer_spki, const std::string& serial_number, @@ -139,7 +139,7 @@ OPENSSL_free(x501_data); } - CRLSet* crl_set = new CRLSet; + scoped_refptr<CRLSet> crl_set(new CRLSet); if (is_expired) crl_set->not_after_ = 1;
diff --git a/net/cert/crl_set.h b/net/cert/crl_set.h index 6db8a847..8cb293f 100644 --- a/net/cert/crl_set.h +++ b/net/cert/crl_set.h
@@ -70,10 +70,10 @@ const CRLList& crls() const; // EmptyCRLSetForTesting returns a valid, but empty, CRLSet for unit tests. - static CRLSet* EmptyCRLSetForTesting(); + static scoped_refptr<CRLSet> EmptyCRLSetForTesting(); // ExpiredCRLSetForTesting returns a expired, empty CRLSet for unit tests. - static CRLSet* ExpiredCRLSetForTesting(); + static scoped_refptr<CRLSet> ExpiredCRLSetForTesting(); // ForTesting returns a CRLSet for testing. If |is_expired| is true, calling // IsExpired on the result will return true. If |issuer_spki| is not NULL, @@ -83,7 +83,7 @@ // CRLSet will consider certificates with a subject consisting only of that // common name to be revoked unless they match an SPKI hash from // |acceptable_spki_hashes_for_cn|. - static CRLSet* ForTesting( + static scoped_refptr<CRLSet> ForTesting( bool is_expired, const SHA256HashValue* issuer_spki, const std::string& serial_number,
diff --git a/net/cert/ev_root_ca_metadata.h b/net/cert/ev_root_ca_metadata.h index e69dbd797..42daddbd 100644 --- a/net/cert/ev_root_ca_metadata.h +++ b/net/cert/ev_root_ca_metadata.h
@@ -91,8 +91,7 @@ ~EVRootCAMetadata(); #if defined(USE_NSS_CERTS) - using PolicyOIDMap = std:: - map<SHA256HashValue, std::vector<PolicyOID>, SHA256HashValueLessThan>; + using PolicyOIDMap = std::map<SHA256HashValue, std::vector<PolicyOID>>; // RegisterOID registers |policy|, a policy OID in dotted string form, and // writes the memoized form to |*out|. It returns true on success. @@ -101,14 +100,12 @@ PolicyOIDMap ev_policy_; std::set<PolicyOID> policy_oids_; #elif defined(OS_WIN) - using ExtraEVCAMap = - std::map<SHA256HashValue, std::string, SHA256HashValueLessThan>; + using ExtraEVCAMap = std::map<SHA256HashValue, std::string>; // extra_cas_ contains any EV CA metadata that was added at runtime. ExtraEVCAMap extra_cas_; #elif defined(PLATFORM_USES_CHROMIUM_EV_METADATA) - using PolicyOIDMap = std:: - map<SHA256HashValue, std::vector<std::string>, SHA256HashValueLessThan>; + using PolicyOIDMap = std::map<SHA256HashValue, std::vector<std::string>>; PolicyOIDMap ev_policy_; std::set<std::string> policy_oids_;
diff --git a/net/cert/known_roots.cc b/net/cert/known_roots.cc index 191923c..1a59ec5 100644 --- a/net/cert/known_roots.cc +++ b/net/cert/known_roots.cc
@@ -19,12 +19,12 @@ // RootCertData to a HashValue struct HashValueToRootCertDataComp { bool operator()(const HashValue& hash, const RootCertData& root_cert) { - DCHECK_EQ(HASH_VALUE_SHA256, hash.tag); + DCHECK_EQ(HASH_VALUE_SHA256, hash.tag()); return memcmp(hash.data(), root_cert.sha256_spki_hash, 32) < 0; } bool operator()(const RootCertData& root_cert, const HashValue& hash) { - DCHECK_EQ(HASH_VALUE_SHA256, hash.tag); + DCHECK_EQ(HASH_VALUE_SHA256, hash.tag()); return memcmp(root_cert.sha256_spki_hash, hash.data(), 32) < 0; } }; @@ -32,7 +32,7 @@ } // namespace int32_t GetNetTrustAnchorHistogramIdForSPKI(const HashValue& spki_hash) { - if (spki_hash.tag != HASH_VALUE_SHA256) + if (spki_hash.tag() != HASH_VALUE_SHA256) return 0; auto* it = std::lower_bound(std::begin(kRootCerts), std::end(kRootCerts),
diff --git a/net/cert/known_roots_mac.cc b/net/cert/known_roots_mac.cc index 475dda6..c4c7c645 100644 --- a/net/cert/known_roots_mac.cc +++ b/net/cert/known_roots_mac.cc
@@ -60,7 +60,7 @@ ~OSXKnownRootHelper() {} - std::set<SHA256HashValue, SHA256HashValueLessThan> known_roots_; + std::set<SHA256HashValue> known_roots_; }; base::LazyInstance<OSXKnownRootHelper>::Leaky g_known_roots =
diff --git a/net/cert/known_roots_nss.cc b/net/cert/known_roots_nss.cc index 34f3896..1e4b45a 100644 --- a/net/cert/known_roots_nss.cc +++ b/net/cert/known_roots_nss.cc
@@ -5,18 +5,87 @@ #include "net/cert/known_roots_nss.h" #include <cert.h> +#include <dlfcn.h> #include <pk11pub.h> +#include <secmod.h> #include <memory> +#include "base/memory/protected_memory.h" +#include "base/memory/protected_memory_cfi.h" +#include "crypto/nss_util_internal.h" +#include "net/base/hash_value.h" +#include "net/cert/x509_util_nss.h" + namespace net { +namespace { + +// This can be removed once the minimum NSS version to build is >= 3.30. +#if !defined(CKA_NSS_MOZILLA_CA_POLICY) +#define CKA_NSS_MOZILLA_CA_POLICY (CKA_NSS + 34) +#endif + +using PK11HasAttributeSetFunction = CK_BBOOL (*)(PK11SlotInfo* slot, + CK_OBJECT_HANDLE id, + CK_ATTRIBUTE_TYPE type, + PRBool haslock); +static PROTECTED_MEMORY_SECTION + base::ProtectedMemory<PK11HasAttributeSetFunction> + g_pk11_has_attribute_set; + +// The function pointer for PK11_HasAttributeSet is saved to read-only memory +// after being dynamically resolved as a security mitigation to prevent the +// pointer from being tampered with. See https://crbug.com/771365 for details. +const base::ProtectedMemory<PK11HasAttributeSetFunction>& +ResolvePK11HasAttributeSet() { + static base::ProtectedMemory<PK11HasAttributeSetFunction>::Initializer init( + &g_pk11_has_attribute_set, + reinterpret_cast<PK11HasAttributeSetFunction>( + dlsym(RTLD_DEFAULT, "PK11_HasAttributeSet"))); + return g_pk11_has_attribute_set; +} + +} // namespace + // IsKnownRoot returns true if the given certificate is one that we believe // is a standard (as opposed to user-installed) root. bool IsKnownRoot(CERTCertificate* root) { if (!root || !root->slot) return false; + if (*ResolvePK11HasAttributeSet() != nullptr) { + // Historically, the set of root certs was determined based on whether or + // not it was part of nssckbi.[so,dll], the read-only PKCS#11 module that + // exported the certs with trust settings. However, some distributions, + // notably those in the Red Hat family, replace nssckbi with a redirect to + // their own store, such as from p11-kit, which can support more robust + // trust settings, like per-system trust, admin-defined, and user-defined + // trust. + // + // As a given certificate may exist in multiple modules and slots, scan + // through all of the available modules, all of the (connected) slots on + // those modules, and check to see if it has the CKA_NSS_MOZILLA_CA_POLICY + // attribute set. This attribute indicates it's from the upstream Mozilla + // trust store, and these distributions preserve the attribute as a flag. + crypto::AutoSECMODListReadLock lock_id; + for (const SECMODModuleList* item = SECMOD_GetDefaultModuleList(); + item != nullptr; item = item->next) { + for (int i = 0; i < item->module->slotCount; ++i) { + PK11SlotInfo* slot = item->module->slots[i]; + if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot)) { + CK_OBJECT_HANDLE handle = PK11_FindCertInSlot(slot, root, nullptr); + if (handle != CK_INVALID_HANDLE && + UnsanitizedCfiCall(ResolvePK11HasAttributeSet())( + root->slot, handle, CKA_NSS_MOZILLA_CA_POLICY, PR_FALSE) == + CK_TRUE) { + return true; + } + } + } + } + } + // This magic name is taken from // http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/security/nss/lib/ckfw/builtins/constants.c&rev=1.13&mark=86,89#79 return 0 == strcmp(PK11_GetSlotName(root->slot), "NSS Builtin Objects");
diff --git a/net/cert/nss_cert_database_unittest.cc b/net/cert/nss_cert_database_unittest.cc index 46f34ce..7781ea4 100644 --- a/net/cert/nss_cert_database_unittest.cc +++ b/net/cert/nss_cert_database_unittest.cc
@@ -117,9 +117,8 @@ std::sort( result.begin(), result.end(), [](const ScopedCERTCertificate& lhs, const ScopedCERTCertificate& rhs) { - return SHA256HashValueLessThan()( - x509_util::CalculateFingerprint256(lhs.get()), - x509_util::CalculateFingerprint256(rhs.get())); + return x509_util::CalculateFingerprint256(lhs.get()) < + x509_util::CalculateFingerprint256(rhs.get()); }); return result; }
diff --git a/net/cert/nss_profile_filter_chromeos_unittest.cc b/net/cert/nss_profile_filter_chromeos_unittest.cc index 3301916..4c2cdef8 100644 --- a/net/cert/nss_profile_filter_chromeos_unittest.cc +++ b/net/cert/nss_profile_filter_chromeos_unittest.cc
@@ -55,9 +55,8 @@ std::sort( result.begin(), result.end(), [](const ScopedCERTCertificate& lhs, const ScopedCERTCertificate& rhs) { - return SHA256HashValueLessThan()( - x509_util::CalculateFingerprint256(lhs.get()), - x509_util::CalculateFingerprint256(rhs.get())); + return x509_util::CalculateFingerprint256(lhs.get()) < + x509_util::CalculateFingerprint256(rhs.get()); }); return result; }
diff --git a/net/cert/symantec_certs_unittest.cc b/net/cert/symantec_certs_unittest.cc index b0c3df2..6a1fff6c 100644 --- a/net/cert/symantec_certs_unittest.cc +++ b/net/cert/symantec_certs_unittest.cc
@@ -42,15 +42,12 @@ } TEST(SymantecCertsTest, AreSortedArrays) { - ASSERT_TRUE(std::is_sorted(kSymantecRoots, - kSymantecRoots + kSymantecRootsLength, - SHA256HashValueLessThan())); + ASSERT_TRUE( + std::is_sorted(kSymantecRoots, kSymantecRoots + kSymantecRootsLength)); ASSERT_TRUE(std::is_sorted(kSymantecExceptions, - kSymantecExceptions + kSymantecExceptionsLength, - SHA256HashValueLessThan())); + kSymantecExceptions + kSymantecExceptionsLength)); ASSERT_TRUE(std::is_sorted(kSymantecManagedCAs, - kSymantecManagedCAs + kSymantecManagedCAsLength, - SHA256HashValueLessThan())); + kSymantecManagedCAs + kSymantecManagedCAsLength)); } } // namespace net
diff --git a/net/http/http_security_headers_unittest.cc b/net/http/http_security_headers_unittest.cc index 1171e33..8ca4cca 100644 --- a/net/http/http_security_headers_unittest.cc +++ b/net/http/http_security_headers_unittest.cc
@@ -37,12 +37,12 @@ reinterpret_cast<char*>(hash_value.data()), hash_value.size()), &base64); std::string ret; - switch (hash_value.tag) { + switch (hash_value.tag()) { case HASH_VALUE_SHA256: ret = "pin-sha256="; break; default: - NOTREACHED() << "Unknown HashValueTag " << hash_value.tag; + NOTREACHED() << "Unknown HashValueTag " << hash_value.tag(); return std::string("ERROR"); } if (quoted)
diff --git a/net/http/transport_security_persister_unittest.cc b/net/http/transport_security_persister_unittest.cc index 3ad2988..f18c4ae7 100644 --- a/net/http/transport_security_persister_unittest.cc +++ b/net/http/transport_security_persister_unittest.cc
@@ -283,7 +283,7 @@ TransportSecurityState::PKPState new_pkp_state; EXPECT_TRUE(state_.GetDynamicPKPState(kTestDomain, &new_pkp_state)); EXPECT_EQ(1u, new_pkp_state.spki_hashes.size()); - EXPECT_EQ(sha256.tag, new_pkp_state.spki_hashes[0].tag); + EXPECT_EQ(sha256.tag(), new_pkp_state.spki_hashes[0].tag()); EXPECT_EQ(0, memcmp(new_pkp_state.spki_hashes[0].data(), sha256.data(), sha256.size())); EXPECT_EQ(report_uri, new_pkp_state.report_uri);
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc index a4df218..b77d6cf 100644 --- a/net/http/transport_security_state.cc +++ b/net/http/transport_security_state.cc
@@ -142,7 +142,7 @@ for (const auto& hash_value : pkp_state.spki_hashes) { std::string known_pin; - switch (hash_value.tag) { + switch (hash_value.tag()) { case HASH_VALUE_SHA256: known_pin += "pin-sha256="; break;
diff --git a/net/nqe/cached_network_quality.h b/net/nqe/cached_network_quality.h index 9f437da9..22f6029 100644 --- a/net/nqe/cached_network_quality.h +++ b/net/nqe/cached_network_quality.h
@@ -41,8 +41,6 @@ base::TimeTicks last_update_time() { return last_update_time_; } - const NetworkQuality& network_quality() { return network_quality_; } - EffectiveConnectionType effective_connection_type() const { return effective_connection_type_; }
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc index cb291ff..0ccfc6d 100644 --- a/net/nqe/network_quality_estimator.cc +++ b/net/nqe/network_quality_estimator.cc
@@ -719,12 +719,15 @@ current_network_id_ = GetCurrentNetworkID(); RecordNetworkIDAvailability(); - MaybeQueryExternalEstimateProvider(); - // Read any cached estimates for the new network. If cached estimates are // unavailable, add the default estimates. if (!ReadCachedNetworkQualityEstimate()) AddDefaultEstimates(); + + // Query external estimate later since cached estimate has a higher priority, + // and if a cached estimate was available, there is no need to query the + // external estimate provider. + MaybeQueryExternalEstimateProvider(); ComputeEffectiveConnectionType(); } @@ -1497,36 +1500,69 @@ if (!cached_estimate_available) return false; + EffectiveConnectionType effective_connection_type = + cached_network_quality.effective_connection_type(); + + if (effective_connection_type == EFFECTIVE_CONNECTION_TYPE_UNKNOWN || + effective_connection_type == EFFECTIVE_CONNECTION_TYPE_OFFLINE || + effective_connection_type == EFFECTIVE_CONNECTION_TYPE_LAST) { + return false; + } + + nqe::internal::NetworkQuality network_quality = + cached_network_quality.network_quality(); + const base::TimeTicks now = tick_clock_->NowTicks(); - if (cached_network_quality.network_quality().downstream_throughput_kbps() != + bool update_network_quality_store = false; + + // Populate |network_quality| with synthetic RTT and throughput observations + // if they are missing. + if (network_quality.http_rtt().InMilliseconds() == nqe::internal::INVALID_RTT_THROUGHPUT) { - Observation througphput_observation( - cached_network_quality.network_quality().downstream_throughput_kbps(), - now, INT32_MIN, - NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); - AddAndNotifyObserversOfThroughput(througphput_observation); + network_quality.set_http_rtt( + params_->TypicalNetworkQuality(effective_connection_type).http_rtt()); + update_network_quality_store = true; } - if (cached_network_quality.network_quality().http_rtt() != - nqe::internal::InvalidRTT()) { - Observation rtt_observation( - cached_network_quality.network_quality().http_rtt().InMilliseconds(), - now, INT32_MIN, - NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); - AddAndNotifyObserversOfRTT(rtt_observation); + if (network_quality.transport_rtt().InMilliseconds() == + nqe::internal::INVALID_RTT_THROUGHPUT) { + network_quality.set_transport_rtt( + params_->TypicalNetworkQuality(effective_connection_type) + .transport_rtt()); + update_network_quality_store = true; } - if (cached_network_quality.network_quality().transport_rtt() != - nqe::internal::InvalidRTT()) { - Observation rtt_observation( - cached_network_quality.network_quality() - .transport_rtt() - .InMilliseconds(), - now, INT32_MIN, - NETWORK_QUALITY_OBSERVATION_SOURCE_TRANSPORT_CACHED_ESTIMATE); - AddAndNotifyObserversOfRTT(rtt_observation); + if (network_quality.downstream_throughput_kbps() == + nqe::internal::INVALID_RTT_THROUGHPUT) { + network_quality.set_downstream_throughput_kbps( + params_->TypicalNetworkQuality(effective_connection_type) + .downstream_throughput_kbps()); + update_network_quality_store = true; } + + if (update_network_quality_store) { + network_quality_store_->Add( + current_network_id_, + nqe::internal::CachedNetworkQuality(now, network_quality, + effective_connection_type)); + } + + Observation http_rtt_observation( + network_quality.http_rtt().InMilliseconds(), now, INT32_MIN, + NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); + AddAndNotifyObserversOfRTT(http_rtt_observation); + + Observation transport_rtt_observation( + network_quality.transport_rtt().InMilliseconds(), now, INT32_MIN, + NETWORK_QUALITY_OBSERVATION_SOURCE_TRANSPORT_CACHED_ESTIMATE); + AddAndNotifyObserversOfRTT(transport_rtt_observation); + + Observation througphput_observation( + network_quality.downstream_throughput_kbps(), now, INT32_MIN, + NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE); + AddAndNotifyObserversOfThroughput(througphput_observation); + ComputeEffectiveConnectionType(); return true; }
diff --git a/net/nqe/network_quality_estimator_unittest.cc b/net/nqe/network_quality_estimator_unittest.cc index 445484b..ae92fe0 100644 --- a/net/nqe/network_quality_estimator_unittest.cc +++ b/net/nqe/network_quality_estimator_unittest.cc
@@ -384,6 +384,9 @@ request->Start(); base::RunLoop().Run(); } + histogram_tester.ExpectUniqueSample("NQE.RTT.ObservationSource", + NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP, + 2); base::RunLoop().RunUntilIdle(); @@ -423,6 +426,11 @@ "NQE.RTT.ObservationSource", NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE, 1); histogram_tester.ExpectBucketCount( + "NQE.RTT.ObservationSource", + NETWORK_QUALITY_OBSERVATION_SOURCE_TRANSPORT_CACHED_ESTIMATE, 1); + histogram_tester.ExpectTotalCount("NQE.RTT.ObservationSource", 4); + + histogram_tester.ExpectBucketCount( "NQE.Kbps.ObservationSource", NETWORK_QUALITY_OBSERVATION_SOURCE_HTTP_CACHED_ESTIMATE, 1); histogram_tester.ExpectTotalCount( @@ -434,7 +442,7 @@ num_net_log_entries); EXPECT_NE(-1, estimator.GetNetLogLastIntegerValue( NetLogEventType::NETWORK_QUALITY_CHANGED, "http_rtt_ms")); - EXPECT_EQ( + EXPECT_NE( -1, estimator.GetNetLogLastIntegerValue( NetLogEventType::NETWORK_QUALITY_CHANGED, "transport_rtt_ms")); EXPECT_NE(-1, estimator.GetNetLogLastIntegerValue( @@ -457,7 +465,7 @@ EXPECT_LE(2U, observer.effective_connection_types().size()); EXPECT_EQ(estimator.GetEffectiveConnectionType(), observer.effective_connection_types().back()); - EXPECT_EQ(1U, rtt_observer.observations().size()); + EXPECT_EQ(2U, rtt_observer.observations().size()); EXPECT_EQ(1U, throughput_observer.observations().size()); } } @@ -1564,6 +1572,7 @@ std::map<std::string, std::string> variation_params; variation_params["throughput_min_requests_in_flight"] = "1"; + variation_params["add_default_platform_observations"] = "false"; TestNetworkQualityEstimator estimator(variation_params, std::move(external_estimate_provider)); estimator.SimulateNetworkChange(net::NetworkChangeNotifier::CONNECTION_WIFI,
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 77af973b..9668d147 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -8,6 +8,8 @@ sources = [ "cors_error_status.cc", "cors_error_status.h", + "http_raw_request_response_info.cc", + "http_raw_request_response_info.h", "mutable_network_traffic_annotation_tag_struct_traits.h", "mutable_partial_network_traffic_annotation_tag_struct_traits.h", "net_adapters.cc",
diff --git a/services/network/public/cpp/http_raw_request_response_info.cc b/services/network/public/cpp/http_raw_request_response_info.cc new file mode 100644 index 0000000..0f758a2 --- /dev/null +++ b/services/network/public/cpp/http_raw_request_response_info.cc
@@ -0,0 +1,28 @@ +// 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 "services/network/public/cpp/http_raw_request_response_info.h" + +#include "base/memory/scoped_refptr.h" + +namespace network { + +HttpRawRequestResponseInfo::HttpRawRequestResponseInfo() + : http_status_code(0) {} + +HttpRawRequestResponseInfo::~HttpRawRequestResponseInfo() {} + +scoped_refptr<HttpRawRequestResponseInfo> HttpRawRequestResponseInfo::DeepCopy() + const { + auto new_info = base::MakeRefCounted<HttpRawRequestResponseInfo>(); + new_info->http_status_code = http_status_code; + new_info->http_status_text = http_status_text; + new_info->request_headers = request_headers; + new_info->response_headers = response_headers; + new_info->request_headers_text = request_headers_text; + new_info->response_headers_text = response_headers_text; + return new_info; +} + +} // namespace network
diff --git a/services/network/public/cpp/http_raw_request_response_info.h b/services/network/public/cpp/http_raw_request_response_info.h new file mode 100644 index 0000000..7a78e2e --- /dev/null +++ b/services/network/public/cpp/http_raw_request_response_info.h
@@ -0,0 +1,42 @@ +// 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 SERVICES_NETWORK_PUBLIC_CPP_HTTP_RAW_REQUEST_RESPONSE_INFO_H_ +#define SERVICES_NETWORK_PUBLIC_CPP_HTTP_RAW_REQUEST_RESPONSE_INFO_H_ + +#include <stdint.h> + +#include <string> +#include <vector> + +#include "base/memory/ref_counted.h" +#include "base/strings/string_split.h" + +namespace network { + +// Note: when modifying this structure, also update DeepCopy in +// http_raw_request_response_info.cc. +struct HttpRawRequestResponseInfo + : base::RefCounted<HttpRawRequestResponseInfo> { + typedef base::StringPairs HeadersVector; + + HttpRawRequestResponseInfo(); + + scoped_refptr<HttpRawRequestResponseInfo> DeepCopy() const; + + int32_t http_status_code; + std::string http_status_text; // Not present in HTTP/2 + HeadersVector request_headers; + HeadersVector response_headers; + std::string request_headers_text; + std::string response_headers_text; + + private: + friend class base::RefCounted<HttpRawRequestResponseInfo>; + ~HttpRawRequestResponseInfo(); +}; + +} // namespace network + +#endif // SERVICES_NETWORK_PUBLIC_CPP_HTTP_RAW_REQUEST_RESPONSE_INFO_H_
diff --git a/services/network/public/cpp/network_param_ipc_traits.cc b/services/network/public/cpp/network_param_ipc_traits.cc index 063d613c..70b73e4e5 100644 --- a/services/network/public/cpp/network_param_ipc_traits.cc +++ b/services/network/public/cpp/network_param_ipc_traits.cc
@@ -6,6 +6,7 @@ #include "ipc/ipc_message_utils.h" #include "net/http/http_util.h" +#include "services/network/public/cpp/http_raw_request_response_info.h" namespace IPC { @@ -100,6 +101,34 @@ l->append(p.ToString()); } +void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Write( + base::Pickle* m, + const param_type& p) { + WriteParam(m, p.get() != nullptr); + if (p.get()) { + // Do not disclose Set-Cookie headers over IPC. + p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); + } +} + +bool ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Read( + const base::Pickle* m, + base::PickleIterator* iter, + param_type* r) { + bool has_object; + if (!ReadParam(m, iter, &has_object)) + return false; + if (has_object) + *r = new net::HttpResponseHeaders(iter); + return true; +} + +void ParamTraits<scoped_refptr<net::HttpResponseHeaders>>::Log( + const param_type& p, + std::string* l) { + l->append("<HttpResponseHeaders>"); +} + void ParamTraits<net::SSLInfo>::Write(base::Pickle* m, const param_type& p) { WriteParam(m, p.is_valid()); if (!p.is_valid()) @@ -184,6 +213,51 @@ l->append("<SignedCertificateTimestamp>"); } +void ParamTraits<scoped_refptr<network::HttpRawRequestResponseInfo>>::Write( + base::Pickle* m, + const param_type& p) { + WriteParam(m, p.get() != nullptr); + if (!p.get()) + return; + + WriteParam(m, p->http_status_code); + WriteParam(m, p->http_status_text); + WriteParam(m, p->request_headers); + WriteParam(m, p->response_headers); + WriteParam(m, p->request_headers_text); + WriteParam(m, p->response_headers_text); +} + +bool ParamTraits<scoped_refptr<network::HttpRawRequestResponseInfo>>::Read( + const base::Pickle* m, + base::PickleIterator* iter, + param_type* r) { + bool has_object; + if (!ReadParam(m, iter, &has_object)) + return false; + if (!has_object) + return true; + *r = new network::HttpRawRequestResponseInfo(); + return ReadParam(m, iter, &(*r)->http_status_code) && + ReadParam(m, iter, &(*r)->http_status_text) && + ReadParam(m, iter, &(*r)->request_headers) && + ReadParam(m, iter, &(*r)->response_headers) && + ReadParam(m, iter, &(*r)->request_headers_text) && + ReadParam(m, iter, &(*r)->response_headers_text); +} + +void ParamTraits<scoped_refptr<network::HttpRawRequestResponseInfo>>::Log( + const param_type& p, + std::string* l) { + l->append("("); + if (p.get()) { + LogParam(p->request_headers, l); + l->append(", "); + LogParam(p->response_headers, l); + } + l->append(")"); +} + } // namespace IPC // Generation of IPC definitions.
diff --git a/services/network/public/cpp/network_param_ipc_traits.h b/services/network/public/cpp/network_param_ipc_traits.h index ac82cca..7204a73 100644 --- a/services/network/public/cpp/network_param_ipc_traits.h +++ b/services/network/public/cpp/network_param_ipc_traits.h
@@ -16,6 +16,8 @@ #include "net/cert/signed_certificate_timestamp_and_status.h" #include "net/http/http_request_headers.h" #include "net/ssl/ssl_info.h" +#include "services/network/public/cpp/cors_error_status.h" +#include "services/network/public/cpp/url_loader_completion_status.h" #ifndef INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_ #define INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_ @@ -27,6 +29,10 @@ #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT +namespace network { +struct HttpRawRequestResponseInfo; +} + namespace IPC { template <> @@ -79,6 +85,26 @@ static void Log(const param_type& p, std::string* l); }; +template <> +struct ParamTraits<scoped_refptr<network::HttpRawRequestResponseInfo>> { + typedef scoped_refptr<network::HttpRawRequestResponseInfo> param_type; + static void Write(base::Pickle* m, const param_type& p); + static bool Read(const base::Pickle* m, + base::PickleIterator* iter, + param_type* r); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<scoped_refptr<net::HttpResponseHeaders>> { + typedef scoped_refptr<net::HttpResponseHeaders> param_type; + static void Write(base::Pickle* m, const param_type& p); + static bool Read(const base::Pickle* m, + base::PickleIterator* iter, + param_type* r); + static void Log(const param_type& p, std::string* l); +}; + } // namespace IPC #endif // INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_ @@ -107,4 +133,24 @@ IPC_STRUCT_TRAITS_MEMBER(status) IPC_STRUCT_TRAITS_END() +// Parameters for a ResourceMsg_RequestComplete +IPC_ENUM_TRAITS_MAX_VALUE(network::mojom::CORSError, + network::mojom::CORSError::kLast) + +IPC_STRUCT_TRAITS_BEGIN(network::CORSErrorStatus) + IPC_STRUCT_TRAITS_MEMBER(cors_error) + IPC_STRUCT_TRAITS_MEMBER(related_response_headers) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(network::URLLoaderCompletionStatus) + IPC_STRUCT_TRAITS_MEMBER(error_code) + IPC_STRUCT_TRAITS_MEMBER(exists_in_cache) + IPC_STRUCT_TRAITS_MEMBER(completion_time) + IPC_STRUCT_TRAITS_MEMBER(encoded_data_length) + IPC_STRUCT_TRAITS_MEMBER(encoded_body_length) + IPC_STRUCT_TRAITS_MEMBER(decoded_body_length) + IPC_STRUCT_TRAITS_MEMBER(cors_error_status) + IPC_STRUCT_TRAITS_MEMBER(ssl_info) +IPC_STRUCT_TRAITS_END() + #endif // SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index 7eb9b45..574bf65 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -5,6 +5,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -47,6 +48,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -89,6 +91,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -131,6 +134,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -174,6 +178,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -216,6 +221,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -278,6 +284,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -320,6 +327,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -362,6 +370,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -404,6 +413,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -447,6 +457,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -489,6 +500,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -575,6 +587,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -617,6 +630,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -659,6 +673,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -701,6 +716,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -744,6 +760,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -786,6 +803,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1231,6 +1249,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1256,6 +1275,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1281,6 +1301,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1306,6 +1327,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1331,6 +1353,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1356,6 +1379,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1427,6 +1451,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1452,6 +1477,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1477,6 +1503,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1525,6 +1552,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1550,6 +1578,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1575,6 +1604,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1600,6 +1630,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1625,6 +1656,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1650,6 +1682,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1675,6 +1708,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1700,6 +1734,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1725,6 +1760,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1750,6 +1786,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1775,6 +1812,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1800,6 +1838,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1825,6 +1864,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1850,6 +1890,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1875,6 +1916,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1900,6 +1942,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1925,6 +1968,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1950,6 +1994,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2075,6 +2120,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2118,6 +2164,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2161,6 +2208,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2204,6 +2252,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2247,6 +2296,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2371,6 +2421,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2414,6 +2465,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2457,6 +2509,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2542,6 +2595,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2586,6 +2640,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2629,6 +2684,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2672,6 +2728,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2715,6 +2772,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2758,6 +2816,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2801,6 +2860,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2844,6 +2904,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2887,6 +2948,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2930,6 +2992,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2973,6 +3036,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3017,6 +3081,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3060,6 +3125,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3103,6 +3169,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3146,6 +3213,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3189,6 +3257,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3232,6 +3301,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3275,6 +3345,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3319,6 +3390,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3407,6 +3479,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3449,6 +3522,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3872,6 +3946,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3895,6 +3970,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3918,6 +3994,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3941,6 +4018,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3964,6 +4042,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3987,6 +4066,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4010,6 +4090,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4033,6 +4114,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4057,6 +4139,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4100,6 +4183,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4123,6 +4207,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4146,6 +4231,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4169,6 +4255,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4192,6 +4279,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4216,6 +4304,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4239,6 +4328,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4262,6 +4352,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4285,6 +4376,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4308,6 +4400,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4331,6 +4424,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4355,6 +4449,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4378,6 +4473,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4401,6 +4497,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4424,6 +4521,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4447,6 +4545,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4470,6 +4569,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4493,6 +4593,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4516,6 +4617,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4539,6 +4641,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4562,6 +4665,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4585,6 +4689,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4608,6 +4713,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4631,6 +4737,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4654,6 +4761,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4677,6 +4785,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4700,6 +4809,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4723,6 +4833,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4746,6 +4857,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4769,6 +4881,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4792,6 +4905,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4815,6 +4929,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4838,6 +4953,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4861,6 +4977,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4885,6 +5002,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4908,6 +5026,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4931,6 +5050,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4955,6 +5075,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4982,6 +5103,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5005,6 +5127,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5028,6 +5151,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5052,6 +5176,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5075,6 +5200,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5098,6 +5224,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5164,6 +5291,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5187,6 +5315,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5210,6 +5339,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5255,6 +5385,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5278,6 +5409,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5301,6 +5433,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5324,6 +5457,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5347,6 +5481,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5371,6 +5506,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5394,6 +5530,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5417,6 +5554,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5440,6 +5578,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5463,6 +5602,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5487,6 +5627,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5511,6 +5652,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5535,6 +5677,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5559,6 +5702,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5582,6 +5726,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5605,6 +5750,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5628,6 +5774,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5651,6 +5798,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5674,6 +5822,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5697,6 +5846,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5720,6 +5870,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": {
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index d62cc53..8d5f864 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -10,6 +10,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -43,6 +44,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -76,6 +78,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -109,6 +112,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -142,6 +146,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -175,6 +180,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -217,6 +223,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -250,6 +257,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -283,6 +291,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -316,6 +325,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -349,6 +359,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -382,6 +393,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -459,6 +471,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -492,6 +505,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -525,6 +539,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -558,6 +573,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -591,6 +607,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -624,6 +641,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -735,6 +753,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -776,6 +795,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -818,6 +838,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -859,6 +880,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -900,6 +922,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -941,6 +964,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -982,6 +1006,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1112,6 +1137,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1153,6 +1179,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1196,6 +1223,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1283,6 +1311,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1325,6 +1354,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1366,6 +1396,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1407,6 +1438,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1448,6 +1480,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1490,6 +1523,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1531,6 +1565,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1572,6 +1607,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1613,6 +1649,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1654,6 +1691,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1695,6 +1733,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1737,6 +1776,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1779,6 +1819,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1821,6 +1862,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1906,6 +1948,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1949,6 +1992,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -1990,6 +2034,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2032,6 +2077,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2073,6 +2119,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2115,6 +2162,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2156,6 +2204,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2197,6 +2246,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2238,6 +2288,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2280,8 +2331,18 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "viz_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -2367,6 +2428,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2408,6 +2470,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2450,6 +2513,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2491,6 +2555,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2532,6 +2597,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2573,6 +2639,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2614,6 +2681,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2743,6 +2811,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2784,6 +2853,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2827,6 +2897,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2914,6 +2985,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2956,6 +3028,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -2997,6 +3070,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3038,6 +3112,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3079,6 +3154,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3121,6 +3197,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3162,6 +3239,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3203,6 +3281,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3244,6 +3323,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3285,6 +3365,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3326,6 +3407,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3368,6 +3450,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3410,6 +3493,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3452,6 +3536,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3537,6 +3622,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3580,6 +3666,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3621,6 +3708,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3663,6 +3751,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3704,6 +3793,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3746,6 +3836,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3787,6 +3878,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3828,6 +3920,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3869,6 +3962,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -3911,8 +4005,18 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "viz_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -3997,6 +4101,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4040,6 +4145,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4083,6 +4189,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4126,6 +4233,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4258,6 +4366,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4301,6 +4410,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4345,6 +4455,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4434,6 +4545,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4477,6 +4589,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4520,6 +4633,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4563,6 +4677,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4606,6 +4721,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4649,6 +4765,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4692,6 +4809,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4735,6 +4853,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4778,6 +4897,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4821,6 +4941,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4864,6 +4985,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4907,6 +5029,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4951,6 +5074,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -4994,6 +5118,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5037,6 +5162,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5080,6 +5206,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5123,6 +5250,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5166,6 +5294,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5209,6 +5338,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5253,6 +5383,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5296,6 +5427,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5343,6 +5475,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5386,6 +5519,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5429,6 +5563,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5472,6 +5607,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5515,6 +5651,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5693,6 +5830,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5736,6 +5874,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5780,6 +5919,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5869,6 +6009,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5912,6 +6053,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5955,6 +6097,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -5998,6 +6141,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6041,6 +6185,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6084,6 +6229,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6127,6 +6273,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6170,6 +6317,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6213,6 +6361,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6256,6 +6405,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6299,6 +6449,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6342,6 +6493,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6385,6 +6537,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6429,6 +6582,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6472,6 +6626,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6515,6 +6670,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6558,6 +6714,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6601,6 +6758,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6644,6 +6802,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6687,6 +6846,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6731,6 +6891,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6774,6 +6935,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6866,6 +7028,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6909,6 +7072,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6952,6 +7116,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -6995,6 +7160,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7038,6 +7204,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7170,6 +7337,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7213,6 +7381,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7257,6 +7426,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7346,6 +7516,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7389,6 +7560,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7432,6 +7604,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7475,6 +7648,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7518,6 +7692,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7561,6 +7736,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7604,6 +7780,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7647,6 +7824,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7690,6 +7868,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7733,6 +7912,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7776,6 +7956,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7819,6 +8000,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7863,6 +8045,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7906,6 +8089,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7949,6 +8133,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -7992,6 +8177,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8035,6 +8221,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8078,6 +8265,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8121,6 +8309,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8165,6 +8354,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8208,6 +8398,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8300,6 +8491,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8385,6 +8577,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8427,6 +8620,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8469,6 +8663,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8511,6 +8706,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8598,6 +8794,7 @@ { "args": [ "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", + "--gs-results-bucket=chromium-result-details", "--recover-devices", "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json" ], @@ -8684,6 +8881,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8726,6 +8924,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8769,6 +8968,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8856,6 +9056,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8898,6 +9099,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8940,6 +9142,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -8982,6 +9185,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9024,6 +9228,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9066,6 +9271,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9108,6 +9314,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9150,6 +9357,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9192,6 +9400,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9234,6 +9443,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9276,6 +9486,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9318,6 +9529,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9361,6 +9573,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9403,6 +9616,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9445,6 +9659,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9487,6 +9702,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9529,6 +9745,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9571,6 +9788,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9613,6 +9831,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9656,6 +9875,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9698,6 +9918,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9833,6 +10054,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9875,6 +10097,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9917,6 +10140,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9958,6 +10182,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -9999,8 +10224,18 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "cc_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -10033,6 +10268,7 @@ { "args": [ "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", + "--gs-results-bucket=chromium-result-details", "--recover-devices", "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json" ], @@ -10119,6 +10355,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10161,6 +10398,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10204,6 +10442,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10291,6 +10530,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10333,6 +10573,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10375,6 +10616,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10416,6 +10658,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10458,6 +10701,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10499,6 +10743,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10541,6 +10786,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10582,6 +10828,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10624,6 +10871,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10665,6 +10913,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10706,6 +10955,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10747,6 +10997,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10789,6 +11040,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10831,6 +11083,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10873,6 +11126,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -10915,6 +11169,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11000,6 +11255,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11043,6 +11299,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11084,8 +11341,18 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "services_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -11117,6 +11384,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11158,6 +11426,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11199,6 +11468,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11240,6 +11510,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11281,6 +11552,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11322,6 +11594,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11365,8 +11638,18 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], + "merge": { + "args": [ + "--bucket", + "chromium-result-details", + "--test-name", + "viz_unittests" + ], + "script": "//build/android/pylib/results/presentation/test_results_presentation.py" + }, "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -11398,6 +11681,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11510,6 +11794,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11553,6 +11838,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11596,6 +11882,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11639,6 +11926,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11682,6 +11970,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11814,6 +12103,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11857,6 +12147,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11901,6 +12192,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -11990,6 +12282,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12033,6 +12326,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12076,6 +12370,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12119,6 +12414,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12162,6 +12458,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12205,6 +12502,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12248,6 +12546,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12291,6 +12590,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12334,6 +12634,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12377,6 +12678,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12420,6 +12722,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12463,6 +12766,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12507,6 +12811,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12550,6 +12855,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12593,6 +12899,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12636,6 +12943,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12679,6 +12987,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12722,6 +13031,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12765,6 +13075,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12809,6 +13120,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12852,6 +13164,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12946,6 +13259,7 @@ "args": [ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -12982,6 +13296,7 @@ "args": [ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": { @@ -13020,6 +13335,7 @@ "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--annotation=Restriction=DON_Enabled", "--don-enabled", + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 3efe43f..bc0b521 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -228,6 +228,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -237,6 +238,7 @@ }, { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -249,6 +251,7 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--test-filter=WebViewWebVrTest#*", + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "merge": {
diff --git a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter index 875737f..30195169 100644 --- a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter +++ b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
@@ -33,6 +33,7 @@ -CredentialManagerBrowserTest.StoreInUnloadHandler_SameSite_OnDemandMojoPipe -CredentialManagerBrowserTest.StoreInUnloadHandler_SameSite_PreestablishedPipe -CredentialManagerBrowserTest.StoreSavesPSLMatchedCredential +-CredentialManagerBrowserTest.UpdatingPSLMatchedCredentialCreatesSecondEntry -CrExtensionsManagerTest.ItemOrder -CrExtensionsManagerTest.UpdateItemData -CrExtensionsServiceTest.ProfileSettings @@ -638,20 +639,10 @@ # Switch test from using a custom net::URLRequestFileJob to using a test # URLLoaderFactory via SetNetworkFactoryForTesting. -ErrorPageOfflineTestWithAllowDinosaurFalse.CheckEasterEggIsDisabled --DNSErrorPageTest.CheckEasterEggIsNotDisabled --DNSErrorPageTest.DNSError_Basic --DNSErrorPageTest.DNSError_DoClickLink --DNSErrorPageTest.DNSError_DoReload --DNSErrorPageTest.DNSError_DoReloadAfterSameDocumentNavigation --DNSErrorPageTest.DNSError_DoSearch --DNSErrorPageTest.DNSError_GoBack1 --DNSErrorPageTest.DNSError_GoBack2 --DNSErrorPageTest.DNSError_GoBack2AndForward --DNSErrorPageTest.DNSError_GoBack2Forward2 -DNSErrorPageTest.Empty404 --DNSErrorPageTest.Failed -DNSErrorPageTest.SniffSmallHttpErrorResponseAsDownload -DNSErrorPageTest.StaleCacheStatus +-DNSErrorPageTest.DNSError_DoClickLink # Switch test from using a net::URLRequestFileJob that adds load timing to # to using a test URLLoaderFactory via SetNetworkFactoryForTesting. @@ -855,8 +846,8 @@ # Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65822%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FNoSessionRestoreTest.PRE_CookiesClearedOnExit%2F0 -NoSessionRestoreTest.CookiesClearedOnExit - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65817%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FRestartTest.CookiesClearedOnExit%2F0 + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65817%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FRestartTest.CookiesClearedOnExit%2F0 -RestartTest.CookiesClearedOnExit # Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests__dbg__1_%2F69105%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FPopupsOnlyUiDelegateTest.ManyPopupNotifications%2F0 @@ -875,22 +866,22 @@ -CaptivePortalBrowserTest.InterstitialTimerNavigateWhileLoading_EndWithCaptivePortalInterstitial # Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65814%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.NotBookmarkedRulesEvaluatedOnBookmarkEvents%2F0 --DeclarativeContentApiTest.NotBookmarkedRulesEvaluatedOnBookmarkEvents - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65815%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.RulesAddedFromManifest%2F0 --DeclarativeContentApiTest.RulesAddedFromManifest - -#Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65829%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.RulesPersistence%2F0 --DeclarativeContentApiTest.RulesPersistence - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65817%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents%2F0 --DeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FPushMessagingBrowserTest.PushEventWithoutPayload%2F0 --PushMessagingBrowserTest.PushEventWithoutPayload - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FNoStatePrefetchBrowserTest__x2f_NoStatePrefetchBrowserTest.ServiceWorkerIntercept__x2f_0%2F0 --NoStatePrefetchBrowserTest/NoStatePrefetchBrowserTest.ServiceWorkerIntercept/* - -# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents%2F0 --DeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents +-DeclarativeContentApiTest.NotBookmarkedRulesEvaluatedOnBookmarkEvents + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65815%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.RulesAddedFromManifest%2F0 +-DeclarativeContentApiTest.RulesAddedFromManifest + +#Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65829%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.RulesPersistence%2F0 +-DeclarativeContentApiTest.RulesPersistence + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65817%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents%2F0 +-DeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FPushMessagingBrowserTest.PushEventWithoutPayload%2F0 +-PushMessagingBrowserTest.PushEventWithoutPayload + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FNoStatePrefetchBrowserTest__x2f_NoStatePrefetchBrowserTest.ServiceWorkerIntercept__x2f_0%2F0 +-NoStatePrefetchBrowserTest/NoStatePrefetchBrowserTest.ServiceWorkerIntercept/* + +# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65816%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FDeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents%2F0 +-DeclarativeContentApiTest.IsBookmarkedRulesEvaluatedOnBookmarkEvents
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py index 79af304..5b85c47d 100755 --- a/testing/buildbot/generate_buildbot_json.py +++ b/testing/buildbot/generate_buildbot_json.py
@@ -11,17 +11,29 @@ import ast import collections import copy +import difflib import itertools import json import os import string import sys +import traceback THIS_DIR = os.path.dirname(os.path.abspath(__file__)) class BBGenErr(Exception): - pass + + def __init__(self, message, cause=None): + super(BBGenErr, self).__init__(BBGenErr._create_message(message, cause)) + + @staticmethod + def _create_message(message, cause): + msg = message + if cause: + msg += '\n\nCaused by:\n' + msg += '\n'.join(' %s' % l for l in traceback.format_exc().splitlines()) + return msg # This class is only present to accommodate certain machines on @@ -71,11 +83,14 @@ # losing the order by avoiding coalescing the dictionaries into one. gtests = [] for test_name, test_config in sorted(input_tests.iteritems()): - test = self.bb_gen.generate_gtest( - waterfall, tester_name, tester_config, test_name, test_config) - if test: - # generate_gtest may veto the test generation on this tester. - gtests.append(test) + try: + test = self.bb_gen.generate_gtest( + waterfall, tester_name, tester_config, test_name, test_config) + if test: + # generate_gtest may veto the test generation on this tester. + gtests.append(test) + except Exception as e: + raise BBGenErr('Failed to generate %s' % test_name, cause=e) return gtests def sort(self, tests): @@ -368,6 +383,9 @@ self.initialize_swarming_dictionary_for_test(result, tester_config) if self.is_android(tester_config) and tester_config.get('use_swarming', True): + if 'args' not in result: + result['args'] = [] + result['args'].append('--gs-results-bucket=chromium-result-details') if result['swarming']['can_use_on_swarming_builders'] and not \ tester_config.get('skip_merge_script', False): result['merge'] = { @@ -400,7 +418,7 @@ }, ] if not tester_config.get('skip_device_recovery', False): - result['args'] = result.get('args', []) + ['--recover-devices'] + result['args'].append('--recover-devices') result = self.update_and_cleanup_test(result, test_name, tester_name, waterfall) @@ -506,6 +524,12 @@ self.resolve_composition_test_suites() self.link_waterfalls_to_test_suites() + def generation_error(self, suite_type, bot_name, waterfall_name, cause): + return BBGenErr( + 'Failed to generate %s from %s:%s' % ( + suite_type, waterfall_name, bot_name), + cause=cause) + def unknown_test_suite(self, suite_name, bot_name, waterfall_name): return BBGenErr( 'Test suite %s from machine %s on waterfall %s not present in ' \ @@ -531,8 +555,11 @@ raise self.unknown_test_suite_type( test_type, name, waterfall['name']) # pragma: no cover test_generator = generator_map[test_type] - tests[test_type] = test_generator.sort(test_generator.generate( - waterfall, name, config, input_tests)) + try: + tests[test_type] = test_generator.sort(test_generator.generate( + waterfall, name, config, input_tests)) + except Exception as e: + raise self.generation_error(test_type, name, waterfall['name'], e) all_tests[name] = tests all_tests['AAAAA1 AUTOGENERATED FILE DO NOT EDIT'] = {} all_tests['AAAAA2 See generate_buildbot_json.py to make changes'] = {} @@ -614,11 +641,14 @@ current = self.read_file(waterfall['name'] + '.json') if expected != current: ungenerated_waterfalls.add(waterfall['name']) - if verbose: + if verbose: # pragma: no cover print ('Waterfall ' + waterfall['name'] + ' did not have the following expected ' - 'contents:') # pragma: no cover - print expected # pragma: no cover + 'contents:') + for line in difflib.unified_diff( + expected.splitlines(), + current.splitlines()): + print line if ungenerated_waterfalls: raise BBGenErr('The following waterfalls have not been properly ' 'autogenerated by generate_buildbot_json.py: ' +
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py index 9ca9e46..4e84db6 100755 --- a/testing/buildbot/generate_buildbot_json_unittest.py +++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -442,6 +442,18 @@ } """ +NONEXISTENT_KEY_REMOVAL = """ +{ + 'foo_test': { + 'key_removals': { + 'Fake Tester': [ + 'args', + ], + } + }, +} +""" + COMPOSITION_WATERFALL_OUTPUT = """\ { "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {}, @@ -702,6 +714,9 @@ ], "gtest_tests": [ { + "args": [ + "--gs-results-bucket=chromium-result-details" + ], "swarming": { "can_use_on_swarming_builders": true, "cipd_packages": [ @@ -739,6 +754,7 @@ "gtest_tests": [ { "args": [ + "--gs-results-bucket=chromium-result-details", "--recover-devices" ], "swarming": { @@ -956,6 +972,13 @@ 'The following nonexistent machines.*', fbb.check_input_file_consistency) + def test_nonexistent_key_removal_raises(self): + fbb = FakeBBGen(FOO_GTESTS_WATERFALL, + FOO_TEST_SUITE, + NONEXISTENT_KEY_REMOVAL) + with self.assertRaises(generate_buildbot_json.BBGenErr): + fbb.check_output_file_consistency(verbose=True) + if __name__ == '__main__': unittest.main()
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 6fd1f8a3..0fef513 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -23,10 +23,11 @@ }, 'android_webview_unittests': { 'remove_from': [ - # On chromium.android, unclear why these aren't run on all bots. + # On chromium.android, these do not need to run prior to M. 'KitKat Phone Tester (dbg)', 'KitKat Phone Tester (rel)', 'KitKat Tablet Tester', + # They should be running here, though, once stabilized. 'Nougat Phone Tester chromium.android', # chromium.android.fyi 'x64 Device Tester', @@ -41,11 +42,6 @@ 'hard_timeout': 900, }, }, - 'Marshmallow Phone Tester (rel)': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, 'Marshmallow Tablet Tester': { 'swarming': { 'hard_timeout': 900, @@ -175,11 +171,6 @@ 'hard_timeout': 600, }, }, - 'Marshmallow 64 bit Tester': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, 'Marshmallow Phone Tester (rel)': { 'swarming': { 'hard_timeout': 960, @@ -592,13 +583,6 @@ ], }, 'cc_unittests': { - 'key_removals': { - # TODO(kbr): on this bot, it looks like the absence of the - # "merge" key is largely an accident. - 'Marshmallow Phone Tester (rel)': [ - 'merge', - ], - }, 'remove_from': [ # chromium.chromiumos 'Linux ChromiumOS Tests (dbg)(1)', @@ -796,7 +780,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json', '--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'hard_timeout': 1920, @@ -841,17 +824,6 @@ 'x86 Cloud Tester': [ 'args', ], - # chromium.clang - 'ToTAndroid x64': [ - 'args', - ], - 'ToTAndroidCFI': [ - 'args', - ], - # chromium.fyi - 'Out of Process Profiling Android': [ - 'args', - ], }, 'modifications': { # chromium.android @@ -2665,22 +2637,6 @@ 'Out of Process Profiling Android', ], 'modifications': { - # chromium.android - 'KitKat Phone Tester (dbg)': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, - 'KitKat Phone Tester (rel)': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, - 'Marshmallow Phone Tester (rel)': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, # chromium.clang 'ToTAndroidCFI': { 'swarming': { @@ -3142,12 +3098,6 @@ 'Linux TSan Tests', 'Mac ASan 64 Tests (1)', ], - 'key_removals': { - 'Marshmallow Phone Tester (rel)': [ - # TODO(kbr): this looks like an accident. - 'merge', - ], - }, 'modifications': { # chromium.android 'Marshmallow Phone Tester (rel)': { @@ -3853,19 +3803,6 @@ # chromium.memory 'Linux CFI', ], - 'key_removals': { - # TODO(kbr): on Android, it looks like the absence of the - # "merge" key is largely an accident. - 'KitKat Phone Tester (dbg)': [ - 'merge', - ], - 'KitKat Phone Tester (rel)': [ - 'merge', - ], - 'Marshmallow Phone Tester (rel)': [ - 'merge', - ], - }, 'modifications': { 'KitKat Tablet Tester': { 'swarming': {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 6a94f53..bd2873c 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -50,7 +50,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json', '--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -67,7 +66,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json', '--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -84,7 +82,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json', '--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -101,7 +98,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_cardboard_skipdon_setupcomplete.json', '--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -118,7 +114,6 @@ 'args': [ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json', '--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -137,7 +132,6 @@ '--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', '--annotation=Restriction=DON_Enabled', '--don-enabled', - '--gs-results-bucket=chromium-result-details', ], 'swarming': { 'dimension_sets': [ @@ -191,7 +185,7 @@ 'args': [ '--shared-prefs-file=src/chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json', '--additional-apk=src/third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', - '--additional-apk=src/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk' + '--additional-apk=src/third_party/gvr-android-sdk/test-apks/daydream_home/daydream_home_current.apk', ], 'test': 'chrome_public_test_vr_apk', }, @@ -251,29 +245,19 @@ 'android_webview_unittests': {}, 'breakpad_unittests': {}, 'content_shell_test_apk': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], 'swarming': { 'hard_timeout': 960, 'shards': 3, }, }, 'chrome_public_test_apk': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], 'swarming': { 'hard_timeout': 1500, 'shards': 10, }, }, - 'chrome_public_test_vr_apk': { - }, + 'chrome_public_test_vr_apk': {}, 'chrome_sync_shell_test_apk': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], 'swarming': { 'hard_timeout': 960, }, @@ -299,11 +283,7 @@ }, }, 'ui_android_unittests': {}, - 'webview_instrumentation_test_apk': { - 'args': [ - '--gs-results-bucket=chromium-result-details', - ], - }, + 'webview_instrumentation_test_apk': {}, }, 'angle_gtests': {
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index 486f88f..10785a8 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -281,7 +281,7 @@ crbug.com/591099 compositing/overflow/composited-scroll-with-fractional-translation.html [ Pass ] crbug.com/591099 compositing/overflow/do-not-crash-use-after-free-update-widget-positions.html [ Crash ] crbug.com/591099 compositing/overflow/fixed-position-ancestor-clip.html [ Failure ] -crbug.com/591099 compositing/overflow/get-transform-from-non-box-container.html [ Crash ] +crbug.com/591099 compositing/overflow/get-transform-from-non-box-container.html [ Crash Failure ] crbug.com/591099 compositing/overflow/grandchild-composited-with-border-radius-ancestor.html [ Failure ] crbug.com/591099 compositing/overflow/grandchild-with-border-radius-ancestor.html [ Failure ] crbug.com/714962 compositing/overflow/image-load-overflow-scrollbars.html [ Failure ] @@ -2269,6 +2269,11 @@ crbug.com/591099 external/wpt/css/css-fonts/test_font_family_parsing.html [ Timeout ] crbug.com/714962 external/wpt/css/css-grid/abspos/grid-positioned-children-writing-modes-001.html [ Failure ] crbug.com/591099 external/wpt/css/css-grid/abspos/positioned-grid-items-should-not-take-up-space-001.html [ Failure ] +crbug.com/591099 external/wpt/css/css-grid/alignment/grid-gutters-002.html [ Pass ] +crbug.com/591099 external/wpt/css/css-grid/alignment/grid-gutters-004.html [ Pass ] +crbug.com/591099 external/wpt/css/css-grid/alignment/grid-gutters-006.html [ Pass ] +crbug.com/591099 external/wpt/css/css-grid/alignment/grid-gutters-008.html [ Pass ] +crbug.com/591099 external/wpt/css/css-grid/alignment/grid-gutters-010.html [ Pass ] crbug.com/591099 external/wpt/css/css-grid/alignment/grid-self-alignment-non-static-positioned-items-009.html [ Failure ] crbug.com/591099 external/wpt/css/css-grid/alignment/grid-self-alignment-non-static-positioned-items-010.html [ Failure ] crbug.com/591099 external/wpt/css/css-grid/alignment/grid-self-alignment-non-static-positioned-items-011.html [ Failure ] @@ -2614,7 +2619,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-018.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-020.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-007.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-009.xht [ Failure Pass ] @@ -2625,7 +2630,7 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-019.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-021.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-023.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-025.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-025.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-027.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-029.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-031.xht [ Failure Pass ] @@ -2648,7 +2653,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-069.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-071.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-071.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure Pass ] @@ -2693,7 +2698,7 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-159.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-161.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-163.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-169.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-171.xht [ Failure Pass ] @@ -2701,7 +2706,7 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-175.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-183.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure Pass ] @@ -2716,7 +2721,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-205.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-211.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-211.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-213.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-215.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-217.xht [ Failure Pass ] @@ -2736,7 +2741,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-016.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-018.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-020.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-022.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-022.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-024.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-026.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-028.xht [ Failure Pass ] @@ -3225,16 +3230,20 @@ crbug.com/591099 external/wpt/html/semantics/interactive-elements/the-dialog-element/inert-node-is-unfocusable.html [ Crash ] crbug.com/591099 external/wpt/html/semantics/interactive-elements/the-dialog-element/show-modal-focusing-steps.html [ Crash ] crbug.com/591099 external/wpt/html/semantics/interactive-elements/the-summary-element/activation-behavior.html [ Crash ] +crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/choice-of-error-2.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-classic.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-external-module.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-module.html [ Pass ] +crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/error-type-3.html [ Pass ] crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/inrange-outofrange.html [ Crash ] crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/readwrite-readonly.html [ Crash ] crbug.com/591099 external/wpt/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html [ Failure ] crbug.com/591099 external/wpt/html/syntax/parsing/named-character-references.html [ Timeout ] crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-1.htm [ Pass Timeout ] +crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-4.htm [ Timeout ] +crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-6.htm [ Timeout ] crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-7.htm [ Pass Timeout ] crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-8.htm [ Timeout ] crbug.com/591099 external/wpt/http/basic-auth-cache-test.html [ Timeout ] @@ -3313,13 +3322,56 @@ crbug.com/591099 external/wpt/webmessaging/broadcastchannel/sandbox.html [ Failure ] crbug.com/591099 external/wpt/webrtc/interfaces.html [ Pass Timeout ] crbug.com/591099 external/wpt/webrtc/interfaces.https.html [ Pass Timeout ] +crbug.com/591099 external/wpt/websockets/binary/001.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/binary/002.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/binary/004.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/binary/005.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/closing-handshake/002.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/closing-handshake/003.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/closing-handshake/004.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/006.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/009.html?wss [ Pass ] crbug.com/591099 external/wpt/websockets/constructor/010.html [ Pass ] crbug.com/591099 external/wpt/websockets/constructor/010.html?wss [ Pass ] crbug.com/591099 external/wpt/websockets/constructor/011.html [ Pass ] crbug.com/591099 external/wpt/websockets/constructor/011.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/013.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/016.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/018.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/019.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/020.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/constructor/022.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/cookies/001.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/cookies/002.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/cookies/003.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/cookies/004.html?wss [ Pass ] crbug.com/591099 external/wpt/websockets/cookies/005.html [ Pass ] +crbug.com/591099 external/wpt/websockets/cookies/005.html?wss [ Pass ] crbug.com/591099 external/wpt/websockets/cookies/007.html [ Failure Pass ] +crbug.com/591099 external/wpt/websockets/extended-payload-length.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/CloseEvent/clean-close.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-blob.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-getting.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-large.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-unicode.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/events/016.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/events/018.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/readyState/006.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/readyState/007.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/readyState/008.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/005.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/006.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/007.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/008.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/009.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/010.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/011.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/send/012.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/opening-handshake/002.html?wss [ Pass ] +crbug.com/591099 external/wpt/websockets/opening-handshake/003.html?wss [ Pass Timeout ] crbug.com/591099 external/wpt/websockets/opening-handshake/005.html [ Pass ] +crbug.com/591099 external/wpt/websockets/opening-handshake/005.html?wss [ Pass ] crbug.com/591099 external/wpt/websockets/unload-a-document/001.html [ Pass ] crbug.com/591099 external/wpt/websockets/unload-a-document/001.html?wss [ Pass ] crbug.com/591099 external/wpt/webstorage/storage_setitem.html [ Pass Timeout ] @@ -3479,7 +3531,6 @@ crbug.com/591099 fast/block/positioning/056.html [ Failure ] crbug.com/591099 fast/block/positioning/059.html [ Failure ] crbug.com/591099 fast/block/positioning/061.html [ Failure ] -crbug.com/591099 fast/block/positioning/abs-inside-inline-rel.html [ Crash ] crbug.com/591099 fast/block/positioning/absolute-appended-to-inline.html [ Failure Pass ] crbug.com/591099 fast/block/positioning/absolute-in-inline-dynamic.html [ Failure ] crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-2.html [ Crash Failure ] @@ -3514,7 +3565,6 @@ crbug.com/591099 fast/block/positioning/rel-positioned-inline-changes-width.html [ Crash ] crbug.com/591099 fast/block/positioning/relative-overflow-block.html [ Failure Pass ] crbug.com/591099 fast/block/positioning/relative-overflow-replaced.html [ Failure ] -crbug.com/591099 fast/block/positioning/removing-inside-relpositioned-inline-crash.html [ Crash ] crbug.com/591099 fast/block/positioning/rtl-static-positioning.html [ Failure ] crbug.com/591099 fast/block/positioning/table-cell-static-position.html [ Failure Pass ] crbug.com/591099 fast/block/positioning/trailing-space-test.html [ Failure Pass ] @@ -4022,8 +4072,7 @@ crbug.com/714962 fast/css/invalidation/sheet-loaded-before-invalidation.html [ Failure ] crbug.com/714962 fast/css/invalidation/style-invalidation-before-attach.html [ Failure ] crbug.com/591099 fast/css/invalidation/valid-invalid-pseudo.html [ Failure ] -crbug.com/591099 fast/css/large-number-round-trip.html [ Crash ] -crbug.com/591099 fast/css/large-numbers.html [ Crash ] +crbug.com/591099 fast/css/large-numbers.html [ Timeout Pass ] crbug.com/591099 fast/css/last-child-pseudo-class.html [ Failure ] crbug.com/591099 fast/css/last-child-style-sharing.html [ Failure ] crbug.com/591099 fast/css/last-of-type-pseudo-class.html [ Failure ] @@ -4084,7 +4133,6 @@ crbug.com/591099 fast/css/percentage-non-integer.html [ Failure ] crbug.com/591099 fast/css/placeholder-shown-basics.html [ Crash ] crbug.com/591099 fast/css/position-negative-top-margin.html [ Failure ] -crbug.com/591099 fast/css/positioned-in-relative-position-inline-crash.html [ Crash ] crbug.com/591099 fast/css/positioned-overflow-scroll.html [ Failure ] crbug.com/591099 fast/css/pseudo-default-checkbox-radio.html [ Crash ] crbug.com/591099 fast/css/pseudo-element-backdrop-hit-test.html [ Crash ] @@ -5138,7 +5186,6 @@ crbug.com/714962 fast/inline/continuation-outlines-with-layers-2.html [ Failure ] crbug.com/591099 fast/inline/continuation-outlines-with-layers.html [ Failure ] crbug.com/591099 fast/inline/continuation-outlines.html [ Failure ] -crbug.com/591099 fast/inline/continuation-positioned-reparenting.html [ Crash ] crbug.com/591099 fast/inline/inline-borders-with-bidi-override.html [ Failure ] crbug.com/591099 fast/inline/inline-box-background-long-image.html [ Failure ] crbug.com/591099 fast/inline/inline-box-background-repeat-x.html [ Failure ] @@ -5196,7 +5243,7 @@ crbug.com/591099 fast/js/toString-and-valueOf-override.html [ Failure ] crbug.com/591099 fast/js/webidl-type-mapping.html [ Timeout ] crbug.com/591099 fast/layers/add-layer-with-nested-stacking.html [ Crash Failure ] -crbug.com/591099 fast/layers/inline-dirty-z-order-lists.html [ Crash ] +crbug.com/591099 fast/layers/inline-dirty-z-order-lists.html [ Crash Failure ] crbug.com/591099 fast/layers/layer-content-visibility-change.html [ Failure ] crbug.com/591099 fast/layers/layer-visibility-sublayer.html [ Failure ] crbug.com/591099 fast/layers/layer-visibility.html [ Failure ] @@ -5725,6 +5772,7 @@ crbug.com/591099 fast/overflow/overflow-visible-should-ignore-scroll.html [ Failure ] crbug.com/591099 fast/overflow/overflow-with-local-background-attachment.html [ Failure ] crbug.com/714962 fast/overflow/overflow-x-y.html [ Failure ] +crbug.com/591099 fast/overflow/recompute-overflow-of-layout-root-container.html [ Failure ] crbug.com/591099 fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto.html [ Failure ] crbug.com/714962 fast/overflow/scroll-div-hide-show.html [ Failure ] crbug.com/591099 fast/overflow/scrollbar-restored-and-then-locked.html [ Failure ] @@ -6196,7 +6244,6 @@ crbug.com/714962 fast/table/table-row-before-child-in-block.html [ Failure ] crbug.com/591099 fast/table/table-rowspan-table-height-and-row-precent-height-too-large.html [ Failure ] crbug.com/591099 fast/table/table-sections-border-spacing.html [ Failure ] -crbug.com/591099 fast/table/table-split-positioned-object-crash.html [ Crash ] crbug.com/591099 fast/table/table-toggle-paragraph-padding.html [ Failure ] crbug.com/591099 fast/table/table-with-borderattr-null.html [ Failure ] crbug.com/591099 fast/table/table-with-borderattr-set-to-null.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index bd0a36d..efc5ba4 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -723,17 +723,13 @@ # ====== IncrementalShadowDOM-only failures until here ====== -# ====== DevTools test migration failures from here ====== +crbug.com/667560 http/tests/devtools/console/console-search.js [ Pass Failure Timeout ] -crbug.com/667560 http/tests/devtools/console/console-search.js [ Skip ] - -crbug.com/667560 http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Pass Failure ] +crbug.com/667560 [ Debug ] http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Pass Failure ] crbug.com/778515 http/tests/devtools/elements/styles-3/styles-add-new-rule.js [ Pass Failure ] crbug.com/785571 http/tests/devtools/console/console-context-selector.js [ Pass Failure ] -# ====== DevTools test migration failures until here ====== - crbug.com/789225 http/tests/devtools/console/console-focus.js [ Pass Failure ] crbug.com/667560 [ Win ] http/tests/devtools/console-cross-origin-iframe-logging.js [ Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/offset-path-interpolation-005-expected.txt b/third_party/WebKit/LayoutTests/animations/interpolation/offset-path-interpolation-005-expected.txt deleted file mode 100644 index 4e105ab..0000000 --- a/third_party/WebKit/LayoutTests/animations/interpolation/offset-path-interpolation-005-expected.txt +++ /dev/null
@@ -1,296 +0,0 @@ -This is a testharness.js-based test. -PASS This test uses interpolation-test.js. -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (-0.3) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.3) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.5) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.6) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1.5) is [ray(0deg closest-side)] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (-0.3) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.3) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.5) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.6) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1) is [none] -PASS CSS Transitions: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1.5) is [none] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (-0.3) is [ray(7deg closest-side)] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (0) is [ray(10deg closest-side)] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.3) is [ray(13deg closest-side)] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.6) is [ray(16deg closest-side)] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Transitions: property <offset-path> from neutral to [ray(20deg closest-side)] at (1.5) is [ray(25deg closest-side)] -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (-0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.6) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (-0.3) is [ray(33deg closest-side)] -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0) is [ray(30deg closest-side)] -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.3) is [ray(27deg closest-side)] -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.6) is [ray(24deg closest-side)] -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Transitions: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1.5) is [ray(15deg closest-side)] -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (-0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.6) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (-0.3) is [ray(-2deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0) is [ray(10deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.3) is [ray(22deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.6) is [ray(34deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1) is [ray(50deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1.5) is [ray(70deg sides contain)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (-0.3) is [ray(2deg farthest-corner)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0) is [ray(-10deg farthest-corner)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.3) is [ray(-22deg farthest-corner)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.6) is [ray(-34deg farthest-corner)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1) is [ray(-50deg farthest-corner)] -PASS CSS Transitions: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1.5) is [ray(-70deg farthest-corner)] -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (-0.3) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.3) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.5) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.6) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1.5) is [ray(0deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (-0.3) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.3) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.5) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.6) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1.5) is [none] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (-0.3) is [ray(7deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (0) is [ray(10deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.3) is [ray(13deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.6) is [ray(16deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from neutral to [ray(20deg closest-side)] at (1.5) is [ray(25deg closest-side)] -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (-0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.6) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (-0.3) is [ray(33deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0) is [ray(30deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.3) is [ray(27deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.6) is [ray(24deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Transitions with transition: all: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1.5) is [ray(15deg closest-side)] -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (-0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.3) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.6) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1.5) is [none] assert_equals: expected "ray ( 20deg closest - side ) " but got "none " -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (-0.3) is [ray(-2deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0) is [ray(10deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.3) is [ray(22deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.6) is [ray(34deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1) is [ray(50deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1.5) is [ray(70deg sides contain)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (-0.3) is [ray(2deg farthest-corner)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0) is [ray(-10deg farthest-corner)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.3) is [ray(-22deg farthest-corner)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.6) is [ray(-34deg farthest-corner)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1) is [ray(-50deg farthest-corner)] -PASS CSS Transitions with transition: all: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1.5) is [ray(-70deg farthest-corner)] -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (-0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.3) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.6) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -FAIL CSS Transitions with transition: all: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1.5) is [none] assert_equals: expected "ray ( 300deg sides ) " but got "none " -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (-0.3) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.3) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.5) is [ray(0deg closest-side)] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.6) is [ray(0deg closest-side)] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1) is [ray(0deg closest-side)] -PASS CSS Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1.5) is [ray(0deg closest-side)] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (-0.3) is [ray(0deg closest-corner)] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0) is [ray(0deg closest-corner)] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.3) is [ray(0deg closest-corner)] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.5) is [none] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.6) is [none] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1) is [none] -PASS CSS Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1.5) is [none] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (-0.3) is [ray(7deg closest-side)] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0) is [ray(10deg closest-side)] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.3) is [ray(13deg closest-side)] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.6) is [ray(16deg closest-side)] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (1.5) is [ray(25deg closest-side)] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (-0.3) is [none] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0) is [none] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.3) is [none] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.5) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.6) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1.5) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (-0.3) is [ray(33deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0) is [ray(30deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.3) is [ray(27deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.6) is [ray(24deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1.5) is [ray(15deg closest-side)] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (-0.3) is [none] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0) is [none] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.3) is [none] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.5) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.6) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1.5) is [ray(20deg closest-side)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (-0.3) is [ray(-2deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0) is [ray(10deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.3) is [ray(22deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.6) is [ray(34deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1) is [ray(50deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1.5) is [ray(70deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (-0.3) is [ray(2deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0) is [ray(-10deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.3) is [ray(-22deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.6) is [ray(-34deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1) is [ray(-50deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1.5) is [ray(-70deg farthest-corner)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (-0.3) is [ray(200deg farthest-side)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0) is [ray(200deg farthest-side)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.3) is [ray(200deg farthest-side)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (-0.3) is [ray(200deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0) is [ray(200deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.3) is [ray(200deg sides contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (-0.3) is [ray(200deg farthest-side contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0) is [ray(200deg farthest-side contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.3) is [ray(200deg farthest-side contain)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS CSS Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (-0.3) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.3) is [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.5) is [ray(0deg closest-side)] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (0.6) is [ray(0deg closest-side)] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1) is [ray(0deg closest-side)] -PASS Web Animations: property <offset-path> from [path('M 0 0 L 100 100 M 100 200 L 200 200 Z L 200 100 Z')] to [ray(0deg closest-side)] at (1.5) is [ray(0deg closest-side)] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (-0.3) is [ray(0deg closest-corner)] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0) is [ray(0deg closest-corner)] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.3) is [ray(0deg closest-corner)] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.5) is [none] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (0.6) is [none] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1) is [none] -PASS Web Animations: property <offset-path> from [ray(0deg closest-corner)] to [none] at (1.5) is [none] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (-0.3) is [ray(7deg closest-side)] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0) is [ray(10deg closest-side)] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.3) is [ray(13deg closest-side)] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (0.6) is [ray(16deg closest-side)] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from neutral to [ray(20deg closest-side)] at (1.5) is [ray(25deg closest-side)] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (-0.3) is [none] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0) is [none] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.3) is [none] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.5) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (0.6) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [initial] to [ray(20deg closest-side)] at (1.5) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (-0.3) is [ray(33deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0) is [ray(30deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.3) is [ray(27deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (0.6) is [ray(24deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [inherit] to [ray(20deg closest-side)] at (1.5) is [ray(15deg closest-side)] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (-0.3) is [none] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0) is [none] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.3) is [none] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.5) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (0.6) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [unset] to [ray(20deg closest-side)] at (1.5) is [ray(20deg closest-side)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (-0.3) is [ray(-2deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0) is [ray(10deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.3) is [ray(22deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (0.6) is [ray(34deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1) is [ray(50deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(10deg sides contain)] to [ray(50deg sides contain)] at (1.5) is [ray(70deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (-0.3) is [ray(2deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0) is [ray(-10deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.3) is [ray(-22deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (0.6) is [ray(-34deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1) is [ray(-50deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(-10deg farthest-corner)] to [ray(-50deg farthest-corner)] at (1.5) is [ray(-70deg farthest-corner)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (-0.3) is [ray(200deg farthest-side)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0) is [ray(200deg farthest-side)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.3) is [ray(200deg farthest-side)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (-0.3) is [ray(200deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0) is [ray(200deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.3) is [ray(200deg sides contain)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg sides contain)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (-0.3) is [ray(200deg farthest-side contain)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0) is [ray(200deg farthest-side contain)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.3) is [ray(200deg farthest-side contain)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.5) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (0.6) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1) is [ray(300deg sides)] -PASS Web Animations: property <offset-path> from [ray(200deg farthest-side contain)] to [ray(300deg sides)] at (1.5) is [ray(300deg sides)] -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index ef55882..ff2bad75 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -167211,6 +167211,48 @@ {} ] ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-001.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-001.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-002.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-002.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-003.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-003.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-004.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-004.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-005.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-005.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-006.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-006.html", + {} + ] + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-007.html": [ + [ + "/css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-007.html", + {} + ] + ], "css/css-grid/abspos/grid-positioned-items-content-alignment-001.html": [ [ "/css/css-grid/abspos/grid-positioned-items-content-alignment-001.html", @@ -253209,87 +253251,87 @@ "visual" ], "css/css-backgrounds/border-radius-001-ref.xht": [ - "ef1308b55e3c17000ad94cf85a03d05ece24f66c", + "565982e400e9a1b62f6224ed655c977064ef3952", "support" ], "css/css-backgrounds/border-radius-001.xht": [ - "3f669ee04eca21655211dd4ec317e5f1cf4dfe39", + "448d22583ccdf4d4b245a219014eded8666a7bfa", "reftest" ], "css/css-backgrounds/border-radius-002-ref.xht": [ - "f8f2373accc3cfbcaf84a07aa6f850ac047931da", + "4bf3a05d4e3f531f59d1a8bb434d9ae8df3e089c", "support" ], "css/css-backgrounds/border-radius-002.xht": [ - "5f9bb278ae68dbdc0b85c54dfff2a8c5c2d6a576", + "54bdc142548fe5cd71336e3757f6b9ad8d8f75ef", "reftest" ], "css/css-backgrounds/border-radius-003-ref.xht": [ - "780b37d4e473e1e73b3c1221441f5c00cc9b64ba", + "21d3674eef4a60927e3849770a391e6b7a46f81a", "support" ], "css/css-backgrounds/border-radius-003.xht": [ - "77439d7aad5f3e58f2d85b034119c8907038545a", + "e27aa9bc45c17c77aeab571a581933bc97bcb95f", "reftest" ], "css/css-backgrounds/border-radius-004-ref.xht": [ - "c7e269aa1a07c964d1f78c943563856344789098", + "5e26e7f77aa27fcbef6636eb498fb9b0fa1e92e6", "support" ], "css/css-backgrounds/border-radius-004.xht": [ - "953b456c7aa306c9420d0d70d889bdf4207bcd53", + "eaf678007f7d5f8ca6751916638e509aea9909f5", "reftest" ], "css/css-backgrounds/border-radius-005-ref.xht": [ - "c2a6c35eba7c158f86922bab340cf20285ecdc0e", + "7dd0c30f5445c9f16cd575b7a48ebd0b8f407560", "support" ], "css/css-backgrounds/border-radius-005.xht": [ - "62e1da7ba92b46dffb2f0ee9a5fd725ae878af5b", + "59c424eed52f033c8c2f695107f44ae5a20b295e", "reftest" ], "css/css-backgrounds/border-radius-006-ref.xht": [ - "63a490cba1adaa2450e9a03edde3d1d3416703a1", + "28fcb03b46a25236eb58f057f056e7718dcf32e1", "support" ], "css/css-backgrounds/border-radius-006.xht": [ - "5d2a76914f94c10bf8d907d863365ee3d63c9d7c", + "4a9190103806f526f570f95ef824e007804fd645", "reftest" ], "css/css-backgrounds/border-radius-007-ref.xht": [ - "a8c78252ac61b36d0631aca15e8ec6ad3a3c16db", + "f547b82c811905504be2e37e4983d4dab8a5b31b", "support" ], "css/css-backgrounds/border-radius-007.xht": [ - "811f971181c1cf3fece208d6989567ed84d08070", + "1f7e0dc63717b1c6caa414d5ada7129510dd979c", "reftest" ], "css/css-backgrounds/border-radius-008.xht": [ - "193de4a55be9f442995b0adeabed0e14664e3f62", + "593d270ff4e46a92517459aa9992507f4b3e6c6a", "reftest" ], "css/css-backgrounds/border-radius-009-ref.xht": [ - "6c9457e7c251b0eb933edfc4be10e5bcb405ec57", + "013f339641d80aebee0ea3a97e44753806fdbd41", "support" ], "css/css-backgrounds/border-radius-009.xht": [ - "0b25cce5f284dcc2dac3e87c3419575ee84f764f", + "f4371415c6f2b4edf2bcf4920408d73493904519", "reftest" ], "css/css-backgrounds/border-radius-010-ref.xht": [ - "1039ef9b8bbe885c440ac80f017ac28567f3dc00", + "281bea790d41ae2cc3adbb8938130f75181f828c", "support" ], "css/css-backgrounds/border-radius-010.xht": [ - "6cd9f8f4f2fa156948f05be417d6e9e20f160b89", + "aa88a59894c5a73470221edaa02e0eadbc1a426b", "reftest" ], "css/css-backgrounds/border-radius-011-ref.xht": [ - "7a708c587aa874ea1bbd7a4862e1eb11eaa0f88f", + "d94d45fb036ee95933d251cdfd2ed491ab0405d2", "support" ], "css/css-backgrounds/border-radius-011.xht": [ - "1fcb231f6b7b8eb638bdcadace732ef80d274f6b", + "8e9493ba18bde48b0ad9e03adab856b54aae1f3b", "reftest" ], "css/css-backgrounds/border-radius-applies-to-001.htm": [ @@ -265964,6 +266006,34 @@ "9aa0e70e845521fd7127581a4cd017e1ba3dc15c", "reftest" ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-001.html": [ + "b15d1db43efd2b8f15aab17dbbcf3afc262baa76", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-002.html": [ + "6efd2dfea5027aca510f7a92e8cec16b3fddef2d", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-003.html": [ + "d485183a7ea0bfcf92503a3e420ae68470593995", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-004.html": [ + "aacc2daef0aae211a8ffa433ff6684d037afd4c8", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-005.html": [ + "fc2cfee0c523129d8cb0bbee1685786a72031e84", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-006.html": [ + "7408735464c2da7fa7916ee5a739518866e5b7a2", + "testharness" + ], + "css/css-grid/abspos/grid-positioned-items-and-autofit-tracks-007.html": [ + "4c50565bb7adf5074f57da937954c3e95ee00d7a", + "testharness" + ], "css/css-grid/abspos/grid-positioned-items-background-001-ref.html": [ "4094fef3dedb631dfb06f600ce44ccfbfdb78d02", "support"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001-ref.xht index 9c7bc4b..0d6f4d70 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001-ref.xht
@@ -3,29 +3,25 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - } - /* ]]> */ + <style> + div { + border:2px solid #a1a1a1; + background:#dddddd; + width:200px; + height: 100px; + } </style> </head> <body> - <p> - There should be two boxes with no rounded corners.</p> + <p>There should be two boxes with no rounded corners.</p> <ul> <li>PASS if the two boxes below are the same.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001.xht index 7536df1..5029dd0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-001.xht
@@ -3,65 +3,33 @@ <head> <title>CSS Test: Borders. border–radius set to zero</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-001-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify when border-radius property, when set to zero, works as expected." /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; } - #test - { - border-radius: 0; - } - /* ]]> */ + #test { + border-radius: 0; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two boxes with no rounded corners. - </p> - <!-- PASS AND FAIL CRITERIA ARE IN THE LIST BELOW --> - <ul> - <li>PASS if the two boxes below are the same.</li> - <li>FAIL if the output is not as expected.</li> - </ul> + <p>There should be two boxes with no rounded corners.</p> + <ul> + <li>PASS if the two boxes below are the same.</li> + <li>FAIL if the output is not as expected.</li> + </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("0px", "0px", "0px", "0px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002-ref.xht index 104c1e15..b9282343 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002-ref.xht
@@ -3,34 +3,28 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 25px; - border-top-right-radius: 25px; - border-bottom-right-radius: 25px; - border-bottom-left-radius: 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + border-bottom-right-radius: 25px; + border-bottom-left-radius: 25px; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002.xht index 1877e08..9f53fc3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-002.xht
@@ -3,68 +3,36 @@ <head> <title>CSS Test: Borders. border–radius using one length value 25px</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-002-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with one length value, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 25px; - } - #reference - { - border-top-left-radius: 25px; - border-top-right-radius: 25px; - border-bottom-right-radius: 25px; - border-bottom-left-radius: 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 25px; + } + #reference { + border-top-left-radius: 25px; + border-top-right-radius: 25px; + border-bottom-right-radius: 25px; + border-bottom-left-radius: 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("25px", "25px", "25px", "25px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003-ref.xht index be824c2..d7017f02 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003-ref.xht
@@ -3,34 +3,28 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 50px; - border-top-right-radius: 0; - border-bottom-right-radius: 50px; - border-bottom-left-radius: 0; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 50px; + border-top-right-radius: 0; + border-bottom-right-radius: 50px; + border-bottom-left-radius: 0; + } </style> </head> <body> - <p> - There should be two identical boxes, each with rounded corners at the top left and bottom right only. - </p> + <p>There should be two identical boxes, each with rounded corners at the top left and bottom right only.</p> <ul> <li>PASS if the two boxes below are the same and only top left and bottom right corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003.xht index cfe4d74..398358f1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-003.xht
@@ -3,68 +3,36 @@ <head> <title>CSS Test: Borders. border–radius set to value: 50px 0</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-003-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with one length value along with a zero, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 50px 0; - } - #reference - { - border-top-left-radius: 50px; - border-top-right-radius: 0; - border-bottom-right-radius: 50px; - border-bottom-left-radius: 0; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 50px 0; + } + #reference { + border-top-left-radius: 50px; + border-top-right-radius: 0; + border-bottom-right-radius: 50px; + border-bottom-left-radius: 0; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with rounded corners at the top left and bottom right only. - </p> + <p>There should be two identical boxes, each with rounded corners at the top left and bottom right only.</p> <ul> <li>PASS if the two boxes below are the same and only top left and bottom right corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("50px", "0px", "50px", "0px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004-ref.xht index 74e70ab..3062d783 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004-ref.xht
@@ -3,34 +3,29 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 50px 25px; - border-top-right-radius: 50px 25px; - border-bottom-right-radius: 50px 25px; - border-bottom-left-radius: 50px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 50px 25px; + border-top-right-radius: 50px 25px; + border-bottom-right-radius: 50px 25px; + border-bottom-left-radius: 50px 25px; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004.xht index cfd57e2..8a000d9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-004.xht
@@ -3,68 +3,37 @@ <head> <title>CSS Test: Borders. border–radius using slash: 50px / 25px</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-004-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with value using slash, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 50px / 25px; - } - #reference - { - border-top-left-radius: 50px 25px; - border-top-right-radius: 50px 25px; - border-bottom-right-radius: 50px 25px; - border-bottom-left-radius: 50px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 50px / 25px; + } + #reference { + border-top-left-radius: 50px 25px; + border-top-right-radius: 50px 25px; + border-bottom-right-radius: 50px 25px; + border-bottom-left-radius: 50px 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("50px 25px", "50px 25px", "50px 25px", "50px 25px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005-ref.xht index 378b40e..57605a76 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005-ref.xht
@@ -3,34 +3,29 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 50px 20px; - border-top-right-radius: 15px 25px; - border-bottom-right-radius: 40px 20px; - border-bottom-left-radius: 15px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 50px 20px; + border-top-right-radius: 15px 25px; + border-bottom-right-radius: 40px 20px; + border-bottom-left-radius: 15px 25px; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005.xht index 839d48f..7be93af 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-005.xht
@@ -3,66 +3,36 @@ <head> <title>CSS Test: Borders. border–radius using slash: 50px 15px 40px / 20px 25px</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-005-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with value using slash, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 50px 15px 40px / 20px 25px; - } - #reference - { - border-top-left-radius: 50px 20px; - border-top-right-radius: 15px 25px; - border-bottom-right-radius: 40px 20px; - border-bottom-left-radius: 15px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 50px 15px 40px / 20px 25px; + } + #reference { + border-top-left-radius: 50px 20px; + border-top-right-radius: 15px 25px; + border-bottom-right-radius: 40px 20px; + border-bottom-left-radius: 15px 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("50px 20px", "15px 25px", "40px 20px", "15px 25px"); - var testResult = check_Multiple_CSS_property(borders, expectedValues); - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006-ref.xht index 730a19b..93c19491 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006-ref.xht
@@ -3,34 +3,28 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 50px 20px; - border-top-right-radius: 15px 25px; - border-bottom-right-radius: 50px 10%; - border-bottom-left-radius: 15px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 50px 20px; + border-top-right-radius: 15px 25px; + border-bottom-right-radius: 50px 10%; + border-bottom-left-radius: 15px 25px; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006.xht index e2426d0..89da74c4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-006.xht
@@ -3,68 +3,36 @@ <head> <title>CSS Test: Borders. border–radius using slash: 50px 15px / 20px 25px 10%</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-006-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with values using slash, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 50px 15px / 20px 25px 10%; - } - #reference - { - border-top-left-radius: 50px 20px; - border-top-right-radius: 15px 25px; - border-bottom-right-radius: 50px 10%; - border-bottom-left-radius: 15px 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 50px 15px / 20px 25px 10%; + } + #reference { + border-top-left-radius: 50px 20px; + border-top-right-radius: 15px 25px; + border-bottom-right-radius: 50px 10%; + border-bottom-left-radius: 15px 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("50px 20px", "15px 25px", "50px 10%", "15px 25px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007-ref.xht index 3d3ab1b..c10c0ee84 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007-ref.xht
@@ -3,34 +3,28 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 50px 0.5in; - border-top-right-radius: 10mm 25px; - border-bottom-right-radius: 6pc 30%; - border-bottom-left-radius: 15% 70pt; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 50px 0.5in; + border-top-right-radius: 10mm 25px; + border-bottom-right-radius: 6pc 30%; + border-bottom-left-radius: 15% 70pt; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007.xht index ab0bdf2e..df442e0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-007.xht
@@ -3,68 +3,36 @@ <head> <title>CSS Test: Borders. border–radius using slash: 50px 10mm 3pc 15% / 0.5in 25px 10% 70pt</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-007-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with values (in different units) using slash, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: 50px 10mm 6pc 15% / 0.5in 25px 30% 70pt; - } - #reference - { - border-top-left-radius: 50px 0.5in; - border-top-right-radius: 10mm 25px; - border-bottom-right-radius: 6pc 30%; - border-bottom-left-radius: 15% 70pt; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: 50px 10mm 6pc 15% / 0.5in 25px 30% 70pt; + } + #reference { + border-top-left-radius: 50px 0.5in; + border-top-right-radius: 10mm 25px; + border-bottom-right-radius: 6pc 30%; + border-bottom-left-radius: 15% 70pt; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("50px 48px", "37px 25px", "96px 30%", "15% 93px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-008.xht index 8c5a7a9..a4b1408 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-008.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-008.xht
@@ -3,65 +3,33 @@ <head> <title>CSS Test: Borders. border–radius using slash: 50px 15px 40px 30em 25em / 20px 25px</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-001-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify border-radius property set with excess values, works as expected" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; } - #test - { - border-radius: 50px 15px 40px 30em 25em / 20px 25px; - } - /* ]]> */ + #test { + border-radius: 50px 15px 40px 30em 25em / 20px 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two boxes with no rounded corners. - </p> - <!-- PASS AND FAIL CRITERIA ARE IN THE LIST BELOW --> - <ul> - <li>PASS if the two boxes below are the same.</li> - <li>FAIL if the output is not as expected.</li> - </ul> + <p>There should be two boxes with no rounded corners.</p> + <!-- PASS AND FAIL CRITERIA ARE IN THE LIST BELOW --> + <ul> + <li>PASS if the two boxes below are the same.</li> + <li>FAIL if the output is not as expected.</li> + </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("0px", "0px", "0px", "0px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009-ref.xht index 9906499..c86e22d3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009-ref.xht
@@ -3,34 +3,29 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 20%; - border-top-right-radius: 25px; - border-bottom-right-radius: 20%; - border-bottom-left-radius: 25px; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 20%; + border-top-right-radius: 25px; + border-bottom-right-radius: 20%; + border-bottom-left-radius: 25px; + } </style> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009.xht index 70169c31..822f166 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-009.xht
@@ -3,70 +3,39 @@ <head> <title>CSS Test: Borders. border–radius using "inherit"</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-009-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify inherit feature works, when it is assigned to border-radius" /> - <style type="text/css"> - /* <![CDATA[ */ - body - { - border-radius: 20% 25px; - } - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: inherit; - } - #reference - { - border-top-left-radius: 20%; - border-top-right-radius: 25px; - border-bottom-right-radius: 20%; - border-bottom-left-radius: 25px; - } - /* ]]> */ + <style> + body { + border-radius: 20% 25px; + } + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: inherit; + } + #reference { + border-top-left-radius: 20%; + border-top-right-radius: 25px; + border-bottom-right-radius: 20%; + border-bottom-left-radius: 25px; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with 4 rounded corners. - </p> + <p>There should be two identical boxes, each with 4 rounded corners.</p> <ul> <li>PASS if the two boxes below are the same and all 4 corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("20%", "25px", "20%", "25px"); - var testResult = check_Multiple_CSS_property(borders, expectedValues); - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010-ref.xht index 7cb553e..882032bf 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010-ref.xht
@@ -3,34 +3,29 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-top-left-radius: 20% 25px; - border-top-right-radius: 0; - border-bottom-right-radius: 20pt 3em; - border-bottom-left-radius: 0; - } - /* ]]> */ + <style> + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-top-left-radius: 20% 25px; + border-top-right-radius: 0; + border-bottom-right-radius: 20pt 3em; + border-bottom-left-radius: 0; + } </style> </head> <body> - <p> - There should be two identical boxes, each with rounded corners at the top left and bottom right only. - </p> + <p>There should be two identical boxes, each with rounded corners at the top left and bottom right only.</p> <ul> <li>PASS if the two boxes below are the same and only top left and bottom right corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010.xht index 99791d1..32d4646 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-010.xht
@@ -3,73 +3,40 @@ <head> <title>CSS Test: Borders. border–radius using "inherit"</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta http-equiv="Content-Style-Type" content="text/css"/> - <meta http-equiv="Content-Script-Type" content="text/javascript"/> <link rel="author" title="Nokia" href="http://www.nokia.com/"/> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-010-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="To verify inherit feature works, when it is assigned to border-radius" /> - <style type="text/css"> - /* <![CDATA[ */ - body - { - border-top-left-radius: 20% 25px; - border-bottom-right-radius: 20pt 3em; - } - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - border-radius: inherit; - } - #reference - { - border-top-left-radius: 20% 25px; - border-top-right-radius: 0; - border-bottom-right-radius: 20pt 3em; - border-bottom-left-radius: 0; - } - /* ]]> */ + <style> + body { + border-top-left-radius: 20% 25px; + border-bottom-right-radius: 20pt 3em; + } + div { + border: 2px solid #a1a1a1; + background: #dddddd; + width: 200px; + height: 100px; + border-radius: inherit; + } + #reference { + border-top-left-radius: 20% 25px; + border-top-right-radius: 0; + border-bottom-right-radius: 20pt 3em; + border-bottom-left-radius: 0; + } </style> -<!-- - <script type="text/javascript" src="js/css3_test_helper.js"></script> ---> </head> <body> - <p> - There should be two identical boxes, each with rounded corners at the top left and bottom right only. - </p> + <p>There should be two identical boxes, each with rounded corners at the top left and bottom right only.</p> <ul> <li>PASS if the two boxes below are the same and only top left and bottom right corners are rounded.</li> <li>FAIL if the output is not as expected.</li> </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="test"></div> - <p><br/></p> - <div id="reference"></div> -<!-- - <script type="text/javascript"> - /* <![CDATA[ */ - var borders = new Array("border-top-left-radius", "border-top-right-radius", - "border-bottom-right-radius", "border-bottom-left-radius"); - var expectedValues = new Array("20% 25px", "0px", "26px 48px", "0px"); - - var testResult = check_Multiple_CSS_property(borders, expectedValues); - - /* if (testResult.pass) - // This portion of the code has been removed to ensure that the test case is not automated - else { - // This portion of the code has been removed to ensure that the test case is not automated - } */ - - if (top.FrameEnabled) top.fnLog(testResult); - /* ]]> */ - </script> ---> + <div id="test"></div> + <p><br/></p> + <div id="reference"></div> </body> </html> -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011-ref.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011-ref.xht index 32120f12..cdeaf1c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011-ref.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011-ref.xht
@@ -3,29 +3,22 @@ <head> <title>CSS Test: Border radius reference</title> <link rel="author" title="Nokia" href="http://www.nokia.com/" /> - <style type="text/css"> - /* <![CDATA[ */ - div - { - border:2px solid #a1a1a1; - background:#dddddd; - width:200px; - height: 100px; - } - /* ]]> */ + <style> + div { + position: absolute; + top: 150px; + width: 200px; + height: 100px; + } </style> </head> <body> - <p> - There should be two boxes, each with corners that have no rounding. - </p> - <ul> - <li>PASS if the two boxes below are the same, each with sharp corner joins (no rounding).</li> - <li>FAIL if corner joins have any rounding.</li> - </ul> + <p>A white rectangle with no border-radius property sits exactly on top of an exact same size red rectangle with border-radius set to zero.</p> + <ul> + <li>PASS if no red is visible on the page.</li> + <li>FAIL if any red is visible.</li> + </ul> - <div></div> - <p><br/></p> - <div></div> + <div></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011.xht index 6a5ceab..8439302d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/border-radius-011.xht
@@ -5,44 +5,36 @@ <link rel="author" title="Nokia" href="http://www.nokia.com/" /> <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-radius" /> <link rel="match" href="border-radius-011-ref.xht" /> - <meta name="flags" content="" /> <meta name="assert" content="If border-radius is zero, all corners are square." /> - <style type="text/css"><![CDATA[ - div - { - width:200px; - height: 100px; + <style> + div { + width: 200px; + height: 100px; } - #reference - { - background: red; - position: absolute; - top: 100px; - left: 30px; + #reference { + background: red; + position: absolute; + top: 150px; + left: 30px; } - #test - { - position: absolute; - border-radius: 0; - background: white; - top: 100px; - left: 30px; - } - - ]]> + #test { + position: absolute; + border-radius: 0; + background: white; + top: 150px; + left: 30px; + } </style> </head> <body> - <p> - A white rectangle with no border-radius property sits exactly on top of an exact same size red rectangle with border-radius set to zero. - </p> - <!-- PASS AND FAIL CRITERIA ARE IN THE LIST BELOW --> - <ul> - <li>PASS if no red is visible on the page.</li> - <li>FAIL if any red is visible.</li> - </ul> + <p>A white rectangle with no border-radius property sits exactly on top of an exact same size red rectangle with border-radius set to zero.</p> + <!-- PASS AND FAIL CRITERIA ARE IN THE LIST BELOW --> + <ul> + <li>PASS if no red is visible on the page.</li> + <li>FAIL if any red is visible.</li> + </ul> <!-- PLACE TEST CONTENT FROM HERE --> - <div id="reference"></div> - <div id="test"></div> + <div id="reference"></div> + <div id="test"></div> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7-expected.html b/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7-expected.html new file mode 100644 index 0000000..5b00a16 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7-expected.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<style> +html { + line-height: 0.5; +} +.float { + width: 100%; + height: 4px; +} +</style> +<p>crbug.com/784793: The list marker should be to the left not the right.</p> +<div class="float"></div> +<ul> + <li>list item</li> +</ul>
diff --git a/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7.html b/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7.html new file mode 100644 index 0000000..b79cb0c --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/lists/list-marker-avoid-float-7.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<style> +html { + line-height: 0.5; +} +.float { + width: 100%; + height: 20px; + float: left; +} +</style> +<p>crbug.com/784793: The list marker should be to the left not the right.</p> +<div class="float"></div> +<ul> + <li>list item</li> +</ul>
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-many.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-many.html index abbfaa4b1..5aedc64 100644 --- a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-many.html +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-many.html
@@ -13,22 +13,48 @@ // - 850 on Windows // - 1700 on Linux -const limit = internals.peerConnectionCountLimit; +let peerConnections = []; + +function allocatePeerConnection() { + peerConnections.push(new RTCPeerConnection()); +} + +function cleanUpPeerConnectionsAndGarbageCollect() { + // Close all peer connections so that they may be garbage collected. + peerConnections.forEach(pc => { + pc.close(); + }); + peerConnections = []; + gc(); +} test(function() { - for (let count = 0; count < limit; count++) { - pc = new RTCPeerConnection(); + try { + // These many peer connections should be OK to allocate. + while (internals.peerConnectionCount() < + internals.peerConnectionCountLimit) { + allocatePeerConnection(); + } + // Exceeding the limit should throw an UnknownError. + assert_throws("UnknownError", allocatePeerConnection, + 'Creating too many RTCPeerConnections gives UnknownError'); + } finally { + // On swarming bots running webkit_layout_tests (such as + // win7_chromium_rel_ng), garbage collection is not guaranteed to occur + // between test pages. As such we cannot assume that the initial count is 0, + // and we must clean up after this test regardless of test result or + // unrelated tests may fail. + let totalAllocatedPeerConnections = internals.peerConnectionCount(); + let peerConnectionsAllocatedByTest = peerConnections.length; + cleanUpPeerConnectionsAndGarbageCollect(); + // We cannot assert there are no peer connections since other swarming tests + // could have left peer connections in a non-closed state, but we can assert + // that at least all |peerConnectionsAllocatedByTest| have been collected. + assert_less_than_equal( + totalAllocatedPeerConnections - peerConnectionsAllocatedByTest, + internals.peerConnectionCount()); } -}, 'We can create ' + limit + ' peerconnections without crashing'); - -test(function() { - while (internals.peerConnectionCount() < internals.peerConnectionCountLimit) { - pc = new RTCPeerConnection(); - } - assert_throws("UnknownError", - function() {pc = new RTCPeerConnection()}, - 'Creating too many PeerConnections gives UnknownError'); -}, 'Creating too many peerconnections returns the right error'); +}, 'Create and garbage collect many RTCPeerConnections'); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt index 13c13cd..73b7ac1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE MESSAGE: line 124: InspectorTest.IndexedDB_callback1 Tests Application Panel response to a main frame navigation. Initial state: @@ -22,12 +21,7 @@ Application Cache Frames top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html + inspected-page.html Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] Visible view is a cookie view: true Page reloaded. @@ -51,12 +45,7 @@ Application Cache Frames top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html + inspected-page.html Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] Visible view is a cookie view: true
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-expected.txt index c7fae3e2..6d16679 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-expected.txt
@@ -1,384 +1,288 @@ -CONSOLE MESSAGE: line 27: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 28: %o -CONSOLE MESSAGE: line 29: %O -CONSOLE MESSAGE: line 30: Test for zero "%f" in formatter -CONSOLE MESSAGE: line 31: %% self-escape1 -CONSOLE MESSAGE: line 32: %%s self-escape2 -CONSOLE MESSAGE: line 33: %%ss self-escape3 -CONSOLE MESSAGE: line 34: %%s%s%%s self-escape4 -CONSOLE MESSAGE: line 35: %%%%% self-escape5 -CONSOLE MESSAGE: line 36: %%%s self-escape6 -CONSOLE MESSAGE: line 12: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -CONSOLE MESSAGE: line 13: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -CONSOLE MESSAGE: line 12: /foo\\bar\sbaz/i -CONSOLE MESSAGE: line 13: /foo\\bar\sbaz/i -CONSOLE MESSAGE: line 12: test -CONSOLE MESSAGE: line 13: test -CONSOLE MESSAGE: line 12: test named "test" -CONSOLE MESSAGE: line 13: test named "test" -CONSOLE MESSAGE: line 12: Error -CONSOLE MESSAGE: line 13: Error -CONSOLE MESSAGE: line 12: Error: my error message -CONSOLE MESSAGE: line 13: Error: my error message -CONSOLE MESSAGE: line 12: Error: my multiline -error message -CONSOLE MESSAGE: line 13: Error: my multiline -error message -CONSOLE MESSAGE: line 12: [object HTMLParagraphElement] -CONSOLE MESSAGE: line 13: [object HTMLParagraphElement] -CONSOLE MESSAGE: line 12: function () { return 1; } -CONSOLE MESSAGE: line 13: function () { return 1; } -CONSOLE MESSAGE: line 12: function () { - return 2; - } -CONSOLE MESSAGE: line 13: function () { - return 2; - } -CONSOLE MESSAGE: line 12: 0.12 -CONSOLE MESSAGE: line 13: 0.12 -CONSOLE MESSAGE: line 12: http://webkit.org/ -CONSOLE MESSAGE: line 13: http://webkit.org/ -CONSOLE MESSAGE: line 12: null -CONSOLE MESSAGE: line 13: -CONSOLE MESSAGE: line 12: undefined -CONSOLE MESSAGE: line 13: -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: NaN -CONSOLE MESSAGE: line 13: NaN -CONSOLE MESSAGE: line 12: Infinity -CONSOLE MESSAGE: line 13: Infinity -CONSOLE MESSAGE: line 12: -Infinity -CONSOLE MESSAGE: line 13: -Infinity -CONSOLE MESSAGE: line 12: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 13: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function () {} -CONSOLE MESSAGE: line 13: function () {} -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: [object SVGSVGElement] -CONSOLE MESSAGE: line 13: [object SVGSVGElement] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: 0 -CONSOLE MESSAGE: line 13: 0 -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function Object() { [native code] } -CONSOLE MESSAGE: line 13: function Object() { [native code] } -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -CONSOLE MESSAGE: line 13: function ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -CONSOLE MESSAGE: line 12: 42.0000 -CONSOLE MESSAGE: line 13: 42.0000 -CONSOLE MESSAGE: line 12: abc -CONSOLE MESSAGE: line 13: abc -CONSOLE MESSAGE: line 12: [object Uint16Array] -CONSOLE MESSAGE: line 13: [object Uint16Array] -CONSOLE MESSAGE: line 12: [object Text] -CONSOLE MESSAGE: line 13: [object Text] -CONSOLE MESSAGE: line 12: [object DOMException] -CONSOLE MESSAGE: line 13: [object DOMException] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -CONSOLE MESSAGE: line 13: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -CONSOLE MESSAGE: line 12: test -CONSOLE MESSAGE: line 13: test Tests that console logging dumps proper messages. - console-format.html:22 Array(10) -console-format.html:23 Array(10) -console-format.html:24 Array(10) -console-format.html:25 Test for zero "0" in formatter -console-format.html:26 % self-escape1 dummy -console-format.html:27 %s self-escape2 dummy -console-format.html:28 %ss self-escape3 dummy -console-format.html:29 %sdummy%s self-escape4 -console-format.html:30 %%% self-escape5 dummy -console-format.html:31 %dummy self-escape6 -console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:8 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] +console-format.js:34 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:35 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:36 Array(10) +console-format.js:37 Test for zero "0" in formatter +console-format.js:38 % self-escape1 dummy +console-format.js:39 %s self-escape2 dummy +console-format.js:40 %ss self-escape3 dummy +console-format.js:41 %sdummy%s self-escape4 +console-format.js:42 %%% self-escape5 dummy +console-format.js:43 %dummy self-escape6 +console-format.js:21 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i +console-format.js:22 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] globals[0] /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:7 /foo\\bar\sbaz/i -console-format.html:8 [/foo\\bar\sbaz/i] +console-format.js:21 /foo\\bar\sbaz/i +console-format.js:22 [/foo\\bar\sbaz/i] globals[1] /foo\\bar\sbaz/i -console-format.html:7 test -console-format.html:8 ["test"] +console-format.js:21 test +console-format.js:22 ["test"] globals[2] "test" -console-format.html:7 test named "test" -console-format.html:8 ["test named "test""] +console-format.js:21 test named "test" +console-format.js:22 ["test named "test""] globals[3] "test named "test"" -console-format.html:7 Error -console-format.html:8 [Error +console-format.js:21 Error +console-format.js:22 [Error ] globals[4] Error -console-format.html:7 Error: my error message -console-format.html:8 [Error: my error message +console-format.js:21 Error: my error message +console-format.js:22 [Error: my error message ] globals[5] Error: my error message -console-format.html:7 Error: my multiline +console-format.js:21 Error: my multiline error message -console-format.html:8 [Error: my multiline +console-format.js:22 [Error: my multiline error message ] globals[6] Error: my multiline error message -console-format.html:7 - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:8 [p#p] +console-format.js:21 + <p id="p"></p> +console-format.js:22 [p#p] globals[7] - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:7 ƒ () { return 1; } -console-format.html:8 [ƒ] + <p id="p"></p> +console-format.js:21 ƒ () { return 1; } +console-format.js:22 [ƒ] globals[8] ƒ () { return 1; } -console-format.html:7 ƒ () { - return 2; - } -console-format.html:8 [ƒ] +console-format.js:21 ƒ () { + return 2; + } +console-format.js:22 [ƒ] globals[9] ƒ () { - return 2; - } -console-format.html:7 0.12 -console-format.html:8 [0.12] + return 2; + } +console-format.js:21 0.12 +console-format.js:22 [0.12] globals[10] 0.12 -console-format.html:7 http://webkit.org/ -console-format.html:8 ["http://webkit.org/"] +console-format.js:21 http://webkit.org/ +console-format.js:22 ["http://webkit.org/"] globals[11] "http://webkit.org/" -console-format.html:7 null -console-format.html:8 [null] +console-format.js:21 null +console-format.js:22 [null] globals[12] null -console-format.html:7 undefined -console-format.html:8 [undefined] +console-format.js:21 undefined +console-format.js:22 [undefined] globals[13] undefined -console-format.html:7 +console-format.js:21 attr="" -console-format.html:8 [attr] +console-format.js:22 [attr] globals[14] attr="" -console-format.html:7 +console-format.js:21 attr="value" -console-format.html:8 [attr] +console-format.js:22 [attr] globals[15] attr="value" -console-format.html:7 +console-format.js:21 id="x" -console-format.html:8 [id] +console-format.js:22 [id] globals[16] id="x" -console-format.html:7 {} -console-format.html:8 [{…}] +console-format.js:21 {} +console-format.js:22 [{…}] globals[17] {} -console-format.html:7 NaN -console-format.html:8 [NaN] +console-format.js:21 NaN +console-format.js:22 [NaN] globals[18] NaN -console-format.html:7 Infinity -console-format.html:8 [Infinity] +console-format.js:21 Infinity +console-format.js:22 [Infinity] globals[19] Infinity -console-format.html:7 -Infinity -console-format.html:8 [-Infinity] +console-format.js:21 -Infinity +console-format.js:22 [-Infinity] globals[20] -Infinity -console-format.html:7 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.html:8 [Array(10)] +console-format.js:21 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:22 [Array(10)] globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.html:7 {} -console-format.html:8 [{…}] +(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:21 {} +console-format.js:22 [{…}] globals[22] {} -console-format.html:7 [ƒ] -console-format.html:8 [Array(1)] +console-format.js:21 [ƒ] +console-format.js:22 [Array(1)] globals[23] [ƒ] -console-format.html:7 {bar: "bar"} -console-format.html:8 [{…}] +console-format.js:21 {bar: "bar"} +console-format.js:22 [{…}] globals[24] {bar: "bar"} -console-format.html:7 +console-format.js:21 <svg id="svg-node"></svg> -console-format.html:8 [svg#svg-node] +console-format.js:22 [svg#svg-node] globals[25] <svg id="svg-node"></svg> -console-format.html:7 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.html:8 [{…}] +console-format.js:21 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} +console-format.js:22 [{…}] globals[26] {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.html:7 -0 -console-format.html:8 [-0] +console-format.js:21 -0 +console-format.js:22 [-0] globals[27] -0 -console-format.html:7 {} -console-format.html:8 [{…}] +console-format.js:21 {} +console-format.js:22 [{…}] globals[28] {} -console-format.html:7 ƒ Object() { [native code] } -console-format.html:8 [ƒ] +console-format.js:21 ƒ Object() { [native code] } +console-format.js:22 [ƒ] globals[29] ƒ Object() { [native code] } -console-format.html:7 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.html:8 [{…}] +console-format.js:21 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} +console-format.js:22 [{…}] globals[30] {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.html:7 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:8 [ƒ] +console-format.js:21 ƒ ( /**/ foo/**/, /*/**/bar, + /**/baz) {} +console-format.js:22 [ƒ] globals[31] ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:7 Number {[[PrimitiveValue]]: 42} -console-format.html:8 [Number] + /**/baz) {} +console-format.js:21 Number {42} +console-format.js:22 [Number] globals[32] -Number {[[PrimitiveValue]]: 42} -console-format.html:7 String {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} -console-format.html:8 [String] +Number {42} +console-format.js:21 String {"abc"} +console-format.js:22 [String] globals[33] -String {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} -console-format.html:7 Uint16Array(3) [1, 2, 3] -console-format.html:8 [Uint16Array(3)] +String {"abc"} +console-format.js:21 Uint16Array(3) [1, 2, 3] +console-format.js:22 [Uint16Array(3)] globals[34] -Uint16Array(3) [1, 2, 3] -console-format.html:7 #text -console-format.html:8 [text] +Uint16Array(3) [1, 2, 3] +console-format.js:21 #text +console-format.js:22 [text] globals[35] #text -console-format.html:7 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:8 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] +console-format.js:21 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. +console-format.js:22 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] globals[36] DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:7 Uint8Array [3] -console-format.html:8 [Uint8Array(1)] +console-format.js:21 Uint8Array [3] +console-format.js:22 [Uint8Array(1)] globals[37] -Uint8Array [3] -console-format.html:7 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:8 [Uint8Array(400)] +Uint8Array [3] +console-format.js:21 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:22 [Uint8Array(400)] globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:7 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:8 [Uint8Array(400000000)] +Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:21 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:22 [Uint8Array(400000000)] globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:7 namespace.longSubNamespace.x.className {} -console-format.html:8 [n…e.l…e.x.className] +Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:21 namespace.longSubNamespace.x.className {} +console-format.js:22 [n…e.l…e.x.className] globals[40] -namespace.longSubNamespace.x.className {} -console-format.html:7 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.html:8 [Array(200)] +namespace.longSubNamespace.x.className {} +console-format.js:21 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] +console-format.js:22 [Array(200)] globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.html:7 ["test"] -console-format.html:8 [Array(1)] +(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] +console-format.js:21 ["test"] +console-format.js:22 [Array(1)] globals[42] ["test"] +console-format.js:21 Number {42, 1: "foo", a: "bar"} +console-format.js:22 [Number] +globals[43] +Number {42, 1: "foo", a: "bar"} +console-format.js:21 String {"abc", 3: "foo", 01: "foo", a: "bar"} +console-format.js:22 [String] +globals[44] +String {"abc", 3: "foo", 01: "foo", a: "bar"} Expanded all messages -console-format.html:22 Array(10) +console-format.js:34 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] 0: "test" 1: "test2" 4: "test4" foo: {} length: 10 __proto__: Array(0) -console-format.html:23 Array(10) +console-format.js:35 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] 0: "test" 1: "test2" 4: "test4" foo: {} length: 10 __proto__: Array(0) -console-format.html:24 Array(10) +console-format.js:36 Array(10) 0: "test" 1: "test2" 4: "test4" foo: {} length: 10 __proto__: Array(0) -console-format.html:25 Test for zero "0" in formatter -console-format.html:26 % self-escape1 dummy -console-format.html:27 %s self-escape2 dummy -console-format.html:28 %ss self-escape3 dummy -console-format.html:29 %sdummy%s self-escape4 -console-format.html:30 %%% self-escape5 dummy -console-format.html:31 %dummy self-escape6 -console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:8 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] +console-format.js:37 Test for zero "0" in formatter +console-format.js:38 % self-escape1 dummy +console-format.js:39 %s self-escape2 dummy +console-format.js:40 %ss self-escape3 dummy +console-format.js:41 %sdummy%s self-escape4 +console-format.js:42 %%% self-escape5 dummy +console-format.js:43 %dummy self-escape6 +console-format.js:21 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i +console-format.js:22 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] 0: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i length: 1 __proto__: Array(0) globals[0] /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:7 /foo\\bar\sbaz/i -console-format.html:8 [/foo\\bar\sbaz/i] +console-format.js:21 /foo\\bar\sbaz/i +console-format.js:22 [/foo\\bar\sbaz/i] 0: /foo\\bar\sbaz/i length: 1 __proto__: Array(0) globals[1] /foo\\bar\sbaz/i -console-format.html:7 test -console-format.html:8 ["test"] +console-format.js:21 test +console-format.js:22 ["test"] 0: "test" length: 1 __proto__: Array(0) globals[2] "test" -console-format.html:7 test named "test" -console-format.html:8 ["test named "test""] +console-format.js:21 test named "test" +console-format.js:22 ["test named "test""] 0: "test named "test"" length: 1 __proto__: Array(0) globals[3] "test named "test"" -console-format.html:7 Error -console-format.html:8 [Error +console-format.js:21 Error +console-format.js:22 [Error ] 0: Error length: 1 __proto__: Array(0) globals[4] Error -console-format.html:7 Error: my error message -console-format.html:8 [Error: my error message +console-format.js:21 Error: my error message +console-format.js:22 [Error: my error message ] 0: Error: my error message length: 1 __proto__: Array(0) globals[5] Error: my error message -console-format.html:7 Error: my multiline +console-format.js:21 Error: my multiline error message -console-format.html:8 [Error: my multiline +console-format.js:22 [Error: my multiline error message ] 0: Error: my multiline @@ -388,89 +292,89 @@ globals[6] Error: my multiline error message -console-format.html:7 - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:8 [p#p] +console-format.js:21 + <p id="p"></p> +console-format.js:22 [p#p] 0: p#p length: 1 __proto__: Array(0) globals[7] - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:7 ƒ () { return 1; } -console-format.html:8 [ƒ] + <p id="p"></p> +console-format.js:21 ƒ () { return 1; } +console-format.js:22 [ƒ] 0: ƒ () length: 1 __proto__: Array(0) globals[8] ƒ () { return 1; } -console-format.html:7 ƒ () { - return 2; - } -console-format.html:8 [ƒ] +console-format.js:21 ƒ () { + return 2; + } +console-format.js:22 [ƒ] 0: ƒ () length: 1 __proto__: Array(0) globals[9] ƒ () { - return 2; - } -console-format.html:7 0.12 -console-format.html:8 [0.12] + return 2; + } +console-format.js:21 0.12 +console-format.js:22 [0.12] 0: 0.12 length: 1 __proto__: Array(0) globals[10] 0.12 -console-format.html:7 http://webkit.org/ -console-format.html:8 ["http://webkit.org/"] +console-format.js:21 http://webkit.org/ +console-format.js:22 ["http://webkit.org/"] 0: "http://webkit.org/" length: 1 __proto__: Array(0) globals[11] "http://webkit.org/" -console-format.html:7 null -console-format.html:8 [null] +console-format.js:21 null +console-format.js:22 [null] 0: null length: 1 __proto__: Array(0) globals[12] null -console-format.html:7 undefined -console-format.html:8 [undefined] +console-format.js:21 undefined +console-format.js:22 [undefined] 0: undefined length: 1 __proto__: Array(0) globals[13] undefined -console-format.html:7 +console-format.js:21 attr="" -console-format.html:8 [attr] +console-format.js:22 [attr] 0: attr length: 1 __proto__: Array(0) globals[14] attr="" -console-format.html:7 +console-format.js:21 attr="value" -console-format.html:8 [attr] +console-format.js:22 [attr] 0: attr length: 1 __proto__: Array(0) globals[15] attr="value" -console-format.html:7 +console-format.js:21 id="x" -console-format.html:8 [id] +console-format.js:22 [id] 0: id length: 1 __proto__: Array(0) globals[16] id="x" -console-format.html:7 {} +console-format.js:21 {} length: (...) get length: ƒ length() __proto__: Object -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {} length: 1 __proto__: Array(0) @@ -479,60 +383,60 @@ length: (...) get length: ƒ length() __proto__: Object -console-format.html:7 NaN -console-format.html:8 [NaN] +console-format.js:21 NaN +console-format.js:22 [NaN] 0: NaN length: 1 __proto__: Array(0) globals[18] NaN -console-format.html:7 Infinity -console-format.html:8 [Infinity] +console-format.js:21 Infinity +console-format.js:22 [Infinity] 0: Infinity length: 1 __proto__: Array(0) globals[19] Infinity -console-format.html:7 -Infinity -console-format.html:8 [-Infinity] +console-format.js:21 -Infinity +console-format.js:22 [-Infinity] 0: -Infinity length: 1 __proto__: Array(0) globals[20] -Infinity -console-format.html:7 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:21 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] 0: "test" 1: "test2" 4: "test4" foo: {} length: 10 __proto__: Array(0) -console-format.html:8 [Array(10)] - 0: (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +console-format.js:22 [Array(10)] + 0: (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] length: 1 __proto__: Array(0) globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] +(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] 0: "test" 1: "test2" 4: "test4" foo: {} length: 10 __proto__: Array(0) -console-format.html:7 {} +console-format.js:21 {} __proto__: Object -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {} length: 1 __proto__: Array(0) globals[22] {} __proto__: Object -console-format.html:7 [ƒ] +console-format.js:21 [ƒ] 0: ƒ () length: 1 __proto__: Array(0) -console-format.html:8 [Array(1)] +console-format.js:22 [Array(1)] 0: [ƒ] length: 1 __proto__: Array(0) @@ -541,10 +445,10 @@ 0: ƒ () length: 1 __proto__: Array(0) -console-format.html:7 {bar: "bar"} +console-format.js:21 {bar: "bar"} bar: "bar" __proto__: Object -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {bar: "bar"} length: 1 __proto__: Array(0) @@ -552,15 +456,15 @@ {bar: "bar"} bar: "bar" __proto__: Object -console-format.html:7 +console-format.js:21 <svg id="svg-node"></svg> -console-format.html:8 [svg#svg-node] +console-format.js:22 [svg#svg-node] 0: svg#svg-node length: 1 __proto__: Array(0) globals[25] <svg id="svg-node"></svg> -console-format.html:7 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} +console-format.js:21 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} enumerableProp: 4 __underscoreEnumerableProp__: 5 abc: 3 @@ -570,7 +474,7 @@ get bar: ƒ () set bar: ƒ (x) __proto__: Object -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} length: 1 __proto__: Array(0) @@ -585,30 +489,30 @@ get bar: ƒ () set bar: ƒ (x) __proto__: Object -console-format.html:7 -0 -console-format.html:8 [-0] +console-format.js:21 -0 +console-format.js:22 [-0] 0: -0 length: 1 __proto__: Array(0) globals[27] -0 -console-format.html:7 {} +console-format.js:21 {} No properties -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {} length: 1 __proto__: Array(0) globals[28] {} No properties -console-format.html:7 ƒ Object() { [native code] } -console-format.html:8 [ƒ] +console-format.js:21 ƒ Object() { [native code] } +console-format.js:22 [ƒ] 0: ƒ Object() length: 1 __proto__: Array(0) globals[29] ƒ Object() { [native code] } -console-format.html:7 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} +console-format.js:21 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} constructor: ƒ Object() hasOwnProperty: ƒ hasOwnProperty() isPrototypeOf: ƒ isPrototypeOf() @@ -622,7 +526,7 @@ __lookupSetter__: ƒ __lookupSetter__() get __proto__: ƒ __proto__() set __proto__: ƒ __proto__() -console-format.html:8 [{…}] +console-format.js:22 [{…}] 0: {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} length: 1 __proto__: Array(0) @@ -641,46 +545,46 @@ __lookupSetter__: ƒ __lookupSetter__() get __proto__: ƒ __proto__() set __proto__: ƒ __proto__() -console-format.html:7 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:8 [ƒ] - 0: ƒ ( /**/ foo/**/, /*/**/bar, /**/baz) +console-format.js:21 ƒ ( /**/ foo/**/, /*/**/bar, + /**/baz) {} +console-format.js:22 [ƒ] + 0: ƒ ( /**/ foo/**/, /*/**/bar, /**/baz) length: 1 __proto__: Array(0) globals[31] ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:7 Number {[[PrimitiveValue]]: 42} + /**/baz) {} +console-format.js:21 Number {42} __proto__: Number [[PrimitiveValue]]: 42 -console-format.html:8 [Number] - 0: Number {[[PrimitiveValue]]: 42} +console-format.js:22 [Number] + 0: Number {42} length: 1 __proto__: Array(0) globals[32] -Number {[[PrimitiveValue]]: 42} +Number {42} __proto__: Number [[PrimitiveValue]]: 42 -console-format.html:7 String {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} +console-format.js:21 String {"abc"} 0: "a" 1: "b" 2: "c" length: 3 __proto__: String [[PrimitiveValue]]: "abc" -console-format.html:8 [String] - 0: String {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} +console-format.js:22 [String] + 0: String {"abc"} length: 1 __proto__: Array(0) globals[33] -String {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} +String {"abc"} 0: "a" 1: "b" 2: "c" length: 3 __proto__: String [[PrimitiveValue]]: "abc" -console-format.html:7 Uint16Array(3) [1, 2, 3] +console-format.js:21 Uint16Array(3) [1, 2, 3] 0: 1 1: 2 2: 3 @@ -690,12 +594,12 @@ length: (...) Symbol(Symbol.toStringTag): (...) __proto__: TypedArray -console-format.html:8 [Uint16Array(3)] - 0: Uint16Array(3) [1, 2, 3] +console-format.js:22 [Uint16Array(3)] + 0: Uint16Array(3) [1, 2, 3] length: 1 __proto__: Array(0) globals[34] -Uint16Array(3) [1, 2, 3] +Uint16Array(3) [1, 2, 3] 0: 1 1: 2 2: 3 @@ -705,21 +609,21 @@ length: (...) Symbol(Symbol.toStringTag): (...) __proto__: TypedArray -console-format.html:7 #text -console-format.html:8 [text] +console-format.js:21 #text +console-format.js:22 [text] 0: text length: 1 __proto__: Array(0) globals[35] #text -console-format.html:7 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:8 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] +console-format.js:21 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. +console-format.js:22 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] 0: DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. length: 1 __proto__: Array(0) globals[36] DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:7 Uint8Array [3] +console-format.js:21 Uint8Array [3] 0: 3 buffer: (...) byteLength: (...) @@ -727,12 +631,12 @@ length: (...) Symbol(Symbol.toStringTag): (...) __proto__: TypedArray -console-format.html:8 [Uint8Array(1)] - 0: Uint8Array [3] +console-format.js:22 [Uint8Array(1)] + 0: Uint8Array [3] length: 1 __proto__: Array(0) globals[37] -Uint8Array [3] +Uint8Array [3] 0: 3 buffer: (...) byteLength: (...) @@ -740,71 +644,71 @@ length: (...) Symbol(Symbol.toStringTag): (...) __proto__: TypedArray -console-format.html:7 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:21 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] [0 … 99] [100 … 199] [200 … 299] [300 … 399] foo: "bar" __proto__: TypedArray -console-format.html:8 [Uint8Array(400)] - 0: Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:22 [Uint8Array(400)] + 0: Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] length: 1 __proto__: Array(0) globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] [0 … 99] [100 … 199] [200 … 299] [300 … 399] foo: "bar" __proto__: TypedArray -console-format.html:7 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:21 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] [0 … 99999999] [100000000 … 199999999] [200000000 … 299999999] [300000000 … 399999999] __proto__: TypedArray -console-format.html:8 [Uint8Array(400000000)] - 0: Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +console-format.js:22 [Uint8Array(400000000)] + 0: Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] length: 1 __proto__: Array(0) globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] +Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] [0 … 99999999] [100000000 … 199999999] [200000000 … 299999999] [300000000 … 399999999] __proto__: TypedArray -console-format.html:7 namespace.longSubNamespace.x.className {} +console-format.js:21 namespace.longSubNamespace.x.className {} __proto__: Object -console-format.html:8 [n…e.l…e.x.className] - 0: namespace.longSubNamespace.x.className {} +console-format.js:22 [n…e.l…e.x.className] + 0: namespace.longSubNamespace.x.className {} length: 1 __proto__: Array(0) globals[40] -namespace.longSubNamespace.x.className {} +namespace.longSubNamespace.x.className {} __proto__: Object -console-format.html:7 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] +console-format.js:21 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] [0 … 99] [100 … 199] length: 200 __proto__: Array(0) -console-format.html:8 [Array(200)] - 0: (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] +console-format.js:22 [Array(200)] + 0: (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] length: 1 __proto__: Array(0) globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] +(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] [0 … 99] [100 … 199] length: 200 __proto__: Array(0) -console-format.html:7 ["test"] +console-format.js:21 ["test"] 0: "test" length: 1 __proto__: Array(0) -console-format.html:8 [Array(1)] +console-format.js:22 [Array(1)] 0: ["test"] length: 1 __proto__: Array(0) @@ -813,4 +717,44 @@ 0: "test" length: 1 __proto__: Array(0) +console-format.js:21 Number {42, 1: "foo", a: "bar"} + 1: "foo" + a: "bar" + __proto__: Number + [[PrimitiveValue]]: 42 +console-format.js:22 [Number] + 0: Number {42, 1: "foo", a: "bar"} + length: 1 + __proto__: Array(0) +globals[43] +Number {42, 1: "foo", a: "bar"} + 1: "foo" + a: "bar" + __proto__: Number + [[PrimitiveValue]]: 42 +console-format.js:21 String {"abc", 3: "foo", 01: "foo", a: "bar"} + 0: "a" + 01: "foo" + 1: "b" + 2: "c" + 3: "foo" + a: "bar" + length: 3 + __proto__: String + [[PrimitiveValue]]: "abc" +console-format.js:22 [String] + 0: String {"abc", 3: "foo", 01: "foo", a: "bar"} + length: 1 + __proto__: Array(0) +globals[44] +String {"abc", 3: "foo", 01: "foo", a: "bar"} + 0: "a" + 01: "foo" + 1: "b" + 2: "c" + 3: "foo" + a: "bar" + length: 3 + __proto__: String + [[PrimitiveValue]]: "abc"
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/indexeddb/database-refresh-view.js b/third_party/WebKit/LayoutTests/http/tests/devtools/indexeddb/database-refresh-view.js index 906a04659..1e1f2b9ce 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/indexeddb/database-refresh-view.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/indexeddb/database-refresh-view.js
@@ -83,12 +83,12 @@ await waitRefreshDatabase(); TestRunner.addResult('Created second objectstore.'); ApplicationTestRunner.dumpIndexedDBTree(); - InspectorTest.dumpObjectStores(); + ApplicationTestRunner.dumpObjectStores(); // Add entries await ApplicationTestRunner.addIDBValueAsync(databaseName, objectStoreName1, 'testKey', 'testValue'); TestRunner.addResult('Added ' + objectStoreName1 + ' entry.'); - InspectorTest.dumpObjectStores(); + ApplicationTestRunner.dumpObjectStores(); // Refresh database view await waitRefreshDatabase(); @@ -96,12 +96,12 @@ await waitUpdateDataView(); await waitUpdateDataView(); TestRunner.addResult('Refreshed database view.'); - InspectorTest.dumpObjectStores(); + ApplicationTestRunner.dumpObjectStores(); // Add entries await ApplicationTestRunner.addIDBValueAsync(databaseName, objectStoreName2, 'testKey2', 'testValue2'); TestRunner.addResult('Added ' + objectStoreName2 + ' entry.'); - InspectorTest.dumpObjectStores(); + ApplicationTestRunner.dumpObjectStores(); // Right-click refresh database view await waitRefreshDatabaseRightClick(); @@ -109,7 +109,7 @@ await waitUpdateDataView(); await waitUpdateDataView(); TestRunner.addResult('Right-click refreshed database.'); - InspectorTest.dumpObjectStores(); + ApplicationTestRunner.dumpObjectStores(); await ApplicationTestRunner.deleteDatabaseAsync(databaseName); TestRunner.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/network/network-columns-visible-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/network/network-columns-visible-expected.txt index 28cc408..c55c1eb9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/network/network-columns-visible-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/network/network-columns-visible-expected.txt
@@ -1,6 +1,6 @@ Tests to ensure column names are matching data. -name: empty.html?xhr/inspector/network/resources +name: empty.html?xhr/devtools/network/resources method: GET status: 200OK protocol: http/1.1 @@ -8,7 +8,7 @@ domain: 127.0.0.1 remoteaddress: 127.0.0.1:8000 type: xhr -initiator: network-columns-visible.html:9Script +initiator: network-columns-visible.js:13Script cookies: setcookies: priority: High
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode-expected.txt index 05192c33..cc078e3 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode-expected.txt
@@ -1,12 +1,12 @@ Verify that for a fileSystem UISourceCode with persistence binding TabbedEditorContainer opens filesystem UISourceCode. Binding created: { - network: http://127.0.0.1:8000/inspector/persistence/resources/foo.js - fileSystem: file:///var/www/inspector/persistence/resources/foo.js + network: http://127.0.0.1:8000/devtools/persistence/resources/foo.js + fileSystem: file:///var/www/devtools/persistence/resources/foo.js exactMatch: false } Opened tabs before opening any UISourceCodes: -request open uiSourceCode: file:///var/www/inspector/persistence/resources/foo.js +request open uiSourceCode: file:///var/www/devtools/persistence/resources/foo.js Opened tabs after opening UISourceCode: - file:///var/www/inspector/persistence/resources/foo.js + file:///var/www/devtools/persistence/resources/foo.js
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer-expected.html b/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer-expected.html new file mode 100644 index 0000000..27e8f61d --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer-expected.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +Changing overflow on the child of a squashed layer should allow the layer to resize and contain the overflow. There should be a white box with black outline. +<div id="test" style="height: 100px; width: 100px; outline: 1px solid black; position: relative; top: 180px"></div>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer.html b/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer.html new file mode 100644 index 0000000..cdf6706 --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/invalidation/overflow/overflow-changed-on-child-of-squashed-layer.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<link rel="match" href="overflow-changed-on-child-of-squashed-layer-expected.html"> +Changing overflow on the child of a squashed layer should allow the layer to resize and contain the overflow. There should be a white box with black outline. +<div style="will-change: transform; width: 100px; height: 100px"></div> +<div id="squashed" style="position: relative; top: -10px; transform; width: 100px; height: 100px"></div> +<div id="parent" style="height: 100px; width: 100px; position: relative; top: -20px"> + <div id="test" style="height: 100px; width: 100px;"></div> +</div> +<script src="../../../resources/run-after-layout-and-paint.js"></script> +<script> +runAfterLayoutAndPaint(function() { + test.style.outline = "1px solid black"; +}, true); +</script>
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/console/console-format-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/console/console-format-expected.txt deleted file mode 100644 index b9fd173f..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/console/console-format-expected.txt +++ /dev/null
@@ -1,760 +0,0 @@ -Tests that console logging dumps proper messages. - -console-format.js:34 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.js:35 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.js:36 Array(10) -console-format.js:37 Test for zero "0" in formatter -console-format.js:38 % self-escape1 dummy -console-format.js:39 %s self-escape2 dummy -console-format.js:40 %ss self-escape3 dummy -console-format.js:41 %sdummy%s self-escape4 -console-format.js:42 %%% self-escape5 dummy -console-format.js:43 %dummy self-escape6 -console-format.js:21 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.js:22 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] -globals[0] -/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.js:21 /foo\\bar\sbaz/i -console-format.js:22 [/foo\\bar\sbaz/i] -globals[1] -/foo\\bar\sbaz/i -console-format.js:21 test -console-format.js:22 ["test"] -globals[2] -"test" -console-format.js:21 test named "test" -console-format.js:22 ["test named "test""] -globals[3] -"test named "test"" -console-format.js:21 Error -console-format.js:22 [Error -] -globals[4] -Error -console-format.js:21 Error: my error message -console-format.js:22 [Error: my error message -] -globals[5] -Error: my error message -console-format.js:21 Error: my multiline -error message -console-format.js:22 [Error: my multiline -error message -] -globals[6] -Error: my multiline -error message -console-format.js:21 - <p id="p"></p> -console-format.js:22 [p#p] -globals[7] - <p id="p"></p> -console-format.js:21 ƒ () { return 1; } -console-format.js:22 [ƒ] -globals[8] -ƒ () { return 1; } -console-format.js:21 ƒ () { - return 2; - } -console-format.js:22 [ƒ] -globals[9] -ƒ () { - return 2; - } -console-format.js:21 0.12 -console-format.js:22 [0.12] -globals[10] -0.12 -console-format.js:21 http://webkit.org/ -console-format.js:22 ["http://webkit.org/"] -globals[11] -"http://webkit.org/" -console-format.js:21 null -console-format.js:22 [null] -globals[12] -null -console-format.js:21 undefined -console-format.js:22 [undefined] -globals[13] -undefined -console-format.js:21 - attr="" -console-format.js:22 [attr] -globals[14] - attr="" -console-format.js:21 - attr="value" -console-format.js:22 [attr] -globals[15] - attr="value" -console-format.js:21 - id="x" -console-format.js:22 [id] -globals[16] - id="x" -console-format.js:21 {} -console-format.js:22 [{…}] -globals[17] -{} -console-format.js:21 NaN -console-format.js:22 [NaN] -globals[18] -NaN -console-format.js:21 Infinity -console-format.js:22 [Infinity] -globals[19] -Infinity -console-format.js:21 -Infinity -console-format.js:22 [-Infinity] -globals[20] --Infinity -console-format.js:21 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.js:22 [Array(10)] -globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.js:21 {} -console-format.js:22 [{…}] -globals[22] -{} -console-format.js:21 [ƒ] -console-format.js:22 [Array(1)] -globals[23] -[ƒ] -console-format.js:21 {bar: "bar"} -console-format.js:22 [{…}] -globals[24] -{bar: "bar"} -console-format.js:21 - <svg id="svg-node"></svg> -console-format.js:22 [svg#svg-node] -globals[25] - <svg id="svg-node"></svg> -console-format.js:21 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.js:22 [{…}] -globals[26] -{enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.js:21 -0 -console-format.js:22 [-0] -globals[27] --0 -console-format.js:21 {} -console-format.js:22 [{…}] -globals[28] -{} -console-format.js:21 ƒ Object() { [native code] } -console-format.js:22 [ƒ] -globals[29] -ƒ Object() { [native code] } -console-format.js:21 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.js:22 [{…}] -globals[30] -{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.js:21 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.js:22 [ƒ] -globals[31] -ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.js:21 Number {42} -console-format.js:22 [Number] -globals[32] -Number {42} -console-format.js:21 String {"abc"} -console-format.js:22 [String] -globals[33] -String {"abc"} -console-format.js:21 Uint16Array(3) [1, 2, 3] -console-format.js:22 [Uint16Array(3)] -globals[34] -Uint16Array(3) [1, 2, 3] -console-format.js:21 #text -console-format.js:22 [text] -globals[35] -#text -console-format.js:21 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.js:22 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] -globals[36] -DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.js:21 Uint8Array [3] -console-format.js:22 [Uint8Array(1)] -globals[37] -Uint8Array [3] -console-format.js:21 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.js:22 [Uint8Array(400)] -globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.js:21 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.js:22 [Uint8Array(400000000)] -globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.js:21 namespace.longSubNamespace.x.className {} -console-format.js:22 [n…e.l…e.x.className] -globals[40] -namespace.longSubNamespace.x.className {} -console-format.js:21 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.js:22 [Array(200)] -globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.js:21 ["test"] -console-format.js:22 [Array(1)] -globals[42] -["test"] -console-format.js:21 Number {42, 1: "foo", a: "bar"} -console-format.js:22 [Number] -globals[43] -Number {42, 1: "foo", a: "bar"} -console-format.js:21 String {"abc", 3: "foo", 01: "foo", a: "bar"} -console-format.js:22 [String] -globals[44] -String {"abc", 3: "foo", 01: "foo", a: "bar"} -Expanded all messages -console-format.js:34 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.js:35 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.js:36 Array(10) - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.js:37 Test for zero "0" in formatter -console-format.js:38 % self-escape1 dummy -console-format.js:39 %s self-escape2 dummy -console-format.js:40 %ss self-escape3 dummy -console-format.js:41 %sdummy%s self-escape4 -console-format.js:42 %%% self-escape5 dummy -console-format.js:43 %dummy self-escape6 -console-format.js:21 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.js:22 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] - 0: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i - length: 1 - __proto__: Array(0) -globals[0] -/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.js:21 /foo\\bar\sbaz/i -console-format.js:22 [/foo\\bar\sbaz/i] - 0: /foo\\bar\sbaz/i - length: 1 - __proto__: Array(0) -globals[1] -/foo\\bar\sbaz/i -console-format.js:21 test -console-format.js:22 ["test"] - 0: "test" - length: 1 - __proto__: Array(0) -globals[2] -"test" -console-format.js:21 test named "test" -console-format.js:22 ["test named "test""] - 0: "test named "test"" - length: 1 - __proto__: Array(0) -globals[3] -"test named "test"" -console-format.js:21 Error -console-format.js:22 [Error -] - 0: Error - length: 1 - __proto__: Array(0) -globals[4] -Error -console-format.js:21 Error: my error message -console-format.js:22 [Error: my error message -] - 0: Error: my error message - length: 1 - __proto__: Array(0) -globals[5] -Error: my error message -console-format.js:21 Error: my multiline -error message -console-format.js:22 [Error: my multiline -error message -] - 0: Error: my multiline -error message - length: 1 - __proto__: Array(0) -globals[6] -Error: my multiline -error message -console-format.js:21 - <p id="p"></p> -console-format.js:22 [p#p] - 0: p#p - length: 1 - __proto__: Array(0) -globals[7] - <p id="p"></p> -console-format.js:21 ƒ () { return 1; } -console-format.js:22 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -globals[8] -ƒ () { return 1; } -console-format.js:21 ƒ () { - return 2; - } -console-format.js:22 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -globals[9] -ƒ () { - return 2; - } -console-format.js:21 0.12 -console-format.js:22 [0.12] - 0: 0.12 - length: 1 - __proto__: Array(0) -globals[10] -0.12 -console-format.js:21 http://webkit.org/ -console-format.js:22 ["http://webkit.org/"] - 0: "http://webkit.org/" - length: 1 - __proto__: Array(0) -globals[11] -"http://webkit.org/" -console-format.js:21 null -console-format.js:22 [null] - 0: null - length: 1 - __proto__: Array(0) -globals[12] -null -console-format.js:21 undefined -console-format.js:22 [undefined] - 0: undefined - length: 1 - __proto__: Array(0) -globals[13] -undefined -console-format.js:21 - attr="" -console-format.js:22 [attr] - 0: attr - length: 1 - __proto__: Array(0) -globals[14] - attr="" -console-format.js:21 - attr="value" -console-format.js:22 [attr] - 0: attr - length: 1 - __proto__: Array(0) -globals[15] - attr="value" -console-format.js:21 - id="x" -console-format.js:22 [id] - 0: id - length: 1 - __proto__: Array(0) -globals[16] - id="x" -console-format.js:21 {} - length: (...) - get length: ƒ length() - __proto__: Object -console-format.js:22 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[17] -{} - length: (...) - get length: ƒ length() - __proto__: Object -console-format.js:21 NaN -console-format.js:22 [NaN] - 0: NaN - length: 1 - __proto__: Array(0) -globals[18] -NaN -console-format.js:21 Infinity -console-format.js:22 [Infinity] - 0: Infinity - length: 1 - __proto__: Array(0) -globals[19] -Infinity -console-format.js:21 -Infinity -console-format.js:22 [-Infinity] - 0: -Infinity - length: 1 - __proto__: Array(0) -globals[20] --Infinity -console-format.js:21 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.js:22 [Array(10)] - 0: (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - length: 1 - __proto__: Array(0) -globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.js:21 {} - __proto__: Object -console-format.js:22 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[22] -{} - __proto__: Object -console-format.js:21 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -console-format.js:22 [Array(1)] - 0: [ƒ] - length: 1 - __proto__: Array(0) -globals[23] -[ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -console-format.js:21 {bar: "bar"} - bar: "bar" - __proto__: Object -console-format.js:22 [{…}] - 0: {bar: "bar"} - length: 1 - __proto__: Array(0) -globals[24] -{bar: "bar"} - bar: "bar" - __proto__: Object -console-format.js:21 - <svg id="svg-node"></svg> -console-format.js:22 [svg#svg-node] - 0: svg#svg-node - length: 1 - __proto__: Array(0) -globals[25] - <svg id="svg-node"></svg> -console-format.js:21 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - enumerableProp: 4 - __underscoreEnumerableProp__: 5 - abc: 3 - bar: (...) - getFoo: ƒ () - __underscoreNonEnumerableProp: 2 - get bar: ƒ () - set bar: ƒ (x) - __proto__: Object -console-format.js:22 [{…}] - 0: {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - length: 1 - __proto__: Array(0) -globals[26] -{enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - enumerableProp: 4 - __underscoreEnumerableProp__: 5 - abc: 3 - bar: (...) - getFoo: ƒ () - __underscoreNonEnumerableProp: 2 - get bar: ƒ () - set bar: ƒ (x) - __proto__: Object -console-format.js:21 -0 -console-format.js:22 [-0] - 0: -0 - length: 1 - __proto__: Array(0) -globals[27] --0 -console-format.js:21 {} - No properties -console-format.js:22 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[28] -{} - No properties -console-format.js:21 ƒ Object() { [native code] } -console-format.js:22 [ƒ] - 0: ƒ Object() - length: 1 - __proto__: Array(0) -globals[29] -ƒ Object() { [native code] } -console-format.js:21 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - constructor: ƒ Object() - hasOwnProperty: ƒ hasOwnProperty() - isPrototypeOf: ƒ isPrototypeOf() - propertyIsEnumerable: ƒ propertyIsEnumerable() - toLocaleString: ƒ toLocaleString() - toString: ƒ toString() - valueOf: ƒ valueOf() - __defineGetter__: ƒ __defineGetter__() - __defineSetter__: ƒ __defineSetter__() - __lookupGetter__: ƒ __lookupGetter__() - __lookupSetter__: ƒ __lookupSetter__() - get __proto__: ƒ __proto__() - set __proto__: ƒ __proto__() -console-format.js:22 [{…}] - 0: {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - length: 1 - __proto__: Array(0) -globals[30] -{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - constructor: ƒ Object() - hasOwnProperty: ƒ hasOwnProperty() - isPrototypeOf: ƒ isPrototypeOf() - propertyIsEnumerable: ƒ propertyIsEnumerable() - toLocaleString: ƒ toLocaleString() - toString: ƒ toString() - valueOf: ƒ valueOf() - __defineGetter__: ƒ __defineGetter__() - __defineSetter__: ƒ __defineSetter__() - __lookupGetter__: ƒ __lookupGetter__() - __lookupSetter__: ƒ __lookupSetter__() - get __proto__: ƒ __proto__() - set __proto__: ƒ __proto__() -console-format.js:21 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.js:22 [ƒ] - 0: ƒ ( /**/ foo/**/, /*/**/bar, /**/baz) - length: 1 - __proto__: Array(0) -globals[31] -ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.js:21 Number {42} - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.js:22 [Number] - 0: Number {42} - length: 1 - __proto__: Array(0) -globals[32] -Number {42} - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.js:21 String {"abc"} - 0: "a" - 1: "b" - 2: "c" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -console-format.js:22 [String] - 0: String {"abc"} - length: 1 - __proto__: Array(0) -globals[33] -String {"abc"} - 0: "a" - 1: "b" - 2: "c" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -console-format.js:21 Uint16Array(3) [1, 2, 3] - 0: 1 - 1: 2 - 2: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.js:22 [Uint16Array(3)] - 0: Uint16Array(3) [1, 2, 3] - length: 1 - __proto__: Array(0) -globals[34] -Uint16Array(3) [1, 2, 3] - 0: 1 - 1: 2 - 2: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.js:21 #text -console-format.js:22 [text] - 0: text - length: 1 - __proto__: Array(0) -globals[35] -#text -console-format.js:21 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.js:22 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] - 0: DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. - length: 1 - __proto__: Array(0) -globals[36] -DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.js:21 Uint8Array [3] - 0: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.js:22 [Uint8Array(1)] - 0: Uint8Array [3] - length: 1 - __proto__: Array(0) -globals[37] -Uint8Array [3] - 0: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.js:21 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99] - [100 … 199] - [200 … 299] - [300 … 399] - foo: "bar" - __proto__: TypedArray -console-format.js:22 [Uint8Array(400)] - 0: Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - length: 1 - __proto__: Array(0) -globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99] - [100 … 199] - [200 … 299] - [300 … 399] - foo: "bar" - __proto__: TypedArray -console-format.js:21 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99999999] - [100000000 … 199999999] - [200000000 … 299999999] - [300000000 … 399999999] - __proto__: TypedArray -console-format.js:22 [Uint8Array(400000000)] - 0: Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - length: 1 - __proto__: Array(0) -globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99999999] - [100000000 … 199999999] - [200000000 … 299999999] - [300000000 … 399999999] - __proto__: TypedArray -console-format.js:21 namespace.longSubNamespace.x.className {} - __proto__: Object -console-format.js:22 [n…e.l…e.x.className] - 0: namespace.longSubNamespace.x.className {} - length: 1 - __proto__: Array(0) -globals[40] -namespace.longSubNamespace.x.className {} - __proto__: Object -console-format.js:21 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - [0 … 99] - [100 … 199] - length: 200 - __proto__: Array(0) -console-format.js:22 [Array(200)] - 0: (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - length: 1 - __proto__: Array(0) -globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - [0 … 99] - [100 … 199] - length: 200 - __proto__: Array(0) -console-format.js:21 ["test"] - 0: "test" - length: 1 - __proto__: Array(0) -console-format.js:22 [Array(1)] - 0: ["test"] - length: 1 - __proto__: Array(0) -globals[42] -["test"] - 0: "test" - length: 1 - __proto__: Array(0) -console-format.js:21 Number {42, 1: "foo", a: "bar"} - 1: "foo" - a: "bar" - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.js:22 [Number] - 0: Number {42, 1: "foo", a: "bar"} - length: 1 - __proto__: Array(0) -globals[43] -Number {42, 1: "foo", a: "bar"} - 1: "foo" - a: "bar" - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.js:21 String {"abc", 3: "foo", 01: "foo", a: "bar"} - 0: "a" - 01: "foo" - 1: "b" - 2: "c" - 3: "foo" - a: "bar" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -console-format.js:22 [String] - 0: String {"abc", 3: "foo", 01: "foo", a: "bar"} - length: 1 - __proto__: Array(0) -globals[44] -String {"abc", 3: "foo", 01: "foo", a: "bar"} - 0: "a" - 01: "foo" - 1: "b" - 2: "c" - 3: "foo" - a: "bar" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -
diff --git a/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/indexeddb/database-refresh-view-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/indexeddb/database-refresh-view-expected.txt deleted file mode 100644 index 0f281a5..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/http/tests/devtools/indexeddb/database-refresh-view-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Tests refreshing the database information and data views. - -Dumping IndexedDB tree: - (empty) -Created database. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - (no object stores) -Created first objectstore. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - Object store: testObjectStore1 - Index: testIndex -Created second objectstore. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - Object store: testObjectStore1 - Index: testIndex - Object store: testObjectStore2 - Index: testIndex -Added testObjectStore1 entry. -Dumping ObjectStore data: - Object store: testObjectStore1 - (no entries) - Object store: testObjectStore2 - (no entries) -Refreshed database view. -Dumping ObjectStore data: - Object store: testObjectStore1 - Key = testKey, value = [object Object] - Object store: testObjectStore2 - (no entries) -Added testObjectStore2 entry. -Dumping ObjectStore data: - Object store: testObjectStore1 - Key = testKey, value = [object Object] - Object store: testObjectStore2 - (no entries) -Right-click refreshed database. -Dumping ObjectStore data: - Object store: testObjectStore1 - Key = testKey, value = [object Object] - Object store: testObjectStore2 - Key = testKey2, value = [object Object] -
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/devtools/console/console-uncaught-promise-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/devtools/console/console-uncaught-promise-expected.txt deleted file mode 100644 index 1c491ab..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/devtools/console/console-uncaught-promise-expected.txt +++ /dev/null
@@ -1,85 +0,0 @@ -CONSOLE ERROR: line 23: Uncaught (in promise) Error: err1 -CONSOLE ERROR: line 44: Uncaught (in promise) Error: err2 -CONSOLE ERROR: line 62: Uncaught (in promise) NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -CONSOLE ERROR: line 68: Uncaught (in promise) 42 -CONSOLE ERROR: line 73: Uncaught (in promise) 1e+100 -CONSOLE ERROR: line 78: Uncaught (in promise) foo -CONSOLE ERROR: line 83: Uncaught (in promise) #<Object> -CONSOLE ERROR: line 88: Uncaught (in promise) undefined -CONSOLE ERROR: Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script. -Tests that uncaught promise rejections are logged into console. - -console-uncaught-promise.html:23 Uncaught (in promise) Error: err1 -promiseTest1 @ console-uncaught-promise.html:23 -timeout @ console-uncaught-promise.html:16 -Promise rejected (async) -promiseTest1 @ console-uncaught-promise.html:26 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:44 Uncaught (in promise) Error: err2 -promiseTest2 @ console-uncaught-promise.html:44 -timeout @ console-uncaught-promise.html:16 -Promise rejected (async) -(anonymous) @ console-uncaught-promise.html:40 -Promise rejected (async) -(anonymous) @ console-uncaught-promise.html:39 -Promise rejected (async) -(anonymous) @ console-uncaught-promise.html:38 -Promise rejected (async) -promiseTest2 @ console-uncaught-promise.html:37 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:62 Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -throwDOMException @ console-uncaught-promise.html:62 -catcher @ console-uncaught-promise.html:54 -Promise rejected (async) -promiseTest3 @ console-uncaught-promise.html:53 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:68 Uncaught (in promise) 42 -promiseTest4 @ console-uncaught-promise.html:68 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:73 Uncaught (in promise) 1e+100 -promiseTest5 @ console-uncaught-promise.html:73 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:78 Uncaught (in promise) foo -promiseTest6 @ console-uncaught-promise.html:78 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:83 Uncaught (in promise) {foo: 42} - foo: 42 - __proto__: Object -promiseTest7 @ console-uncaught-promise.html:83 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -console-uncaught-promise.html:88 Uncaught (in promise) undefined -promiseTest8 @ console-uncaught-promise.html:88 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -A bad HTTP response code (404) was received when fetching the script. -console-uncaught-promise.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script. -Promise (async) -promiseTest9 @ console-uncaught-promise.html:93 -timeout @ console-uncaught-promise.html:16 -setTimeout (async) -runNextPromiseTest @ console-uncaught-promise.html:15 -(anonymous) @ VM:1 -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt deleted file mode 100644 index 1b4bd59f9..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt +++ /dev/null
@@ -1,31 +0,0 @@ -This tests long text in datagrid. -Original lengths -key text length: 1500 -value text length: 1000 - -Test committing a long key -key element is being edited -key text length: 3000 -Blurring the key -Editor value committed. -key text length: 3000 - -Test no-op editing the key -key element is being edited -key text length: 3000 -Blurring the key -key text length: 3000 - -Test committing a long value -value element is being edited -value text length: 3000 -Blurring the value -Editor value committed. -value text length: 1000 - -Test no-op editing the value -value element is being edited -value text length: 3000 -Blurring the value -value text length: 1000 -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt deleted file mode 100644 index 13c13cd..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt +++ /dev/null
@@ -1,62 +0,0 @@ -CONSOLE MESSAGE: line 124: InspectorTest.IndexedDB_callback1 -Tests Application Panel response to a main frame navigation. - -Initial state: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - database-for-test - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -Page reloaded. -After navigation: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/console/console-format-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/console/console-format-expected.txt deleted file mode 100644 index 99da3d48..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/console/console-format-expected.txt +++ /dev/null
@@ -1,816 +0,0 @@ -CONSOLE MESSAGE: line 27: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 28: %o -CONSOLE MESSAGE: line 29: %O -CONSOLE MESSAGE: line 30: Test for zero "%f" in formatter -CONSOLE MESSAGE: line 31: %% self-escape1 -CONSOLE MESSAGE: line 32: %%s self-escape2 -CONSOLE MESSAGE: line 33: %%ss self-escape3 -CONSOLE MESSAGE: line 34: %%s%s%%s self-escape4 -CONSOLE MESSAGE: line 35: %%%%% self-escape5 -CONSOLE MESSAGE: line 36: %%%s self-escape6 -CONSOLE MESSAGE: line 12: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -CONSOLE MESSAGE: line 13: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -CONSOLE MESSAGE: line 12: /foo\\bar\sbaz/i -CONSOLE MESSAGE: line 13: /foo\\bar\sbaz/i -CONSOLE MESSAGE: line 12: test -CONSOLE MESSAGE: line 13: test -CONSOLE MESSAGE: line 12: test named "test" -CONSOLE MESSAGE: line 13: test named "test" -CONSOLE MESSAGE: line 12: Error -CONSOLE MESSAGE: line 13: Error -CONSOLE MESSAGE: line 12: Error: my error message -CONSOLE MESSAGE: line 13: Error: my error message -CONSOLE MESSAGE: line 12: Error: my multiline -error message -CONSOLE MESSAGE: line 13: Error: my multiline -error message -CONSOLE MESSAGE: line 12: [object HTMLParagraphElement] -CONSOLE MESSAGE: line 13: [object HTMLParagraphElement] -CONSOLE MESSAGE: line 12: function () { return 1; } -CONSOLE MESSAGE: line 13: function () { return 1; } -CONSOLE MESSAGE: line 12: function () { - return 2; - } -CONSOLE MESSAGE: line 13: function () { - return 2; - } -CONSOLE MESSAGE: line 12: 0.12 -CONSOLE MESSAGE: line 13: 0.12 -CONSOLE MESSAGE: line 12: http://webkit.org/ -CONSOLE MESSAGE: line 13: http://webkit.org/ -CONSOLE MESSAGE: line 12: null -CONSOLE MESSAGE: line 13: -CONSOLE MESSAGE: line 12: undefined -CONSOLE MESSAGE: line 13: -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Attr] -CONSOLE MESSAGE: line 13: [object Attr] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: NaN -CONSOLE MESSAGE: line 13: NaN -CONSOLE MESSAGE: line 12: Infinity -CONSOLE MESSAGE: line 13: Infinity -CONSOLE MESSAGE: line 12: -Infinity -CONSOLE MESSAGE: line 13: -Infinity -CONSOLE MESSAGE: line 12: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 13: test,test2,,,test4,,,,, -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function () {} -CONSOLE MESSAGE: line 13: function () {} -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: [object SVGSVGElement] -CONSOLE MESSAGE: line 13: [object SVGSVGElement] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: 0 -CONSOLE MESSAGE: line 13: 0 -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function Object() { [native code] } -CONSOLE MESSAGE: line 13: function Object() { [native code] } -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: function ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -CONSOLE MESSAGE: line 13: function ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -CONSOLE MESSAGE: line 12: 42.0000 -CONSOLE MESSAGE: line 13: 42.0000 -CONSOLE MESSAGE: line 12: abc -CONSOLE MESSAGE: line 13: abc -CONSOLE MESSAGE: line 12: [object Uint16Array] -CONSOLE MESSAGE: line 13: [object Uint16Array] -CONSOLE MESSAGE: line 12: [object Text] -CONSOLE MESSAGE: line 13: [object Text] -CONSOLE MESSAGE: line 12: [object DOMException] -CONSOLE MESSAGE: line 13: [object DOMException] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Uint8Array] -CONSOLE MESSAGE: line 13: [object Uint8Array] -CONSOLE MESSAGE: line 12: [object Object] -CONSOLE MESSAGE: line 13: [object Object] -CONSOLE MESSAGE: line 12: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -CONSOLE MESSAGE: line 13: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -CONSOLE MESSAGE: line 12: test -CONSOLE MESSAGE: line 13: test -Tests that console logging dumps proper messages. - - console-format.html:22 Array(10) -console-format.html:23 Array(10) -console-format.html:24 Array(10) -console-format.html:25 Test for zero "0" in formatter -console-format.html:26 % self-escape1 dummy -console-format.html:27 %s self-escape2 dummy -console-format.html:28 %ss self-escape3 dummy -console-format.html:29 %sdummy%s self-escape4 -console-format.html:30 %%% self-escape5 dummy -console-format.html:31 %dummy self-escape6 -console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:8 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] -globals[0] -/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:7 /foo\\bar\sbaz/i -console-format.html:8 [/foo\\bar\sbaz/i] -globals[1] -/foo\\bar\sbaz/i -console-format.html:7 test -console-format.html:8 ["test"] -globals[2] -"test" -console-format.html:7 test named "test" -console-format.html:8 ["test named "test""] -globals[3] -"test named "test"" -console-format.html:7 Error -console-format.html:8 [Error -] -globals[4] -Error -console-format.html:7 Error: my error message -console-format.html:8 [Error: my error message -] -globals[5] -Error: my error message -console-format.html:7 Error: my multiline -error message -console-format.html:8 [Error: my multiline -error message -] -globals[6] -Error: my multiline -error message -console-format.html:7 - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:8 [p#p] -globals[7] - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:7 ƒ () { return 1; } -console-format.html:8 [ƒ] -globals[8] -ƒ () { return 1; } -console-format.html:7 ƒ () { - return 2; - } -console-format.html:8 [ƒ] -globals[9] -ƒ () { - return 2; - } -console-format.html:7 0.12 -console-format.html:8 [0.12] -globals[10] -0.12 -console-format.html:7 http://webkit.org/ -console-format.html:8 ["http://webkit.org/"] -globals[11] -"http://webkit.org/" -console-format.html:7 null -console-format.html:8 [null] -globals[12] -null -console-format.html:7 undefined -console-format.html:8 [undefined] -globals[13] -undefined -console-format.html:7 - attr="" -console-format.html:8 [attr] -globals[14] - attr="" -console-format.html:7 - attr="value" -console-format.html:8 [attr] -globals[15] - attr="value" -console-format.html:7 - id="x" -console-format.html:8 [id] -globals[16] - id="x" -console-format.html:7 {} -console-format.html:8 [{…}] -globals[17] -{} -console-format.html:7 NaN -console-format.html:8 [NaN] -globals[18] -NaN -console-format.html:7 Infinity -console-format.html:8 [Infinity] -globals[19] -Infinity -console-format.html:7 -Infinity -console-format.html:8 [-Infinity] -globals[20] --Infinity -console-format.html:7 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.html:8 [Array(10)] -globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] -console-format.html:7 {} -console-format.html:8 [{…}] -globals[22] -{} -console-format.html:7 [ƒ] -console-format.html:8 [Array(1)] -globals[23] -[ƒ] -console-format.html:7 {bar: "bar"} -console-format.html:8 [{…}] -globals[24] -{bar: "bar"} -console-format.html:7 - <svg id="svg-node"></svg> -console-format.html:8 [svg#svg-node] -globals[25] - <svg id="svg-node"></svg> -console-format.html:7 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.html:8 [{…}] -globals[26] -{enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} -console-format.html:7 -0 -console-format.html:8 [-0] -globals[27] --0 -console-format.html:7 {} -console-format.html:8 [{…}] -globals[28] -{} -console-format.html:7 ƒ Object() { [native code] } -console-format.html:8 [ƒ] -globals[29] -ƒ Object() { [native code] } -console-format.html:7 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.html:8 [{…}] -globals[30] -{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} -console-format.html:7 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:8 [ƒ] -globals[31] -ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:7 Number {[[PrimitiveValue]]: 42} -console-format.html:8 [Number] -globals[32] -Number {[[PrimitiveValue]]: 42} -console-format.html:7 String {[[PrimitiveValue]]: "abc"} -console-format.html:8 [String] -globals[33] -String {[[PrimitiveValue]]: "abc"} -console-format.html:7 Uint16Array(3) [1, 2, 3] -console-format.html:8 [Uint16Array(3)] -globals[34] -Uint16Array(3) [1, 2, 3] -console-format.html:7 #text -console-format.html:8 [text] -globals[35] -#text -console-format.html:7 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:8 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] -globals[36] -DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:7 Uint8Array [3] -console-format.html:8 [Uint8Array(1)] -globals[37] -Uint8Array [3] -console-format.html:7 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:8 [Uint8Array(400)] -globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:7 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:8 [Uint8Array(400000000)] -globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] -console-format.html:7 namespace.longSubNamespace.x.className {} -console-format.html:8 [n…e.l…e.x.className] -globals[40] -namespace.longSubNamespace.x.className {} -console-format.html:7 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.html:8 [Array(200)] -globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] -console-format.html:7 ["test"] -console-format.html:8 [Array(1)] -globals[42] -["test"] -Expanded all messages -console-format.html:22 Array(10) - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.html:23 Array(10) - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.html:24 Array(10) - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.html:25 Test for zero "0" in formatter -console-format.html:26 % self-escape1 dummy -console-format.html:27 %s self-escape2 dummy -console-format.html:28 %ss self-escape3 dummy -console-format.html:29 %sdummy%s self-escape4 -console-format.html:30 %%% self-escape5 dummy -console-format.html:31 %dummy self-escape6 -console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:8 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i] - 0: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i - length: 1 - __proto__: Array(0) -globals[0] -/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i -console-format.html:7 /foo\\bar\sbaz/i -console-format.html:8 [/foo\\bar\sbaz/i] - 0: /foo\\bar\sbaz/i - length: 1 - __proto__: Array(0) -globals[1] -/foo\\bar\sbaz/i -console-format.html:7 test -console-format.html:8 ["test"] - 0: "test" - length: 1 - __proto__: Array(0) -globals[2] -"test" -console-format.html:7 test named "test" -console-format.html:8 ["test named "test""] - 0: "test named "test"" - length: 1 - __proto__: Array(0) -globals[3] -"test named "test"" -console-format.html:7 Error -console-format.html:8 [Error -] - 0: Error - length: 1 - __proto__: Array(0) -globals[4] -Error -console-format.html:7 Error: my error message -console-format.html:8 [Error: my error message -] - 0: Error: my error message - length: 1 - __proto__: Array(0) -globals[5] -Error: my error message -console-format.html:7 Error: my multiline -error message -console-format.html:8 [Error: my multiline -error message -] - 0: Error: my multiline -error message - length: 1 - __proto__: Array(0) -globals[6] -Error: my multiline -error message -console-format.html:7 - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:8 [p#p] - 0: p#p - length: 1 - __proto__: Array(0) -globals[7] - <p id="p">Tests that console logging dumps proper messages.</p> -console-format.html:7 ƒ () { return 1; } -console-format.html:8 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -globals[8] -ƒ () { return 1; } -console-format.html:7 ƒ () { - return 2; - } -console-format.html:8 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -globals[9] -ƒ () { - return 2; - } -console-format.html:7 0.12 -console-format.html:8 [0.12] - 0: 0.12 - length: 1 - __proto__: Array(0) -globals[10] -0.12 -console-format.html:7 http://webkit.org/ -console-format.html:8 ["http://webkit.org/"] - 0: "http://webkit.org/" - length: 1 - __proto__: Array(0) -globals[11] -"http://webkit.org/" -console-format.html:7 null -console-format.html:8 [null] - 0: null - length: 1 - __proto__: Array(0) -globals[12] -null -console-format.html:7 undefined -console-format.html:8 [undefined] - 0: undefined - length: 1 - __proto__: Array(0) -globals[13] -undefined -console-format.html:7 - attr="" -console-format.html:8 [attr] - 0: attr - length: 1 - __proto__: Array(0) -globals[14] - attr="" -console-format.html:7 - attr="value" -console-format.html:8 [attr] - 0: attr - length: 1 - __proto__: Array(0) -globals[15] - attr="value" -console-format.html:7 - id="x" -console-format.html:8 [id] - 0: id - length: 1 - __proto__: Array(0) -globals[16] - id="x" -console-format.html:7 {} - length: (...) - get length: ƒ length() - __proto__: Object -console-format.html:8 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[17] -{} - length: (...) - get length: ƒ length() - __proto__: Object -console-format.html:7 NaN -console-format.html:8 [NaN] - 0: NaN - length: 1 - __proto__: Array(0) -globals[18] -NaN -console-format.html:7 Infinity -console-format.html:8 [Infinity] - 0: Infinity - length: 1 - __proto__: Array(0) -globals[19] -Infinity -console-format.html:7 -Infinity -console-format.html:8 [-Infinity] - 0: -Infinity - length: 1 - __proto__: Array(0) -globals[20] --Infinity -console-format.html:7 (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.html:8 [Array(10)] - 0: (10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - length: 1 - __proto__: Array(0) -globals[21] -(10) ["test", "test2", empty × 2, "test4", empty × 5, foo: {…}] - 0: "test" - 1: "test2" - 4: "test4" - foo: {} - length: 10 - __proto__: Array(0) -console-format.html:7 {} - __proto__: Object -console-format.html:8 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[22] -{} - __proto__: Object -console-format.html:7 [ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -console-format.html:8 [Array(1)] - 0: [ƒ] - length: 1 - __proto__: Array(0) -globals[23] -[ƒ] - 0: ƒ () - length: 1 - __proto__: Array(0) -console-format.html:7 {bar: "bar"} - bar: "bar" - __proto__: Object -console-format.html:8 [{…}] - 0: {bar: "bar"} - length: 1 - __proto__: Array(0) -globals[24] -{bar: "bar"} - bar: "bar" - __proto__: Object -console-format.html:7 - <svg id="svg-node"></svg> -console-format.html:8 [svg#svg-node] - 0: svg#svg-node - length: 1 - __proto__: Array(0) -globals[25] - <svg id="svg-node"></svg> -console-format.html:7 {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - enumerableProp: 4 - __underscoreEnumerableProp__: 5 - abc: 3 - bar: (...) - getFoo: ƒ () - __underscoreNonEnumerableProp: 2 - get bar: ƒ () - set bar: ƒ (x) - __proto__: Object -console-format.html:8 [{…}] - 0: {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - length: 1 - __proto__: Array(0) -globals[26] -{enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3, getFoo: ƒ, …} - enumerableProp: 4 - __underscoreEnumerableProp__: 5 - abc: 3 - bar: (...) - getFoo: ƒ () - __underscoreNonEnumerableProp: 2 - get bar: ƒ () - set bar: ƒ (x) - __proto__: Object -console-format.html:7 -0 -console-format.html:8 [-0] - 0: -0 - length: 1 - __proto__: Array(0) -globals[27] --0 -console-format.html:7 {} - No properties -console-format.html:8 [{…}] - 0: {} - length: 1 - __proto__: Array(0) -globals[28] -{} - No properties -console-format.html:7 ƒ Object() { [native code] } -console-format.html:8 [ƒ] - 0: ƒ Object() - length: 1 - __proto__: Array(0) -globals[29] -ƒ Object() { [native code] } -console-format.html:7 {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - constructor: ƒ Object() - hasOwnProperty: ƒ hasOwnProperty() - isPrototypeOf: ƒ isPrototypeOf() - propertyIsEnumerable: ƒ propertyIsEnumerable() - toLocaleString: ƒ toLocaleString() - toString: ƒ toString() - valueOf: ƒ valueOf() - __defineGetter__: ƒ __defineGetter__() - __defineSetter__: ƒ __defineSetter__() - __lookupGetter__: ƒ __lookupGetter__() - __lookupSetter__: ƒ __lookupSetter__() - get __proto__: ƒ __proto__() - set __proto__: ƒ __proto__() -console-format.html:8 [{…}] - 0: {constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - length: 1 - __proto__: Array(0) -globals[30] -{constructor: ƒ, __defineGetter__: ƒ, __defineSetter__: ƒ, hasOwnProperty: ƒ, __lookupGetter__: ƒ, …} - constructor: ƒ Object() - hasOwnProperty: ƒ hasOwnProperty() - isPrototypeOf: ƒ isPrototypeOf() - propertyIsEnumerable: ƒ propertyIsEnumerable() - toLocaleString: ƒ toLocaleString() - toString: ƒ toString() - valueOf: ƒ valueOf() - __defineGetter__: ƒ __defineGetter__() - __defineSetter__: ƒ __defineSetter__() - __lookupGetter__: ƒ __lookupGetter__() - __lookupSetter__: ƒ __lookupSetter__() - get __proto__: ƒ __proto__() - set __proto__: ƒ __proto__() -console-format.html:7 ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:8 [ƒ] - 0: ƒ ( /**/ foo/**/, /*/**/bar, /**/baz) - length: 1 - __proto__: Array(0) -globals[31] -ƒ ( /**/ foo/**/, /*/**/bar, - /**/baz) {} -console-format.html:7 Number {[[PrimitiveValue]]: 42} - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.html:8 [Number] - 0: Number {[[PrimitiveValue]]: 42} - length: 1 - __proto__: Array(0) -globals[32] -Number {[[PrimitiveValue]]: 42} - __proto__: Number - [[PrimitiveValue]]: 42 -console-format.html:7 String {[[PrimitiveValue]]: "abc"} - 0: "a" - 1: "b" - 2: "c" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -console-format.html:8 [String] - 0: String {[[PrimitiveValue]]: "abc"} - length: 1 - __proto__: Array(0) -globals[33] -String {[[PrimitiveValue]]: "abc"} - 0: "a" - 1: "b" - 2: "c" - length: 3 - __proto__: String - [[PrimitiveValue]]: "abc" -console-format.html:7 Uint16Array(3) [1, 2, 3] - 0: 1 - 1: 2 - 2: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.html:8 [Uint16Array(3)] - 0: Uint16Array(3) [1, 2, 3] - length: 1 - __proto__: Array(0) -globals[34] -Uint16Array(3) [1, 2, 3] - 0: 1 - 1: 2 - 2: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.html:7 #text -console-format.html:8 [text] - 0: text - length: 1 - __proto__: Array(0) -globals[35] -#text -console-format.html:7 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:8 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…] - 0: DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. - length: 1 - __proto__: Array(0) -globals[36] -DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. -console-format.html:7 Uint8Array [3] - 0: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.html:8 [Uint8Array(1)] - 0: Uint8Array [3] - length: 1 - __proto__: Array(0) -globals[37] -Uint8Array [3] - 0: 3 - buffer: (...) - byteLength: (...) - byteOffset: (...) - length: (...) - Symbol(Symbol.toStringTag): (...) - __proto__: TypedArray -console-format.html:7 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99] - [100 … 199] - [200 … 299] - [300 … 399] - foo: "bar" - __proto__: TypedArray -console-format.html:8 [Uint8Array(400)] - 0: Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - length: 1 - __proto__: Array(0) -globals[38] -Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99] - [100 … 199] - [200 … 299] - [300 … 399] - foo: "bar" - __proto__: TypedArray -console-format.html:7 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99999999] - [100000000 … 199999999] - [200000000 … 299999999] - [300000000 … 399999999] - __proto__: TypedArray -console-format.html:8 [Uint8Array(400000000)] - 0: Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - length: 1 - __proto__: Array(0) -globals[39] -Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …] - [0 … 99999999] - [100000000 … 199999999] - [200000000 … 299999999] - [300000000 … 399999999] - __proto__: TypedArray -console-format.html:7 namespace.longSubNamespace.x.className {} - __proto__: Object -console-format.html:8 [n…e.l…e.x.className] - 0: namespace.longSubNamespace.x.className {} - length: 1 - __proto__: Array(0) -globals[40] -namespace.longSubNamespace.x.className {} - __proto__: Object -console-format.html:7 (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - [0 … 99] - [100 … 199] - length: 200 - __proto__: Array(0) -console-format.html:8 [Array(200)] - 0: (200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - length: 1 - __proto__: Array(0) -globals[41] -(200) [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …] - [0 … 99] - [100 … 199] - length: 200 - __proto__: Array(0) -console-format.html:7 ["test"] - 0: "test" - length: 1 - __proto__: Array(0) -console-format.html:8 [Array(1)] - 0: ["test"] - length: 1 - __proto__: Array(0) -globals[42] -["test"] - 0: "test" - length: 1 - __proto__: Array(0) -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt deleted file mode 100644 index 1b4bd59f9..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt +++ /dev/null
@@ -1,31 +0,0 @@ -This tests long text in datagrid. -Original lengths -key text length: 1500 -value text length: 1000 - -Test committing a long key -key element is being edited -key text length: 3000 -Blurring the key -Editor value committed. -key text length: 3000 - -Test no-op editing the key -key element is being edited -key text length: 3000 -Blurring the key -key text length: 3000 - -Test committing a long value -value element is being edited -value text length: 3000 -Blurring the value -Editor value committed. -value text length: 1000 - -Test no-op editing the value -value element is being edited -value text length: 3000 -Blurring the value -value text length: 1000 -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt deleted file mode 100644 index 13c13cd..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt +++ /dev/null
@@ -1,62 +0,0 @@ -CONSOLE MESSAGE: line 124: InspectorTest.IndexedDB_callback1 -Tests Application Panel response to a main frame navigation. - -Initial state: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - database-for-test - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -Page reloaded. -After navigation: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt deleted file mode 100644 index 23b9e95e..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/http/tests/devtools/unit/datagrid-editable-longtext-expected.txt +++ /dev/null
@@ -1,33 +0,0 @@ -This tests long text in datagrid. -Original lengths -key text length: 1500 -value text length: 1000 - -Test committing a long key -key element is being edited -key text length: 3000 -Blurring the key -key element is being edited -key text length: 3000 - -Test no-op editing the key -key element is being edited -key text length: 3000 -Blurring the key -key element is being edited -key text length: 3000 - -Test committing a long value -value element is being edited -value text length: 3000 -Blurring the value -value element is being edited -value text length: 3000 - -Test no-op editing the value -value element is being edited -value text length: 1500 -Blurring the value -value element is being edited -value text length: 1500 -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt deleted file mode 100644 index 81506662..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/application-panel/resources-panel-selection-on-reload-expected.txt +++ /dev/null
@@ -1,64 +0,0 @@ -CONSOLE MESSAGE: line 124: InspectorTest.IndexedDB_callback1 -Tests Application Panel response to a main frame navigation. - -Initial state: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - database-for-test - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - credentials - http://127.0.0.1:8000 - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -Page reloaded. -After navigation: -Application - Manifest - Service Workers - Clear storage -Storage - Local Storage - http://127.0.0.1:8000 - Session Storage - http://127.0.0.1:8000 - IndexedDB - Database1 - http://127.0.0.1:8000 - Web SQL - Cookies - http://127.0.0.1:8000 -Cache - Cache Storage - credentials - http://127.0.0.1:8000 - Application Cache -Frames - top - Scripts - console-test.js - indexeddb-test.js - inspector-test.js - resources-test.js - resources-panel-selection-on-reload.html -Selection: ["cookies://http://127.0.0.1:8000","category://Cookies"] -Visible view is a cookie view: true -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/network/network-columns-visible-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/network/network-columns-visible-expected.txt deleted file mode 100644 index 99fe7a0..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/devtools/network/network-columns-visible-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -Tests to ensure column names are matching data. - -name: empty.html?xhr/devtools/network/resources -method: GET -status: 200OK -protocol: http/1.1 -scheme: http -domain: 127.0.0.1 -remoteaddress: 127.0.0.1:8000 -type: xhr -initiator: network-columns-visible.html:9Script -cookies: -setcookies: -priority: High -cache-control: -connection: -content-encoding: -content-length: 0 -vary: -
diff --git a/third_party/WebKit/LayoutTests/platform/win/http/tests/devtools/indexeddb/database-refresh-view-expected.txt b/third_party/WebKit/LayoutTests/platform/win/http/tests/devtools/indexeddb/database-refresh-view-expected.txt deleted file mode 100644 index 610c52d3..0000000 --- a/third_party/WebKit/LayoutTests/platform/win/http/tests/devtools/indexeddb/database-refresh-view-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -Tests refreshing the database information and data views. - -Dumping IndexedDB tree: - (empty) -Created database. -Dumping IndexedDB tree: - database: Database1 - http://127.0.0.1:8000 - Object store: Store1 - (no indexes) - database: testDatabase - http://127.0.0.1:8000 - (no object stores) -Created first objectstore. -Dumping IndexedDB tree: - database: Database1 - http://127.0.0.1:8000 - Object store: Store1 - (no indexes) - database: testDatabase - http://127.0.0.1:8000 - (no object stores) -Created second objectstore. -Dumping IndexedDB tree: - database: Database1 - http://127.0.0.1:8000 - Object store: Store1 - (no indexes) - database: testDatabase - http://127.0.0.1:8000 - (no object stores) -Error: Promise was collected -
diff --git a/third_party/WebKit/LayoutTests/platform/win7/http/tests/devtools/indexeddb/database-refresh-view-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/http/tests/devtools/indexeddb/database-refresh-view-expected.txt deleted file mode 100644 index 30325ca..0000000 --- a/third_party/WebKit/LayoutTests/platform/win7/http/tests/devtools/indexeddb/database-refresh-view-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Tests refreshing the database information and data views. - -Dumping IndexedDB tree: - (empty) -Created database. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - (no object stores) -Created first objectstore. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - Object store: testObjectStore1 - Index: testIndex -Created second objectstore. -Dumping IndexedDB tree: - database: testDatabase - http://127.0.0.1:8000 - Object store: testObjectStore1 - Index: testIndex - Object store: testObjectStore2 - Index: testIndex -Added testObjectStore1 entry. -Dumping ObjectStore data: - Object store: testObjectStore1 - (no entries) - Object store: testObjectStore2 - (no entries) -Refreshed database view. -Dumping ObjectStore data: - Object store: testObjectStore1 - (no entries) - Object store: testObjectStore2 - (no entries) -Added testObjectStore2 entry. -Dumping ObjectStore data: - Object store: testObjectStore1 - Key = testKey, value = [object Object] - Object store: testObjectStore2 - (no entries) -Right-click refreshed database. -Dumping ObjectStore data: - Object store: testObjectStore1 - Key = testKey, value = [object Object] - Object store: testObjectStore2 - Key = testKey2, value = [object Object] -
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_base.py b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_base.py index fd4e341..4fc54c6 100755 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_base.py +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_base.py
@@ -19,9 +19,9 @@ pass -class CSSPropertyWriter(json5_generator.Writer): +class CSSPropertyBaseWriter(json5_generator.Writer): def __init__(self, json5_file_paths): - super(CSSPropertyWriter, self).__init__([]) + super(CSSPropertyBaseWriter, self).__init__([]) self._input_files = json5_file_paths self._outputs = { 'CSSUnresolvedProperty.h': self.generate_unresolved_property_header, @@ -120,4 +120,4 @@ } if __name__ == '__main__': - json5_generator.Maker(CSSPropertyWriter).main() + json5_generator.Maker(CSSPropertyBaseWriter).main()
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py deleted file mode 100755 index 8d12e14..0000000 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_headers.py +++ /dev/null
@@ -1,158 +0,0 @@ -#!/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. - -import os -import sys -sys.path.append(os.path.join(os.path.dirname(__file__), '../../..')) -import types - -import json5_generator -import template_expander - -from collections import defaultdict, namedtuple -from make_css_property_base import CSSPropertyWriter - - -class PropertyMethod(namedtuple('PropertyMethod', 'name,return_type,parameters')): - pass - - -class CSSPropertyHeadersWriter(CSSPropertyWriter): - def __init__(self, json5_file_paths): - super(CSSPropertyHeadersWriter, self).__init__(json5_file_paths) - assert len(json5_file_paths) == 3,\ - ('CSSPropertyHeadersWriter requires 3 input json5 files, ' + - 'got {}.'.format(len(json5_file_paths))) - - # Map of property method name -> (return_type, parameters) - self._property_methods = {} - property_methods = json5_generator.Json5File.load_from_files( - [json5_file_paths[2]]) - for property_method in property_methods.name_dictionaries: - self._property_methods[property_method['name']] = PropertyMethod( - name=property_method['name'], - return_type=property_method['return_type'], - parameters=property_method['parameters'], - ) - - self._outputs = {} - output_dir = sys.argv[sys.argv.index('--output_dir') + 1] - properties = self.css_properties.longhands - namespace_group = 'Longhand' - if 'shorthands' in output_dir: - properties = self.css_properties.shorthands - namespace_group = 'Shorthand' - for property_ in properties: - property_['property_methods'] = [ - self._property_methods[method_name] - for method_name in property_['property_methods'] - ] - property_['namespace_group'] = namespace_group - class_data = self.get_class(property_) - self.calculate_apply_functions_to_declare(property_) - self.populate_includes(property_) - self._outputs[class_data.classname + '.h'] = ( - self.generate_property_h_builder( - class_data.classname, property_)) - for property_ in self.css_properties.aliases: - if ('shorthands' in output_dir and property_['longhands']) or \ - ('longhands' in output_dir and not property_['longhands']): - class_data = self.get_class(property_) - property_['namespace_group'] = namespace_group - self.populate_includes(property_) - self._outputs[class_data.classname + '.h'] = ( - self.generate_property_h_builder( - class_data.classname, property_)) - - def generate_property_h_builder(self, property_classname, property_): - @template_expander.use_jinja( - 'core/css/properties/templates/CSSPropertySubclass.h.tmpl') - def generate_property_h(): - return { - 'input_files': self._input_files, - 'property_classname': property_classname, - 'property': property_, - } - return generate_property_h - - def calculate_apply_functions_to_declare(self, property_): - # Functions should only be declared on the property classes if they are - # implemented. - property_['should_declare_apply_functions'] = \ - property_['is_property'] \ - and not property_['longhands'] \ - and not property_['direction_aware_options'] \ - and not property_['builder_skip'] - if property_['custom_apply_functions_all']: - property_name = property_['upper_camel_name'] - if (property_name in - ['Clip', 'ColumnCount', 'ColumnWidth', 'ZIndex']): - property_['custom_apply'] = "auto" - property_['custom_apply_args'] = {'auto_identity': 'CSSValueAuto'} - if property_name == 'ColumnGap': - property_['custom_apply'] = "auto" - property_['custom_apply_args'] = { - 'auto_getter': 'HasNormalColumnGap', - 'auto_setter': 'SetHasNormalColumnGap', - 'auto_identity': 'CSSValueNormal'} - if (property_name in - ['BorderImageOutset', 'BorderImageRepeat', - 'BorderImageSlice', 'BorderImageWidth', - 'WebkitMaskBoxImageOutset', 'WebkitMaskBoxImageRepeat', - 'WebkitMaskBoxImageSlice', 'WebkitMaskBoxImageWidth']): - property_['custom_apply'] = 'border_image' - is_mask_box = 'WebkitMaskBox' in property_name - getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' - modifier_type = property_name[len('WebkitMaskBoxImage'):] if is_mask_box else property_name[len('BorderImage'):] - property_['custom_apply_args'] = { - 'is_mask_box': is_mask_box, - 'modifier_type': modifier_type, - 'getter': getter, - 'setter': 'Set' + getter - } - property_['should_implement_apply_functions'] = ( - property_['should_declare_apply_functions'] and - (not (property_['custom_apply_functions_initial'] and - property_['custom_apply_functions_inherit'] and - property_['custom_apply_functions_value']) or - 'custom_apply' in property_.keys())) - - def populate_includes(self, property_): - includes = [] - if property_['alias_for']: - includes.append("core/css/properties/CSSUnresolvedProperty.h") - else: - includes.append("core/css/properties/" + property_['namespace_group'] + ".h") - if property_['direction_aware_options']: - includes.append("core/StylePropertyShorthand.h") - if property_['runtime_flag']: - includes.append("platform/runtime_enabled_features.h") - if property_['should_implement_apply_functions']: - includes.append("core/css/resolver/StyleResolverState.h") - if property_['converter'] == "CSSPrimitiveValue": - includes.append("core/css/CSSPrimitiveValue.h") - includes.append("core/css/CSSPrimitiveValueMappings.h") - elif property_['converter'] == "CSSIdentifierValue": - includes.append("core/css/CSSIdentifierValue.h") - elif property_['converter']: - includes.append("core/css/CSSPrimitiveValueMappings.h") - includes.append("core/css/resolver/StyleBuilderConverter.h") - if property_['font']: - includes.append("core/css/resolver/FontBuilder.h") - elif property_['svg']: - includes.append("core/css/CSSPrimitiveValueMappings.h") - includes.append("core/style/ComputedStyle.h") - includes.append("core/style/SVGComputedStyle.h") - else: - includes.append("core/style/ComputedStyle.h") - if (property_.get('custom_apply_args') and - property_.get('custom_apply_args').get('modifier_type') - in ['Width', 'Slice', 'Outset']): - includes.append("core/css/properties/StyleBuildingUtils.h") - includes.sort() - property_['includes'] = includes - -if __name__ == '__main__': - json5_generator.Maker(CSSPropertyHeadersWriter).main()
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_subclasses.py b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_subclasses.py new file mode 100755 index 0000000..9267d1b --- /dev/null +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/make_css_property_subclasses.py
@@ -0,0 +1,187 @@ +#!/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. + +import os +import sys +sys.path.append(os.path.join(os.path.dirname(__file__), '../../..')) + +import json5_generator +import template_expander + +from collections import namedtuple +from make_css_property_base import CSSPropertyBaseWriter + + +class PropertyMethod(namedtuple('PropertyMethod', 'name,return_type,parameters')): + pass + + +class CSSPropertiesWriter(CSSPropertyBaseWriter): + def __init__(self, json5_file_paths): + super(CSSPropertiesWriter, self).__init__(json5_file_paths) + assert len(json5_file_paths) == 3,\ + ('CSSPropertiesWriter requires 3 input json5 files, ' + + 'got {}.'.format(len(json5_file_paths))) + + # Map of property method name -> (return_type, parameters) + self._property_methods = {} + property_methods = json5_generator.Json5File.load_from_files( + [json5_file_paths[2]]) + for property_method in property_methods.name_dictionaries: + self._property_methods[property_method['name']] = PropertyMethod( + name=property_method['name'], + return_type=property_method['return_type'], + parameters=property_method['parameters'], + ) + + self._outputs = {} + output_dir = sys.argv[sys.argv.index('--output_dir') + 1] + properties = self.css_properties.longhands + namespace_group = 'Longhand' + if 'shorthands' in output_dir: + properties = self.css_properties.shorthands + namespace_group = 'Shorthand' + for property_ in properties: + property_['property_methods'] = [ + self._property_methods[method_name] + for method_name in property_['property_methods'] + ] + property_['namespace_group'] = namespace_group + class_data = self.get_class(property_) + self.calculate_apply_functions_to_declare(property_) + self._outputs[class_data.classname + '.h'] = ( + self.generate_property_h_builder( + class_data.classname, property_)) + if 'should_implement_apply_functions_in_cpp' in property_: + self._outputs[class_data.classname + '.cpp'] = ( + self.generate_property_cpp_builder( + class_data.classname, property_)) + for property_ in self.css_properties.aliases: + if ('shorthands' in output_dir and property_['longhands']) or \ + ('longhands' in output_dir and not property_['longhands']): + class_data = self.get_class(property_) + property_['namespace_group'] = namespace_group + self._outputs[class_data.classname + '.h'] = ( + self.generate_property_h_builder( + class_data.classname, property_)) + + def generate_property_h_builder(self, property_classname, property_): + @template_expander.use_jinja( + 'core/css/properties/templates/CSSPropertySubclass.h.tmpl') + def generate_property_h(): + return { + 'input_files': self._input_files, + 'property_classname': property_classname, + 'property': property_, + 'includes': sorted(list(self.h_includes(property_))) + } + return generate_property_h + + def generate_property_cpp_builder(self, property_classname, property_): + @template_expander.use_jinja( + 'core/css/properties/templates/CSSPropertySubclass.cpp.tmpl') + def generate_property_cpp(): + return { + 'input_files': self._input_files, + 'property_classname': property_classname, + 'property': property_, + 'includes': sorted(list(self.cpp_includes(property_))) + } + return generate_property_cpp + + def calculate_apply_functions_to_declare(self, property_): + if property_['custom_apply_functions_all']: + property_name = property_['upper_camel_name'] + if (property_name in ['Clip', 'ColumnCount', 'ColumnWidth', 'ZIndex']): + property_['custom_apply'] = "auto" + property_['custom_apply_args'] = {'auto_identity': 'CSSValueAuto'} + elif property_name == 'ColumnGap': + property_['custom_apply'] = "auto" + property_['custom_apply_args'] = { + 'auto_getter': 'HasNormalColumnGap', + 'auto_setter': 'SetHasNormalColumnGap', + 'auto_identity': 'CSSValueNormal'} + elif (property_name in [ + 'BorderImageOutset', 'BorderImageRepeat', 'BorderImageSlice', 'BorderImageWidth', 'WebkitMaskBoxImageOutset', + 'WebkitMaskBoxImageRepeat', 'WebkitMaskBoxImageSlice', 'WebkitMaskBoxImageWidth']): + property_['custom_apply'] = 'border_image' + is_mask_box = 'WebkitMaskBox' in property_name + getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' + modifier_type = property_name[len('WebkitMaskBoxImage'):] if is_mask_box else property_name[len('BorderImage'):] + property_['custom_apply_args'] = { + 'is_mask_box': is_mask_box, + 'modifier_type': modifier_type, + 'getter': getter, + 'setter': 'Set' + getter + } + elif (property_name in [ + 'BackgroundAttachment', 'BackgroundBlendMode', 'BackgroundClip', 'BackgroundImage', 'BackgroundOrigin', + 'BackgroundPositionX', 'BackgroundPositionY', 'BackgroundRepeatX', 'BackgroundRepeatY', 'BackgroundSize', + 'MaskSourceType', 'WebkitMaskClip', 'WebkitMaskComposite', 'WebkitMaskImage', 'WebkitMaskOrigin', + 'WebkitMaskPositionX', 'WebkitMaskPositionY', 'WebkitMaskRepeatX', 'WebkitMaskRepeatY', 'WebkitMaskSize']): + fill_type = property_name if property_name == 'MaskSourceType' else property_name[len('Background'):] + property_['custom_apply'] = 'fill_layer' + property_['should_implement_apply_functions_in_cpp'] = True + property_['custom_apply_args'] = { + 'layer_type': 'Background' if 'Background' in property_name else 'Mask', + 'fill_type': fill_type, + 'fill_type_getter': 'Get' + fill_type if fill_type == "Image" else fill_type + } + property_['should_implement_apply_functions'] = ( + property_['is_property'] and + not property_['longhands'] and + not property_['direction_aware_options'] and + not property_['builder_skip'] and + (not (property_['custom_apply_functions_initial'] and + property_['custom_apply_functions_inherit'] and + property_['custom_apply_functions_value']) or + 'custom_apply' in property_)) + + def h_includes(self, property_): + if property_['alias_for']: + yield "core/css/properties/CSSUnresolvedProperty.h" + else: + yield "core/css/properties/" + property_['namespace_group'] + ".h" + if property_['direction_aware_options']: + yield "core/StylePropertyShorthand.h" + if property_['runtime_flag']: + yield "platform/runtime_enabled_features.h" + if property_['should_implement_apply_functions']: + for include in self.apply_includes(property_): + yield include + + def cpp_includes(self, property_): + if 'should_implement_apply_functions_in_cpp' in property_: + for include in self.apply_includes(property_): + yield include + + def apply_includes(self, property_): + yield "core/css/resolver/StyleResolverState.h" + if property_['converter'] == "CSSPrimitiveValue": + yield "core/css/CSSPrimitiveValue.h" + yield "core/css/CSSPrimitiveValueMappings.h" + elif property_['converter'] == "CSSIdentifierValue": + yield "core/css/CSSIdentifierValue.h" + else: + yield "core/css/CSSPrimitiveValueMappings.h" + yield "core/css/resolver/StyleBuilderConverter.h" + if property_['font']: + yield "core/css/resolver/FontBuilder.h" + elif property_['svg']: + yield "core/css/CSSPrimitiveValueMappings.h" + yield "core/style/ComputedStyle.h" + yield "core/style/SVGComputedStyle.h" + else: + yield "core/style/ComputedStyle.h" + if ('custom_apply_args' in property_ and + property_['custom_apply_args'].get('modifier_type') + in ['Width', 'Slice', 'Outset']): + yield "core/css/properties/StyleBuildingUtils.h" + if property_.get('custom_apply') == "fill_layer": + yield "core/css/CSSValueList.h" + + +if __name__ == '__main__': + json5_generator.Maker(CSSPropertiesWriter).main()
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.cpp.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.cpp.tmpl new file mode 100644 index 0000000..ed4e6fe --- /dev/null +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.cpp.tmpl
@@ -0,0 +1,74 @@ +// 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. + +{% from 'core/css/properties/templates/style_builder_functions.tmpl' import declare_initial, declare_inherit, declare_value %} +{% from 'templates/macros.tmpl' import source_files_for_generated_file %} +{{source_files_for_generated_file(template_file, input_files)}} + +#include "core/css/properties/{{property.namespace_group.lower()}}s/{{property_classname}}.h" + +{% for include in includes %} +#include "{{include}}" +{% endfor %} + +namespace blink { +namespace CSSLonghand { + +{% if property.custom_apply == "fill_layer" %} +{% set layer_type = property.custom_apply_args['layer_type'] %} +{% set fill_type = property.custom_apply_args['fill_type'] %} +{{declare_initial(property.upper_camel_name)}} { + FillLayer* currChild = &state.Style()->Access{{layer_type}}Layers(); + currChild->Set{{fill_type}}(FillLayer::InitialFill{{fill_type}}(EFillLayerType::k{{layer_type}})); + for (currChild = currChild->Next(); currChild; currChild = currChild->Next()) + currChild->Clear{{fill_type}}(); +} + +{{declare_inherit(property.upper_camel_name)}} { + FillLayer* currChild = &state.Style()->Access{{layer_type}}Layers(); + FillLayer* prevChild = 0; + const FillLayer* currParent = &state.ParentStyle()->{{layer_type}}Layers(); + while (currParent && currParent->Is{{fill_type}}Set()) { + if (!currChild) + currChild = prevChild->EnsureNext(); + currChild->Set{{fill_type}}(currParent->{{property.custom_apply_args['fill_type_getter']}}()); + prevChild = currChild; + currChild = prevChild->Next(); + currParent = currParent->Next(); + } + + while (currChild) { + // Reset any remaining layers to not have the property set. + currChild->Clear{{fill_type}}(); + currChild = currChild->Next(); + } +} + +{{declare_value(property.upper_camel_name)}} { + FillLayer* currChild = &state.Style()->Access{{layer_type}}Layers(); + FillLayer* prevChild = 0; + if (value.IsValueList() && !value.IsImageSetValue()) { + // Walk each value and put it into a layer, creating new layers as needed. + const CSSValueList& valueList = ToCSSValueList(value); + for (unsigned int i = 0; i < valueList.length(); i++) { + if (!currChild) + currChild = prevChild->EnsureNext(); + CSSToStyleMap::MapFill{{fill_type}}(state, currChild, valueList.Item(i)); + prevChild = currChild; + currChild = currChild->Next(); + } + } else { + CSSToStyleMap::MapFill{{fill_type}}(state, currChild, value); + currChild = currChild->Next(); + } + while (currChild) { + // Reset all remaining layers to not have the property set. + currChild->Clear{{fill_type}}(); + currChild = currChild->Next(); + } +} +{% endif %} + +} // namespace CSSLonghand +} // namespace blink
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl index 6789fe1..964f902 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl
@@ -9,14 +9,11 @@ #ifndef GEN_BLINK_CORE_CSS_PROPERTIES_{{property.namespace_group.upper()}}_{{property_classname}}_h #define GEN_BLINK_CORE_CSS_PROPERTIES_{{property.namespace_group.upper()}}_{{property_classname}}_h -{% for include in property.includes %} +{% for include in includes %} #include "{{include}}" {% endfor %} namespace blink { - -class CSSValue; - namespace CSS{{property.namespace_group}} { {% if property.is_property %}
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl index d533ace..36b37a9 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/style_builder_functions.tmpl
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -{% macro declare_initial() %} -void ApplyInitial(StyleResolverState& state) const override { +{% macro declare_initial(prefix = None) %} +void {{prefix ~ '::' if prefix}}ApplyInitial(StyleResolverState& state) const{{' override' if not prefix}} {%- endmacro %} -{% macro declare_inherit() %} -void ApplyInherit(StyleResolverState& state) const override { +{% macro declare_inherit(prefix = None) %} +void {{prefix ~ '::' if prefix}}ApplyInherit(StyleResolverState& state) const{{' override' if not prefix}} {%- endmacro %} -{% macro declare_value() %} -void ApplyValue(StyleResolverState& state, const CSSValue& value) const override { +{% macro declare_value(prefix = None) %} +void {{prefix ~ '::' if prefix}}ApplyValue(StyleResolverState& state, const CSSValue& value) const{{' override' if not prefix}} {%- endmacro %} {% macro set_value(property) %} @@ -33,145 +33,152 @@ {% endmacro %} {% macro style_builder_functions(property) %} - {% if not property.custom_apply_functions_initial %} - {{declare_initial()}} - {% if property.svg %} + {% if property.should_implement_apply_functions_in_cpp %} + {# declaration only #} + {{declare_initial()}}; + {{declare_inherit()}}; + {{declare_value()}}; + {% else %} + {# full implementation #} + {% if not property.custom_apply_functions_initial %} + {{declare_initial()}} { + {% if property.svg %} {{set_value(property)}}(SVGComputedStyle::{{property.initial}}()); - {% elif property.font %} + {% elif property.font %} {{set_value(property)}}(FontBuilder::{{property.initial}}()); - {% else %} + {% else %} {{set_value(property)}}(ComputedStyleInitialValues::{{property.initial}}()); - {% endif %} - {% if property.independent %} - state.Style()->{{property.is_inherited_setter}}(false); - {% endif %} - } - {% endif %} - {% if not property.custom_apply_functions_inherit %} - {{declare_inherit()}} - {% if property.svg %} - {{set_value(property)}}(state.ParentStyle()->SvgStyle().{{property.getter}}()); - {% elif property.font %} - {{set_value(property)}}(state.ParentFontDescription().{{property.getter}}()); - {% else %} - {{set_value(property)}}(state.ParentStyle()->{{property.getter}}()); - {% endif %} - {% if property.independent %} - state.Style()->{{property.is_inherited_setter}}(true); - {% endif %} - } - {% endif %} - {% if not property.custom_apply_functions_value %} - {{declare_value()}} - {{convert_and_set_value(property)}} + {% endif %} {% if property.independent %} state.Style()->{{property.is_inherited_setter}}(false); {% endif %} } - {% endif %} - {% if property.custom_apply == "auto" %} - {% set auto_getter = property.custom_apply_args['auto_getter'] or + {% endif %} + {% if not property.custom_apply_functions_inherit %} + {{declare_inherit()}} { + {% if property.svg %} + {{set_value(property)}}(state.ParentStyle()->SvgStyle().{{property.getter}}()); + {% elif property.font %} + {{set_value(property)}}(state.ParentFontDescription().{{property.getter}}()); + {% else %} + {{set_value(property)}}(state.ParentStyle()->{{property.getter}}()); + {% endif %} + {% if property.independent %} + state.Style()->{{property.is_inherited_setter}}(true); + {% endif %} + } + {% endif %} + {% if not property.custom_apply_functions_value %} + {{declare_value()}} { + {{convert_and_set_value(property)}} + {% if property.independent %} + state.Style()->{{property.is_inherited_setter}}(false); + {% endif %} + } + {% endif %} + {% if property.custom_apply == "auto" %} + {% set auto_getter = property.custom_apply_args['auto_getter'] or 'HasAuto' + property.name_for_methods %} - {% set auto_setter = property.custom_apply_args['auto_setter'] or + {% set auto_setter = property.custom_apply_args['auto_setter'] or 'SetHasAuto' + property.name_for_methods %} - {% set auto_identity = property.custom_apply_args['auto_identity'] or + {% set auto_identity = property.custom_apply_args['auto_identity'] or 'CSSValueAuto' %} - {{declare_initial()}} + {{declare_initial()}} { state.Style()->{{auto_setter}}(); } - {{declare_inherit()}} + {{declare_inherit()}} { if (state.ParentStyle()->{{auto_getter}}()) state.Style()->{{auto_setter}}(); else {{set_value(property)}}(state.ParentStyle()->{{property.getter}}()); } - {{declare_value()}} + {{declare_value()}} { if (value.IsIdentifierValue() && ToCSSIdentifierValue(value).GetValueID() == {{auto_identity}}) state.Style()->{{auto_setter}}(); else {{convert_and_set_value(property)}} } - {% elif property.custom_apply == "border_image" %} - {% set is_mask_box = property.custom_apply_args['is_mask_box'] %} - {% set modifier_type = property.custom_apply_args['modifier_type'] %} - {% set getter = property.custom_apply_args['getter'] %} - {% set setter = property.custom_apply_args['setter'] %} - {{declare_initial()}} + {% elif property.custom_apply == "border_image" %} + {% set is_mask_box = property.custom_apply_args['is_mask_box'] %} + {% set modifier_type = property.custom_apply_args['modifier_type'] %} + {% set getter = property.custom_apply_args['getter'] %} + {% set setter = property.custom_apply_args['setter'] %} + {{declare_initial()}} { const NinePieceImage& currentImage = state.Style()->{{getter}}(); {# Check for equality in case we can bail out before creating a new NinePieceImage. #} - {% if modifier_type == 'Outset' %} + {% if modifier_type == 'Outset' %} if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.Outset(), BorderImageLength(Length(0, kFixed)))) return; - {% elif modifier_type == 'Repeat' %} + {% elif modifier_type == 'Repeat' %} if (currentImage.HorizontalRule() == kStretchImageRule && currentImage.VerticalRule() == kStretchImageRule) return; - {% elif modifier_type == 'Slice' and is_mask_box %} + {% elif modifier_type == 'Slice' and is_mask_box %} // Masks have a different initial value for slices. Preserve the value of 0 // for backwards compatibility. if (currentImage.Fill() == true && StyleBuildingUtils::lengthMatchesAllSides(currentImage.ImageSlices(), Length(0, kFixed))) return; - {% elif modifier_type == 'Slice' and not is_mask_box %} + {% elif modifier_type == 'Slice' and not is_mask_box %} if (currentImage.Fill() == false && StyleBuildingUtils::lengthMatchesAllSides(currentImage.ImageSlices(), Length(100, kPercent))) return; - {% elif modifier_type == 'Width' and is_mask_box %} + {% elif modifier_type == 'Width' and is_mask_box %} // Masks have a different initial value for widths. Preserve the value of // 'auto' for backwards compatibility. if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.BorderSlices(), BorderImageLength(Length(kAuto)))) return; - {% elif modifier_type == 'Width' and not is_mask_box %} + {% elif modifier_type == 'Width' and not is_mask_box %} if (StyleBuildingUtils::borderImageLengthMatchesAllSides(currentImage.BorderSlices(), BorderImageLength(1.0))) return; - {% endif %} + {% endif %} NinePieceImage image(currentImage); - {% if modifier_type == 'Outset' %} + {% if modifier_type == 'Outset' %} image.SetOutset(Length(0, kFixed)); - {% elif modifier_type == 'Repeat' %} + {% elif modifier_type == 'Repeat' %} image.SetHorizontalRule(kStretchImageRule); image.SetVerticalRule(kStretchImageRule); - {% elif modifier_type == 'Slice' and is_mask_box %} + {% elif modifier_type == 'Slice' and is_mask_box %} image.SetImageSlices(LengthBox({{ (['Length(0, kFixed)']*4) | join(', ') }})); image.SetFill(true); - {% elif modifier_type == 'Slice' and not is_mask_box %} + {% elif modifier_type == 'Slice' and not is_mask_box %} image.SetImageSlices(LengthBox({{ (['Length(100, kPercent)']*4) | join(', ') }})); image.SetFill(false); - {% elif modifier_type == 'Width' %} + {% elif modifier_type == 'Width' %} image.SetBorderSlices({{ 'Length(kAuto)' if is_mask_box else '1.0' }}); - {% endif %} + {% endif %} state.Style()->{{setter}}(image); } - {{declare_inherit()}} + {{declare_inherit()}} { NinePieceImage image(state.Style()->{{getter}}()); - {% if modifier_type == 'Outset' %} + {% if modifier_type == 'Outset' %} image.CopyOutsetFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Repeat' %} + {% elif modifier_type == 'Repeat' %} image.CopyRepeatFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Slice' %} + {% elif modifier_type == 'Slice' %} image.CopyImageSlicesFrom(state.ParentStyle()->{{getter}}()); - {% elif modifier_type == 'Width' %} + {% elif modifier_type == 'Width' %} image.CopyBorderSlicesFrom(state.ParentStyle()->{{getter}}()); - {% endif %} + {% endif %} state.Style()->{{setter}}(image); } - {{declare_value()}} + {{declare_value()}} { NinePieceImage image(state.Style()->{{getter}}()); - {% if modifier_type == 'Outset' %} + {% if modifier_type == 'Outset' %} image.SetOutset(CSSToStyleMap::MapNinePieceImageQuad(state, value)); - {% elif modifier_type == 'Repeat' %} + {% elif modifier_type == 'Repeat' %} CSSToStyleMap::MapNinePieceImageRepeat(state, value, image); - {% elif modifier_type == 'Slice' %} + {% elif modifier_type == 'Slice' %} CSSToStyleMap::MapNinePieceImageSlice(state, value, image); - {% elif modifier_type == 'Width' %} + {% elif modifier_type == 'Width' %} image.SetBorderSlices(CSSToStyleMap::MapNinePieceImageQuad(state, value)); - {% endif %} + {% endif %} state.Style()->{{setter}}(image); } - {% endif %} - {# TODO(crbug.com/751354): emit function declaration only for larger functions #} + {% endif %} + {%- endif %} {%- endmacro %}
diff --git a/third_party/WebKit/Source/build/scripts/make_style_builder.py b/third_party/WebKit/Source/build/scripts/make_style_builder.py index ddb6b5e..fe45731b 100755 --- a/third_party/WebKit/Source/build/scripts/make_style_builder.py +++ b/third_party/WebKit/Source/build/scripts/make_style_builder.py
@@ -50,12 +50,14 @@ # TODO(crbug.com/751354): Remove this hard coded list of supported # properties once all of them have been implemented if property_['custom_apply_functions_all']: - if (property_['upper_camel_name'] in - ['BorderImageOutset', 'BorderImageRepeat', 'BorderImageSlice', - 'BorderImageWidth', 'Clip', 'ColumnCount', 'ColumnGap', - 'ColumnWidth', 'WebkitMaskBoxImageOutset', - 'WebkitMaskBoxImageRepeat', 'WebkitMaskBoxImageSlice', - 'WebkitMaskBoxImageWidth', 'ZIndex']): + if (property_['upper_camel_name'] in [ + 'BackgroundAttachment', 'BackgroundBlendMode', 'BackgroundClip', 'BackgroundImage', 'BackgroundOrigin', + 'BackgroundPositionX', 'BackgroundPositionY', 'BackgroundRepeatX', 'BackgroundRepeatY', 'BackgroundSize', + 'BorderImageOutset', 'BorderImageRepeat', 'BorderImageSlice', 'BorderImageWidth', 'Clip', 'ColumnCount', + 'ColumnGap', 'ColumnWidth', 'MaskSourceType', 'WebkitMaskBoxImageOutset', 'WebkitMaskBoxImageRepeat', + 'WebkitMaskBoxImageSlice', 'WebkitMaskBoxImageWidth', 'WebkitMaskClip', 'WebkitMaskComposite', 'WebkitMaskImage', + 'WebkitMaskOrigin', 'WebkitMaskPositionX', 'WebkitMaskPositionY', 'WebkitMaskRepeatX', 'WebkitMaskRepeatY', + 'WebkitMaskSize', 'ZIndex']): property_['use_property_class_in_stylebuilder'] = True
diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl index 34a794e..f90a511 100644 --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -217,84 +217,6 @@ {{apply_counter('CSSPropertyCounterIncrement', 'Increment')}} {{apply_counter('CSSPropertyCounterReset', 'Reset')}} -{% macro apply_fill_layer(property_id, fill_type, fill_type_getter = None) %} -{% set layer_type = 'Background' if 'Background' in property_id else 'Mask' %} -{% set fill_layer_type = 'EFillLayerType::k' + layer_type %} -{% set access_layers = 'Access' + layer_type + 'Layers' %} -{% set map_fill = 'MapFill' + fill_type %} -{% set fill_type_getter = fill_type_getter or fill_type %} -{{declare_initial_function(property_id)}} { -FillLayer* currChild = &state.Style()->{{access_layers}}(); -currChild->Set{{fill_type}}(FillLayer::InitialFill{{fill_type}}({{fill_layer_type}})); -for (currChild = currChild->Next(); currChild; currChild = currChild->Next()) - currChild->Clear{{fill_type}}(); -} - -{{declare_inherit_function(property_id)}} { -FillLayer* currChild = &state.Style()->{{access_layers}}(); -FillLayer* prevChild = 0; -const FillLayer* currParent = &state.ParentStyle()->{{layer_type}}Layers(); -while (currParent && currParent->Is{{fill_type}}Set()) { - if (!currChild) - currChild = prevChild->EnsureNext(); - currChild->Set{{fill_type}}(currParent->{{fill_type_getter}}()); - prevChild = currChild; - currChild = prevChild->Next(); - currParent = currParent->Next(); - } - - while (currChild) { - // Reset any remaining layers to not have the property set. - currChild->Clear{{fill_type}}(); - currChild = currChild->Next(); - } -} - -{{declare_value_function(property_id)}} { - FillLayer* currChild = &state.Style()->{{access_layers}}(); - FillLayer* prevChild = 0; - if (value.IsValueList() && !value.IsImageSetValue()) { - // Walk each value and put it into a layer, creating new layers as needed. - const CSSValueList& valueList = ToCSSValueList(value); - for (unsigned int i = 0; i < valueList.length(); i++) { - if (!currChild) - currChild = prevChild->EnsureNext(); - CSSToStyleMap::{{map_fill}}(state, currChild, valueList.Item(i)); - prevChild = currChild; - currChild = currChild->Next(); - } - } else { - CSSToStyleMap::{{map_fill}}(state, currChild, value); - currChild = currChild->Next(); - } - while (currChild) { - // Reset all remaining layers to not have the property set. - currChild->Clear{{fill_type}}(); - currChild = currChild->Next(); - } -} -{% endmacro %} -{{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} -{{apply_fill_layer('CSSPropertyBackgroundBlendMode', 'BlendMode')}} -{{apply_fill_layer('CSSPropertyBackgroundClip', 'Clip')}} -{{apply_fill_layer('CSSPropertyBackgroundImage', 'Image', 'GetImage')}} -{{apply_fill_layer('CSSPropertyBackgroundOrigin', 'Origin')}} -{{apply_fill_layer('CSSPropertyBackgroundPositionX', 'PositionX')}} -{{apply_fill_layer('CSSPropertyBackgroundPositionY', 'PositionY')}} -{{apply_fill_layer('CSSPropertyBackgroundRepeatX', 'RepeatX')}} -{{apply_fill_layer('CSSPropertyBackgroundRepeatY', 'RepeatY')}} -{{apply_fill_layer('CSSPropertyBackgroundSize', 'Size', 'Size')}} -{{apply_fill_layer('CSSPropertyMaskSourceType', 'MaskSourceType')}} -{{apply_fill_layer('CSSPropertyWebkitMaskClip', 'Clip')}} -{{apply_fill_layer('CSSPropertyWebkitMaskComposite', 'Composite')}} -{{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image', 'GetImage')}} -{{apply_fill_layer('CSSPropertyWebkitMaskOrigin', 'Origin')}} -{{apply_fill_layer('CSSPropertyWebkitMaskPositionX', 'PositionX')}} -{{apply_fill_layer('CSSPropertyWebkitMaskPositionY', 'PositionY')}} -{{apply_fill_layer('CSSPropertyWebkitMaskRepeatX', 'RepeatX')}} -{{apply_fill_layer('CSSPropertyWebkitMaskRepeatY', 'RepeatY')}} -{{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size', 'Size')}} - {% macro apply_grid_template(property_id, type) %} {{declare_initial_function(property_id)}} { state.Style()->SetGridTemplate{{type}}s(ComputedStyleInitialValues::InitialGridTemplate{{type}}s());
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index 8a2e042..4e2bb1d4 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -544,10 +544,12 @@ # FIXME: Need a better way to specify generated output files css_properties("make_core_generated_css_longhand_property_classes") { - script = "../build/scripts/core/css/properties/make_css_property_headers.py" + script = + "../build/scripts/core/css/properties/make_css_property_subclasses.py" in_files = [ "css/properties/CSSPropertyMethods.json5" ] other_inputs = [ "../build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl", + "../build/scripts/core/css/properties/templates/CSSPropertySubclass.cpp.tmpl", ] outputs = [ "$blink_core_output_dir/css/properties/longhands/AlignContent.h", @@ -566,16 +568,26 @@ "$blink_core_output_dir/css/properties/longhands/BackdropFilter.h", "$blink_core_output_dir/css/properties/longhands/BackfaceVisibility.h", "$blink_core_output_dir/css/properties/longhands/BackgroundAttachment.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundAttachment.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundBlendMode.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundBlendMode.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundClip.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundClip.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundColor.h", "$blink_core_output_dir/css/properties/longhands/BackgroundImage.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundImage.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundOrigin.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundOrigin.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundPositionX.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundPositionX.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundPositionY.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundPositionY.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundRepeatX.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundRepeatX.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundRepeatY.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundRepeatY.cpp", "$blink_core_output_dir/css/properties/longhands/BackgroundSize.h", + "$blink_core_output_dir/css/properties/longhands/BackgroundSize.cpp", "$blink_core_output_dir/css/properties/longhands/BaselineShift.h", "$blink_core_output_dir/css/properties/longhands/BlockSize.h", "$blink_core_output_dir/css/properties/longhands/BorderBottomColor.h", @@ -710,6 +722,7 @@ "$blink_core_output_dir/css/properties/longhands/MarkerStart.h", "$blink_core_output_dir/css/properties/longhands/Mask.h", "$blink_core_output_dir/css/properties/longhands/MaskSourceType.h", + "$blink_core_output_dir/css/properties/longhands/MaskSourceType.cpp", "$blink_core_output_dir/css/properties/longhands/MaskType.h", "$blink_core_output_dir/css/properties/longhands/MaxBlockSize.h", "$blink_core_output_dir/css/properties/longhands/MaxHeight.h", @@ -921,14 +934,23 @@ "$blink_core_output_dir/css/properties/longhands/WebkitMaskBoxImageSource.h", "$blink_core_output_dir/css/properties/longhands/WebkitMaskBoxImageWidth.h", "$blink_core_output_dir/css/properties/longhands/WebkitMaskClip.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskClip.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskComposite.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskComposite.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskImage.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskImage.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskOrigin.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskOrigin.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskPositionX.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskPositionX.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskPositionY.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskPositionY.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskRepeatX.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskRepeatX.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskRepeatY.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskRepeatY.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaskSize.h", + "$blink_core_output_dir/css/properties/longhands/WebkitMaskSize.cpp", "$blink_core_output_dir/css/properties/longhands/WebkitMaxLogicalHeight.h", "$blink_core_output_dir/css/properties/longhands/WebkitMaxLogicalWidth.h", "$blink_core_output_dir/css/properties/longhands/WebkitMinLogicalHeight.h", @@ -992,7 +1014,8 @@ # FIXME: Need a better way to specify generated output files css_properties("make_core_generated_css_shorthand_property_classes") { - script = "../build/scripts/core/css/properties/make_css_property_headers.py" + script = + "../build/scripts/core/css/properties/make_css_property_subclasses.py" in_files = [ "css/properties/CSSPropertyMethods.json5" ] other_inputs = [ "../build/scripts/core/css/properties/templates/CSSPropertySubclass.h.tmpl",
diff --git a/third_party/WebKit/Source/core/animation/PathInterpolationFunctions.cpp b/third_party/WebKit/Source/core/animation/PathInterpolationFunctions.cpp index 484fc9f..b4d3f54 100644 --- a/third_party/WebKit/Source/core/animation/PathInterpolationFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/PathInterpolationFunctions.cpp
@@ -157,7 +157,7 @@ .PathSegTypes(); const Vector<SVGPathSegType>& end_types = ToSVGPathNonInterpolableValue(*end.non_interpolable_value).PathSegTypes(); - if (!PathSegTypesMatch(start_types, end_types)) + if (start_types.size() == 0 || !PathSegTypesMatch(start_types, end_types)) return nullptr; return PairwiseInterpolationValue(std::move(start.interpolable_value),
diff --git a/third_party/WebKit/Source/core/css/BUILD.gn b/third_party/WebKit/Source/core/css/BUILD.gn index 31db26c..e4cf21f 100644 --- a/third_party/WebKit/Source/core/css/BUILD.gn +++ b/third_party/WebKit/Source/core/css/BUILD.gn
@@ -430,332 +430,332 @@ "properties/Longhand.h", "properties/Shorthand.h", "properties/StyleBuildingUtils.h", - "properties/longhands/AlignContent.cpp", - "properties/longhands/AlignItems.cpp", - "properties/longhands/AlignSelf.cpp", - "properties/longhands/AnimationDelay.cpp", - "properties/longhands/AnimationDirection.cpp", - "properties/longhands/AnimationDuration.cpp", - "properties/longhands/AnimationFillMode.cpp", - "properties/longhands/AnimationIterationCount.cpp", - "properties/longhands/AnimationName.cpp", - "properties/longhands/AnimationPlayState.cpp", - "properties/longhands/AnimationTimingFunction.cpp", - "properties/longhands/BackdropFilter.cpp", - "properties/longhands/BackgroundAttachment.cpp", - "properties/longhands/BackgroundBlendMode.cpp", - "properties/longhands/BackgroundClip.cpp", - "properties/longhands/BackgroundColor.cpp", - "properties/longhands/BackgroundImage.cpp", - "properties/longhands/BackgroundOrigin.cpp", - "properties/longhands/BackgroundPositionX.cpp", - "properties/longhands/BackgroundPositionY.cpp", - "properties/longhands/BackgroundSize.cpp", - "properties/longhands/BaselineShift.cpp", - "properties/longhands/BlockSize.cpp", - "properties/longhands/BorderBottomColor.cpp", - "properties/longhands/BorderBottomLeftRadius.cpp", - "properties/longhands/BorderBottomRightRadius.cpp", - "properties/longhands/BorderBottomWidth.cpp", - "properties/longhands/BorderImageOutset.cpp", - "properties/longhands/BorderImageRepeat.cpp", - "properties/longhands/BorderImageSlice.cpp", - "properties/longhands/BorderImageSource.cpp", - "properties/longhands/BorderImageWidth.cpp", - "properties/longhands/BorderLeftColor.cpp", - "properties/longhands/BorderLeftWidth.cpp", - "properties/longhands/BorderRightColor.cpp", - "properties/longhands/BorderRightWidth.cpp", - "properties/longhands/BorderTopColor.cpp", - "properties/longhands/BorderTopLeftRadius.cpp", - "properties/longhands/BorderTopRightRadius.cpp", - "properties/longhands/BorderTopWidth.cpp", - "properties/longhands/Bottom.cpp", - "properties/longhands/BoxShadow.cpp", - "properties/longhands/CaretColor.cpp", - "properties/longhands/Clip.cpp", - "properties/longhands/ClipPath.cpp", - "properties/longhands/Color.cpp", - "properties/longhands/ColumnCount.cpp", - "properties/longhands/ColumnGap.cpp", - "properties/longhands/ColumnRuleColor.cpp", - "properties/longhands/ColumnRuleWidth.cpp", - "properties/longhands/ColumnSpan.cpp", - "properties/longhands/ColumnWidth.cpp", - "properties/longhands/Contain.cpp", - "properties/longhands/Content.cpp", - "properties/longhands/CounterIncrement.cpp", - "properties/longhands/CounterReset.cpp", - "properties/longhands/Cursor.cpp", - "properties/longhands/Cx.cpp", - "properties/longhands/Cy.cpp", - "properties/longhands/D.cpp", - "properties/longhands/Fill.cpp", - "properties/longhands/FillOpacity.cpp", - "properties/longhands/Filter.cpp", - "properties/longhands/FlexBasis.cpp", - "properties/longhands/FlexGrow.cpp", - "properties/longhands/FlexShrink.cpp", - "properties/longhands/FloodColor.cpp", - "properties/longhands/FloodOpacity.cpp", - "properties/longhands/FontFamily.cpp", - "properties/longhands/FontFeatureSettings.cpp", - "properties/longhands/FontSize.cpp", - "properties/longhands/FontSizeAdjust.cpp", - "properties/longhands/FontStretch.cpp", - "properties/longhands/FontStyle.cpp", - "properties/longhands/FontVariantCaps.cpp", - "properties/longhands/FontVariantEastAsian.cpp", - "properties/longhands/FontVariantLigatures.cpp", - "properties/longhands/FontVariantNumeric.cpp", - "properties/longhands/FontVariationSettings.cpp", - "properties/longhands/FontWeight.cpp", - "properties/longhands/GridAutoColumns.cpp", - "properties/longhands/GridAutoFlow.cpp", - "properties/longhands/GridAutoRows.cpp", - "properties/longhands/GridColumnEnd.cpp", - "properties/longhands/GridColumnGap.cpp", - "properties/longhands/GridColumnStart.cpp", - "properties/longhands/GridRowEnd.cpp", - "properties/longhands/GridRowGap.cpp", - "properties/longhands/GridRowStart.cpp", - "properties/longhands/GridTemplateAreas.cpp", - "properties/longhands/GridTemplateColumns.cpp", - "properties/longhands/GridTemplateRows.cpp", - "properties/longhands/Height.cpp", - "properties/longhands/ImageOrientation.cpp", - "properties/longhands/InlineSize.cpp", - "properties/longhands/JustifyContent.cpp", - "properties/longhands/JustifyItems.cpp", - "properties/longhands/JustifySelf.cpp", - "properties/longhands/Left.cpp", - "properties/longhands/LetterSpacing.cpp", - "properties/longhands/LightingColor.cpp", - "properties/longhands/LineHeight.cpp", - "properties/longhands/LineHeightStep.cpp", - "properties/longhands/ListStyleImage.cpp", - "properties/longhands/MarginBottom.cpp", - "properties/longhands/MarginLeft.cpp", - "properties/longhands/MarginRight.cpp", - "properties/longhands/MarginTop.cpp", - "properties/longhands/MarkerEnd.cpp", - "properties/longhands/MarkerMid.cpp", - "properties/longhands/MarkerStart.cpp", - "properties/longhands/Mask.cpp", - "properties/longhands/MaskSourceType.cpp", - "properties/longhands/MaxBlockSize.cpp", - "properties/longhands/MaxHeight.cpp", - "properties/longhands/MaxInlineSize.cpp", - "properties/longhands/MaxWidth.cpp", - "properties/longhands/MinBlockSize.cpp", - "properties/longhands/MinHeight.cpp", - "properties/longhands/MinInlineSize.cpp", - "properties/longhands/MinWidth.cpp", - "properties/longhands/ObjectPosition.cpp", - "properties/longhands/OffsetAnchor.cpp", - "properties/longhands/OffsetDistance.cpp", - "properties/longhands/OffsetPath.cpp", - "properties/longhands/OffsetPosition.cpp", - "properties/longhands/OffsetRotate.cpp", - "properties/longhands/Opacity.cpp", - "properties/longhands/Order.cpp", - "properties/longhands/Orphans.cpp", - "properties/longhands/OutlineColor.cpp", - "properties/longhands/OutlineOffset.cpp", - "properties/longhands/OutlineWidth.cpp", - "properties/longhands/PaddingBottom.cpp", - "properties/longhands/PaddingLeft.cpp", - "properties/longhands/PaddingRight.cpp", - "properties/longhands/PaddingTop.cpp", - "properties/longhands/Page.cpp", - "properties/longhands/PaintOrder.cpp", - "properties/longhands/Perspective.cpp", - "properties/longhands/PerspectiveOrigin.cpp", - "properties/longhands/Quotes.cpp", - "properties/longhands/R.cpp", - "properties/longhands/Right.cpp", - "properties/longhands/Rotate.cpp", - "properties/longhands/Rx.cpp", - "properties/longhands/Ry.cpp", - "properties/longhands/Scale.cpp", - "properties/longhands/ScrollPaddingBlockEnd.cpp", - "properties/longhands/ScrollPaddingBlockStart.cpp", - "properties/longhands/ScrollPaddingBottom.cpp", - "properties/longhands/ScrollPaddingInlineEnd.cpp", - "properties/longhands/ScrollPaddingInlineStart.cpp", - "properties/longhands/ScrollPaddingLeft.cpp", - "properties/longhands/ScrollPaddingRight.cpp", - "properties/longhands/ScrollPaddingTop.cpp", - "properties/longhands/ScrollSnapAlign.cpp", - "properties/longhands/ScrollSnapMarginBlockEnd.cpp", - "properties/longhands/ScrollSnapMarginBlockStart.cpp", - "properties/longhands/ScrollSnapMarginBottom.cpp", - "properties/longhands/ScrollSnapMarginInlineEnd.cpp", - "properties/longhands/ScrollSnapMarginInlineStart.cpp", - "properties/longhands/ScrollSnapMarginLeft.cpp", - "properties/longhands/ScrollSnapMarginRight.cpp", - "properties/longhands/ScrollSnapMarginTop.cpp", - "properties/longhands/ScrollSnapType.cpp", - "properties/longhands/ShapeImageThreshold.cpp", - "properties/longhands/ShapeMargin.cpp", - "properties/longhands/ShapeOutside.cpp", - "properties/longhands/Size.cpp", - "properties/longhands/StopColor.cpp", - "properties/longhands/StopOpacity.cpp", - "properties/longhands/Stroke.cpp", - "properties/longhands/StrokeDasharray.cpp", - "properties/longhands/StrokeDashoffset.cpp", - "properties/longhands/StrokeMiterlimit.cpp", - "properties/longhands/StrokeOpacity.cpp", - "properties/longhands/StrokeWidth.cpp", - "properties/longhands/TabSize.cpp", - "properties/longhands/TextDecorationColor.cpp", - "properties/longhands/TextDecorationLine.cpp", - "properties/longhands/TextIndent.cpp", - "properties/longhands/TextShadow.cpp", - "properties/longhands/TextSizeAdjust.cpp", - "properties/longhands/TextUnderlinePosition.cpp", - "properties/longhands/Top.cpp", - "properties/longhands/TouchAction.cpp", - "properties/longhands/Transform.cpp", - "properties/longhands/TransformOrigin.cpp", - "properties/longhands/TransitionDelay.cpp", - "properties/longhands/TransitionDuration.cpp", - "properties/longhands/TransitionProperty.cpp", - "properties/longhands/TransitionTimingFunction.cpp", - "properties/longhands/Translate.cpp", + "properties/longhands/AlignContentCustom.cpp", + "properties/longhands/AlignItemsCustom.cpp", + "properties/longhands/AlignSelfCustom.cpp", + "properties/longhands/AnimationDelayCustom.cpp", + "properties/longhands/AnimationDirectionCustom.cpp", + "properties/longhands/AnimationDurationCustom.cpp", + "properties/longhands/AnimationFillModeCustom.cpp", + "properties/longhands/AnimationIterationCountCustom.cpp", + "properties/longhands/AnimationNameCustom.cpp", + "properties/longhands/AnimationPlayStateCustom.cpp", + "properties/longhands/AnimationTimingFunctionCustom.cpp", + "properties/longhands/BackdropFilterCustom.cpp", + "properties/longhands/BackgroundAttachmentCustom.cpp", + "properties/longhands/BackgroundBlendModeCustom.cpp", + "properties/longhands/BackgroundClipCustom.cpp", + "properties/longhands/BackgroundColorCustom.cpp", + "properties/longhands/BackgroundImageCustom.cpp", + "properties/longhands/BackgroundOriginCustom.cpp", + "properties/longhands/BackgroundPositionXCustom.cpp", + "properties/longhands/BackgroundPositionYCustom.cpp", + "properties/longhands/BackgroundSizeCustom.cpp", + "properties/longhands/BaselineShiftCustom.cpp", + "properties/longhands/BlockSizeCustom.cpp", + "properties/longhands/BorderBottomColorCustom.cpp", + "properties/longhands/BorderBottomLeftRadiusCustom.cpp", + "properties/longhands/BorderBottomRightRadiusCustom.cpp", + "properties/longhands/BorderBottomWidthCustom.cpp", + "properties/longhands/BorderImageOutsetCustom.cpp", + "properties/longhands/BorderImageRepeatCustom.cpp", + "properties/longhands/BorderImageSliceCustom.cpp", + "properties/longhands/BorderImageSourceCustom.cpp", + "properties/longhands/BorderImageWidthCustom.cpp", + "properties/longhands/BorderLeftColorCustom.cpp", + "properties/longhands/BorderLeftWidthCustom.cpp", + "properties/longhands/BorderRightColorCustom.cpp", + "properties/longhands/BorderRightWidthCustom.cpp", + "properties/longhands/BorderTopColorCustom.cpp", + "properties/longhands/BorderTopLeftRadiusCustom.cpp", + "properties/longhands/BorderTopRightRadiusCustom.cpp", + "properties/longhands/BorderTopWidthCustom.cpp", + "properties/longhands/BottomCustom.cpp", + "properties/longhands/BoxShadowCustom.cpp", + "properties/longhands/CaretColorCustom.cpp", + "properties/longhands/ClipCustom.cpp", + "properties/longhands/ClipPathCustom.cpp", + "properties/longhands/ColorCustom.cpp", + "properties/longhands/ColumnCountCustom.cpp", + "properties/longhands/ColumnGapCustom.cpp", + "properties/longhands/ColumnRuleColorCustom.cpp", + "properties/longhands/ColumnRuleWidthCustom.cpp", + "properties/longhands/ColumnSpanCustom.cpp", + "properties/longhands/ColumnWidthCustom.cpp", + "properties/longhands/ContainCustom.cpp", + "properties/longhands/ContentCustom.cpp", + "properties/longhands/CounterIncrementCustom.cpp", + "properties/longhands/CounterResetCustom.cpp", + "properties/longhands/CursorCustom.cpp", + "properties/longhands/CxCustom.cpp", + "properties/longhands/CyCustom.cpp", + "properties/longhands/DCustom.cpp", + "properties/longhands/FillCustom.cpp", + "properties/longhands/FillOpacityCustom.cpp", + "properties/longhands/FilterCustom.cpp", + "properties/longhands/FlexBasisCustom.cpp", + "properties/longhands/FlexGrowCustom.cpp", + "properties/longhands/FlexShrinkCustom.cpp", + "properties/longhands/FloodColorCustom.cpp", + "properties/longhands/FloodOpacityCustom.cpp", + "properties/longhands/FontFamilyCustom.cpp", + "properties/longhands/FontFeatureSettingsCustom.cpp", + "properties/longhands/FontSizeAdjustCustom.cpp", + "properties/longhands/FontSizeCustom.cpp", + "properties/longhands/FontStretchCustom.cpp", + "properties/longhands/FontStyleCustom.cpp", + "properties/longhands/FontVariantCapsCustom.cpp", + "properties/longhands/FontVariantEastAsianCustom.cpp", + "properties/longhands/FontVariantLigaturesCustom.cpp", + "properties/longhands/FontVariantNumericCustom.cpp", + "properties/longhands/FontVariationSettingsCustom.cpp", + "properties/longhands/FontWeightCustom.cpp", + "properties/longhands/GridAutoColumnsCustom.cpp", + "properties/longhands/GridAutoFlowCustom.cpp", + "properties/longhands/GridAutoRowsCustom.cpp", + "properties/longhands/GridColumnEndCustom.cpp", + "properties/longhands/GridColumnGapCustom.cpp", + "properties/longhands/GridColumnStartCustom.cpp", + "properties/longhands/GridRowEndCustom.cpp", + "properties/longhands/GridRowGapCustom.cpp", + "properties/longhands/GridRowStartCustom.cpp", + "properties/longhands/GridTemplateAreasCustom.cpp", + "properties/longhands/GridTemplateColumnsCustom.cpp", + "properties/longhands/GridTemplateRowsCustom.cpp", + "properties/longhands/HeightCustom.cpp", + "properties/longhands/ImageOrientationCustom.cpp", + "properties/longhands/InlineSizeCustom.cpp", + "properties/longhands/JustifyContentCustom.cpp", + "properties/longhands/JustifyItemsCustom.cpp", + "properties/longhands/JustifySelfCustom.cpp", + "properties/longhands/LeftCustom.cpp", + "properties/longhands/LetterSpacingCustom.cpp", + "properties/longhands/LightingColorCustom.cpp", + "properties/longhands/LineHeightCustom.cpp", + "properties/longhands/LineHeightStepCustom.cpp", + "properties/longhands/ListStyleImageCustom.cpp", + "properties/longhands/MarginBottomCustom.cpp", + "properties/longhands/MarginLeftCustom.cpp", + "properties/longhands/MarginRightCustom.cpp", + "properties/longhands/MarginTopCustom.cpp", + "properties/longhands/MarkerEndCustom.cpp", + "properties/longhands/MarkerMidCustom.cpp", + "properties/longhands/MarkerStartCustom.cpp", + "properties/longhands/MaskCustom.cpp", + "properties/longhands/MaskSourceTypeCustom.cpp", + "properties/longhands/MaxBlockSizeCustom.cpp", + "properties/longhands/MaxHeightCustom.cpp", + "properties/longhands/MaxInlineSizeCustom.cpp", + "properties/longhands/MaxWidthCustom.cpp", + "properties/longhands/MinBlockSizeCustom.cpp", + "properties/longhands/MinHeightCustom.cpp", + "properties/longhands/MinInlineSizeCustom.cpp", + "properties/longhands/MinWidthCustom.cpp", + "properties/longhands/ObjectPositionCustom.cpp", + "properties/longhands/OffsetAnchorCustom.cpp", + "properties/longhands/OffsetDistanceCustom.cpp", + "properties/longhands/OffsetPathCustom.cpp", + "properties/longhands/OffsetPositionCustom.cpp", + "properties/longhands/OffsetRotateCustom.cpp", + "properties/longhands/OpacityCustom.cpp", + "properties/longhands/OrderCustom.cpp", + "properties/longhands/OrphansCustom.cpp", + "properties/longhands/OutlineColorCustom.cpp", + "properties/longhands/OutlineOffsetCustom.cpp", + "properties/longhands/OutlineWidthCustom.cpp", + "properties/longhands/PaddingBottomCustom.cpp", + "properties/longhands/PaddingLeftCustom.cpp", + "properties/longhands/PaddingRightCustom.cpp", + "properties/longhands/PaddingTopCustom.cpp", + "properties/longhands/PageCustom.cpp", + "properties/longhands/PaintOrderCustom.cpp", + "properties/longhands/PerspectiveCustom.cpp", + "properties/longhands/PerspectiveOriginCustom.cpp", + "properties/longhands/QuotesCustom.cpp", + "properties/longhands/RCustom.cpp", + "properties/longhands/RightCustom.cpp", + "properties/longhands/RotateCustom.cpp", + "properties/longhands/RxCustom.cpp", + "properties/longhands/RyCustom.cpp", + "properties/longhands/ScaleCustom.cpp", + "properties/longhands/ScrollPaddingBlockEndCustom.cpp", + "properties/longhands/ScrollPaddingBlockStartCustom.cpp", + "properties/longhands/ScrollPaddingBottomCustom.cpp", + "properties/longhands/ScrollPaddingInlineEndCustom.cpp", + "properties/longhands/ScrollPaddingInlineStartCustom.cpp", + "properties/longhands/ScrollPaddingLeftCustom.cpp", + "properties/longhands/ScrollPaddingRightCustom.cpp", + "properties/longhands/ScrollPaddingTopCustom.cpp", + "properties/longhands/ScrollSnapAlignCustom.cpp", + "properties/longhands/ScrollSnapMarginBlockEndCustom.cpp", + "properties/longhands/ScrollSnapMarginBlockStartCustom.cpp", + "properties/longhands/ScrollSnapMarginBottomCustom.cpp", + "properties/longhands/ScrollSnapMarginInlineEndCustom.cpp", + "properties/longhands/ScrollSnapMarginInlineStartCustom.cpp", + "properties/longhands/ScrollSnapMarginLeftCustom.cpp", + "properties/longhands/ScrollSnapMarginRightCustom.cpp", + "properties/longhands/ScrollSnapMarginTopCustom.cpp", + "properties/longhands/ScrollSnapTypeCustom.cpp", + "properties/longhands/ShapeImageThresholdCustom.cpp", + "properties/longhands/ShapeMarginCustom.cpp", + "properties/longhands/ShapeOutsideCustom.cpp", + "properties/longhands/SizeCustom.cpp", + "properties/longhands/StopColorCustom.cpp", + "properties/longhands/StopOpacityCustom.cpp", + "properties/longhands/StrokeCustom.cpp", + "properties/longhands/StrokeDasharrayCustom.cpp", + "properties/longhands/StrokeDashoffsetCustom.cpp", + "properties/longhands/StrokeMiterlimitCustom.cpp", + "properties/longhands/StrokeOpacityCustom.cpp", + "properties/longhands/StrokeWidthCustom.cpp", + "properties/longhands/TabSizeCustom.cpp", + "properties/longhands/TextDecorationColorCustom.cpp", + "properties/longhands/TextDecorationLineCustom.cpp", + "properties/longhands/TextIndentCustom.cpp", + "properties/longhands/TextShadowCustom.cpp", + "properties/longhands/TextSizeAdjustCustom.cpp", + "properties/longhands/TextUnderlinePositionCustom.cpp", + "properties/longhands/TopCustom.cpp", + "properties/longhands/TouchActionCustom.cpp", + "properties/longhands/TransformCustom.cpp", + "properties/longhands/TransformOriginCustom.cpp", + "properties/longhands/TransitionDelayCustom.cpp", + "properties/longhands/TransitionDurationCustom.cpp", + "properties/longhands/TransitionPropertyCustom.cpp", + "properties/longhands/TransitionTimingFunctionCustom.cpp", + "properties/longhands/TranslateCustom.cpp", "properties/longhands/Variable.h", - "properties/longhands/VerticalAlign.cpp", - "properties/longhands/WebkitBorderAfterColor.cpp", - "properties/longhands/WebkitBorderAfterWidth.cpp", - "properties/longhands/WebkitBorderBeforeColor.cpp", - "properties/longhands/WebkitBorderBeforeWidth.cpp", - "properties/longhands/WebkitBorderEndColor.cpp", - "properties/longhands/WebkitBorderEndWidth.cpp", - "properties/longhands/WebkitBorderHorizontalSpacing.cpp", - "properties/longhands/WebkitBorderImage.cpp", - "properties/longhands/WebkitBorderStartColor.cpp", - "properties/longhands/WebkitBorderStartWidth.cpp", - "properties/longhands/WebkitBorderVerticalSpacing.cpp", - "properties/longhands/WebkitBoxFlex.cpp", - "properties/longhands/WebkitBoxFlexGroup.cpp", - "properties/longhands/WebkitBoxOrdinalGroup.cpp", - "properties/longhands/WebkitBoxReflect.cpp", - "properties/longhands/WebkitFontSizeDelta.cpp", - "properties/longhands/WebkitHighlight.cpp", - "properties/longhands/WebkitHyphenateCharacter.cpp", - "properties/longhands/WebkitLineClamp.cpp", - "properties/longhands/WebkitLocale.cpp", - "properties/longhands/WebkitLogicalHeight.cpp", - "properties/longhands/WebkitLogicalWidth.cpp", - "properties/longhands/WebkitMarginAfter.cpp", - "properties/longhands/WebkitMarginBefore.cpp", - "properties/longhands/WebkitMarginEnd.cpp", - "properties/longhands/WebkitMarginStart.cpp", - "properties/longhands/WebkitMaskBoxImageOutset.cpp", - "properties/longhands/WebkitMaskBoxImageRepeat.cpp", - "properties/longhands/WebkitMaskBoxImageSlice.cpp", - "properties/longhands/WebkitMaskBoxImageSource.cpp", - "properties/longhands/WebkitMaskBoxImageWidth.cpp", - "properties/longhands/WebkitMaskClip.cpp", - "properties/longhands/WebkitMaskComposite.cpp", - "properties/longhands/WebkitMaskImage.cpp", - "properties/longhands/WebkitMaskOrigin.cpp", - "properties/longhands/WebkitMaskPositionX.cpp", - "properties/longhands/WebkitMaskPositionY.cpp", - "properties/longhands/WebkitMaskSize.cpp", - "properties/longhands/WebkitMaxLogicalHeight.cpp", - "properties/longhands/WebkitMaxLogicalWidth.cpp", - "properties/longhands/WebkitMinLogicalHeight.cpp", - "properties/longhands/WebkitMinLogicalWidth.cpp", - "properties/longhands/WebkitPaddingAfter.cpp", - "properties/longhands/WebkitPaddingBefore.cpp", - "properties/longhands/WebkitPaddingEnd.cpp", - "properties/longhands/WebkitPaddingStart.cpp", - "properties/longhands/WebkitPerspectiveOriginX.cpp", - "properties/longhands/WebkitPerspectiveOriginY.cpp", - "properties/longhands/WebkitTapHighlightColor.cpp", - "properties/longhands/WebkitTextDecorationsInEffect.cpp", - "properties/longhands/WebkitTextEmphasisColor.cpp", - "properties/longhands/WebkitTextEmphasisPosition.cpp", - "properties/longhands/WebkitTextEmphasisStyle.cpp", - "properties/longhands/WebkitTextFillColor.cpp", - "properties/longhands/WebkitTextStrokeColor.cpp", - "properties/longhands/WebkitTextStrokeWidth.cpp", - "properties/longhands/WebkitTransformOriginX.cpp", - "properties/longhands/WebkitTransformOriginY.cpp", - "properties/longhands/WebkitTransformOriginZ.cpp", - "properties/longhands/Widows.cpp", - "properties/longhands/Width.cpp", - "properties/longhands/WillChange.cpp", - "properties/longhands/WordSpacing.cpp", - "properties/longhands/X.cpp", - "properties/longhands/Y.cpp", - "properties/longhands/ZIndex.cpp", - "properties/longhands/Zoom.cpp", - "properties/shorthands/Animation.cpp", - "properties/shorthands/Background.cpp", - "properties/shorthands/BackgroundPosition.cpp", - "properties/shorthands/BackgroundRepeat.cpp", - "properties/shorthands/Border.cpp", - "properties/shorthands/BorderBottom.cpp", - "properties/shorthands/BorderColor.cpp", - "properties/shorthands/BorderImage.cpp", - "properties/shorthands/BorderLeft.cpp", - "properties/shorthands/BorderRadius.cpp", - "properties/shorthands/BorderRight.cpp", - "properties/shorthands/BorderSpacing.cpp", - "properties/shorthands/BorderStyle.cpp", - "properties/shorthands/BorderTop.cpp", - "properties/shorthands/BorderWidth.cpp", - "properties/shorthands/ColumnRule.cpp", - "properties/shorthands/Columns.cpp", - "properties/shorthands/Flex.cpp", - "properties/shorthands/FlexFlow.cpp", - "properties/shorthands/Font.cpp", - "properties/shorthands/FontVariant.cpp", - "properties/shorthands/Grid.cpp", - "properties/shorthands/GridArea.cpp", - "properties/shorthands/GridColumn.cpp", - "properties/shorthands/GridGap.cpp", - "properties/shorthands/GridRow.cpp", - "properties/shorthands/GridTemplate.cpp", - "properties/shorthands/ListStyle.cpp", - "properties/shorthands/Margin.cpp", - "properties/shorthands/Marker.cpp", - "properties/shorthands/Offset.cpp", - "properties/shorthands/Outline.cpp", - "properties/shorthands/Overflow.cpp", - "properties/shorthands/OverscrollBehavior.cpp", - "properties/shorthands/Padding.cpp", - "properties/shorthands/PageBreakAfter.cpp", - "properties/shorthands/PageBreakBefore.cpp", - "properties/shorthands/PageBreakInside.cpp", - "properties/shorthands/PlaceContent.cpp", - "properties/shorthands/PlaceItems.cpp", - "properties/shorthands/PlaceSelf.cpp", - "properties/shorthands/ScrollPadding.cpp", - "properties/shorthands/ScrollPaddingBlock.cpp", - "properties/shorthands/ScrollPaddingInline.cpp", - "properties/shorthands/ScrollSnapMargin.cpp", - "properties/shorthands/ScrollSnapMarginBlock.cpp", - "properties/shorthands/ScrollSnapMarginInline.cpp", - "properties/shorthands/TextDecoration.cpp", - "properties/shorthands/Transition.cpp", - "properties/shorthands/WebkitBorderAfter.cpp", - "properties/shorthands/WebkitBorderBefore.cpp", - "properties/shorthands/WebkitBorderEnd.cpp", - "properties/shorthands/WebkitBorderStart.cpp", - "properties/shorthands/WebkitColumnBreakAfter.cpp", - "properties/shorthands/WebkitColumnBreakBefore.cpp", - "properties/shorthands/WebkitColumnBreakInside.cpp", - "properties/shorthands/WebkitMarginCollapse.cpp", - "properties/shorthands/WebkitMask.cpp", - "properties/shorthands/WebkitMaskBoxImage.cpp", - "properties/shorthands/WebkitMaskPosition.cpp", - "properties/shorthands/WebkitMaskRepeat.cpp", - "properties/shorthands/WebkitTextEmphasis.cpp", - "properties/shorthands/WebkitTextStroke.cpp", + "properties/longhands/VerticalAlignCustom.cpp", + "properties/longhands/WebkitBorderAfterColorCustom.cpp", + "properties/longhands/WebkitBorderAfterWidthCustom.cpp", + "properties/longhands/WebkitBorderBeforeColorCustom.cpp", + "properties/longhands/WebkitBorderBeforeWidthCustom.cpp", + "properties/longhands/WebkitBorderEndColorCustom.cpp", + "properties/longhands/WebkitBorderEndWidthCustom.cpp", + "properties/longhands/WebkitBorderHorizontalSpacingCustom.cpp", + "properties/longhands/WebkitBorderImageCustom.cpp", + "properties/longhands/WebkitBorderStartColorCustom.cpp", + "properties/longhands/WebkitBorderStartWidthCustom.cpp", + "properties/longhands/WebkitBorderVerticalSpacingCustom.cpp", + "properties/longhands/WebkitBoxFlexCustom.cpp", + "properties/longhands/WebkitBoxFlexGroupCustom.cpp", + "properties/longhands/WebkitBoxOrdinalGroupCustom.cpp", + "properties/longhands/WebkitBoxReflectCustom.cpp", + "properties/longhands/WebkitFontSizeDeltaCustom.cpp", + "properties/longhands/WebkitHighlightCustom.cpp", + "properties/longhands/WebkitHyphenateCharacterCustom.cpp", + "properties/longhands/WebkitLineClampCustom.cpp", + "properties/longhands/WebkitLocaleCustom.cpp", + "properties/longhands/WebkitLogicalHeightCustom.cpp", + "properties/longhands/WebkitLogicalWidthCustom.cpp", + "properties/longhands/WebkitMarginAfterCustom.cpp", + "properties/longhands/WebkitMarginBeforeCustom.cpp", + "properties/longhands/WebkitMarginEndCustom.cpp", + "properties/longhands/WebkitMarginStartCustom.cpp", + "properties/longhands/WebkitMaskBoxImageOutsetCustom.cpp", + "properties/longhands/WebkitMaskBoxImageRepeatCustom.cpp", + "properties/longhands/WebkitMaskBoxImageSliceCustom.cpp", + "properties/longhands/WebkitMaskBoxImageSourceCustom.cpp", + "properties/longhands/WebkitMaskBoxImageWidthCustom.cpp", + "properties/longhands/WebkitMaskClipCustom.cpp", + "properties/longhands/WebkitMaskCompositeCustom.cpp", + "properties/longhands/WebkitMaskImageCustom.cpp", + "properties/longhands/WebkitMaskOriginCustom.cpp", + "properties/longhands/WebkitMaskPositionXCustom.cpp", + "properties/longhands/WebkitMaskPositionYCustom.cpp", + "properties/longhands/WebkitMaskSizeCustom.cpp", + "properties/longhands/WebkitMaxLogicalHeightCustom.cpp", + "properties/longhands/WebkitMaxLogicalWidthCustom.cpp", + "properties/longhands/WebkitMinLogicalHeightCustom.cpp", + "properties/longhands/WebkitMinLogicalWidthCustom.cpp", + "properties/longhands/WebkitPaddingAfterCustom.cpp", + "properties/longhands/WebkitPaddingBeforeCustom.cpp", + "properties/longhands/WebkitPaddingEndCustom.cpp", + "properties/longhands/WebkitPaddingStartCustom.cpp", + "properties/longhands/WebkitPerspectiveOriginXCustom.cpp", + "properties/longhands/WebkitPerspectiveOriginYCustom.cpp", + "properties/longhands/WebkitTapHighlightColorCustom.cpp", + "properties/longhands/WebkitTextDecorationsInEffectCustom.cpp", + "properties/longhands/WebkitTextEmphasisColorCustom.cpp", + "properties/longhands/WebkitTextEmphasisPositionCustom.cpp", + "properties/longhands/WebkitTextEmphasisStyleCustom.cpp", + "properties/longhands/WebkitTextFillColorCustom.cpp", + "properties/longhands/WebkitTextStrokeColorCustom.cpp", + "properties/longhands/WebkitTextStrokeWidthCustom.cpp", + "properties/longhands/WebkitTransformOriginXCustom.cpp", + "properties/longhands/WebkitTransformOriginYCustom.cpp", + "properties/longhands/WebkitTransformOriginZCustom.cpp", + "properties/longhands/WidowsCustom.cpp", + "properties/longhands/WidthCustom.cpp", + "properties/longhands/WillChangeCustom.cpp", + "properties/longhands/WordSpacingCustom.cpp", + "properties/longhands/XCustom.cpp", + "properties/longhands/YCustom.cpp", + "properties/longhands/ZIndexCustom.cpp", + "properties/longhands/ZoomCustom.cpp", + "properties/shorthands/AnimationCustom.cpp", + "properties/shorthands/BackgroundCustom.cpp", + "properties/shorthands/BackgroundPositionCustom.cpp", + "properties/shorthands/BackgroundRepeatCustom.cpp", + "properties/shorthands/BorderBottomCustom.cpp", + "properties/shorthands/BorderColorCustom.cpp", + "properties/shorthands/BorderCustom.cpp", + "properties/shorthands/BorderImageCustom.cpp", + "properties/shorthands/BorderLeftCustom.cpp", + "properties/shorthands/BorderRadiusCustom.cpp", + "properties/shorthands/BorderRightCustom.cpp", + "properties/shorthands/BorderSpacingCustom.cpp", + "properties/shorthands/BorderStyleCustom.cpp", + "properties/shorthands/BorderTopCustom.cpp", + "properties/shorthands/BorderWidthCustom.cpp", + "properties/shorthands/ColumnRuleCustom.cpp", + "properties/shorthands/ColumnsCustom.cpp", + "properties/shorthands/FlexCustom.cpp", + "properties/shorthands/FlexFlowCustom.cpp", + "properties/shorthands/FontCustom.cpp", + "properties/shorthands/FontVariantCustom.cpp", + "properties/shorthands/GridAreaCustom.cpp", + "properties/shorthands/GridColumnCustom.cpp", + "properties/shorthands/GridCustom.cpp", + "properties/shorthands/GridGapCustom.cpp", + "properties/shorthands/GridRowCustom.cpp", + "properties/shorthands/GridTemplateCustom.cpp", + "properties/shorthands/ListStyleCustom.cpp", + "properties/shorthands/MarginCustom.cpp", + "properties/shorthands/MarkerCustom.cpp", + "properties/shorthands/OffsetCustom.cpp", + "properties/shorthands/OutlineCustom.cpp", + "properties/shorthands/OverflowCustom.cpp", + "properties/shorthands/OverscrollBehaviorCustom.cpp", + "properties/shorthands/PaddingCustom.cpp", + "properties/shorthands/PageBreakAfterCustom.cpp", + "properties/shorthands/PageBreakBeforeCustom.cpp", + "properties/shorthands/PageBreakInsideCustom.cpp", + "properties/shorthands/PlaceContentCustom.cpp", + "properties/shorthands/PlaceItemsCustom.cpp", + "properties/shorthands/PlaceSelfCustom.cpp", + "properties/shorthands/ScrollPaddingBlockCustom.cpp", + "properties/shorthands/ScrollPaddingCustom.cpp", + "properties/shorthands/ScrollPaddingInlineCustom.cpp", + "properties/shorthands/ScrollSnapMarginBlockCustom.cpp", + "properties/shorthands/ScrollSnapMarginCustom.cpp", + "properties/shorthands/ScrollSnapMarginInlineCustom.cpp", + "properties/shorthands/TextDecorationCustom.cpp", + "properties/shorthands/TransitionCustom.cpp", + "properties/shorthands/WebkitBorderAfterCustom.cpp", + "properties/shorthands/WebkitBorderBeforeCustom.cpp", + "properties/shorthands/WebkitBorderEndCustom.cpp", + "properties/shorthands/WebkitBorderStartCustom.cpp", + "properties/shorthands/WebkitColumnBreakAfterCustom.cpp", + "properties/shorthands/WebkitColumnBreakBeforeCustom.cpp", + "properties/shorthands/WebkitColumnBreakInsideCustom.cpp", + "properties/shorthands/WebkitMarginCollapseCustom.cpp", + "properties/shorthands/WebkitMaskBoxImageCustom.cpp", + "properties/shorthands/WebkitMaskCustom.cpp", + "properties/shorthands/WebkitMaskPositionCustom.cpp", + "properties/shorthands/WebkitMaskRepeatCustom.cpp", + "properties/shorthands/WebkitTextEmphasisCustom.cpp", + "properties/shorthands/WebkitTextStrokeCustom.cpp", "resolver/AnimatedStyleBuilder.cpp", "resolver/AnimatedStyleBuilder.h", "resolver/CSSPropertyPriority.h",
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h index 9edd6cb7..e1429b46 100644 --- a/third_party/WebKit/Source/core/css/CSSSelector.h +++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -260,8 +260,7 @@ // Selectors are kept in an array by CSSSelectorList. The next component of // the selector is the next item in the array. const CSSSelector* TagHistory() const { - return is_last_in_tag_history_ ? nullptr - : const_cast<CSSSelector*>(this + 1); + return is_last_in_tag_history_ ? nullptr : this + 1; } static const AtomicString& UniversalSelectorAtom() { return g_null_atom; }
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AlignContent.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AlignContentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AlignContent.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AlignContentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AlignItems.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AlignItemsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AlignItems.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AlignItemsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AlignSelf.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AlignSelfCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AlignSelf.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AlignSelfCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationDelay.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationDelayCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationDelay.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationDelayCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationDirection.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationDirectionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationDirection.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationDirectionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationDuration.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationDurationCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationDuration.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationDurationCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationFillMode.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationFillModeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationFillMode.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationFillModeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationIterationCount.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationIterationCountCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationIterationCount.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationIterationCountCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationName.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationNameCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationName.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationNameCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationPlayState.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationPlayStateCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationPlayState.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationPlayStateCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/AnimationTimingFunction.cpp b/third_party/WebKit/Source/core/css/properties/longhands/AnimationTimingFunctionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/AnimationTimingFunction.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/AnimationTimingFunctionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackdropFilter.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackdropFilterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackdropFilter.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackdropFilterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundAttachment.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundAttachmentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundAttachment.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundAttachmentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundBlendMode.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundBlendModeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundBlendMode.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundBlendModeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundClip.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundClipCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundClip.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundClipCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImage.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundImage.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundOrigin.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundOriginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundOrigin.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundOriginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionX.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionXCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionX.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionXCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionY.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionYCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionY.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundPositionYCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BackgroundSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BaselineShift.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BaselineShiftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BaselineShift.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BaselineShiftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BlockSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BlockSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BlockSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BlockSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderBottomColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderBottomColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomLeftRadius.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomLeftRadiusCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderBottomLeftRadius.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderBottomLeftRadiusCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomRightRadius.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomRightRadiusCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderBottomRightRadius.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderBottomRightRadiusCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderBottomWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderBottomWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderBottomWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderImageOutset.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderImageOutsetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderImageOutset.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderImageOutsetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderImageRepeat.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderImageRepeatCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderImageRepeat.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderImageRepeatCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderImageSlice.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderImageSliceCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderImageSlice.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderImageSliceCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderImageSource.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderImageSourceCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderImageSource.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderImageSourceCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderImageWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderImageWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderImageWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderImageWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderLeftColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderLeftColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderLeftColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderLeftColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderLeftWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderLeftWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderLeftWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderLeftWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderRightColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderRightColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderRightColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderRightColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderRightWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderRightWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderRightWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderRightWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderTopColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderTopColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderTopColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderTopColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderTopLeftRadius.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderTopLeftRadiusCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderTopLeftRadius.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderTopLeftRadiusCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderTopRightRadius.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderTopRightRadiusCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderTopRightRadius.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderTopRightRadiusCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BorderTopWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BorderTopWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BorderTopWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BorderTopWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Bottom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BottomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Bottom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BottomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BoxShadow.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BoxShadowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/BoxShadow.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/BoxShadowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/CaretColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CaretColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/CaretColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CaretColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Clip.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ClipCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Clip.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ClipCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ClipPath.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ClipPathCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ClipPath.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ClipPathCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Color.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Color.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnCount.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnCountCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnCount.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnCountCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnGap.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnGapCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnGap.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnGapCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnRuleWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnSpan.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnSpanCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnSpan.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnSpanCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ColumnWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ColumnWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ColumnWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ColumnWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Contain.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ContainCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Contain.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ContainCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Content.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ContentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Content.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ContentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/CounterIncrement.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CounterIncrementCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/CounterIncrement.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CounterIncrementCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/CounterReset.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CounterResetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/CounterReset.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CounterResetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Cursor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CursorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Cursor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CursorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Cx.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CxCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Cx.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CxCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Cy.cpp b/third_party/WebKit/Source/core/css/properties/longhands/CyCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Cy.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/CyCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/D.cpp b/third_party/WebKit/Source/core/css/properties/longhands/DCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/D.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/DCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Fill.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FillCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Fill.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FillCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FillOpacity.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FillOpacityCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FillOpacity.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FillOpacityCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Filter.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FilterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Filter.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FilterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FlexBasis.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FlexBasisCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FlexBasis.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FlexBasisCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FlexGrow.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FlexGrowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FlexGrow.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FlexGrowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FlexShrink.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FlexShrinkCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FlexShrink.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FlexShrinkCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FloodColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FloodColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FloodColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FloodColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FloodOpacity.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FloodOpacityCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FloodOpacity.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FloodOpacityCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontFamily.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontFamilyCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontFamily.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontFamilyCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontFeatureSettings.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontFeatureSettingsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontFeatureSettings.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontFeatureSettingsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontSizeAdjust.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontSizeAdjustCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontSizeAdjust.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontSizeAdjustCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontStretch.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontStretchCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontStretch.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontStretchCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontStyle.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontStyleCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontStyle.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontStyleCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontVariantCaps.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontVariantCapsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontVariantCaps.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontVariantCapsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontVariantEastAsian.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontVariantEastAsianCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontVariantEastAsian.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontVariantEastAsianCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontVariantLigatures.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontVariantLigaturesCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontVariantLigatures.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontVariantLigaturesCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontVariantNumeric.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontVariantNumericCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontVariantNumeric.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontVariantNumericCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontVariationSettings.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontVariationSettingsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontVariationSettings.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontVariationSettingsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/FontWeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/FontWeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/FontWeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/FontWeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridAutoColumns.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridAutoColumnsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridAutoColumns.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridAutoColumnsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridAutoFlow.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridAutoFlowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridAutoFlow.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridAutoFlowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridAutoRows.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridAutoRowsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridAutoRows.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridAutoRowsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridColumnEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridColumnEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridColumnEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridColumnEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridColumnGap.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridColumnGapCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridColumnGap.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridColumnGapCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridColumnStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridColumnStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridColumnStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridColumnStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridRowEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridRowEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridRowEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridRowEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridRowGap.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridRowGapCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridRowGap.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridRowGapCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridRowStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridRowStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridRowStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridRowStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateAreas.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateAreasCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridTemplateAreas.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridTemplateAreasCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateColumns.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateColumnsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridTemplateColumns.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridTemplateColumnsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateRows.cpp b/third_party/WebKit/Source/core/css/properties/longhands/GridTemplateRowsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/GridTemplateRows.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/GridTemplateRowsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Height.cpp b/third_party/WebKit/Source/core/css/properties/longhands/HeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Height.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/HeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ImageOrientation.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ImageOrientationCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ImageOrientation.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ImageOrientationCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/InlineSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/InlineSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/InlineSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/InlineSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/JustifyContent.cpp b/third_party/WebKit/Source/core/css/properties/longhands/JustifyContentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/JustifyContent.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/JustifyContentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/JustifyItems.cpp b/third_party/WebKit/Source/core/css/properties/longhands/JustifyItemsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/JustifyItems.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/JustifyItemsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/JustifySelf.cpp b/third_party/WebKit/Source/core/css/properties/longhands/JustifySelfCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/JustifySelf.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/JustifySelfCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Left.cpp b/third_party/WebKit/Source/core/css/properties/longhands/LeftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Left.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/LeftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/LetterSpacing.cpp b/third_party/WebKit/Source/core/css/properties/longhands/LetterSpacingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/LetterSpacing.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/LetterSpacingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/LightingColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/LightingColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/LightingColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/LightingColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/LineHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/LineHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/LineHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/LineHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/LineHeightStep.cpp b/third_party/WebKit/Source/core/css/properties/longhands/LineHeightStepCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/LineHeightStep.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/LineHeightStepCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ListStyleImage.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ListStyleImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ListStyleImage.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ListStyleImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarginBottom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarginBottomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarginBottom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarginBottomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarginLeft.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarginLeftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarginLeft.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarginLeftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarginRight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarginRightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarginRight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarginRightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarginTop.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarginTopCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarginTop.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarginTopCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarkerEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarkerEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarkerEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarkerEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarkerMid.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarkerMidCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarkerMid.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarkerMidCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MarkerStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MarkerStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MarkerStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MarkerStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Mask.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaskCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Mask.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaskCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MaskSourceType.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaskSourceTypeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MaskSourceType.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaskSourceTypeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MaxBlockSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaxBlockSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MaxBlockSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaxBlockSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MaxHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaxHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MaxHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaxHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MaxInlineSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaxInlineSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MaxInlineSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaxInlineSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MaxWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MaxWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MaxWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MaxWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MinBlockSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MinBlockSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MinBlockSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MinBlockSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MinHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MinHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MinHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MinHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MinInlineSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MinInlineSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MinInlineSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MinInlineSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/MinWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/MinWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/MinWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/MinWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ObjectPosition.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ObjectPositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ObjectPosition.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ObjectPositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OffsetAnchor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OffsetAnchorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OffsetAnchor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OffsetAnchorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OffsetDistance.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OffsetDistanceCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OffsetDistance.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OffsetDistanceCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OffsetPath.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OffsetPathCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OffsetPath.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OffsetPathCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OffsetPosition.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OffsetPositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OffsetPosition.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OffsetPositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OffsetRotate.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OffsetRotateCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OffsetRotate.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OffsetRotateCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Opacity.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OpacityCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Opacity.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OpacityCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Order.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OrderCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Order.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OrderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Orphans.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OrphansCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Orphans.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OrphansCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OutlineColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OutlineColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OutlineColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OutlineColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OutlineOffset.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OutlineOffsetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OutlineOffset.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OutlineOffsetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/OutlineWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/OutlineWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/OutlineWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/OutlineWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PaddingBottom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PaddingBottomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PaddingBottom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PaddingBottomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PaddingLeft.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PaddingLeftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PaddingLeft.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PaddingLeftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PaddingRight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PaddingRightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PaddingRight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PaddingRightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PaddingTop.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PaddingTopCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PaddingTop.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PaddingTopCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Page.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Page.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PaintOrder.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PaintOrderCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PaintOrder.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PaintOrderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Perspective.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PerspectiveCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Perspective.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PerspectiveCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/PerspectiveOrigin.cpp b/third_party/WebKit/Source/core/css/properties/longhands/PerspectiveOriginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/PerspectiveOrigin.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/PerspectiveOriginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Quotes.cpp b/third_party/WebKit/Source/core/css/properties/longhands/QuotesCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Quotes.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/QuotesCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/R.cpp b/third_party/WebKit/Source/core/css/properties/longhands/RCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/R.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/RCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Right.cpp b/third_party/WebKit/Source/core/css/properties/longhands/RightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Right.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/RightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Rotate.cpp b/third_party/WebKit/Source/core/css/properties/longhands/RotateCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Rotate.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/RotateCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Rx.cpp b/third_party/WebKit/Source/core/css/properties/longhands/RxCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Rx.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/RxCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Ry.cpp b/third_party/WebKit/Source/core/css/properties/longhands/RyCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Ry.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/RyCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Scale.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScaleCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Scale.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScaleCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBlockStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBottom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBottomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBottom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingBottomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingInlineStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingLeft.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingLeftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingLeft.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingLeftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingRight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingRightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingRight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingRightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingTop.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingTopCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingTop.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollPaddingTopCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapAlign.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapAlignCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapAlign.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapAlignCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBlockStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBottom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBottomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBottom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginBottomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginInlineStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginLeft.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginLeftCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginLeft.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginLeftCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginRight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginRightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginRight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginRightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginTop.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginTopCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginTop.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapMarginTopCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapType.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapTypeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapType.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ScrollSnapTypeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ShapeImageThreshold.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ShapeImageThresholdCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ShapeImageThreshold.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ShapeImageThresholdCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ShapeMargin.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ShapeMarginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ShapeMargin.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ShapeMarginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ShapeOutside.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ShapeOutsideCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ShapeOutside.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ShapeOutsideCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Size.cpp b/third_party/WebKit/Source/core/css/properties/longhands/SizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Size.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/SizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StopColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StopColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StopColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StopColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StopOpacity.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StopOpacityCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StopOpacity.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StopOpacityCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Stroke.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Stroke.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StrokeDasharray.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeDasharrayCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StrokeDasharray.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeDasharrayCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StrokeDashoffset.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeDashoffsetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StrokeDashoffset.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeDashoffsetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StrokeMiterlimit.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeMiterlimitCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StrokeMiterlimit.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeMiterlimitCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StrokeOpacity.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeOpacityCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StrokeOpacity.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeOpacityCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/StrokeWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/StrokeWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/StrokeWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/StrokeWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TabSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TabSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TabSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TabSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextDecorationColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextDecorationColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationLine.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextDecorationLineCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextDecorationLine.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextDecorationLineCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextIndent.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextIndentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextIndent.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextIndentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextShadow.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextShadowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextShadow.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextShadowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextSizeAdjust.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextSizeAdjustCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextSizeAdjust.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextSizeAdjustCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TextUnderlinePosition.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TextUnderlinePositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TextUnderlinePosition.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TextUnderlinePositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Top.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TopCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Top.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TopCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TouchAction.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TouchActionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TouchAction.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TouchActionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Transform.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransformCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Transform.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransformCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TransformOrigin.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransformOriginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TransformOrigin.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransformOriginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TransitionDelay.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransitionDelayCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TransitionDelay.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransitionDelayCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TransitionDuration.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransitionDurationCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TransitionDuration.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransitionDurationCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TransitionProperty.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransitionPropertyCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TransitionProperty.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransitionPropertyCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/TransitionTimingFunction.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TransitionTimingFunctionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/TransitionTimingFunction.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TransitionTimingFunctionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Translate.cpp b/third_party/WebKit/Source/core/css/properties/longhands/TranslateCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Translate.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/TranslateCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/VerticalAlign.cpp b/third_party/WebKit/Source/core/css/properties/longhands/VerticalAlignCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/VerticalAlign.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/VerticalAlignCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderAfterWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderBeforeWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderEndWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderHorizontalSpacing.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderHorizontalSpacingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderHorizontalSpacing.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderHorizontalSpacingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderImage.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderImage.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderStartWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderVerticalSpacing.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderVerticalSpacingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderVerticalSpacing.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBorderVerticalSpacingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlex.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlex.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexGroup.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexGroupCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexGroup.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxFlexGroupCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxOrdinalGroup.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxOrdinalGroupCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxOrdinalGroup.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxOrdinalGroupCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxReflect.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxReflectCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxReflect.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitBoxReflectCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitFontSizeDelta.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitFontSizeDeltaCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitFontSizeDelta.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitFontSizeDeltaCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitHighlight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitHighlightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitHighlight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitHighlightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitHyphenateCharacter.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitHyphenateCharacterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitHyphenateCharacter.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitHyphenateCharacterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitLineClamp.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitLineClampCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitLineClamp.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitLineClampCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitLocale.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitLocaleCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitLocale.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitLocaleCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitLogicalWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginAfter.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginAfterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginAfter.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginAfterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginBefore.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginBeforeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginBefore.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginBeforeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMarginStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageOutset.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageOutsetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageOutset.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageOutsetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageRepeat.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageRepeatCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageRepeat.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageRepeatCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSlice.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSliceCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSlice.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSliceCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSource.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSourceCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSource.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageSourceCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskBoxImageWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskClip.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskClipCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskClip.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskClipCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskComposite.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskCompositeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskComposite.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskCompositeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImage.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImage.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskOrigin.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskOriginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskOrigin.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskOriginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionX.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionXCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionX.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionXCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionY.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionYCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionY.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskPositionYCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSize.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSize.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMaxLogicalWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalHeight.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalHeightCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalHeight.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalHeightCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitMinLogicalWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingAfter.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingAfterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingAfter.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingAfterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingBefore.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingBeforeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingBefore.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingBeforeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingEnd.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingEnd.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingStart.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingStart.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPaddingStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginX.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginXCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginX.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginXCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginY.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginYCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginY.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitPerspectiveOriginYCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTapHighlightColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTapHighlightColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTapHighlightColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTapHighlightColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextDecorationsInEffect.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextDecorationsInEffectCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextDecorationsInEffect.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextDecorationsInEffectCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisPosition.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisPositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisPosition.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisPositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisStyle.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisStyleCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisStyle.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextEmphasisStyleCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextFillColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextFillColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextFillColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextFillColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeColor.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeColor.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeWidth.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeWidth.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTextStrokeWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginX.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginXCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginX.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginXCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginY.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginYCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginY.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginYCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginZ.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginZCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginZ.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WebkitTransformOriginZCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Widows.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WidowsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Widows.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WidowsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Width.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Width.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WillChange.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WillChangeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WillChange.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WillChangeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WordSpacing.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WordSpacingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/WordSpacing.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/WordSpacingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/X.cpp b/third_party/WebKit/Source/core/css/properties/longhands/XCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/X.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/XCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Y.cpp b/third_party/WebKit/Source/core/css/properties/longhands/YCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Y.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/YCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/ZIndex.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ZIndexCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/ZIndex.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ZIndexCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/Zoom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/ZoomCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/longhands/Zoom.cpp rename to third_party/WebKit/Source/core/css/properties/longhands/ZoomCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Animation.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/AnimationCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Animation.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/AnimationCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Background.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Background.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPosition.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPosition.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeat.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeat.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderBottom.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp index 5dd8358..3bb0eba5 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderBottomCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/BorderBottom.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderColor.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderColor.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderColorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Border.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Border.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderImage.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderImage.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeft.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderLeft.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp index 6a224a4c..805da108 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeft.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderLeftCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/BorderLeft.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderRadius.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderRadiusCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderRadius.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderRadiusCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderRight.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderRight.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp index c427cdd..f76b667c 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderRight.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderRightCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/BorderRight.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderSpacing.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderSpacingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderSpacing.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderSpacingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyle.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderStyle.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderStyleCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderTop.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderTop.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp index 41e857a..d342fe6 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BorderTop.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BorderTopCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/BorderTop.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidth.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/BorderWidth.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/BorderWidthCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRule.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/ColumnRule.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp index e62604b2..25cc470 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRule.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnRuleCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/ColumnRule.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Columns.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Columns.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ColumnsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Flex.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Flex.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/FlexCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlow.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/FlexFlow.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp index 46e13ba..917504e 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlow.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/FlexFlowCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/FlexFlow.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Font.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FontCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Font.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/FontCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/FontVariant.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/FontVariant.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/FontVariantCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridArea.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/GridArea.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridAreaCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridColumn.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/GridColumn.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridColumnCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Grid.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Grid.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridGap.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/GridGap.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridGapCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridRow.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/GridRow.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridRowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplate.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/GridTemplate.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/GridTemplateCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ListStyle.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/ListStyle.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp index f2aa050..4f4e942 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/ListStyle.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/ListStyleCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/ListStyle.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Margin.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Margin.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/MarginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Marker.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/MarkerCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Marker.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/MarkerCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Offset.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/OffsetCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Offset.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/OffsetCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Outline.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/Outline.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp index b593f9a..8b67cd1 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/Outline.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/OutlineCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/Outline.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Overflow.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/OverflowCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Overflow.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/OverflowCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/OverscrollBehavior.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/OverscrollBehaviorCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/OverscrollBehavior.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/OverscrollBehaviorCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Padding.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Padding.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PaddingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakAfter.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakAfterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PageBreakAfter.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PageBreakAfterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakBefore.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakBeforeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PageBreakBefore.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PageBreakBeforeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakInside.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PageBreakInsideCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PageBreakInside.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PageBreakInsideCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContent.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PlaceContent.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PlaceContentCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItems.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PlaceItems.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PlaceItemsCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelf.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelf.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/PlaceSelfCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlock.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlock.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingBlockCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPadding.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollPadding.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInline.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInline.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollPaddingInlineCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginBlock.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginBlockCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginBlock.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginBlockCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMargin.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMargin.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginInline.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginInlineCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginInline.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/ScrollSnapMarginInlineCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/TextDecoration.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/TextDecoration.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp index f4e7b4f8..91b1311f 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/TextDecoration.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/TextDecorationCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/TextDecoration.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/Transition.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/TransitionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/Transition.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/TransitionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderAfter.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderAfterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderAfter.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderAfterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderBefore.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderBeforeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderBefore.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderBeforeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderEnd.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderEndCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderEnd.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderEndCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderStart.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderStartCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderStart.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitBorderStartCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakAfter.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakAfterCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakAfter.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakAfterCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakBefore.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakBeforeCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakBefore.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakBeforeCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakInside.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakInsideCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakInside.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitColumnBreakInsideCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMarginCollapse.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMarginCollapseCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitMarginCollapse.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitMarginCollapseCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskBoxImage.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskBoxImageCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskBoxImage.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskBoxImageCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMask.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitMask.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPosition.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPosition.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeat.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp similarity index 100% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeat.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasis.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasisCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasis.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasisCustom.cpp index 35f3585..32ff7c87 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasis.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextEmphasisCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/WebkitTextEmphasis.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStroke.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStrokeCustom.cpp similarity index 99% rename from third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStroke.cpp rename to third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStrokeCustom.cpp index 91141ca6..c5432fa2 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStroke.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitTextStrokeCustom.cpp
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "core/css/properties/shorthands/WebkitTextStroke.h" + #include "core/StylePropertyShorthand.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp index 7c62be5..06ddada 100644 --- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -250,12 +250,10 @@ web_local_frame_impl_->GetFrame(), web_local_frame_impl_->GetFrame()->GetInstrumentationToken())), resource_container_(new InspectorResourceContainer(inspected_frames_)), - trace_events_(new InspectorTraceEvents()), include_view_agents_(include_view_agents), layer_tree_id_(0) { DCHECK(IsMainThread()); DCHECK(web_local_frame_impl_->GetFrame()); - probe_sink_->addInspectorTraceEvents(trace_events_); } WebDevToolsAgentImpl::~WebDevToolsAgentImpl() { @@ -268,7 +266,6 @@ visitor->Trace(resource_content_loader_); visitor->Trace(inspected_frames_); visitor->Trace(resource_container_); - visitor->Trace(trace_events_); visitor->Trace(page_agents_); visitor->Trace(network_agents_); visitor->Trace(tracing_agents_); @@ -279,8 +276,6 @@ void WebDevToolsAgentImpl::WillBeDestroyed() { DCHECK(web_local_frame_impl_->GetFrame()); DCHECK(inspected_frames_->Root()->View()); - probe_sink_->removeInspectorTraceEvents(trace_events_); - trace_events_ = nullptr; Vector<int> session_ids; for (int session_id : sessions_.Keys())
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h index 1fbddea5..9fbc896 100644 --- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h +++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h
@@ -51,7 +51,6 @@ class InspectorOverlayAgent; class InspectorResourceContainer; class InspectorResourceContentLoader; -class InspectorTraceEvents; class LocalFrame; class WebDevToolsAgentClient; class WebLayerTreeView; @@ -146,7 +145,6 @@ Member<InspectorResourceContentLoader> resource_content_loader_; Member<InspectedFrames> inspected_frames_; Member<InspectorResourceContainer> resource_container_; - Member<InspectorTraceEvents> trace_events_; HeapHashMap<int, Member<InspectorPageAgent>> page_agents_; HeapHashMap<int, Member<InspectorNetworkAgent>> network_agents_;
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index db596ad7..8bc21d5 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -63,6 +63,7 @@ #include "core/html/PluginDocument.h" #include "core/input/EventHandler.h" #include "core/inspector/ConsoleMessage.h" +#include "core/inspector/InspectorTraceEvents.h" #include "core/layout/HitTestResult.h" #include "core/layout/LayoutView.h" #include "core/layout/api/LayoutEmbeddedContentItem.h" @@ -220,6 +221,7 @@ visitor->Trace(probe_sink_); visitor->Trace(performance_monitor_); visitor->Trace(idleness_detector_); + visitor->Trace(inspector_trace_events_); visitor->Trace(loader_); visitor->Trace(navigation_scheduler_); visitor->Trace(view_); @@ -280,6 +282,8 @@ if (IsLocalRoot()) performance_monitor_->Shutdown(); idleness_detector_->Shutdown(); + if (inspector_trace_events_) + probe_sink_->removeInspectorTraceEvents(inspector_trace_events_); PluginScriptForbiddenScope forbid_plugin_destructor_scripting; loader_.StopAllLoaders(); @@ -802,6 +806,8 @@ if (IsLocalRoot()) { probe_sink_ = new CoreProbeSink(); performance_monitor_ = new PerformanceMonitor(this); + inspector_trace_events_ = new InspectorTraceEvents(); + probe_sink_->addInspectorTraceEvents(inspector_trace_events_); } else { // Inertness only needs to be updated if this frame might inherit the // inert state from a higher-level frame. If this is an OOPIF local root,
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h index e6b97eb..8247fabd 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.h +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h
@@ -63,6 +63,7 @@ class FrameResourceCoordinator; class FrameSelection; class InputMethodController; +class InspectorTraceEvents; class CoreProbeSink; class IdlenessDetector; class InterfaceRegistry; @@ -348,6 +349,7 @@ Member<CoreProbeSink> probe_sink_; Member<PerformanceMonitor> performance_monitor_; Member<IdlenessDetector> idleness_detector_; + Member<InspectorTraceEvents> inspector_trace_events_; InterfaceRegistry* const interface_registry_; String instrumentation_token_;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp index cc699f5..1f5f337 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -92,23 +92,6 @@ v8::CpuProfiler::CollectSample(v8::Isolate::GetCurrent()); } -void InspectorTraceEvents::Init(CoreProbeSink* instrumenting_agents, - protocol::UberDispatcher*, - protocol::DictionaryValue*) { - instrumenting_agents_ = instrumenting_agents; - instrumenting_agents_->addInspectorTraceEvents(this); -} - -void InspectorTraceEvents::Dispose() { - instrumenting_agents_->removeInspectorTraceEvents(this); - instrumenting_agents_ = nullptr; -} - -void InspectorTraceEvents::Trace(blink::Visitor* visitor) { - visitor->Trace(instrumenting_agents_); - InspectorAgent::Trace(visitor); -} - void InspectorTraceEvents::WillSendRequest( ExecutionContext*, unsigned long identifier,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h index 31291a744..b91ca9f1 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
@@ -10,7 +10,6 @@ #include "base/macros.h" #include "core/CoreExport.h" #include "core/css/CSSSelector.h" -#include "core/inspector/InspectorBaseAgent.h" #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/instrumentation/tracing/TracedValue.h" @@ -70,14 +69,11 @@ class ParseHTML; } -class CORE_EXPORT InspectorTraceEvents : public InspectorAgent { +class CORE_EXPORT InspectorTraceEvents + : public GarbageCollected<InspectorTraceEvents> { public: InspectorTraceEvents() {} - void Init(CoreProbeSink*, - protocol::UberDispatcher*, - protocol::DictionaryValue*) override; - void Dispose() override; void WillSendRequest(ExecutionContext*, unsigned long identifier, DocumentLoader*, @@ -113,10 +109,9 @@ void PaintTiming(Document*, const char* name, double timestamp); - void Trace(blink::Visitor*) override; + void Trace(blink::Visitor*) {} private: - Member<CoreProbeSink> instrumenting_agents_; DISALLOW_COPY_AND_ASSIGN(InspectorTraceEvents); };
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp index 01b61fcd..0d245be 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -479,6 +479,7 @@ DISABLE_CFI_PERF void LayoutBlock::ComputeOverflow(LayoutUnit old_client_after_edge, bool) { + LayoutRect previous_visual_overflow_rect = VisualOverflowRect(); overflow_.reset(); AddOverflowFromChildren(); @@ -508,12 +509,8 @@ AddVisualEffectOverflow(); AddVisualOverflowFromTheme(); - // An enclosing composited layer will need to update its bounds if we now - // overflow it. - PaintLayer* layer = EnclosingLayer(); - if (!NeedsLayout() && layer->HasCompositedLayerMapping() && - !layer->VisualRect().Contains(VisualOverflowRect())) - layer->SetNeedsCompositingInputsUpdate(); + if (Layer() && VisualOverflowRect() != previous_visual_overflow_rect) + Layer()->SetNeedsCompositingInputsUpdate(); } void LayoutBlock::AddOverflowFromBlockChildren() {
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h index d7495ad3..2634446 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
@@ -587,8 +587,6 @@ void RemoveFloatingObject(LayoutBox*); void RemoveFloatingObjectsBelow(FloatingObject*, LayoutUnit logical_offset); - LayoutUnit GetClearDelta(LayoutBox* child, LayoutUnit y_pos); - bool HasOverhangingFloat(LayoutBox*); void AddIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, @@ -871,6 +869,8 @@ virtual ETextAlign TextAlignmentForLine(bool ends_with_soft_break) const; + LayoutUnit GetClearDelta(LayoutBox* child, LayoutUnit y_pos); + private: LayoutUnit CollapsedMarginBefore() const final { return MaxPositiveMarginBefore() - MaxNegativeMarginBefore();
diff --git a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp index 37b3c523..6715329 100644 --- a/third_party/WebKit/Source/core/layout/LayoutListItem.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
@@ -219,6 +219,17 @@ return false; } +void LayoutListItem::UpdateBlockLayout(bool relayout_children) { + DCHECK(NeedsLayout()); + // The list marker needs to clear any floats that leave no room + // for it. + if (marker_) { + marker_->SetLogicalTop(marker_->LogicalTop() + + GetClearDelta(marker_, LayoutUnit())); + } + LayoutBlockFlow::UpdateBlockLayout(relayout_children); +} + bool LayoutListItem::UpdateMarkerLocation() { DCHECK(marker_); @@ -354,10 +365,7 @@ // pretty wrong (https://crbug.com/554160). // FIXME: Need to account for relative positioning in the layout overflow. if (Style()->IsLeftToRightDirection()) { - LayoutUnit marker_line_offset = - std::min(marker_->LineOffset(), - LogicalLeftOffsetForLine(marker_->LogicalTop(), - kDoNotIndentText, LayoutUnit())); + LayoutUnit marker_line_offset = marker_->LineOffset(); marker_logical_left = marker_line_offset - line_offset - PaddingStart() - BorderStart() + marker_->MarginStart(); marker_inline_box->MoveInInlineDirection(marker_logical_left - @@ -390,10 +398,7 @@ hit_self_painting_layer = true; } } else { - LayoutUnit marker_line_offset = - std::max(marker_->LineOffset(), - LogicalRightOffsetForLine(marker_->LogicalTop(), - kDoNotIndentText, LayoutUnit())); + LayoutUnit marker_line_offset = marker_->LineOffset(); marker_logical_left = marker_line_offset - line_offset + PaddingStart() + BorderStart() + marker_->MarginEnd(); marker_inline_box->MoveInInlineDirection(marker_logical_left -
diff --git a/third_party/WebKit/Source/core/layout/LayoutListItem.h b/third_party/WebKit/Source/core/layout/LayoutListItem.h index 1392a1f8..f8378eb 100644 --- a/third_party/WebKit/Source/core/layout/LayoutListItem.h +++ b/third_party/WebKit/Source/core/layout/LayoutListItem.h
@@ -26,6 +26,7 @@ #include "core/html/ListItemOrdinal.h" #include "core/layout/LayoutBlockFlow.h" +#include "core/layout/LayoutBox.h" namespace blink { @@ -35,6 +36,8 @@ public: explicit LayoutListItem(Element*); + void UpdateBlockLayout(bool relayout_children) override; + int Value() const; const String& MarkerText() const;
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h index 149c68e..f8c2286 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
@@ -66,13 +66,14 @@ // Create a box when the box is empty, for open/close tags. bool needs_box_when_empty = false; - // Inside of this is not breakable. Set only for text items. + // Inside of this may be breakable. False means there are no break + // opportunities, or has CSS properties that prohibit breaking. // Used only during line breaking. - bool no_break_opportunities_inside = false; + bool may_break_inside = false; - // Lines must not break after this. Set for all items. + // Lines can break after this item. Set for all items. // Used only during line breaking. - bool prohibit_break_after = false; + bool can_break_after = false; // Has spaces that hangs beyond the end margin. // Set only for text items.
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 1debd2b..9208f66 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
@@ -48,6 +48,12 @@ } } +inline NGLineBreaker::LineBreakState NGLineBreaker::ToLineBreakState( + const NGInlineItemResult& item_result) { + return item_result.can_break_after ? LineBreakState::kIsBreakable + : LineBreakState::kNotBreakable; +} + // @return if this is the "first formatted line". // https://www.w3.org/TR/CSS22/selector.html#first-formatted-line bool NGLineBreaker::IsFirstFormattedLine() const { @@ -152,8 +158,8 @@ #if DCHECK_IS_ON() if (!item_results->IsEmpty() && (state == LineBreakState::kIsBreakable || state == LineBreakState::kNotBreakable)) { - DCHECK_EQ(item_results->back().prohibit_break_after, - state == LineBreakState::kNotBreakable); + DCHECK_EQ(item_results->back().can_break_after, + state == LineBreakState::kIsBreakable); } #endif @@ -196,15 +202,14 @@ } else if (item.Length()) { // For other items with text (e.g., bidi controls), use their text to // determine the break opportunity. - item_result->prohibit_break_after = - !break_iterator_.IsBreakable(item_result->end_offset); - state = item_result->prohibit_break_after ? LineBreakState::kNotBreakable - : LineBreakState::kIsBreakable; + item_result->can_break_after = + break_iterator_.IsBreakable(item_result->end_offset); + state = ToLineBreakState(*item_result); MoveToNextOf(item); } else { if (item.Type() == NGInlineItem::kListMarker) line_.should_create_line_box = true; - item_result->prohibit_break_after = true; + DCHECK(!item_result->can_break_after); state = LineBreakState::kNotBreakable; MoveToNextOf(item); } @@ -255,10 +260,10 @@ NGLineBreaker::LineBreakState NGLineBreaker::ComputeIsBreakableAfter( NGInlineItemResult* item_result) const { if (auto_wrap_ && break_iterator_.IsBreakable(item_result->end_offset)) { - DCHECK(!item_result->prohibit_break_after); + item_result->can_break_after = true; return LineBreakState::kIsBreakable; } - item_result->prohibit_break_after = true; + DCHECK(!item_result->can_break_after); return LineBreakState::kNotBreakable; } @@ -279,7 +284,7 @@ LayoutUnit next_position = line_.position + item_result->inline_size; if (!auto_wrap_ || next_position <= available_width) { item_result->shape_result = item.TextShapeResult(); - item_result->no_break_opportunities_inside = !auto_wrap_; + item_result->may_break_inside = auto_wrap_; line_.position = next_position; MoveToNextOf(item); return ComputeIsBreakableAfter(item_result); @@ -292,7 +297,7 @@ LayoutUnit next_position = line_.position + item_result->inline_size; bool is_overflow = next_position > available_width; line_.position = next_position; - item_result->no_break_opportunities_inside = is_overflow; + item_result->may_break_inside = !is_overflow; if (item_result->end_offset < item.EndOffset()) offset_ = item_result->end_offset; else @@ -311,8 +316,7 @@ } DCHECK(is_overflow || item_result->start_offset != item.StartOffset()); - return item_result->prohibit_break_after ? LineBreakState::kNotBreakable - : LineBreakState::kIsBreakable; + return ToLineBreakState(*item_result); } // Add the rest of the item if !auto_wrap. @@ -321,8 +325,8 @@ DCHECK_NE(offset_, item.StartOffset()); BreakText(item_result, item, LayoutUnit::Max(), line_info); DCHECK_EQ(item_result->end_offset, item.EndOffset()); - item_result->no_break_opportunities_inside = true; - item_result->prohibit_break_after = true; + DCHECK(!item_result->may_break_inside); + item_result->can_break_after = false; line_.position += item_result->inline_size; MoveToNextOf(item); return LineBreakState::kNotBreakable; @@ -394,11 +398,11 @@ // offset is the first break opportunity, either inside, at the end, or // beyond the end. if (item_result->end_offset < item.EndOffset()) { - item_result->prohibit_break_after = false; + item_result->can_break_after = true; } else { DCHECK_EQ(item_result->end_offset, item.EndOffset()); - item_result->prohibit_break_after = - !break_iterator_.IsBreakable(item_result->end_offset); + item_result->can_break_after = + break_iterator_.IsBreakable(item_result->end_offset); } } @@ -435,14 +439,17 @@ line_.position += item_result->inline_size; MoveToNextOf(item); // TODO(kojii): Implement break around the tab character. + item_result->can_break_after = true; return LineBreakState::kIsBreakable; } case kZeroWidthSpaceCharacter: // <wbr> tag creates break opportunities regardless of auto_wrap. MoveToNextOf(item); + item_result->can_break_after = true; return LineBreakState::kIsBreakable; } NOTREACHED(); + item_result->can_break_after = true; return LineBreakState::kIsBreakable; } @@ -580,7 +587,7 @@ void NGLineBreaker::HandleOpenTag(const NGInlineItem& item, NGInlineItemResult* item_result) { - item_result->prohibit_break_after = true; + DCHECK(!item_result->can_break_after); DCHECK(item.Style()); const ComputedStyle& style = *item.Style(); @@ -646,7 +653,7 @@ SetCurrentStyle(item.GetLayoutObject()->Parent()->StyleRef()); MoveToNextOf(item); - // Prohibit break before a close tag by setting prohibit_break_after to the + // Prohibit break before a close tag by setting can_break_after to the // previous result. // TODO(kojii): There should be a result before close tag, but there are cases // that doesn't because of the way we handle trailing spaces. This needs to be @@ -654,12 +661,11 @@ if (item_results->size() >= 2) { NGInlineItemResult* last = &(*item_results)[item_results->size() - 2]; if (was_auto_wrap == auto_wrap_) { - item_result->prohibit_break_after = last->prohibit_break_after; - last->prohibit_break_after = true; - return item_result->prohibit_break_after ? LineBreakState::kNotBreakable - : LineBreakState::kIsBreakable; + item_result->can_break_after = last->can_break_after; + last->can_break_after = false; + return ToLineBreakState(*item_result); } - last->prohibit_break_after = true; + last->can_break_after = false; } return ComputeIsBreakableAfter(item_result); } @@ -686,7 +692,7 @@ NGInlineItemResult* item_result = &(*item_results)[--i]; // Try to break after this item. - if (i < item_results->size() - 1 && !item_result->prohibit_break_after) { + if (i < item_results->size() - 1 && item_result->can_break_after) { if (width_to_rewind <= 0) { line_.position = available_width + width_to_rewind; return Rewind(line_info, i + 1); @@ -700,7 +706,7 @@ DCHECK(item_result->item); const NGInlineItem& item = *item_result->item; if (item.Type() == NGInlineItem::kText && next_width_to_rewind < 0 && - (!item_result->no_break_opportunities_inside || force_break_anywhere)) { + (item_result->may_break_inside || force_break_anywhere)) { // When the text fits but its right margin does not, the break point // must not be at the end. LayoutUnit item_available_width = @@ -716,7 +722,7 @@ DCHECK(item_result->end_offset < item.EndOffset() || (item_result->end_offset == item.EndOffset() && item_result->has_hanging_spaces)); - DCHECK(!item_result->prohibit_break_after); + DCHECK(item_result->can_break_after); DCHECK_LE(i + 1, item_results->size()); if (i + 1 == item_results->size()) { line_.position =
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h index ffb88a7..db5dbe76 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h
@@ -133,6 +133,7 @@ void SetCurrentStyle(const ComputedStyle&); bool IsFirstBreakOpportunity(unsigned, const NGLineInfo&) const; + static LineBreakState ToLineBreakState(const NGInlineItemResult&); LineBreakState ComputeIsBreakableAfter(NGInlineItemResult*) const; void MoveToNextOf(const NGInlineItem&);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc index cce67727..2e35734 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_absolute_utils.cc
@@ -216,8 +216,13 @@ width = container_size.width - *left - *right - *margin_left - *margin_right; } - DCHECK_EQ(container_size.width, - *left + *right + *margin_left + *margin_right + *width); + + // The DCHECK is useful, but only holds true when not saturated. + if (!(left->MightBeSaturated() || right->MightBeSaturated() || + width->MightBeSaturated() || margin_left->MightBeSaturated() || + margin_right->MightBeSaturated())) + DCHECK_EQ(container_size.width, + *left + *right + *margin_left + *margin_right + *width); // If calculated width is outside of min/max constraints, // rerun the algorithm with constrained width.
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp index 62e09fe..98aaf67 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1631,6 +1631,7 @@ context_.force_subtree_update = true; fragment.ClearPaintProperties(); } + fragment.SetPaginationOffset(LayoutPoint()); } void ObjectPaintPropertyTreeBuilder::InitSingleFragmentFromParent(
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp index b618ab0..f3458eb 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -3735,6 +3735,31 @@ // TODO(crbug.com/797779): Add code to verify fragments under the iframe. } +TEST_P(PaintPropertyTreeBuilderTest, + FragmentedBecomesUnfragmentedClearPaginationOffset) { + SetBodyInnerHTML(R"HTML( + <style> + #target { + width: 30px; height: 20px; position: relative; + } + </style> + <div style='columns: 2; height: 20px width: 400px'> + <div style='height: 20px'></div> + <div id=target></div> + </div> + </div> + )HTML"); + + LayoutObject* target = GetLayoutObjectByElementId("target"); + EXPECT_EQ(LayoutPoint(LayoutUnit(392.5f), LayoutUnit(-20)), + target->FirstFragment().PaginationOffset()); + Element* target_element = GetDocument().getElementById("target"); + + target_element->setAttribute(HTMLNames::styleAttr, "position: absolute"); + GetDocument().View()->UpdateAllLifecyclePhases(); + EXPECT_EQ(LayoutPoint(0, 0), target->FirstFragment().PaginationOffset()); +} + TEST_P(PaintPropertyTreeBuilderTest, Reflection) { SetBodyInnerHTML( "<div id='filter' style='-webkit-box-reflect: below; height:1000px;'>"
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index 734e2c4a..7e0f265a 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -512,6 +512,8 @@ if (InstanceCounters::CounterValue( InstanceCounters::kRTCPeerConnectionCounter) >= kMaxPeerConnections) { + closed_ = true; + stopped_ = true; exception_state.ThrowDOMException(kUnknownError, "Cannot create so many PeerConnections"); return;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp index 5b431dc..f2585ae 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -37,7 +37,9 @@ #include <memory> #include <utility> +#include "platform/fonts/CharacterRange.h" #include "platform/fonts/Font.h" +#include "platform/fonts/shaping/ShapeResultBuffer.h" #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" #include "platform/fonts/shaping/ShapeResultSpacing.h" #include "platform/wtf/text/StringBuilder.h" @@ -226,6 +228,12 @@ return self_byte_size; } +CharacterRange ShapeResult::GetCharacterRange(unsigned from, + unsigned to) const { + return ShapeResultBuffer::GetCharacterRange(this, Direction(), Width(), from, + to); +} + unsigned ShapeResult::StartIndexForResult() const { if (UNLIKELY(runs_.IsEmpty())) return 0;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h index 0843d2be..2d265c9 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
@@ -47,6 +47,7 @@ namespace blink { +struct CharacterRange; class Font; template <typename TextContainerType> class PLATFORM_EXPORT ShapeResultSpacing; @@ -78,6 +79,7 @@ // even when the result is in vertical flow. const FloatRect& Bounds() const { return glyph_bounding_box_; } unsigned NumCharacters() const { return num_characters_; } + CharacterRange GetCharacterRange(unsigned from, unsigned to) const; // The character start/end index of a range shape result. unsigned StartIndexForResult() const; unsigned EndIndexForResult() const;
diff --git a/third_party/android_platform/README.chromium b/third_party/android_platform/README.chromium index 2346f55..9685213 100644 --- a/third_party/android_platform/README.chromium +++ b/third_party/android_platform/README.chromium
@@ -40,6 +40,10 @@ Fixed invalid using decl in logging header debug.h Only attempt to symbolize with ELF libraries. +Changed the stack script to use llvm symbolizer instead of addr2line, +objdump, etc, since llvm symbolizer is more efficient in finding +function names, line numbers etc. + Android relocation packing tool details: Copy sources from AOSP bionic/tools/relocation_packer Remove scripts that regenerate golden test data (not relevant here)
diff --git a/third_party/android_platform/development/scripts/stack b/third_party/android_platform/development/scripts/stack index 8d09461..a69cec3 100755 --- a/third_party/android_platform/development/scripts/stack +++ b/third_party/android_platform/development/scripts/stack
@@ -31,8 +31,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir, 'build', 'android')) + from pylib import constants +sys.path.insert(0, os.path.join(os.path.dirname(__file__), + os.pardir, os.pardir, os.pardir, os.pardir, + 'tools', 'python')) +import llvm_symbolizer DEFAULT_SYMROOT='/tmp/symbols' # From: https://source.android.com/source/build-numbers.html @@ -225,10 +230,12 @@ print ("Reading Android symbols from: " + os.path.normpath(symbol.SYMBOLS_DIR)) chrome_search_path = symbol.GetLibrarySearchPaths() - print ("Searching for Chrome symbols from within: " - + ':'.join((os.path.normpath(d) for d in chrome_search_path))) - stack_core.ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome, - arch_defined) + + with llvm_symbolizer.LLVMSymbolizer() as symbolizer: + print ("Searching for Chrome symbols from within: " + + ':'.join((os.path.normpath(d) for d in chrome_search_path))) + stack_core.ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome, + arch_defined, symbolizer) if rootdir: # be a good citizen and clean up...os.rmdir and os.removedirs() don't work
diff --git a/third_party/android_platform/development/scripts/stack_core.py b/third_party/android_platform/development/scripts/stack_core.py index f206793..03c5f59 100755 --- a/third_party/android_platform/development/scripts/stack_core.py +++ b/third_party/android_platform/development/scripts/stack_core.py
@@ -158,7 +158,7 @@ print print '-----------------------------------------------------\n' -def ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome, arch_defined): +def ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome, arch_defined, llvm_symbolizer): """Convert strings containing native crash to a stack.""" InitWidthRelatedLineMatchers() @@ -189,7 +189,7 @@ print ('Find ABI:' + arch) symbol.ARCH = arch - ResolveCrashSymbol(list(useful_log), more_info) + ResolveCrashSymbol(list(useful_log), more_info, llvm_symbolizer) end = time.time() logging.debug('Finished resolving symbols. Elapsed time: %.4fs', (end - start)) @@ -304,7 +304,7 @@ useful_log.append(line) return useful_log, self._so_dirs -def ResolveCrashSymbol(lines, more_info): +def ResolveCrashSymbol(lines, more_info, llvm_symbolizer): """Convert unicode strings which contains native crash to a stack """ @@ -313,39 +313,15 @@ last_frame = -1 pid = -1 - # It is faster to get symbol information with a single call rather than with - # separate calls for each line. Since symbol.SymbolInformation caches results, - # we can extract all the addresses that we will want symbol information for - # from the log and call symbol.SymbolInformation so that the results are - # cached in the following lookups. - code_addresses = {} - # Collects all java exception lines, keyed by pid for later output during # native crash handling. java_stderr_by_pid = {} for line in lines: - lib, address = None, None - - match = _TRACE_LINE.match(line) or _DEBUG_TRACE_LINE.match(line) - if match: - address, lib = match.group('address', 'lib') - - match = _VALUE_LINE.match(line) - if match and not _CODE_LINE.match(line): - (_0, _1, address, lib, _2, _3) = match.groups() - - if lib: - code_addresses.setdefault(lib, set()).add(address) - java_stderr_match = _JAVA_STDERR_LINE.search(line) if java_stderr_match: pid, msg = java_stderr_match.groups() java_stderr_by_pid.setdefault(pid, []).append(msg) - for lib in code_addresses: - symbol.SymbolInformationForSet( - symbol.TranslateLibPath(lib), code_addresses[lib], more_info) - for line in lines: # AndroidFeedback adds zero width spaces into its crash reports. These # should be removed or the regular expresssions will fail to match. @@ -410,25 +386,19 @@ logging.debug('Identified lib: %s' % area) # If a calls b which further calls c and c is inlined to b, we want to # display "a -> b -> c" in the stack trace instead of just "a -> c" - info = symbol.SymbolInformation(area, code_addr, more_info) + # To use llvm symbolizer, the hexadecimal address has to start with 0x. + info = llvm_symbolizer.GetSymbolInformation( + os.path.join(symbol.SYMBOLS_DIR, symbol.TranslateLibPath(area)), + '0x' + code_addr) logging.debug('symbol information: %s' % info) nest_count = len(info) - 1 - for (source_symbol, source_location, object_symbol_with_offset) in info: - if not source_symbol: - if symbol_present: - source_symbol = symbol.CallCppFilt(symbol_name) - else: - source_symbol = UNKNOWN - if not source_location: - source_location = area + for source_symbol, source_location in info: if nest_count > 0: nest_count = nest_count - 1 trace_lines.append(('v------>', source_symbol, source_location)) else: - if not object_symbol_with_offset: - object_symbol_with_offset = source_symbol trace_lines.append((code_addr, - object_symbol_with_offset, + source_symbol, source_location)) match = _VALUE_LINE.match(line) if match: @@ -436,20 +406,14 @@ if area == UNKNOWN or area == HEAP or area == STACK or not area: value_lines.append((addr, value, '', area)) else: - info = symbol.SymbolInformation(area, value, more_info) - (source_symbol, source_location, object_symbol_with_offset) = info.pop() - if not source_symbol: - if symbol_present: - source_symbol = symbol.CallCppFilt(symbol_name) - else: - source_symbol = UNKNOWN - if not source_location: - source_location = area - if not object_symbol_with_offset: - object_symbol_with_offset = source_symbol + info = llvm_symbolizer.GetSymbolInformation( + os.path.join(symbol.SYMBOLS_DIR, symbol.TranslateLibPath(area)), + '0x' + value) + source_symbol, source_location = info.pop() + value_lines.append((addr, value, - object_symbol_with_offset, + source_symbol, source_location)) java_lines = []
diff --git a/third_party/android_platform/development/scripts/symbol.py b/third_party/android_platform/development/scripts/symbol.py index 469446ca..8e09ba7 100755 --- a/third_party/android_platform/development/scripts/symbol.py +++ b/third_party/android_platform/development/scripts/symbol.py
@@ -104,56 +104,6 @@ toolchain_subdir, toolchain_prefix + "-" + tool) -def FindToolchain(): - """Look for the latest available toolchain - - Args: - None - - Returns: - A pair of strings containing toolchain label and target prefix. - """ - global TOOLCHAIN_INFO - if TOOLCHAIN_INFO is not None: - return TOOLCHAIN_INFO - - ## Known toolchains, newer ones in the front. - gcc_version = "4.9" - if ARCH == "arm64": - known_toolchains = [ - ("aarch64-linux-android-" + gcc_version, "aarch64", "aarch64-linux-android") - ] - elif ARCH == "arm": - known_toolchains = [ - ("arm-linux-androideabi-" + gcc_version, "arm", "arm-linux-androideabi") - ] - elif ARCH =="x86": - known_toolchains = [ - ("x86-" + gcc_version, "x86", "i686-linux-android") - ] - elif ARCH =="x86_64" or ARCH =="x64": - known_toolchains = [ - ("x86_64-" + gcc_version, "x86_64", "x86_64-linux-android") - ] - elif ARCH == "mips": - known_toolchains = [ - ("mipsel-linux-android-" + gcc_version, "mips", "mipsel-linux-android") - ] - else: - known_toolchains = [] - - logging.debug('FindToolcahin: known_toolchains=%s' % known_toolchains) - # Look for addr2line to check for valid toolchain path. - for (label, platform, target) in known_toolchains: - toolchain_info = (label, platform, target); - if os.path.exists(ToolPath("addr2line", toolchain_info)): - TOOLCHAIN_INFO = toolchain_info - print ("Using toolchain from: " - + os.path.normpath(ToolPath("", TOOLCHAIN_INFO))) - return toolchain_info - - raise Exception("Could not find tool chain") - def GetAapt(): """Returns the path to aapt. @@ -364,250 +314,7 @@ library_path = os.path.relpath(candidate_libraries[0], SYMBOLS_DIR) logging.debug('TranslateLibPath: library_path=%s' % library_path) - return '/' + library_path - -def SymbolInformation(lib, addr, get_detailed_info): - """Look up symbol information about an address. - - Args: - lib: library (or executable) pathname containing symbols - addr: string hexidecimal address - - Returns: - A list of the form [(source_symbol, source_location, - object_symbol_with_offset)]. - - If the function has been inlined then the list may contain - more than one element with the symbols for the most deeply - nested inlined location appearing first. The list is - always non-empty, even if no information is available. - - Usually you want to display the source_location and - object_symbol_with_offset from the last element in the list. - """ - lib = TranslateLibPath(lib) - info = SymbolInformationForSet(lib, set([addr]), get_detailed_info) - return (info and info.get(addr)) or [(None, None, None)] - - -def SymbolInformationForSet(lib, unique_addrs, get_detailed_info): - """Look up symbol information for a set of addresses from the given library. - - Args: - lib: library (or executable) pathname containing symbols - unique_addrs: set of hexidecimal addresses - - Returns: - A dictionary of the form {addr: [(source_symbol, source_location, - object_symbol_with_offset)]} where each address has a list of - associated symbols and locations. The list is always non-empty. - - If the function has been inlined then the list may contain - more than one element with the symbols for the most deeply - nested inlined location appearing first. The list is - always non-empty, even if no information is available. - - Usually you want to display the source_location and - object_symbol_with_offset from the last element in the list. - """ - if not lib: - return None - - addr_to_line = CallAddr2LineForSet(lib, unique_addrs) - if not addr_to_line: - return None - - if get_detailed_info: - addr_to_objdump = CallObjdumpForSet(lib, unique_addrs) - if not addr_to_objdump: - return None - else: - addr_to_objdump = dict((addr, ("", 0)) for addr in unique_addrs) - - result = {} - for addr in unique_addrs: - source_info = addr_to_line.get(addr) - if not source_info: - source_info = [(None, None)] - if addr in addr_to_objdump: - (object_symbol, object_offset) = addr_to_objdump.get(addr) - object_symbol_with_offset = FormatSymbolWithOffset(object_symbol, - object_offset) - else: - object_symbol_with_offset = None - result[addr] = [(source_symbol, source_location, object_symbol_with_offset) - for (source_symbol, source_location) in source_info] - - return result - - -class MemoizedForSet(object): - def __init__(self, fn): - self.fn = fn - self.cache = {} - - def __call__(self, lib, unique_addrs): - lib_cache = self.cache.setdefault(lib, {}) - - no_cache = filter(lambda x: x not in lib_cache, unique_addrs) - if no_cache: - lib_cache.update((k, None) for k in no_cache) - result = self.fn(lib, no_cache) - if result: - lib_cache.update(result) - - return dict((k, lib_cache[k]) for k in unique_addrs if lib_cache[k]) - - -@MemoizedForSet -def CallAddr2LineForSet(lib, unique_addrs): - """Look up line and symbol information for a set of addresses. - - Args: - lib: library (or executable) pathname containing symbols - unique_addrs: set of string hexidecimal addresses look up. - - Returns: - A dictionary of the form {addr: [(symbol, file:line)]} where - each address has a list of associated symbols and locations - or an empty list if no symbol information was found. - - If the function has been inlined then the list may contain - more than one element with the symbols for the most deeply - nested inlined location appearing first. - """ - if not lib: - return None - - symbols = SYMBOLS_DIR + lib - if not os.path.splitext(symbols)[1] in ['', '.so', '.apk']: - return None - - if not os.path.isfile(symbols): - return None - - addrs = sorted(unique_addrs) - result = {} - - def _Callback(sym, addr): - records = [] - while sym: # Traverse all the inlines following the |inlined_by| chain. - if sym.source_path and sym.source_line: - location = '%s:%d' % (sym.source_path, sym.source_line) - else: - location = None - records += [(sym.name, location)] - sym = sym.inlined_by - result[addr] = records - - (label, platform, target) = FindToolchain() - symbolizer = elf_symbolizer.ELFSymbolizer( - elf_file_path=symbols, - addr2line_path=ToolPath("addr2line"), - callback=_Callback, - inlines=True) - - for addr in addrs: - symbolizer.SymbolizeAsync(int(addr, 16), addr) - symbolizer.Join() - return result - - -def StripPC(addr): - """Strips the Thumb bit a program counter address when appropriate. - - Args: - addr: the program counter address - - Returns: - The stripped program counter address. - """ - global ARCH - - if ARCH == "arm": - return addr & ~1 - return addr - -@MemoizedForSet -def CallObjdumpForSet(lib, unique_addrs): - """Use objdump to find out the names of the containing functions. - - Args: - lib: library (or executable) pathname containing symbols - unique_addrs: set of string hexidecimal addresses to find the functions for. - - Returns: - A dictionary of the form {addr: (string symbol, offset)}. - """ - if not lib: - return None - - symbols = SYMBOLS_DIR + lib - if not os.path.exists(symbols): - return None - - symbols = SYMBOLS_DIR + lib - if not os.path.exists(symbols): - return None - - result = {} - - # Function lines look like: - # 000177b0 <android::IBinder::~IBinder()+0x2c>: - # We pull out the address and function first. Then we check for an optional - # offset. This is tricky due to functions that look like "operator+(..)+0x2c" - func_regexp = re.compile("(^[a-f0-9]*) \<(.*)\>:$") - offset_regexp = re.compile("(.*)\+0x([a-f0-9]*)") - - # A disassembly line looks like: - # 177b2: b510 push {r4, lr} - asm_regexp = re.compile("(^[ a-f0-9]*):[ a-f0-0]*.*$") - - for target_addr in unique_addrs: - start_addr_dec = str(StripPC(int(target_addr, 16))) - stop_addr_dec = str(StripPC(int(target_addr, 16)) + 8) - cmd = [ToolPath("objdump"), - "--section=.text", - "--demangle", - "--disassemble", - "--start-address=" + start_addr_dec, - "--stop-address=" + stop_addr_dec, - symbols] - - current_symbol = None # The current function symbol in the disassembly. - current_symbol_addr = 0 # The address of the current function. - - stream = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout - for line in stream: - # Is it a function line like: - # 000177b0 <android::IBinder::~IBinder()>: - components = func_regexp.match(line) - if components: - # This is a new function, so record the current function and its address. - current_symbol_addr = int(components.group(1), 16) - current_symbol = components.group(2) - - # Does it have an optional offset like: "foo(..)+0x2c"? - components = offset_regexp.match(current_symbol) - if components: - current_symbol = components.group(1) - offset = components.group(2) - if offset: - current_symbol_addr -= int(offset, 16) - - # Is it an disassembly line like: - # 177b2: b510 push {r4, lr} - components = asm_regexp.match(line) - if components: - addr = components.group(1) - i_addr = int(addr, 16) - i_target = StripPC(int(target_addr, 16)) - if i_addr == i_target: - result[target_addr] = (current_symbol, i_target - current_symbol_addr) - stream.close() - - return result - + return library_path def CallCppFilt(mangled_symbol): cmd = [ToolPath("c++filt")]
diff --git a/tools/binary_size/libsupersize/nm.py b/tools/binary_size/libsupersize/nm.py index 1483f51f..4a797de 100755 --- a/tools/binary_size/libsupersize/nm.py +++ b/tools/binary_size/libsupersize/nm.py
@@ -55,6 +55,7 @@ import subprocess import sys import threading +import traceback import concurrent import models @@ -669,8 +670,12 @@ def _WorkerThreadMain(self): while True: - func = self._job_queue.get() - func() + # Handle exceptions so test failure will be explicit and not block. + try: + func = self._job_queue.get() + func() + except Exception: + traceback.print_exc() self._job_queue.task_done() def _WaitForAnalyzePathJobs(self):
diff --git a/tools/clang/value_cleanup/ValueRewriter.cpp b/tools/clang/value_cleanup/ValueRewriter.cpp index 780f8bf2..647eb78 100644 --- a/tools/clang/value_cleanup/ValueRewriter.cpp +++ b/tools/clang/value_cleanup/ValueRewriter.cpp
@@ -4,31 +4,49 @@ #include "ValueRewriter.h" +#include <utility> + using namespace clang::ast_matchers; -ValueRewriter::GetTypeCallback::GetTypeCallback( +ValueRewriter::ListValueCallback::ListValueCallback( + std::string method, + std::string replacement, std::set<clang::tooling::Replacement>* replacements) - : replacements_(replacements) {} + : method_(std::move(method)), + replacement_(std::move(replacement)), + replacements_(replacements) {} -// Replaces calls to |base::Value::GetType| with calls to |base::Value::type|. -void ValueRewriter::GetTypeCallback::run( +void ValueRewriter::ListValueCallback::run( const MatchFinder::MatchResult& result) { - // Replace 'GetType' with 'type'. - auto* callExpr = result.Nodes.getNodeAs<clang::CXXMemberCallExpr>("callExpr"); + auto* callExpr = result.Nodes.getNodeAs<clang::CXXMemberCallExpr>(method()); clang::CharSourceRange call_range = clang::CharSourceRange::getTokenRange(callExpr->getExprLoc()); - replacements_->emplace(*result.SourceManager, call_range, "type"); + replacements_->emplace(*result.SourceManager, call_range, replacement()); } ValueRewriter::ValueRewriter( std::set<clang::tooling::Replacement>* replacements) - : get_type_callback_(replacements) {} + : list_value_callbacks_({ + {"::base::ListValue::Clear", "GetList().clear", replacements}, + {"::base::ListValue::GetSize", "GetList().size", replacements}, + {"::base::ListValue::empty", "GetList().empty", replacements}, + {"::base::ListValue::Reserve", "GetList().reserve", replacements}, + {"::base::ListValue::AppendBoolean", "GetList().emplace_back", + replacements}, + {"::base::ListValue::AppendInteger", "GetList().emplace_back", + replacements}, + {"::base::ListValue::AppendDouble", "GetList().emplace_back", + replacements}, + {"::base::ListValue::AppendString", "GetList().emplace_back", + replacements}, + }) {} void ValueRewriter::RegisterMatchers(MatchFinder* match_finder) { - match_finder->addMatcher( - id("callExpr", cxxMemberCallExpr(callee(cxxMethodDecl( - hasName("::base::Value::GetType"))), - argumentCountIs(0))), - &get_type_callback_); + for (auto& callback : list_value_callbacks_) { + match_finder->addMatcher( + callExpr(callee(functionDecl(hasName(callback.method())))) + .bind(callback.method()), + &callback); + } }
diff --git a/tools/clang/value_cleanup/ValueRewriter.h b/tools/clang/value_cleanup/ValueRewriter.h index e7aab75..8924c42 100644 --- a/tools/clang/value_cleanup/ValueRewriter.h +++ b/tools/clang/value_cleanup/ValueRewriter.h
@@ -8,6 +8,9 @@ #define TOOLS_CLANG_VALUE_CLEANUP_VALUE_REWRITER_H_ #include <set> +#include <string> +#include <utility> +#include <vector> #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/Tooling/Refactoring.h" @@ -19,20 +22,26 @@ void RegisterMatchers(clang::ast_matchers::MatchFinder* match_finder); private: - class GetTypeCallback + class ListValueCallback : public clang::ast_matchers::MatchFinder::MatchCallback { public: - explicit GetTypeCallback( - std::set<clang::tooling::Replacement>* replacements); + ListValueCallback(std::string method, + std::string replacement, + std::set<clang::tooling::Replacement>* replacements); void run( const clang::ast_matchers::MatchFinder::MatchResult& result) override; + const std::string& method() const { return method_; } + const std::string& replacement() const { return replacement_; } + private: + const std::string method_; + const std::string replacement_; std::set<clang::tooling::Replacement>* const replacements_; }; - GetTypeCallback get_type_callback_; + std::vector<ListValueCallback> list_value_callbacks_; }; #endif // TOOLS_CLANG_VALUE_CLEANUP_VALUE_REWRITER_H_
diff --git a/tools/clang/value_cleanup/tests/listvalue-expected.cc b/tools/clang/value_cleanup/tests/listvalue-expected.cc new file mode 100644 index 0000000..765713f9 --- /dev/null +++ b/tools/clang/value_cleanup/tests/listvalue-expected.cc
@@ -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. + +#include "values.h" + +// All of these should be renamed to |GetList().emplace_back()|. +void F() { + base::ListValue value; + value.GetList().emplace_back(false); + value.GetList().emplace_back(0); + value.GetList().emplace_back(0.0); + value.GetList().emplace_back(""); +} + +// All of these should be renamed to GetList() + their std::vector equivalent. +void G() { + base::ListValue value; + value.GetList().clear(); + value.GetList().size(); + value.GetList().empty(); + value.GetList().reserve(0); +} + +// None of these should be renamed, as these methods require different handling. +void H() { + base::ListValue value; + value.Append(std::unique_ptr<base::Value>(new base::Value())); + value.AppendStrings({"foo", "bar"}); + value.AppendIfNotPresent(std::unique_ptr<base::Value>(new base::Value())); +}
diff --git a/tools/clang/value_cleanup/tests/listvalue-original.cc b/tools/clang/value_cleanup/tests/listvalue-original.cc new file mode 100644 index 0000000..7cb3138 --- /dev/null +++ b/tools/clang/value_cleanup/tests/listvalue-original.cc
@@ -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. + +#include "values.h" + +// All of these should be renamed to |GetList().emplace_back()|. +void F() { + base::ListValue value; + value.AppendBoolean(false); + value.AppendInteger(0); + value.AppendDouble(0.0); + value.AppendString(""); +} + +// All of these should be renamed to GetList() + their std::vector equivalent. +void G() { + base::ListValue value; + value.Clear(); + value.GetSize(); + value.empty(); + value.Reserve(0); +} + +// None of these should be renamed, as these methods require different handling. +void H() { + base::ListValue value; + value.Append(std::unique_ptr<base::Value>(new base::Value())); + value.AppendStrings({"foo", "bar"}); + value.AppendIfNotPresent(std::unique_ptr<base::Value>(new base::Value())); +}
diff --git a/tools/clang/value_cleanup/tests/value-get-type-expected.cc b/tools/clang/value_cleanup/tests/value-get-type-expected.cc deleted file mode 100644 index e5ba40b..0000000 --- a/tools/clang/value_cleanup/tests/value-get-type-expected.cc +++ /dev/null
@@ -1,49 +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 "values.h" - -namespace { - -class Preference { - public: - Preference() : type_(base::Value::Type::NONE) {} - base::Value::Type GetType() const { return type_; } - - private: - const base::Value::Type type_; -}; - -} // namespace - -// This should rename |GetType| to |type|, as it's called on a base::Value. -bool F() { - base::Value value; - return value.type() == base::Value::Type::BINARY; -} - -// Same here, both occurrences should be renamed. -bool G() { - base::Value value_1, value_2; - return value_1.type() == value_2.type(); -} - -// This should not be renamed, as no base::Value is involved. -bool H() { - Preference pref; - return pref.GetType() == base::Value::Type::DICTIONARY; -} - -// Same here, no renaming should take place. -bool I() { - Preference pref_1, pref_2; - return pref_1.GetType() == pref_2.GetType(); -} - -// A mix of |GetType|s, only the second one should be renamed. -bool J() { - Preference pref; - base::Value val; - return pref.GetType() == val.type(); -}
diff --git a/tools/clang/value_cleanup/tests/value-get-type-original.cc b/tools/clang/value_cleanup/tests/value-get-type-original.cc deleted file mode 100644 index a424c769..0000000 --- a/tools/clang/value_cleanup/tests/value-get-type-original.cc +++ /dev/null
@@ -1,49 +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 "values.h" - -namespace { - -class Preference { - public: - Preference() : type_(base::Value::Type::NONE) {} - base::Value::Type GetType() const { return type_; } - - private: - const base::Value::Type type_; -}; - -} // namespace - -// This should rename |GetType| to |type|, as it's called on a base::Value. -bool F() { - base::Value value; - return value.GetType() == base::Value::Type::BINARY; -} - -// Same here, both occurrences should be renamed. -bool G() { - base::Value value_1, value_2; - return value_1.GetType() == value_2.GetType(); -} - -// This should not be renamed, as no base::Value is involved. -bool H() { - Preference pref; - return pref.GetType() == base::Value::Type::DICTIONARY; -} - -// Same here, no renaming should take place. -bool I() { - Preference pref_1, pref_2; - return pref_1.GetType() == pref_2.GetType(); -} - -// A mix of |GetType|s, only the second one should be renamed. -bool J() { - Preference pref; - base::Value val; - return pref.GetType() == val.GetType(); -}
diff --git a/tools/clang/value_cleanup/tests/values.h b/tools/clang/value_cleanup/tests/values.h index a3652716..5548dbde 100644 --- a/tools/clang/value_cleanup/tests/values.h +++ b/tools/clang/value_cleanup/tests/values.h
@@ -5,27 +5,38 @@ #ifndef VALUES_H_ #define VALUES_H_ +#include <memory> +#include <string> +#include <vector> + namespace base { class Value { public: - enum class Type { - NONE = 0, - BOOLEAN, - INTEGER, - DOUBLE, - STRING, - BINARY, - DICTIONARY, - LIST - }; + using ListStorage = std::vector<Value>; - // Returns the type of the value stored by the current Value object. - Type GetType() const { return type_; } // DEPRECATED, use type(). - Type type() const { return type_; } + ListStorage& GetList(); + const ListStorage& GetList() const; - private: - Type type_ = Type::NONE; + protected: + ListStorage list_; +}; + +class ListValue : public Value { + public: + void Clear(); + size_t GetSize() const; + bool empty() const; + void Reserve(size_t); + + void AppendBoolean(bool); + void AppendInteger(int); + void AppendDouble(double); + void AppendString(std::string); + + void Append(std::unique_ptr<Value> in_value); + void AppendStrings(const std::vector<std::string>& in_values); + bool AppendIfNotPresent(std::unique_ptr<Value> in_value); }; } // namespace base
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 9a74baed..8e14e159 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -26124,7 +26124,6 @@ <int value="1668611601" label="enable-encrypted-media"/> <int value="1670161209" label="ClickToOpenPDFPlaceholder:enabled"/> <int value="1670799163" label="ChromeHomeShowGoogleGWhenUrlCleared:enabled"/> - <int value="1672878289" label="PwaMinimalUi:disabled"/> <int value="1673427566" label="ChromeHomeExpandButton:disabled"/> <int value="1689123607" label="enable-app-link"/> <int value="1689183477" label="enable-merge-key-char-events"/> @@ -26188,7 +26187,6 @@ <int value="1844110073" label="enable-app-view"/> <int value="1847024354" label="enable-hotword-hardware"/> <int value="1849379463" label="OfflinePagesCTV2:enabled"/> - <int value="1851085023" label="PwaMinimalUi:enabled"/> <int value="1851358497" label="enable-ash-sidebar"/> <int value="1852630189" label="NTPBookmarkSuggestions:disabled"/> <int value="1855524566" label="allow-insecure-websocket-from-https-origin"/>
diff --git a/tools/python/llvm_symbolizer.py b/tools/python/llvm_symbolizer.py new file mode 100644 index 0000000..fd0df11 --- /dev/null +++ b/tools/python/llvm_symbolizer.py
@@ -0,0 +1,110 @@ +# 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 logging +import os +import re +import subprocess +import threading + +_CHROME_SRC = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) +_LLVM_SYMBOLIZER_PATH = os.path.join( + _CHROME_SRC, 'third_party', 'llvm-build', 'Release+Asserts', 'bin', + 'llvm-symbolizer') + +_BINARY = re.compile(r'0b[0,1]+') +_HEX = re.compile(r'0x[0-9,a-e]+') +_OCTAL = re.compile(r'0[0-7]+') + +_UNKNOWN = '<UNKNOWN>' + + +def _CheckValidAddr(addr): + """ + Check whether the addr is valid input to llvm symbolizer. + Valid addr has to be octal, binary, or hex number. + + Args: + addr: addr to be entered to llvm symbolizer. + + Returns: + whether the addr is valid input to llvm symbolizer. + """ + return _HEX.match(addr) or _OCTAL.match(addr) or _BINARY.match(addr) + + +class LLVMSymbolizer(object): + def __init__(self): + """Create a LLVMSymbolizer instance that interacts with the llvm symbolizer. + + The purpose of the LLVMSymbolizer is to get function names and line + numbers of an address from the symbols library. + """ + self._llvm_symbolizer_subprocess = None + # Allow only one thread to call GetSymbolInformation at a time. + self._lock = threading.Lock() + + def Start(self): + """Start the llvm symbolizer subprocess. + + Create a subprocess of the llvm symbolizer executable, which will be used + to retrieve function names etc. + """ + if os.path.isfile(_LLVM_SYMBOLIZER_PATH): + self._llvm_symbolizer_subprocess = subprocess.Popen( + [_LLVM_SYMBOLIZER_PATH], stdout=subprocess.PIPE, stdin=subprocess.PIPE) + else: + logging.error('Cannot find llvm_symbolizer here: %s.' % + _LLVM_SYMBOLIZER_PATH) + self._llvm_symbolizer_subprocess = None + + def Close(self): + """Close the llvm symbolizer subprocess. + + Close the subprocess by closing stdin, stdout and killing the subprocess. + """ + with self._lock: + if self._llvm_symbolizer_subprocess: + self._llvm_symbolizer_subprocess.kill() + self._llvm_symbolizer_subprocess = None + + def __enter__(self): + """Start the llvm symbolizer subprocess.""" + self.Start() + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + """Close the llvm symbolizer subprocess.""" + self.Close() + + def GetSymbolInformation(self, lib, addr): + """Return the corresponding function names and line numbers. + + Args: + lib: library to search for info. + addr: address to look for info. + + Returns: + A list of (function name, line numbers) tuple. + """ + if (self._llvm_symbolizer_subprocess is None or not lib + or not _CheckValidAddr(addr) or not os.path.isfile(lib)): + return [(_UNKNOWN, lib)] + + with self._lock: + self._llvm_symbolizer_subprocess.stdin.write('%s %s\n' % (lib, addr)) + self._llvm_symbolizer_subprocess.stdin.flush() + + result = [] + # Read till see new line, which is a symbol of end of output. + # One line of function name is always followed by one line of line number. + while True: + line = self._llvm_symbolizer_subprocess.stdout.readline() + if line != '\n': + line_numbers = self._llvm_symbolizer_subprocess.stdout.readline() + result.append( + (line[:-1], + line_numbers[:-1])) + else: + return result
diff --git a/tools/win/subtract_time.py b/tools/win/subtract_time.py index 4e1559b..e11c6bfc 100644 --- a/tools/win/subtract_time.py +++ b/tools/win/subtract_time.py
@@ -3,7 +3,7 @@ # found in the LICENSE file. """ -This script converts to %time% compatible strings passed to it into seconds, +This script converts two %time% compatible strings passed to it into seconds, subtracts them, and prints the difference. That's it. It's used by timeit.bat. """ @@ -11,8 +11,9 @@ import sys def ParseTime(time_string): - # Time looks like 15:19:30.32 - match = re.match("(.*):(.*):(.*)\.(.*)", time_string) + # Time looks like 15:19:30.32 or 15:19:30,32 depending on locale + # (and there might be other variants as well) + match = re.match("(.*):(.*):(.*)[\.,](.*)", time_string) hours, minutes, seconds, fraction = map(int, match.groups()) return hours * 3600 + minutes * 60 + seconds + fraction * .01
diff --git a/ui/base/clipboard/clipboard_util_mac.mm b/ui/base/clipboard/clipboard_util_mac.mm index a5c796e5..1f7296e 100644 --- a/ui/base/clipboard/clipboard_util_mac.mm +++ b/ui/base/clipboard/clipboard_util_mac.mm
@@ -7,6 +7,8 @@ #include "base/mac/foundation_util.h" #include "base/mac/scoped_cftyperef.h" +namespace ui { + namespace { NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType"; NSString* const kPublicUrl = @"public.url"; @@ -22,8 +24,6 @@ } } // namespace -namespace ui { - UniquePasteboard::UniquePasteboard() : pasteboard_([[NSPasteboard pasteboardWithUniqueName] retain]) {}
diff --git a/ui/base/ime/BUILD.gn b/ui/base/ime/BUILD.gn index c4cdbb3..96575db 100644 --- a/ui/base/ime/BUILD.gn +++ b/ui/base/ime/BUILD.gn
@@ -124,7 +124,7 @@ "//skia", ] - if (!use_aura || (!is_linux && !use_ozone)) { + if (!use_aura || is_chromeos || (!is_linux && !use_ozone)) { sources -= [ "input_method_auralinux.cc", "input_method_auralinux.h",
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc index 3e33b5a..adcfbe15 100644 --- a/ui/base/ime/input_method_win.cc +++ b/ui/base/ime/input_method_win.cc
@@ -15,7 +15,6 @@ #include "ui/base/ime/ime_engine_handler_interface.h" #include "ui/base/ime/text_input_client.h" #include "ui/base/ime/win/tsf_input_scope.h" -#include "ui/base/ui_base_switches.h" #include "ui/display/win/screen_win.h" #include "ui/events/event.h" #include "ui/events/event_constants.h" @@ -123,29 +122,26 @@ } std::vector<MSG> char_msgs; - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableMergeKeyCharEvents)) { - // Combines the WM_KEY* and WM_CHAR messages in the event processing flow - // which is necessary to let Chrome IME extension to process the key event - // and perform corresponding IME actions. - // Chrome IME extension may wants to consume certain key events based on - // the character information of WM_CHAR messages. Holding WM_KEY* messages - // until WM_CHAR is processed by the IME extension is not feasible because - // there is no way to know wether there will or not be a WM_CHAR following - // the WM_KEY*. - // Chrome never handles dead chars so it is safe to remove/ignore - // WM_*DEADCHAR messages. - MSG msg; - while (::PeekMessage(&msg, native_key_event.hwnd, WM_CHAR, WM_DEADCHAR, - PM_REMOVE)) { - if (msg.message == WM_CHAR) - char_msgs.push_back(msg); - } - while (::PeekMessage(&msg, native_key_event.hwnd, WM_SYSCHAR, - WM_SYSDEADCHAR, PM_REMOVE)) { - if (msg.message == WM_SYSCHAR) - char_msgs.push_back(msg); - } + // Combines the WM_KEY* and WM_CHAR messages in the event processing flow + // which is necessary to let Chrome IME extension to process the key event + // and perform corresponding IME actions. + // Chrome IME extension may wants to consume certain key events based on + // the character information of WM_CHAR messages. Holding WM_KEY* messages + // until WM_CHAR is processed by the IME extension is not feasible because + // there is no way to know wether there will or not be a WM_CHAR following + // the WM_KEY*. + // Chrome never handles dead chars so it is safe to remove/ignore + // WM_*DEADCHAR messages. + MSG msg; + while (::PeekMessage(&msg, native_key_event.hwnd, WM_CHAR, WM_DEADCHAR, + PM_REMOVE)) { + if (msg.message == WM_CHAR) + char_msgs.push_back(msg); + } + while (::PeekMessage(&msg, native_key_event.hwnd, WM_SYSCHAR, + WM_SYSDEADCHAR, PM_REMOVE)) { + if (msg.message == WM_SYSCHAR) + char_msgs.push_back(msg); } // Handles ctrl-shift key to change text direction and layout alignment. @@ -181,9 +177,7 @@ // 1) |char_msgs| is empty when the event is non-character key. // 2) |char_msgs|.size() == 1 when the event is character key and the WM_CHAR // messages have been combined in the event processing flow. - if (!base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableMergeKeyCharEvents) && - char_msgs.size() <= 1 && GetEngine() && + if (char_msgs.size() <= 1 && GetEngine() && GetEngine()->IsInterestedInKeyEvent()) { ui::IMEEngineHandlerInterface::KeyEventDoneCallback callback = base::Bind( &InputMethodWin::ProcessKeyEventDone, weak_ptr_factory_.GetWeakPtr(),
diff --git a/ui/base/l10n/time_format.cc b/ui/base/l10n/time_format.cc index 2ac75b0..58e4c94 100644 --- a/ui/base/l10n/time_format.cc +++ b/ui/base/l10n/time_format.cc
@@ -16,7 +16,6 @@ #include "ui/base/ui_base_export.h" #include "ui/strings/grit/ui_strings.h" -using base::Time; using base::TimeDelta; using ui::TimeFormat; @@ -149,13 +148,14 @@ // static base::string16 TimeFormat::RelativeDate( - const Time& time, - const Time* optional_midnight_today) { - Time midnight_today = optional_midnight_today ? *optional_midnight_today : - Time::Now().LocalMidnight(); - TimeDelta day = TimeDelta::FromMicroseconds(Time::kMicrosecondsPerDay); - Time tomorrow = midnight_today + day; - Time yesterday = midnight_today - day; + const base::Time& time, + const base::Time* optional_midnight_today) { + base::Time midnight_today = optional_midnight_today + ? *optional_midnight_today + : base::Time::Now().LocalMidnight(); + TimeDelta day = TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerDay); + base::Time tomorrow = midnight_today + day; + base::Time yesterday = midnight_today - day; if (time >= tomorrow) return base::string16(); else if (time >= midnight_today)
diff --git a/ui/base/template_expressions.cc b/ui/base/template_expressions.cc index bea26c4..9618dc7 100644 --- a/ui/base/template_expressions.cc +++ b/ui/base/template_expressions.cc
@@ -16,8 +16,8 @@ const char kKeyOpen = '{'; const char kKeyClose = '}'; -// Escape quotes and backslashes ('"\) with backslashes. -std::string BackslashEscape(const std::string& in_string) { +// Escape quotes and backslashes ('"\). +std::string PolymerParameterEscape(const std::string& in_string) { std::string out; out.reserve(in_string.size() * 2); for (const char c : in_string) { @@ -29,7 +29,7 @@ out.append("\\'"); break; case '"': - out.append("\\\""); + out.append("""); break; case ',': out.append("\\,"); @@ -105,7 +105,7 @@ // Pass the replacement through unchanged. } else if (context == "Polymer") { // Escape quotes and backslash for '$i18nPolymer{}' use (i.e. quoted). - replacement = BackslashEscape(replacement); + replacement = PolymerParameterEscape(replacement); } else { CHECK(false) << "Unknown context " << context; }
diff --git a/ui/base/template_expressions_unittest.cc b/ui/base/template_expressions_unittest.cc index 41d253c..0866d10 100644 --- a/ui/base/template_expressions_unittest.cc +++ b/ui/base/template_expressions_unittest.cc
@@ -68,7 +68,7 @@ "<div>[[Call('$i18nPolymer{singleSample}')]]", substitutions)); // This resolves |Call('\"moo\" said the cow')| to Polymer, which is // presented as |"moo" said the cow| to the user. - EXPECT_EQ("<div>[[Call('\\\"moo\\\" said the cow')]]", + EXPECT_EQ("<div>[[Call('"moo" said the cow')]]", ReplaceTemplateExpressions( "<div>[[Call('$i18nPolymer{doubleSample}')]]", substitutions)); } @@ -77,12 +77,12 @@ static TemplateReplacements substitutions; substitutions["punctuationSample"] = "a\"b'c<d>e&f,g"; substitutions["htmlSample"] = "<div>hello</div>"; - EXPECT_EQ("a\\\"b\\'c<d>e&f\\,g", + EXPECT_EQ("a"b\\'c<d>e&f\\,g", ReplaceTemplateExpressions("$i18nPolymer{punctuationSample}", substitutions)); EXPECT_EQ("<div>hello</div>", ReplaceTemplateExpressions( "$i18nPolymer{htmlSample}", substitutions)); - EXPECT_EQ("multiple: <div>hello</div>, a\\\"b\\'c<d>e&f\\,g.", + EXPECT_EQ("multiple: <div>hello</div>, a"b\\'c<d>e&f\\,g.", ReplaceTemplateExpressions("multiple: $i18nPolymer{htmlSample}, " "$i18nPolymer{punctuationSample}.", substitutions));
diff --git a/ui/base/ui_base_switches.cc b/ui/base/ui_base_switches.cc index d35bde1..00a5ec67 100644 --- a/ui/base/ui_base_switches.cc +++ b/ui/base/ui_base_switches.cc
@@ -30,14 +30,6 @@ const char kShowMacOverlayBorders[] = "show-mac-overlay-borders"; #endif -#if defined(OS_WIN) -// Disables merging the key event (WM_KEY*) with the char event (WM_CHAR). -const char kDisableMergeKeyCharEvents[] = "disable-merge-key-char-events"; - -// Enables merging the key event (WM_KEY*) with the char event (WM_CHAR). -const char kEnableMergeKeyCharEvents[] = "enable-merge-key-char-events"; -#endif - // Disables layer-edge anti-aliasing in the compositor. const char kDisableCompositedAntialiasing[] = "disable-composited-antialiasing";
diff --git a/ui/base/ui_base_switches.h b/ui/base/ui_base_switches.h index fbcca7e9..a4201e68 100644 --- a/ui/base/ui_base_switches.h +++ b/ui/base/ui_base_switches.h
@@ -27,11 +27,6 @@ UI_BASE_EXPORT extern const char kShowMacOverlayBorders[]; #endif -#if defined(OS_WIN) -UI_BASE_EXPORT extern const char kDisableMergeKeyCharEvents[]; -UI_BASE_EXPORT extern const char kEnableMergeKeyCharEvents[]; -#endif - UI_BASE_EXPORT extern const char kDisableCompositedAntialiasing[]; UI_BASE_EXPORT extern const char kDisableDwmComposition[]; UI_BASE_EXPORT extern const char kDisableTouchAdjustment[];
diff --git a/ui/login/display_manager.js b/ui/login/display_manager.js index 1c94df0..d92d8d4c 100644 --- a/ui/login/display_manager.js +++ b/ui/login/display_manager.js
@@ -38,6 +38,7 @@ 'unrecoverable-cryptohome-error'; /** @const */ var SCREEN_ACTIVE_DIRECTORY_PASSWORD_CHANGE = 'ad-password-change'; +/** @const */ var SCREEN_SYNC_CONSENT = 'sync-consent'; /* Accelerator identifiers. Must be kept in sync with webui_login_view.cc. */ /** @const */ var ACCELERATOR_CANCEL = 'cancel'; @@ -156,7 +157,8 @@ SCREEN_WRONG_HWID, SCREEN_CONFIRM_PASSWORD, SCREEN_UPDATE_REQUIRED, - SCREEN_FATAL_ERROR + SCREEN_FATAL_ERROR, + SCREEN_SYNC_CONSENT ]; /**