diff --git a/.gitignore b/.gitignore index d12ac93b..aaf4bf7 100644 --- a/.gitignore +++ b/.gitignore
@@ -372,7 +372,6 @@ /third_party/jsoncpp/source /third_party/jsr-305/src /third_party/junit/src -/third_party/kasko /third_party/khronos_glcts /third_party/leakcanary/src /third_party/leveldatabase/src
diff --git a/.gn b/.gn index be1fb72..0042ecbb 100644 --- a/.gn +++ b/.gn
@@ -137,7 +137,6 @@ #"//third_party/*", # May not ever want this. "//third_party/hunspell/*", - "//third_party/kasko/*", "//third_party/libaddressinput/*", "//third_party/libphonenumber/*", "//third_party/WebKit/Source/*",
diff --git a/DEPS b/DEPS index 2ab47ae..9b29d65 100644 --- a/DEPS +++ b/DEPS
@@ -40,11 +40,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '44f80a24f010e99de773dad89fb9f50100898969', + 'skia_revision': '7e97dc0aa1ff5b03593e689fe1cfdcc3550c169e', # 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': 'b30e976b3bbab8b7c0a193300f1b316b9be79fa5', + 'v8_revision': '5dd3abff9a8c0b83ab86809b6a94d164edcc26e2', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -64,7 +64,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '1f5e327bc8a4114b5c390b89ac94ee320d1d06de', + 'pdfium_revision': '4bd0d99c11102514fb43328b67b7674165888619', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -72,7 +72,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': '358baeb9a4df81ccb916a5b8cf0ed059087645bd', + 'boringssl_revision': 'c26692cfdd9b0c86f2573ad03461416c9702bd39', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'a801abb6bc4419c4d50a9c47a504a001bc1568c4', + 'catapult_revision': 'fe1f77a00fc87241d0b3c0127d3d61c2ac7e3166', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -232,7 +232,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '2a4b1756ee43486e2bf1e0194a2d5850ce2ae050', # commit position 16404 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'baf0285bc234fa332b201064bc5fe77baaa48ac2', # commit position 16413 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'), @@ -1004,19 +1004,6 @@ '--copy-dia-binaries', ], }, - # TODO(pmonette): Move include files out of binaries folder. - { - 'name': 'kasko', - 'pattern': '.', - 'action': ['python', - 'src/build/get_syzygy_binaries.py', - '--output-dir=src/third_party/kasko/binaries', - '--revision=266a18d9209be5ca5c5dcd0620942b82a2d238f3', - '--resource=kasko.zip', - '--resource=kasko_symbols.zip', - '--overwrite', - ], - }, { 'name': 'apache_win32', 'pattern': '\\.sha1',
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java index 6a551661..8aa544f 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java +++ b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
@@ -35,7 +35,7 @@ @Override public void run() { AwContentsStatics.setSafeBrowsingEnabled( - isHarmfulAppDetectionEnabled(appContext)); + isScanDeviceForSecurityThreatsEnabled(appContext)); } }); } @@ -64,14 +64,11 @@ } @SuppressLint("NewApi") // android.provider.Settings.Global#getInt requires API level 17 - private static boolean isHarmfulAppDetectionEnabled(Context applicationContext) { - // Determine if the "Improve harmful app detection" functionality is enabled in + private static boolean isScanDeviceForSecurityThreatsEnabled(Context applicationContext) { + // Determine if the "Scan device for security threats" functionality is enabled in // Android->System->Google->Security settings. ContentResolver contentResolver = applicationContext.getContentResolver(); - boolean user_consent = - Settings.Secure.getInt(contentResolver, "package_verifier_user_consent", 1) > 0; - boolean apk_upload = Settings.Global.getInt(contentResolver, "upload_apk_enable", 1) > 0; - return user_consent && apk_upload; + return Settings.Secure.getInt(contentResolver, "package_verifier_user_consent", 1) > 0; } // Not meant to be instantiated.
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java index 2551dbbb..2ddcd72 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java
@@ -6,6 +6,7 @@ import android.support.test.filters.MediumTest; +import org.chromium.base.test.util.DisabledTest; import org.chromium.base.test.util.Feature; import org.chromium.content.browser.ContentViewCore; import org.chromium.content.browser.test.util.DOMUtils; @@ -32,6 +33,7 @@ @MediumTest @Feature({"AndroidWebView"}) + @DisabledTest(message = "crbug.com/620890") public void testCanPlayPlatformMediaCodecs() throws Throwable { loadUrlSync(mTestContainerView.getAwContents(), mContentsClient.getOnPageFinishedHelper(), "file:///android_asset/platform-media-codec-test.html");
diff --git a/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java b/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java index c8b3ae7..f23ec754 100644 --- a/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java +++ b/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java
@@ -44,18 +44,17 @@ import android.widget.FrameLayout; import android.widget.PopupMenu; import android.widget.TextView; +import android.widget.Toast; import org.chromium.base.Log; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.net.URI; -import java.net.URISyntaxException; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -74,6 +73,12 @@ // WebKit permissions with no corresponding Android permission can always be granted private static final String NO_ANDROID_PERMISSION = "NO_ANDROID_PERMISSION"; + // TODO(timav): Remove these variables after http://crbug.com/626202 is fixed. + // The Bundle key for WebView serialized state + private static final String SAVE_RESTORE_STATE_KEY = "WEBVIEW_CHROMIUM_STATE"; + // Maximal size of this state. + private static final int MAX_STATE_LENGTH = 300 * 1024; + // Map from WebKit permissions to Android permissions private static final HashMap<String, String> sPermissions; static { @@ -214,6 +219,17 @@ public void onSaveInstanceState(Bundle savedInstanceState) { // Deliberately don't catch TransactionTooLargeException here. mWebView.saveState(savedInstanceState); + + // TODO(timav): Remove this hack after http://crbug.com/626202 is fixed. + // Drop the saved state of it is too long since Android N and above + // can't handle large states without a crash. + byte[] webViewState = savedInstanceState.getByteArray(SAVE_RESTORE_STATE_KEY); + if (webViewState != null && webViewState.length > MAX_STATE_LENGTH) { + savedInstanceState.remove(SAVE_RESTORE_STATE_KEY); + String message = String.format( + Locale.US, "Can't save state: %dkb is too long", webViewState.length / 1024); + Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); + } } @Override @@ -401,16 +417,10 @@ public void loadUrlFromUrlBar(View view) { String url = mUrlBar.getText().toString(); - try { - URI uri = new URI(url); - url = (uri.getScheme() == null) ? "http://" + uri.toString() : uri.toString(); - } catch (URISyntaxException e) { - String message = "<html><body>URISyntaxException: " + e.getMessage() + "</body></html>"; - mWebView.loadData(message, "text/html", "UTF-8"); - setUrlFail(true); - return; - } - + // Parse with android.net.Uri instead of java.net.URI because Uri does no validation. Rather + // than failing in the browser, let WebView handle weird URLs. WebView will escape illegal + // characters and display error pages for bad URLs like "blah://example.com". + if (Uri.parse(url).getScheme() == null) url = "http://" + url; setUrlBarText(url); setUrlFail(false); loadUrl(url);
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 3d4ebe6..e0bfcf1 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -859,7 +859,7 @@ ] deps = [ "//ash/autoclick/common:autoclick", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/touch_hud", "//base", @@ -985,7 +985,7 @@ ":ash", ] deps = [ - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//base", "//base/third_party/dynamic_annotations", "//content/public/browser", @@ -1042,7 +1042,7 @@ deps = [ ":ash", "//ash/common/test:test_support", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/test:test_support_without_content", "//base", "//base:i18n", @@ -1078,7 +1078,7 @@ deps = [ ":ash_shell_lib", ":ash_with_content", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/test:test_support_without_content", "//base:i18n", "//chrome:packed_resources", @@ -1120,7 +1120,7 @@ ":ash", ":ash_with_content", "//ash/common/test:test_support", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/test:ash_with_aura_test_support", "//ash/test:test_support_with_content", "//base", @@ -1334,7 +1334,7 @@ "//ash/common:unittests", "//ash/common/strings", "//ash/common/test:test_support", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/resources", "//ash/resources/vector_icons",
diff --git a/ash/autoclick/mus/BUILD.gn b/ash/autoclick/mus/BUILD.gn index daaf7ea..1a8dccc 100644 --- a/ash/autoclick/mus/BUILD.gn +++ b/ash/autoclick/mus/BUILD.gn
@@ -16,7 +16,7 @@ deps = [ "//ash/autoclick/common:autoclick", "//ash/autoclick/mus/public/interfaces", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//base", "//mash/public/interfaces",
diff --git a/ash/common/BUILD.gn b/ash/common/BUILD.gn index e5c535f1..80c98b0 100644 --- a/ash/common/BUILD.gn +++ b/ash/common/BUILD.gn
@@ -9,6 +9,7 @@ sources = [ "accelerators/accelerator_table_unittest.cc", "drag_drop/drag_image_view_unittest.cc", + "mus_property_mirror_ash_unittest.cc", "system/chromeos/audio/tray_audio_unittest.cc", "system/chromeos/brightness/tray_brightness_unittest.cc", "system/chromeos/network/vpn_list_unittest.cc", @@ -25,7 +26,7 @@ deps = [ "//ash", "//ash/common/test:test_support", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/test:test_support_without_content", "//ui/aura",
diff --git a/ash/common/devtools/ash_devtools_dom_agent.cc b/ash/common/devtools/ash_devtools_dom_agent.cc index f6bf8d1..cd803f59 100644 --- a/ash/common/devtools/ash_devtools_dom_agent.cc +++ b/ash/common/devtools/ash_devtools_dom_agent.cc
@@ -99,6 +99,10 @@ MaskColor(rgba->getB())); } +views::Widget* GetWidgetFromWmWindow(WmWindow* window) { + return views::Widget::GetWidgetForNativeView(window->aura_window()); +} + } // namespace AshDevToolsDOMAgent::AshDevToolsDOMAgent(ash::WmShell* shell) : shell_(shell) { @@ -253,7 +257,7 @@ ash::WmWindow* window) { DCHECK(!window_to_node_id_map_.count(window)); std::unique_ptr<Array<DOM::Node>> children = Array<DOM::Node>::create(); - views::Widget* widget = window->GetInternalWidget(); + views::Widget* widget = GetWidgetFromWmWindow(window); if (widget) children->addItem(BuildTreeForRootWidget(widget)); for (ash::WmWindow* child : window->GetChildren()) { @@ -317,8 +321,8 @@ if (IsHighlightingWindow(window)) return; - if (window->GetInternalWidget()) - RemoveWidgetTree(window->GetInternalWidget(), remove_observer); + if (GetWidgetFromWmWindow(window)) + RemoveWidgetTree(GetWidgetFromWmWindow(window), remove_observer); for (ash::WmWindow* child : window->GetChildren()) RemoveWindowTree(child, remove_observer); @@ -524,7 +528,7 @@ bool AshDevToolsDOMAgent::IsHighlightingWindow(WmWindow* window) { return widget_for_highlighting_ && - window->GetInternalWidget() == widget_for_highlighting_.get(); + GetWidgetFromWmWindow(window) == widget_for_highlighting_.get(); } } // namespace devtools
diff --git a/ash/common/mus_property_mirror_ash_unittest.cc b/ash/common/mus_property_mirror_ash_unittest.cc new file mode 100644 index 0000000..e81f05b0 --- /dev/null +++ b/ash/common/mus_property_mirror_ash_unittest.cc
@@ -0,0 +1,90 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/public/cpp/mus_property_mirror_ash.h" + +#include <string> + +#include "ash/common/test/ash_test.h" +#include "ash/common/wm_window.h" +#include "ash/public/cpp/window_properties.h" +#include "base/strings/string16.h" +#include "base/strings/utf_string_conversions.h" +#include "ui/aura/client/aura_constants.h" +#include "ui/aura/window.h" + +namespace ash { + +using MusPropertyMirrorAshTest = AshTest; + +// Ensure the property mirror can copy primitive properties between windows. +TEST_F(MusPropertyMirrorAshTest, PrimitiveProperties) { + MusPropertyMirrorAsh mus_property_mirror_ash; + std::unique_ptr<WindowOwner> window_owner_1(CreateTestWindow()); + std::unique_ptr<WindowOwner> window_owner_2(CreateTestWindow()); + aura::Window* window_1 = window_owner_1->window()->aura_window(); + aura::Window* window_2 = window_owner_2->window()->aura_window(); + + EXPECT_EQ(TYPE_UNDEFINED, window_1->GetProperty(kShelfItemTypeKey)); + EXPECT_EQ(TYPE_UNDEFINED, window_2->GetProperty(kShelfItemTypeKey)); + window_1->SetProperty(kShelfItemTypeKey, static_cast<int32_t>(TYPE_APP)); + EXPECT_EQ(TYPE_APP, window_1->GetProperty(kShelfItemTypeKey)); + mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( + window_1, window_2, kShelfItemTypeKey); + EXPECT_EQ(TYPE_APP, window_2->GetProperty(kShelfItemTypeKey)); + + EXPECT_FALSE(window_1->GetProperty(aura::client::kDrawAttentionKey)); + EXPECT_FALSE(window_2->GetProperty(aura::client::kDrawAttentionKey)); + window_1->SetProperty(aura::client::kDrawAttentionKey, true); + EXPECT_TRUE(window_1->GetProperty(aura::client::kDrawAttentionKey)); + mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( + window_1, window_2, aura::client::kDrawAttentionKey); + EXPECT_TRUE(window_2->GetProperty(aura::client::kDrawAttentionKey)); +} + +// Ensure the property mirror can copy owned object properties between windows. +TEST_F(MusPropertyMirrorAshTest, OwnedProperties) { + MusPropertyMirrorAsh mus_property_mirror_ash; + std::unique_ptr<WindowOwner> window_owner_1(CreateTestWindow()); + std::unique_ptr<WindowOwner> window_owner_2(CreateTestWindow()); + aura::Window* window_1 = window_owner_1->window()->aura_window(); + aura::Window* window_2 = window_owner_2->window()->aura_window(); + + EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kAppIdKey)); + EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kAppIdKey)); + window_1->SetProperty(aura::client::kAppIdKey, new std::string("abc")); + EXPECT_EQ("abc", *window_1->GetProperty(aura::client::kAppIdKey)); + mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( + window_1, window_2, aura::client::kAppIdKey); + EXPECT_EQ("abc", *window_2->GetProperty(aura::client::kAppIdKey)); + EXPECT_NE(window_1->GetProperty(aura::client::kAppIdKey), + window_2->GetProperty(aura::client::kAppIdKey)); + + EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kTitleKey)); + EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kTitleKey)); + window_1->SetProperty(aura::client::kTitleKey, + new base::string16(base::ASCIIToUTF16("def"))); + EXPECT_EQ(base::ASCIIToUTF16("def"), + *window_1->GetProperty(aura::client::kTitleKey)); + mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( + window_1, window_2, aura::client::kTitleKey); + EXPECT_EQ(base::ASCIIToUTF16("def"), + *window_2->GetProperty(aura::client::kTitleKey)); + EXPECT_NE(window_1->GetProperty(aura::client::kTitleKey), + window_2->GetProperty(aura::client::kTitleKey)); + + window_1->ClearProperty(aura::client::kWindowIconKey); + EXPECT_EQ(nullptr, window_1->GetProperty(aura::client::kWindowIconKey)); + window_2->ClearProperty(aura::client::kWindowIconKey); + EXPECT_EQ(nullptr, window_2->GetProperty(aura::client::kWindowIconKey)); + window_1->SetProperty(aura::client::kWindowIconKey, new gfx::ImageSkia()); + EXPECT_NE(nullptr, window_1->GetProperty(aura::client::kWindowIconKey)); + mus_property_mirror_ash.MirrorPropertyFromWidgetWindowToRootWindow( + window_1, window_2, aura::client::kWindowIconKey); + EXPECT_NE(nullptr, window_2->GetProperty(aura::client::kWindowIconKey)); + EXPECT_NE(window_1->GetProperty(aura::client::kWindowIconKey), + window_2->GetProperty(aura::client::kWindowIconKey)); +} + +} // namespace ash
diff --git a/ash/common/shelf/shelf_constants.h b/ash/common/shelf/shelf_constants.h index 708e2ad..dc584eb 100644 --- a/ash/common/shelf/shelf_constants.h +++ b/ash/common/shelf/shelf_constants.h
@@ -43,8 +43,6 @@ // the shelf items, notifications, status area etc. extern const int kShelfItemInset; -const int kInvalidShelfID = 0; - // Animation duration for switching black shelf and dock background on and off. ASH_EXPORT extern const int kTimeToSwitchBackgroundMs;
diff --git a/ash/common/shelf/shelf_item_types.h b/ash/common/shelf/shelf_item_types.h index ea021bb..62d279eb 100644 --- a/ash/common/shelf/shelf_item_types.h +++ b/ash/common/shelf/shelf_item_types.h
@@ -1,60 +1,22 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. +// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMMON_SHELF_SHELF_ITEM_TYPES_H_ #define ASH_COMMON_SHELF_SHELF_ITEM_TYPES_H_ +// TODO(msw): Rename these files to shelf_item.*; audit users. + #include <string> #include <vector> #include "ash/ash_export.h" -#include "ash/common/shelf/shelf_constants.h" +#include "ash/public/cpp/shelf_types.h" #include "base/strings/string16.h" #include "ui/gfx/image/image_skia.h" namespace ash { -typedef int ShelfID; - -// The type of a shelf item. -enum ShelfItemType { - // Represents a running app panel. - TYPE_APP_PANEL, - - // Represents a pinned shortcut to an app. - TYPE_APP_SHORTCUT, - - // Toggles visiblity of the app list. - TYPE_APP_LIST, - - // The browser shortcut button. - TYPE_BROWSER_SHORTCUT, - - // Represents an app: Extension "V1" (legacy packaged and hosted) apps, - // Extension "V2" (platform) apps, - // Arc (App Runtime for Chrome - Android Play Store) apps. - TYPE_APP, - - // Represents a dialog. - TYPE_DIALOG, - - // Default value. - TYPE_UNDEFINED, -}; - -// Represents the status of applications in the shelf. -enum ShelfItemStatus { - // A closed shelf item, i.e. has no live instance. - STATUS_CLOSED, - // A shelf item that has live instance. - STATUS_RUNNING, - // An active shelf item that has focus. - STATUS_ACTIVE, - // A shelf item that needs user's attention. - STATUS_ATTENTION, -}; - struct ASH_EXPORT ShelfItem { ShelfItem(); ShelfItem(const ShelfItem& shelf_item);
diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc index cc0632fb..3c2a607f 100644 --- a/ash/common/system/tray/tray_popup_utils.cc +++ b/ash/common/system/tray/tray_popup_utils.cc
@@ -4,6 +4,9 @@ #include "ash/common/system/tray/tray_popup_utils.h" +#include <algorithm> +#include <utility> + #include "ash/common/ash_constants.h" #include "ash/common/ash_view_ids.h" #include "ash/common/material_design/material_design_controller.h" @@ -350,30 +353,9 @@ const views::View* host, const gfx::Point& center_point, SkColor color) { - const gfx::Rect bounds = - TrayPopupUtils::GetInkDropBounds(ink_drop_style, host); - switch (ink_drop_style) { - case TrayPopupInkDropStyle::HOST_CENTERED: - if (MaterialDesignController::GetMode() == - MaterialDesignController::MATERIAL_EXPERIMENTAL) { - return base::MakeUnique<views::SquareInkDropRipple>( - bounds.size(), bounds.size().width() / 2, bounds.size(), - bounds.size().width() / 2, center_point, bounds.CenterPoint(), - color, kTrayPopupInkDropRippleOpacity); - } - // Intentional fall through. - case TrayPopupInkDropStyle::INSET_BOUNDS: - case TrayPopupInkDropStyle::FILL_BOUNDS: { - const gfx::Insets insets = - TrayPopupUtils::GetInkDropInsets(ink_drop_style); - return base::MakeUnique<views::FloodFillInkDropRipple>( - host->size(), insets, center_point, color, - kTrayPopupInkDropRippleOpacity); - } - } - // Required for some compilers. - NOTREACHED(); - return nullptr; + return base::MakeUnique<views::FloodFillInkDropRipple>( + host->size(), TrayPopupUtils::GetInkDropInsets(ink_drop_style), + center_point, color, kTrayPopupInkDropRippleOpacity); } std::unique_ptr<views::InkDropHighlight> TrayPopupUtils::CreateInkDropHighlight(
diff --git a/ash/common/system/tray/tray_popup_utils.h b/ash/common/system/tray/tray_popup_utils.h index 557ce070..1e73c1fc 100644 --- a/ash/common/system/tray/tray_popup_utils.h +++ b/ash/common/system/tray/tray_popup_utils.h
@@ -5,6 +5,8 @@ #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_UTILS_H_ +#include <memory> + #include "ash/common/login_status.h" #include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_popup_ink_drop_style.h"
diff --git a/ash/common/test/BUILD.gn b/ash/common/test/BUILD.gn index cafc2c1..13e30b3 100644 --- a/ash/common/test/BUILD.gn +++ b/ash/common/test/BUILD.gn
@@ -32,7 +32,7 @@ ] deps = [ "//ash", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//base", "//components/signin/core/account_id",
diff --git a/ash/common/wm_window.cc b/ash/common/wm_window.cc index 25db9e5..8dfa9cb 100644 --- a/ash/common/wm_window.cc +++ b/ash/common/wm_window.cc
@@ -14,6 +14,7 @@ #include "ash/common/wm_window_observer.h" #include "ash/common/wm_window_property.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/screen_util.h" #include "ash/shell.h"
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 3668e51..b19455ab 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -526,22 +526,22 @@ EXPECT_EQ(8U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 480x400", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("50,400 480x400", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("480,0 480x400", - display_manager()->GetDisplayAt(2).bounds().ToString()); - EXPECT_EQ("960,30 480x400", - display_manager()->GetDisplayAt(3).bounds().ToString()); - EXPECT_EQ("730,430 480x400", - display_manager()->GetDisplayAt(4).bounds().ToString()); - EXPECT_EQ("-730,-300 480x400", - display_manager()->GetDisplayAt(5).bounds().ToString()); - EXPECT_EQ("-250,-400 480x400", - display_manager()->GetDisplayAt(6).bounds().ToString()); - EXPECT_EQ("-780,-450 530x150", - display_manager()->GetDisplayAt(7).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 480, 400), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(50, 400, 480, 400), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(480, 0, 480, 400), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(960, 30, 480, 400), + display_manager()->GetDisplayAt(3).bounds()); + EXPECT_EQ(gfx::Rect(730, 430, 480, 400), + display_manager()->GetDisplayAt(4).bounds()); + EXPECT_EQ(gfx::Rect(-730, -300, 480, 400), + display_manager()->GetDisplayAt(5).bounds()); + EXPECT_EQ(gfx::Rect(-250, -400, 480, 400), + display_manager()->GetDisplayAt(6).bounds()); + EXPECT_EQ(gfx::Rect(-780, -450, 530, 150), + display_manager()->GetDisplayAt(7).bounds()); // Expect that the displays have been reparented correctly, such that a // child is always touching its parent. @@ -618,14 +618,14 @@ // EXPECT_EQ(4U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 696x800", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("0,800 696x800", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("696,800 300x800", - display_manager()->GetDisplayAt(2).bounds().ToString()); - EXPECT_EQ("996,100 696x800", - display_manager()->GetDisplayAt(3).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 696, 800), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(0, 800, 696, 800), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(696, 800, 300, 800), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(996, 100, 696, 800), + display_manager()->GetDisplayAt(3).bounds()); // This case if not handled correctly might lead to a cyclic dependency. // Make sure this doesn't happen. @@ -683,12 +683,12 @@ // +---------+ EXPECT_EQ(3U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 696x500", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("-696,0 696x500", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("-696,500 696x500", - display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 696, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(-696, 0, 696, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(-696, 500, 696, 500), + display_manager()->GetDisplayAt(2).bounds()); } { @@ -735,12 +735,12 @@ // EXPECT_EQ(3U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 696x500", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("0,-500 696x500", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("-696,-500 696x500", - display_manager()->GetDisplayAt(2).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 696, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(0, -500, 696, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(-696, -500, 696, 500), + display_manager()->GetDisplayAt(2).bounds()); } } @@ -788,14 +788,14 @@ // EXPECT_EQ(4U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 1200x500", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("-110,-500 600x500", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("490,-500 600x500", - display_manager()->GetDisplayAt(2).bounds().ToString()); - EXPECT_EQ("1090,-500 600x500", - display_manager()->GetDisplayAt(3).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 1200, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(-110, -500, 600, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(490, -500, 600, 500), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(1090, -500, 600, 500), + display_manager()->GetDisplayAt(3).bounds()); } TEST_P(DisplayManagerTest, NoOverlappedDisplaysAfterResolutionChange) { @@ -839,16 +839,16 @@ // There should be no overlap at all. EXPECT_EQ(5U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 1000x500", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("-250,-500 500x500", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("250,-500 500x500", - display_manager()->GetDisplayAt(2).bounds().ToString()); - EXPECT_EQ("750,-500 500x500", - display_manager()->GetDisplayAt(3).bounds().ToString()); - EXPECT_EQ("0,-1000 1000x500", - display_manager()->GetDisplayAt(4).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 1000, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(-250, -500, 500, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(250, -500, 500, 500), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(750, -500, 500, 500), + display_manager()->GetDisplayAt(3).bounds()); + EXPECT_EQ(gfx::Rect(0, -1000, 1000, 500), + display_manager()->GetDisplayAt(4).bounds()); // Change the resolution of display (2) and expect the following layout. // @@ -875,16 +875,103 @@ UpdateDisplay("1000x500,500x500,600x600,500x500,1000x500"); EXPECT_EQ(5U, display_manager()->GetNumDisplays()); - EXPECT_EQ("0,0 1000x500", - display_manager()->GetDisplayAt(0).bounds().ToString()); - EXPECT_EQ("-250,-500 500x500", - display_manager()->GetDisplayAt(1).bounds().ToString()); - EXPECT_EQ("250,-600 600x600", - display_manager()->GetDisplayAt(2).bounds().ToString()); - EXPECT_EQ("850,-500 500x500", - display_manager()->GetDisplayAt(3).bounds().ToString()); - EXPECT_EQ("0,-1100 1000x500", - display_manager()->GetDisplayAt(4).bounds().ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 1000, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(-250, -500, 500, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(250, -600, 600, 600), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(850, -500, 500, 500), + display_manager()->GetDisplayAt(3).bounds()); + EXPECT_EQ(gfx::Rect(0, -1100, 1000, 500), + display_manager()->GetDisplayAt(4).bounds()); +} + +TEST_P(DisplayManagerTest, NoOverlappedDisplaysWithDetachedDisplays) { + // Detached displays that intersect other non-detached displays. + // + // +---------+---------+---------+ + // | 1 | 2 | 3 | + // | | | | + // | | | | + // | | | | + // +----+----+-----+---+----+----+ + // | 4, 5 | P | + // | detached | | + // | | | + // +----------+ | + // +-------------------+ + // + + int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); + display::DisplayIdList list = display::test::CreateDisplayIdListN( + 6, primary_id, primary_id + 1, primary_id + 2, primary_id + 3, + primary_id + 4, primary_id + 5); + display::DisplayLayoutBuilder builder(primary_id); + builder.AddDisplayPlacement(list[1], primary_id, + display::DisplayPlacement::TOP, -250); + builder.AddDisplayPlacement(list[2], primary_id, + display::DisplayPlacement::TOP, 250); + builder.AddDisplayPlacement(list[3], primary_id, + display::DisplayPlacement::TOP, 750); + display_manager()->layout_store()->RegisterLayoutForDisplayIdList( + list, builder.Build()); + UpdateDisplay("1000x500,500x500,500x500,500x500,500x400,500x400"); + + // Detached displays will be de-intersected and reparented appropriately. + // + // +---------+---------+---------+ + // | 1 | 2 | 3 | + // | | | | + // | | | | + // | | | | + // +----+----+---------+----+----+ + // | P | + // | | + // | | + // | | + // +----------+--------+ + // | 4 | + // | | + // | | + // +----------+ + // | 5 | + // | | + // | | + // +----------+ + // + + EXPECT_EQ(6U, display_manager()->GetNumDisplays()); + EXPECT_EQ(gfx::Rect(0, 0, 1000, 500), + display_manager()->GetDisplayAt(0).bounds()); + EXPECT_EQ(gfx::Rect(-250, -500, 500, 500), + display_manager()->GetDisplayAt(1).bounds()); + EXPECT_EQ(gfx::Rect(250, -500, 500, 500), + display_manager()->GetDisplayAt(2).bounds()); + EXPECT_EQ(gfx::Rect(750, -500, 500, 500), + display_manager()->GetDisplayAt(3).bounds()); + EXPECT_EQ(gfx::Rect(0, 500, 500, 400), + display_manager()->GetDisplayAt(4).bounds()); + EXPECT_EQ(gfx::Rect(0, 900, 500, 400), + display_manager()->GetDisplayAt(5).bounds()); + + // This case if not handled correctly might lead to a cyclic dependency. + // Make sure this doesn't happen. + display::DisplayLayoutBuilder expected_layout_builder(primary_id); + expected_layout_builder.AddDisplayPlacement( + list[1], primary_id, display::DisplayPlacement::TOP, -250); + expected_layout_builder.AddDisplayPlacement( + list[2], primary_id, display::DisplayPlacement::TOP, 250); + expected_layout_builder.AddDisplayPlacement( + list[3], primary_id, display::DisplayPlacement::TOP, 750); + expected_layout_builder.AddDisplayPlacement( + list[4], primary_id, display::DisplayPlacement::BOTTOM, 0); + expected_layout_builder.AddDisplayPlacement( + list[5], list[4], display::DisplayPlacement::BOTTOM, 0); + + const display::DisplayLayout& layout = + display_manager()->GetCurrentResolvedDisplayLayout(); + EXPECT_TRUE(layout.HasSamePlacementList(*(expected_layout_builder.Build()))); } TEST_P(DisplayManagerTest, NoMirrorInThreeDisplays) {
diff --git a/ash/mus/BUILD.gn b/ash/mus/BUILD.gn index 1a4bd7b..fa7d5ed 100644 --- a/ash/mus/BUILD.gn +++ b/ash/mus/BUILD.gn
@@ -92,7 +92,7 @@ public_deps = [ "//ash", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//base", "//base:i18n",
diff --git a/ash/mus/window_manager.cc b/ash/mus/window_manager.cc index bcf57726..19db97b 100644 --- a/ash/mus/window_manager.cc +++ b/ash/mus/window_manager.cc
@@ -26,12 +26,12 @@ #include "ash/mus/top_level_window_factory.h" #include "ash/mus/window_properties.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/root_window_settings.h" #include "ash/shell.h" #include "ash/shell_init_params.h" #include "ash/wm/ash_focus_rules.h" -#include "ash/wm/window_properties.h" #include "base/memory/ptr_util.h" #include "services/service_manager/public/cpp/connector.h" #include "services/ui/common/accelerator_util.h" @@ -41,6 +41,7 @@ #include "services/ui/public/interfaces/window_manager.mojom.h" #include "ui/aura/client/window_parenting_client.h" #include "ui/aura/env.h" +#include "ui/aura/mus/capture_synchronizer.h" #include "ui/aura/mus/property_converter.h" #include "ui/aura/mus/window_tree_client.h" #include "ui/aura/mus/window_tree_host_mus.h" @@ -114,6 +115,13 @@ std::move(frame_decoration_values)); lookup_.reset(new WmLookupMus); + + // Notify PointerWatcherEventRouter and CaptureSynchronizer that the capture + // client has been set. + aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); + pointer_watcher_event_router_->AttachToCaptureClient(capture_client); + window_tree_client_->capture_synchronizer()->AttachToCaptureClient( + capture_client); } void WindowManager::DeleteAllRootWindowControllers() { @@ -238,6 +246,11 @@ if (!window_tree_client_) return; + aura::client::CaptureClient* capture_client = wm_state_->capture_controller(); + pointer_watcher_event_router_->DetachFromCaptureClient(capture_client); + window_tree_client_->capture_synchronizer()->DetachFromCaptureClient( + capture_client); + Shell::DeleteInstance(); lookup_.reset(); @@ -280,10 +293,6 @@ pointer_watcher_event_router_->OnPointerEventObserved(event, target); } -aura::client::CaptureClient* WindowManager::GetCaptureClient() { - return wm_state_->capture_controller(); -} - aura::PropertyConverter* WindowManager::GetPropertyConverter() { return property_converter_.get(); }
diff --git a/ash/mus/window_manager.h b/ash/mus/window_manager.h index bd9b8b54..27dae0ee 100644 --- a/ash/mus/window_manager.h +++ b/ash/mus/window_manager.h
@@ -132,7 +132,6 @@ void OnLostConnection(aura::WindowTreeClient* client) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // WindowManagerDelegate:
diff --git a/ash/mus/window_manager_unittest.cc b/ash/mus/window_manager_unittest.cc index 168bb4b..4c2c0cd 100644 --- a/ash/mus/window_manager_unittest.cc +++ b/ash/mus/window_manager_unittest.cc
@@ -49,9 +49,6 @@ void OnLostConnection(aura::WindowTreeClient* client) override {} void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override {} - aura::client::CaptureClient* GetCaptureClient() override { - return wm_state_.capture_controller(); - } aura::PropertyConverter* GetPropertyConverter() override { return &property_converter_; }
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index 521d9fbb..baae1f0 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -3,15 +3,24 @@ # found in the LICENSE file. # C++ headers and sources that can be used outside ash. -source_set("cpp") { +component("ash_public_cpp") { sources = [ + "ash_public_export.h", + "mus_property_mirror_ash.cc", + "mus_property_mirror_ash.h", "session_types.h", "shelf_types.h", "shell_window_ids.cc", "shell_window_ids.h", + "window_properties.cc", + "window_properties.h", ] + defines = [ "ASH_PUBLIC_IMPLEMENTATION" ] + deps = [ "//base", + "//ui/aura", + "//ui/views/mus", ] }
diff --git a/ash/public/cpp/ash_public_export.h b/ash/public/cpp/ash_public_export.h new file mode 100644 index 0000000..8108434 --- /dev/null +++ b/ash/public/cpp/ash_public_export.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 ASH_PUBLIC_CPP_ASH_PUBLIC_EXPORT_H_ +#define ASH_PUBLIC_CPP_ASH_PUBLIC_EXPORT_H_ + +#if defined(COMPONENT_BUILD) + +#if defined(WIN32) + +#if defined(ASH_PUBLIC_IMPLEMENTATION) +#define ASH_PUBLIC_EXPORT __declspec(dllexport) +#else +#define ASH_PUBLIC_EXPORT __declspec(dllimport) +#endif + +#else // !defined(WIN32) + +#if defined(ASH_PUBLIC_IMPLEMENTATION) +#define ASH_PUBLIC_EXPORT __attribute((visibility("default"))) +#else +#define ASH_PUBLIC_EXPORT +#endif + +#endif // defined(WIN32) + +#else // !defined(COMPONENT_BUILD) + +#define ASH_PUBLIC_EXPORT + +#endif // defined(COMPONENT_BUILD) + +#endif // ASH_PUBLIC_CPP_ASH_PUBLIC_EXPORT_H_
diff --git a/ash/public/cpp/mus_property_mirror_ash.cc b/ash/public/cpp/mus_property_mirror_ash.cc new file mode 100644 index 0000000..25ddc91 --- /dev/null +++ b/ash/public/cpp/mus_property_mirror_ash.cc
@@ -0,0 +1,54 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/public/cpp/mus_property_mirror_ash.h" + +#include "ash/public/cpp/window_properties.h" +#include "ui/aura/client/aura_constants.h" + +namespace { + +template <typename T> +void MirrorOwnedProperty(aura::Window* window, + aura::Window* root_window, + const aura::WindowProperty<T*>* key) { + T* value = window->GetProperty(key); + if (!value) + root_window->ClearProperty(key); + else + root_window->SetProperty(key, new T(*value)); +} + +} // namespace + +namespace ash { + +MusPropertyMirrorAsh::MusPropertyMirrorAsh() {} +MusPropertyMirrorAsh::~MusPropertyMirrorAsh() {} + +void MusPropertyMirrorAsh::MirrorPropertyFromWidgetWindowToRootWindow( + aura::Window* window, + aura::Window* root_window, + const void* key) { + if (key == kPanelAttachedKey) { + bool value = window->GetProperty(kPanelAttachedKey); + root_window->SetProperty(kPanelAttachedKey, value); + } else if (key == kShelfItemTypeKey) { + int32_t value = window->GetProperty(kShelfItemTypeKey); + root_window->SetProperty(kShelfItemTypeKey, value); + } else if (key == aura::client::kAppIconKey) { + MirrorOwnedProperty(window, root_window, aura::client::kAppIconKey); + } else if (key == aura::client::kAppIdKey) { + MirrorOwnedProperty(window, root_window, aura::client::kAppIdKey); + } else if (key == aura::client::kDrawAttentionKey) { + bool value = window->GetProperty(aura::client::kDrawAttentionKey); + root_window->SetProperty(aura::client::kDrawAttentionKey, value); + } else if (key == aura::client::kTitleKey) { + MirrorOwnedProperty(window, root_window, aura::client::kTitleKey); + } else if (key == aura::client::kWindowIconKey) { + MirrorOwnedProperty(window, root_window, aura::client::kWindowIconKey); + } +} + +} // namespace ash
diff --git a/ash/public/cpp/mus_property_mirror_ash.h b/ash/public/cpp/mus_property_mirror_ash.h new file mode 100644 index 0000000..6cacfc12 --- /dev/null +++ b/ash/public/cpp/mus_property_mirror_ash.h
@@ -0,0 +1,33 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_PUBLIC_CPP_MUS_PROPERTY_MIRROR_H_ +#define ASH_PUBLIC_CPP_MUS_PROPERTY_MIRROR_H_ + +#include "ash/public/cpp/ash_public_export.h" +#include "base/macros.h" +#include "ui/views/mus/mus_property_mirror.h" + +namespace ash { + +// Relays aura content window properties to its root window (the mash frame). +// Ash relies on various window properties for frame titles, shelf items, etc. +// These properties are read from the client's root, not child content windows. +class ASH_PUBLIC_EXPORT MusPropertyMirrorAsh : public views::MusPropertyMirror { + public: + MusPropertyMirrorAsh(); + ~MusPropertyMirrorAsh() override; + + // MusPropertyMirror: + void MirrorPropertyFromWidgetWindowToRootWindow(aura::Window* window, + aura::Window* root_window, + const void* key) override; + + private: + DISALLOW_COPY_AND_ASSIGN(MusPropertyMirrorAsh); +}; + +} // namespace ash + +#endif // ASH_PUBLIC_CPP_MUS_PROPERTY_MIRROR_H_
diff --git a/ash/public/cpp/shelf_types.h b/ash/public/cpp/shelf_types.h index 5044211..d63dfc8f 100644 --- a/ash/public/cpp/shelf_types.h +++ b/ash/public/cpp/shelf_types.h
@@ -55,6 +55,47 @@ SHELF_BACKGROUND_MAXIMIZED, }; +typedef int ShelfID; +const int kInvalidShelfID = 0; + +// The type of a shelf item. +enum ShelfItemType { + // Represents a running app panel. + TYPE_APP_PANEL, + + // Represents a pinned shortcut to an app. + TYPE_APP_SHORTCUT, + + // Toggles visiblity of the app list. + TYPE_APP_LIST, + + // The browser shortcut button. + TYPE_BROWSER_SHORTCUT, + + // Represents an app: Extension "V1" (legacy packaged and hosted) apps, + // Extension "V2" (platform) apps, + // Arc (App Runtime for Chrome - Android Play Store) apps. + TYPE_APP, + + // Represents a dialog. + TYPE_DIALOG, + + // Default value. + TYPE_UNDEFINED, +}; + +// Represents the status of applications in the shelf. +enum ShelfItemStatus { + // A closed shelf item, i.e. has no live instance. + STATUS_CLOSED, + // A shelf item that has live instance. + STATUS_RUNNING, + // An active shelf item that has focus. + STATUS_ACTIVE, + // A shelf item that needs user's attention. + STATUS_ATTENTION, +}; + } // namespace ash #endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_
diff --git a/ash/public/cpp/shell_window_ids.h b/ash/public/cpp/shell_window_ids.h index 6e1b91d..9b6a765a 100644 --- a/ash/public/cpp/shell_window_ids.h +++ b/ash/public/cpp/shell_window_ids.h
@@ -8,6 +8,8 @@ #include <stddef.h> #include <stdint.h> +#include "ash/public/cpp/ash_public_export.h" + // Declarations of ids of special shell windows. namespace ash { @@ -111,11 +113,11 @@ // These are the list of container ids of containers which may contain windows // that need to be activated. -extern const int32_t kActivatableShellWindowIds[]; -extern const size_t kNumActivatableShellWindowIds; +ASH_PUBLIC_EXPORT extern const int32_t kActivatableShellWindowIds[]; +ASH_PUBLIC_EXPORT extern const size_t kNumActivatableShellWindowIds; // Returns true if |id| is in |kActivatableShellWindowIds|. -bool IsActivatableShellWindowId(int32_t id); +ASH_PUBLIC_EXPORT bool IsActivatableShellWindowId(int32_t id); } // namespace ash
diff --git a/ash/public/cpp/window_properties.cc b/ash/public/cpp/window_properties.cc new file mode 100644 index 0000000..e51444c --- /dev/null +++ b/ash/public/cpp/window_properties.cc
@@ -0,0 +1,13 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/public/cpp/window_properties.h" + +namespace ash { + +DEFINE_UI_CLASS_PROPERTY_KEY(bool, kPanelAttachedKey, true); + +DEFINE_UI_CLASS_PROPERTY_KEY(int32_t, kShelfItemTypeKey, TYPE_UNDEFINED); + +} // namespace ash
diff --git a/ash/public/cpp/window_properties.h b/ash/public/cpp/window_properties.h new file mode 100644 index 0000000..7187ae7 --- /dev/null +++ b/ash/public/cpp/window_properties.h
@@ -0,0 +1,37 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_PUBLIC_CPP_WINDOW_PROPERTIES_H_ +#define ASH_PUBLIC_CPP_WINDOW_PROPERTIES_H_ + +#include <stdint.h> + +#include "ash/public/cpp/ash_public_export.h" +#include "ash/public/cpp/shelf_types.h" +#include "ui/base/class_property.h" + +namespace aura { +template <typename T> +using WindowProperty = ui::ClassProperty<T>; +} + +namespace ash { + +// Shell-specific window property keys for use by ash and its clients. + +// Alphabetical sort. + +// If true (and the window is a panel), it's attached to its shelf item. +ASH_PUBLIC_EXPORT extern const aura::WindowProperty<bool>* const + kPanelAttachedKey; + +// A property key to store the type of a window's shelf item. +ASH_PUBLIC_EXPORT extern const aura::WindowProperty<int32_t>* const + kShelfItemTypeKey; + +// Alphabetical sort. + +} // namespace ash + +#endif // ASH_PUBLIC_CPP_WINDOW_PROPERTIES_H_
diff --git a/ash/public/interfaces/session_controller.typemap b/ash/public/interfaces/session_controller.typemap index c0179ce..1a0bbd2 100644 --- a/ash/public/interfaces/session_controller.typemap +++ b/ash/public/interfaces/session_controller.typemap
@@ -10,7 +10,7 @@ ] traits_headers = [ "//ash/public/interfaces/session_controller_traits.h" ] public_deps = [ - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//components/session_manager:base", "//components/user_manager", ]
diff --git a/ash/public/interfaces/shelf.typemap b/ash/public/interfaces/shelf.typemap index 1a85b6e..cbf5c7f 100644 --- a/ash/public/interfaces/shelf.typemap +++ b/ash/public/interfaces/shelf.typemap
@@ -6,7 +6,7 @@ public_headers = [ "//ash/public/cpp/shelf_types.h" ] traits_headers = [ "//ash/public/interfaces/shelf_struct_traits.h" ] public_deps = [ - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", ] type_mappings = [ "ash.mojom.ShelfAlignment=ash::ShelfAlignment",
diff --git a/ash/public/interfaces/wallpaper.typemap b/ash/public/interfaces/wallpaper.typemap index 6b314986..ce017ca 100644 --- a/ash/public/interfaces/wallpaper.typemap +++ b/ash/public/interfaces/wallpaper.typemap
@@ -6,6 +6,6 @@ public_headers = [ "//components/wallpaper/wallpaper_layout.h" ] traits_headers = [ "//ash/public/interfaces/wallpaper_struct_traits.h" ] public_deps = [ - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", ] type_mappings = [ "ash.mojom.WallpaperLayout=wallpaper::WallpaperLayout" ]
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 7585098..953c520f 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc
@@ -66,6 +66,7 @@ #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/mus/window_mus.h" +#include "ui/aura/mus/window_port_mus.h" #include "ui/aura/mus/window_tree_client.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" @@ -248,6 +249,11 @@ WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) { WmWindow* window = WmShell::Get()->NewWindow(ui::wm::WINDOW_TYPE_UNKNOWN, ui::LAYER_NOT_DRAWN); + if (WmShell::Get()->IsRunningInMash()) { + aura::WindowPortMus::Get(window->aura_window()) + ->SetEventTargetingPolicy( + ui::mojom::EventTargetingPolicy::DESCENDANTS_ONLY); + } window->SetShellWindowId(window_id); window->SetName(name); parent->AddChild(window);
diff --git a/ash/shell/panel_window.cc b/ash/shell/panel_window.cc index f9150b8..e10c68c 100644 --- a/ash/shell/panel_window.cc +++ b/ash/shell/panel_window.cc
@@ -5,9 +5,9 @@ #include "ash/shell/panel_window.h" #include "ash/common/wm/panels/panel_frame_view.h" +#include "ash/public/cpp/window_properties.h" #include "ash/screen_util.h" #include "ash/shell.h" -#include "ash/wm/window_properties.h" #include "base/strings/utf_string_conversions.h" #include "ui/aura/window.h" #include "ui/gfx/canvas.h"
diff --git a/ash/test/BUILD.gn b/ash/test/BUILD.gn index 91e78a8c..7cc197a2 100644 --- a/ash/test/BUILD.gn +++ b/ash/test/BUILD.gn
@@ -145,7 +145,7 @@ ] deps = [ "//ash/common/test:test_support", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/resources", "//base:i18n",
diff --git a/ash/touch_hud/mus/BUILD.gn b/ash/touch_hud/mus/BUILD.gn index ad999d5..a91f9cc 100644 --- a/ash/touch_hud/mus/BUILD.gn +++ b/ash/touch_hud/mus/BUILD.gn
@@ -14,7 +14,7 @@ ] deps = [ - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/touch_hud", "//base",
diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc index a09e167..730d478 100644 --- a/ash/wm/dock/docked_window_resizer_unittest.cc +++ b/ash/wm/dock/docked_window_resizer_unittest.cc
@@ -17,13 +17,13 @@ #include "ash/display/window_tree_host_manager.h" #include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/screen_util.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/cursor_manager_test_api.h" #include "ash/wm/drag_window_resizer.h" -#include "ash/wm/window_properties.h" #include "ash/wm/window_state_aura.h" #include "ash/wm/window_util.h" #include "base/command_line.h"
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index 987cb27b..12164ac 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -16,12 +16,12 @@ #include "ash/common/wm_window_property.h" #include "ash/public/cpp/shelf_types.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/cursor_manager_test_api.h" #include "ash/wm/drag_window_resizer.h" -#include "ash/wm/window_properties.h" #include "ash/wm/window_state_aura.h" #include "base/i18n/rtl.h" #include "ui/aura/client/aura_constants.h"
diff --git a/ash/wm/window_properties.cc b/ash/wm/window_properties.cc index 1364c08..f6f8e41a2 100644 --- a/ash/wm/window_properties.cc +++ b/ash/wm/window_properties.cc
@@ -5,7 +5,6 @@ #include "ash/wm/window_properties.h" #include "ash/common/wm/window_state.h" -#include "ui/base/class_property.h" DECLARE_UI_CLASS_PROPERTY_TYPE(ash::wm::WindowState*); DECLARE_EXPORTED_UI_CLASS_PROPERTY_TYPE(ASH_EXPORT, ash::WidgetCreationType); @@ -14,8 +13,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(bool, kLockedToRootKey, false); -DEFINE_UI_CLASS_PROPERTY_KEY(bool, kPanelAttachedKey, true); - DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, kRestoreBoundsOverrideKey, NULL); DEFINE_UI_CLASS_PROPERTY_KEY(ui::WindowShowState, @@ -24,8 +21,6 @@ DEFINE_UI_CLASS_PROPERTY_KEY(ShelfID, kShelfIDKey, kInvalidShelfID); -DEFINE_UI_CLASS_PROPERTY_KEY(int32_t, kShelfItemTypeKey, TYPE_UNDEFINED); - DEFINE_UI_CLASS_PROPERTY_KEY(bool, kSnapChildrenToPixelBoundary, false); DEFINE_UI_CLASS_PROPERTY_KEY(bool, kUsesScreenCoordinatesKey, false);
diff --git a/ash/wm/window_properties.h b/ash/wm/window_properties.h index c0c3d035..561f18b 100644 --- a/ash/wm/window_properties.h +++ b/ash/wm/window_properties.h
@@ -47,9 +47,6 @@ // bounds outside of its root window is set. ASH_EXPORT extern const aura::WindowProperty<bool>* const kLockedToRootKey; -// If true (and the window is a panel), it's attached to its shelf item. -ASH_EXPORT extern const aura::WindowProperty<bool>* const kPanelAttachedKey; - // A property key which stores the bounds to restore a window to. These take // preference over the current bounds/state. This is used by e.g. the always // maximized mode window manager. @@ -65,9 +62,6 @@ // A property key to store the id for a window's shelf item. ASH_EXPORT extern const aura::WindowProperty<ShelfID>* const kShelfIDKey; -// A property key to store the type of a window's shelf item. -ASH_EXPORT extern const aura::WindowProperty<int32_t>* const kShelfItemTypeKey; - // Containers with this property (true) are aligned with physical pixel // boundary. extern const aura::WindowProperty<bool>* const kSnapChildrenToPixelBoundary;
diff --git a/base/BUILD.gn b/base/BUILD.gn index c370c21..ef37887 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -1146,6 +1146,12 @@ "allocator/allocator_shim_override_linker_wrapped_symbols.h", ] all_dependent_configs += [ "//base/allocator:wrap_malloc_symbols" ] + } else if (is_mac) { + sources += [ + "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc", + "allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h", + "allocator/allocator_shim_override_mac_symbols.h", + ] } }
diff --git a/base/allocator/allocator_interception_mac.h b/base/allocator/allocator_interception_mac.h index 87cbf489..694d66b3 100644 --- a/base/allocator/allocator_interception_mac.h +++ b/base/allocator/allocator_interception_mac.h
@@ -25,22 +25,38 @@ typedef void* (*memalign_type)(struct _malloc_zone_t* zone, size_t alignment, size_t size); +typedef unsigned (*batch_malloc_type)(struct _malloc_zone_t* zone, + size_t size, + void** results, + unsigned num_requested); +typedef void (*batch_free_type)(struct _malloc_zone_t* zone, + void** to_be_freed, + unsigned num_to_be_freed); +typedef void (*free_definite_size_type)(struct _malloc_zone_t* zone, + void* ptr, + size_t size); +typedef size_t (*size_fn_type)(struct _malloc_zone_t* zone, const void* ptr); struct MallocZoneFunctions { + MallocZoneFunctions(); malloc_type malloc = nullptr; calloc_type calloc = nullptr; valloc_type valloc = nullptr; free_type free = nullptr; realloc_type realloc = nullptr; memalign_type memalign = nullptr; + batch_malloc_type batch_malloc = nullptr; + batch_free_type batch_free = nullptr; + free_definite_size_type free_definite_size = nullptr; + size_fn_type size = nullptr; }; -// Saves the function pointers currently used by |zone| into |functions|. -void StoreZoneFunctions(ChromeMallocZone* zone, MallocZoneFunctions* functions); +// Saves the function pointers currently used by default zone into |functions|. +void StoreFunctionsForDefaultZone(MallocZoneFunctions* functions); -// Updates the malloc zone to use the functions specified by |functions|. -void ReplaceZoneFunctions(ChromeMallocZone* zone, - const MallocZoneFunctions* functions); +// Updates the default malloc zone to use the functions specified by +// |functions|. +void ReplaceFunctionsForDefaultZone(const MallocZoneFunctions* functions); // Calls the original implementation of malloc/calloc prior to interception. bool UncheckedMallocMac(size_t size, void** result); @@ -48,6 +64,8 @@ // Intercepts calls to default and purgeable malloc zones. Intercepts Core // Foundation and Objective-C allocations. +// Has no effect on the default malloc zone if the allocator shim already +// performs that interception. void InterceptAllocationsMac(); } // namespace allocator } // namespace base
diff --git a/base/allocator/allocator_interception_mac.mm b/base/allocator/allocator_interception_mac.mm index 11ee3ed..be6c0fa 100644 --- a/base/allocator/allocator_interception_mac.mm +++ b/base/allocator/allocator_interception_mac.mm
@@ -38,9 +38,12 @@ namespace base { namespace allocator { +MallocZoneFunctions::MallocZoneFunctions() {} + namespace { bool g_oom_killer_enabled; +bool g_replaced_default_zone = false; // Starting with Mac OS X 10.7, the zone allocators set up by the system are // read-only, to prevent them from being overwritten in an attack. However, @@ -302,13 +305,22 @@ functions->valloc = zone->valloc; functions->free = zone->free; functions->realloc = zone->realloc; + functions->size = zone->size; CHECK(functions->malloc && functions->calloc && functions->valloc && - functions->free && functions->realloc); + functions->free && functions->realloc && functions->size); + + // These functions might be nullptr. + functions->batch_malloc = zone->batch_malloc; + functions->batch_free = zone->batch_free; if (zone->version >= 5) { functions->memalign = zone->memalign; CHECK(functions->memalign); } + if (zone->version >= 6) { + // This may be nullptr. + functions->free_definite_size = zone->free_definite_size; + } } void ReplaceZoneFunctions(ChromeMallocZone* zone, @@ -320,14 +332,25 @@ DeprotectMallocZone(zone, &reprotection_start, &reprotection_length, &reprotection_value); + CHECK(functions->malloc && functions->calloc && functions->valloc && + functions->free && functions->realloc); zone->malloc = functions->malloc; zone->calloc = functions->calloc; zone->valloc = functions->valloc; zone->free = functions->free; zone->realloc = functions->realloc; - if (zone->version >= 5) { + if (functions->batch_malloc) + zone->batch_malloc = functions->batch_malloc; + if (functions->batch_free) + zone->batch_free = functions->batch_free; + if (functions->size) + zone->size = functions->size; + if (zone->version >= 5 && functions->memalign) { zone->memalign = functions->memalign; } + if (zone->version >= 6 && functions->free_definite_size) { + zone->free_definite_size = functions->free_definite_size; + } // Restore protection if it was active. if (reprotection_start) { @@ -338,6 +361,23 @@ } } +void StoreFunctionsForDefaultZone(MallocZoneFunctions* functions) { + ChromeMallocZone* default_zone = reinterpret_cast<ChromeMallocZone*>( + malloc_default_zone()); + StoreZoneFunctions(default_zone, functions); +} + +void ReplaceFunctionsForDefaultZone(const MallocZoneFunctions* functions) { + CHECK(!g_replaced_default_zone); + g_replaced_default_zone = true; +#if !defined(ADDRESS_SANITIZER) + StoreFunctionsForDefaultZone(&g_old_zone); +#endif + ChromeMallocZone* default_zone = reinterpret_cast<ChromeMallocZone*>( + malloc_default_zone()); + ReplaceZoneFunctions(default_zone, functions); +} + void InterceptAllocationsMac() { if (g_oom_killer_enabled) return; @@ -356,17 +396,17 @@ #if !defined(ADDRESS_SANITIZER) // Don't do anything special on OOM for the malloc zones replaced by // AddressSanitizer, as modifying or protecting them may not work correctly. - ChromeMallocZone* default_zone = - reinterpret_cast<ChromeMallocZone*>(malloc_default_zone()); - StoreZoneFunctions(default_zone, &g_old_zone); - MallocZoneFunctions new_functions; - new_functions.malloc = oom_killer_malloc; - new_functions.calloc = oom_killer_calloc; - new_functions.valloc = oom_killer_valloc; - new_functions.free = oom_killer_free; - new_functions.realloc = oom_killer_realloc; - new_functions.memalign = oom_killer_memalign; - ReplaceZoneFunctions(default_zone, &new_functions); + if (!g_replaced_default_zone) { + StoreFunctionsForDefaultZone(&g_old_zone); + MallocZoneFunctions new_functions; + new_functions.malloc = oom_killer_malloc; + new_functions.calloc = oom_killer_calloc; + new_functions.valloc = oom_killer_valloc; + new_functions.free = oom_killer_free; + new_functions.realloc = oom_killer_realloc; + new_functions.memalign = oom_killer_memalign; + ReplaceFunctionsForDefaultZone(&new_functions); + } ChromeMallocZone* purgeable_zone = reinterpret_cast<ChromeMallocZone*>(malloc_default_purgeable_zone());
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index a9fc095b..bad8fc6e 100644 --- a/base/allocator/allocator_shim.cc +++ b/base/allocator/allocator_shim.cc
@@ -241,12 +241,35 @@ return chain_head->free_function(chain_head, address); } +size_t ShimGetSizeEstimate(const void* address) { + const allocator::AllocatorDispatch* const chain_head = GetChainHead(); + return chain_head->get_size_estimate_function(chain_head, + const_cast<void*>(address)); +} + +unsigned ShimBatchMalloc(size_t size, void** results, unsigned num_requested) { + const allocator::AllocatorDispatch* const chain_head = GetChainHead(); + return chain_head->batch_malloc_function(chain_head, size, results, + num_requested); +} + +void ShimBatchFree(void** to_be_freed, unsigned num_to_be_freed) { + const allocator::AllocatorDispatch* const chain_head = GetChainHead(); + return chain_head->batch_free_function(chain_head, to_be_freed, + num_to_be_freed); +} + +void ShimFreeDefiniteSize(void* ptr, size_t size) { + const allocator::AllocatorDispatch* const chain_head = GetChainHead(); + return chain_head->free_definite_size_function(chain_head, ptr, size); +} + } // extern "C" -#if !defined(OS_WIN) +#if !defined(OS_WIN) && !defined(OS_MACOSX) // Cpp symbols (new / delete) should always be routed through the shim layer -// except on Windows where the malloc intercept is deep enough that it also -// catches the cpp calls. +// except on Windows and macOS where the malloc intercept is deep enough that it +// also catches the cpp calls. #include "base/allocator/allocator_shim_override_cpp_symbols.h" #endif @@ -257,6 +280,9 @@ #elif defined(OS_WIN) // On Windows we use plain link-time overriding of the CRT symbols. #include "base/allocator/allocator_shim_override_ucrt_symbols_win.h" +#elif defined(OS_MACOSX) +#include "base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h" +#include "base/allocator/allocator_shim_override_mac_symbols.h" #else #include "base/allocator/allocator_shim_override_libc_symbols.h" #endif @@ -268,6 +294,22 @@ #include "base/allocator/allocator_shim_override_glibc_weak_symbols.h" #endif +#if defined(OS_MACOSX) +namespace base { +namespace allocator { +void InitializeAllocatorShim() { + // Prepares the default dispatch. After the intercepted malloc calls have + // traversed the shim this will route them to the default malloc zone. + InitializeDefaultDispatchToMacAllocator(); + + // This replaces the default malloc zone, causing calls to malloc & friends + // from the codebase to be routed to ShimMalloc() above. + OverrideMacSymbols(); +} +} // namespace allocator +} // namespace base +#endif + // Cross-checks. #if defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
diff --git a/base/allocator/allocator_shim.h b/base/allocator/allocator_shim.h index 8fd060fc..f43ec29 100644 --- a/base/allocator/allocator_shim.h +++ b/base/allocator/allocator_shim.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include "base/base_export.h" +#include "build/build_config.h" namespace base { namespace allocator { @@ -62,6 +63,16 @@ // allocation. If no good estimate is possible, returns zero. using GetSizeEstimateFn = size_t(const AllocatorDispatch* self, void* address); + using BatchMallocFn = unsigned(const AllocatorDispatch* self, + size_t size, + void** results, + unsigned num_requested); + using BatchFreeFn = void(const AllocatorDispatch* self, + void** to_be_freed, + unsigned num_to_be_freed); + using FreeDefiniteSizeFn = void(const AllocatorDispatch* self, + void* ptr, + size_t size); AllocFn* const alloc_function; AllocZeroInitializedFn* const alloc_zero_initialized_function; @@ -69,6 +80,9 @@ ReallocFn* const realloc_function; FreeFn* const free_function; GetSizeEstimateFn* const get_size_estimate_function; + BatchMallocFn* const batch_malloc_function; + BatchFreeFn* const batch_free_function; + FreeDefiniteSizeFn* const free_definite_size_function; const AllocatorDispatch* next; @@ -97,6 +111,11 @@ // in malloc(), which we really don't want. BASE_EXPORT void RemoveAllocatorDispatchForTesting(AllocatorDispatch* dispatch); +#if defined(OS_MACOSX) +// On macOS, the allocator shim needs to be turned on during runtime. +BASE_EXPORT void InitializeAllocatorShim(); +#endif // defined(OS_MACOSX) + } // namespace allocator } // namespace base
diff --git a/base/allocator/allocator_shim_default_dispatch_to_glibc.cc b/base/allocator/allocator_shim_default_dispatch_to_glibc.cc index f3a53597..7415ec6 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_glibc.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_glibc.cc
@@ -57,5 +57,8 @@ &GlibcRealloc, /* realloc_function */ &GlibcFree, /* free_function */ &GlibcGetSizeEstimate, /* get_size_estimate_function */ + nullptr, /* batch_malloc_function */ + nullptr, /* batch_free_function */ + nullptr, /* free_definite_size_function */ nullptr, /* next */ };
diff --git a/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc b/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc index 69953ae..0fe7719 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc
@@ -92,5 +92,8 @@ &RealRealloc, /* realloc_function */ &RealFree, /* free_function */ &RealSizeEstimate, /* get_size_estimate_function */ + nullptr, /* batch_malloc_function */ + nullptr, /* batch_free_function */ + nullptr, /* free_definite_size_function */ nullptr, /* next */ };
diff --git a/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc b/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.cc new file mode 100644 index 0000000..bc13100 --- /dev/null +++ b/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.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 "base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h" + +#include <utility> + +#include "base/allocator/allocator_interception_mac.h" +#include "base/allocator/allocator_shim.h" +#include "base/logging.h" + +namespace base { +namespace allocator { + +namespace { + +// This is the zone that the allocator shim will call to actually perform heap +// allocations. It should be populated with the original, unintercepted default +// malloc zone. +MallocZoneFunctions g_default_zone; + +void* MallocImpl(const AllocatorDispatch*, size_t size) { + return g_default_zone.malloc(malloc_default_zone(), size); +} + +void* CallocImpl(const AllocatorDispatch*, size_t n, size_t size) { + return g_default_zone.calloc(malloc_default_zone(), n, size); +} + +void* MemalignImpl(const AllocatorDispatch*, size_t alignment, size_t size) { + return g_default_zone.memalign(malloc_default_zone(), alignment, size); +} + +void* ReallocImpl(const AllocatorDispatch*, void* ptr, size_t size) { + return g_default_zone.realloc(malloc_default_zone(), ptr, size); +} + +void FreeImpl(const AllocatorDispatch*, void* ptr) { + g_default_zone.free(malloc_default_zone(), ptr); +} + +size_t GetSizeEstimateImpl(const AllocatorDispatch*, void* ptr) { + return g_default_zone.size(malloc_default_zone(), ptr); +} + +unsigned BatchMallocImpl(const AllocatorDispatch* self, + size_t size, + void** results, + unsigned num_requested) { + return g_default_zone.batch_malloc(malloc_default_zone(), size, results, + num_requested); +} + +void BatchFreeImpl(const AllocatorDispatch* self, + void** to_be_freed, + unsigned num_to_be_freed) { + g_default_zone.batch_free(malloc_default_zone(), to_be_freed, + num_to_be_freed); +} + +void FreeDefiniteSizeImpl(const AllocatorDispatch* self, + void* ptr, + size_t size) { + g_default_zone.free_definite_size(malloc_default_zone(), ptr, size); +} + +} // namespace + +void InitializeDefaultDispatchToMacAllocator() { + StoreFunctionsForDefaultZone(&g_default_zone); +} + +const AllocatorDispatch AllocatorDispatch::default_dispatch = { + &MallocImpl, /* alloc_function */ + &CallocImpl, /* alloc_zero_initialized_function */ + &MemalignImpl, /* alloc_aligned_function */ + &ReallocImpl, /* realloc_function */ + &FreeImpl, /* free_function */ + &GetSizeEstimateImpl, /* get_size_estimate_function */ + &BatchMallocImpl, /* batch_malloc_function */ + &BatchFreeImpl, /* batch_free_function */ + &FreeDefiniteSizeImpl, /* free_definite_size_function */ + nullptr, /* next */ +}; + +} // namespace allocator +} // namespace base
diff --git a/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h b/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h new file mode 100644 index 0000000..9e26d826 --- /dev/null +++ b/base/allocator/allocator_shim_default_dispatch_to_mac_zoned_malloc.h
@@ -0,0 +1,21 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_ALLOCATOR_ALLOCATOR_SHIM_DEFAULT_DISPATCH_TO_ZONED_MALLOC_H_ +#define BASE_ALLOCATOR_ALLOCATOR_SHIM_DEFAULT_DISPATCH_TO_ZONED_MALLOC_H_ + +#include "base/allocator/allocator_interception_mac.h" + +namespace base { +namespace allocator { + +// This initializes AllocatorDispatch::default_dispatch by saving pointers to +// the functions in the current default malloc zone. This must be called before +// the default malloc zone is changed to have its intended effect. +void InitializeDefaultDispatchToMacAllocator(); + +} // namespace allocator +} // namespace base + +#endif // BASE_ALLOCATOR_ALLOCATOR_SHIM_DEFAULT_DISPATCH_TO_ZONED_MALLOC_H_
diff --git a/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc b/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc index 7853422..c90b4c8 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
@@ -44,6 +44,9 @@ &TCRealloc, /* realloc_function */ &TCFree, /* free_function */ &TCGetSizeEstimate, /* get_size_estimate_function */ + nullptr, /* batch_malloc_function */ + nullptr, /* batch_free_function */ + nullptr, /* free_definite_size_function */ nullptr, /* next */ };
diff --git a/base/allocator/allocator_shim_default_dispatch_to_winheap.cc b/base/allocator/allocator_shim_default_dispatch_to_winheap.cc index 2df3fdf..2772e0f 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_winheap.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_winheap.cc
@@ -61,5 +61,8 @@ &DefaultWinHeapReallocImpl, &DefaultWinHeapFreeImpl, &DefaultWinHeapGetSizeEstimateImpl, + nullptr, /* batch_malloc_function */ + nullptr, /* batch_free_function */ + nullptr, /* free_definite_size_function */ nullptr, /* next */ };
diff --git a/base/allocator/allocator_shim_override_mac_symbols.h b/base/allocator/allocator_shim_override_mac_symbols.h new file mode 100644 index 0000000..5107d752 --- /dev/null +++ b/base/allocator/allocator_shim_override_mac_symbols.h
@@ -0,0 +1,58 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifdef BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_MAC_SYMBOLS_H_ +#error This header is meant to be included only once by allocator_shim.cc +#endif +#define BASE_ALLOCATOR_ALLOCATOR_SHIM_OVERRIDE_MAC_SYMBOLS_H_ + +#include "base/allocator/allocator_interception_mac.h" +#include "third_party/apple_apsl/malloc.h" + +namespace base { +namespace allocator { + +void OverrideMacSymbols() { + MallocZoneFunctions new_functions; + new_functions.size = [](malloc_zone_t* zone, const void* ptr) -> size_t { + return ShimGetSizeEstimate(ptr); + }; + new_functions.malloc = [](malloc_zone_t* zone, size_t size) -> void* { + return ShimMalloc(size); + }; + new_functions.calloc = [](malloc_zone_t* zone, size_t n, + size_t size) -> void* { + return ShimCalloc(n, size); + }; + new_functions.valloc = [](malloc_zone_t* zone, size_t size) -> void* { + return ShimValloc(size); + }; + new_functions.free = [](malloc_zone_t* zone, void* ptr) { ShimFree(ptr); }; + new_functions.realloc = [](malloc_zone_t* zone, void* ptr, + size_t size) -> void* { + return ShimRealloc(ptr, size); + }; + new_functions.batch_malloc = [](struct _malloc_zone_t* zone, size_t size, + void** results, + unsigned num_requested) -> unsigned { + return ShimBatchMalloc(size, results, num_requested); + }; + new_functions.batch_free = [](struct _malloc_zone_t* zone, void** to_be_freed, + unsigned num_to_be_freed) -> void { + ShimBatchFree(to_be_freed, num_to_be_freed); + }; + new_functions.memalign = [](malloc_zone_t* zone, size_t alignment, + size_t size) -> void* { + return ShimMemalign(alignment, size); + }; + new_functions.free_definite_size = [](malloc_zone_t* zone, void* ptr, + size_t size) { + ShimFreeDefiniteSize(ptr, size); + }; + + base::allocator::ReplaceFunctionsForDefaultZone(&new_functions); +} + +} // namespace allocator +} // namespace base
diff --git a/base/allocator/allocator_shim_unittest.cc b/base/allocator/allocator_shim_unittest.cc index e45b03d..cff7dd7 100644 --- a/base/allocator/allocator_shim_unittest.cc +++ b/base/allocator/allocator_shim_unittest.cc
@@ -4,7 +4,6 @@ #include "base/allocator/allocator_shim.h" -#include <malloc.h> #include <stdlib.h> #include <string.h> @@ -18,12 +17,20 @@ #include "base/synchronization/waitable_event.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_local.h" +#include "build/build_config.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) #include <windows.h> +#elif defined(OS_MACOSX) +#include <malloc/malloc.h> +#include "third_party/apple_apsl/malloc.h" #else +#include <malloc.h> +#endif + +#if !defined(OS_WIN) #include <unistd.h> #endif @@ -83,15 +90,15 @@ void* address, size_t size) { if (instance_) { - // Address 0x420 is a special sentinel for the NewHandlerConcurrency test. - // The first time (but only the first one) it is hit it fails, causing the + // Size 0xFEED a special sentinel for the NewHandlerConcurrency test. + // Hitting it for the first time will cause a failure, causing the // invocation of the std::new_handler. - if (address == reinterpret_cast<void*>(0x420)) { - if (!instance_->did_fail_realloc_0x420_once->Get()) { - instance_->did_fail_realloc_0x420_once->Set(true); + if (size == 0xFEED) { + if (!instance_->did_fail_realloc_0xfeed_once->Get()) { + instance_->did_fail_realloc_0xfeed_once->Set(true); return nullptr; } else { - return reinterpret_cast<void*>(0x420ul); + return address; } } @@ -109,6 +116,44 @@ self->next->free_function(self->next, address); } + static size_t MockGetSizeEstimate(const AllocatorDispatch* self, + void* address) { + return self->next->get_size_estimate_function(self->next, address); + } + + static unsigned MockBatchMalloc(const AllocatorDispatch* self, + size_t size, + void** results, + unsigned num_requested) { + if (instance_) { + instance_->batch_mallocs_intercepted_by_size[size] = + instance_->batch_mallocs_intercepted_by_size[size] + num_requested; + } + return self->next->batch_malloc_function(self->next, size, results, + num_requested); + } + + static void MockBatchFree(const AllocatorDispatch* self, + void** to_be_freed, + unsigned num_to_be_freed) { + if (instance_) { + for (unsigned i = 0; i < num_to_be_freed; ++i) { + ++instance_->batch_frees_intercepted_by_addr[Hash(to_be_freed[i])]; + } + } + self->next->batch_free_function(self->next, to_be_freed, num_to_be_freed); + } + + static void MockFreeDefiniteSize(const AllocatorDispatch* self, + void* ptr, + size_t size) { + if (instance_) { + ++instance_->frees_intercepted_by_addr[Hash(ptr)]; + ++instance_->free_definite_sizes_intercepted_by_size[size]; + } + self->next->free_definite_size_function(self->next, ptr, size); + } + static void NewHandler() { if (!instance_) return; @@ -127,11 +172,21 @@ memset(&aligned_allocs_intercepted_by_alignment, 0, array_size); memset(&reallocs_intercepted_by_size, 0, array_size); memset(&frees_intercepted_by_addr, 0, array_size); - did_fail_realloc_0x420_once.reset(new ThreadLocalBoolean()); + memset(&batch_mallocs_intercepted_by_size, 0, array_size); + memset(&batch_frees_intercepted_by_addr, 0, array_size); + memset(&free_definite_sizes_intercepted_by_size, 0, array_size); + did_fail_realloc_0xfeed_once.reset(new ThreadLocalBoolean()); subtle::Release_Store(&num_new_handler_calls, 0); instance_ = this; + } +#if defined(OS_MACOSX) + static void SetUpTestCase() { + InitializeAllocatorShim(); + } +#endif + void TearDown() override { instance_ = nullptr; } protected: @@ -142,7 +197,10 @@ size_t reallocs_intercepted_by_size[kMaxSizeTracked]; size_t reallocs_intercepted_by_addr[kMaxSizeTracked]; size_t frees_intercepted_by_addr[kMaxSizeTracked]; - std::unique_ptr<ThreadLocalBoolean> did_fail_realloc_0x420_once; + size_t batch_mallocs_intercepted_by_size[kMaxSizeTracked]; + size_t batch_frees_intercepted_by_addr[kMaxSizeTracked]; + size_t free_definite_sizes_intercepted_by_size[kMaxSizeTracked]; + std::unique_ptr<ThreadLocalBoolean> did_fail_realloc_0xfeed_once; subtle::Atomic32 num_new_handler_calls; private: @@ -165,8 +223,9 @@ void ThreadMain() override { event_->Wait(); - void* res = realloc(reinterpret_cast<void*>(0x420ul), 1); - EXPECT_EQ(reinterpret_cast<void*>(0x420ul), res); + void* temp = malloc(1); + void* res = realloc(temp, 0xFEED); + EXPECT_EQ(temp, res); } private: @@ -181,7 +240,11 @@ &AllocatorShimTest::MockAllocAligned, /* alloc_aligned_function */ &AllocatorShimTest::MockRealloc, /* realloc_function */ &AllocatorShimTest::MockFree, /* free_function */ - nullptr, /* next */ + &AllocatorShimTest::MockGetSizeEstimate, /* get_size_estimate_function */ + &AllocatorShimTest::MockBatchMalloc, /* batch_malloc_function */ + &AllocatorShimTest::MockBatchFree, /* batch_free_function */ + &AllocatorShimTest::MockFreeDefiniteSize, /* free_definite_size_function */ + nullptr, /* next */ }; TEST_F(AllocatorShimTest, InterceptLibcSymbols) { @@ -196,12 +259,7 @@ ASSERT_GE(zero_allocs_intercepted_by_size[2 * 23], 1u); #if !defined(OS_WIN) - void* memalign_ptr = memalign(128, 53); - ASSERT_NE(nullptr, memalign_ptr); - ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128); - ASSERT_GE(aligned_allocs_intercepted_by_alignment[128], 1u); - ASSERT_GE(aligned_allocs_intercepted_by_size[53], 1u); - + const size_t kPageSize = base::GetPageSize(); void* posix_memalign_ptr = nullptr; int res = posix_memalign(&posix_memalign_ptr, 256, 59); ASSERT_EQ(0, res); @@ -212,10 +270,17 @@ void* valloc_ptr = valloc(61); ASSERT_NE(nullptr, valloc_ptr); - const size_t kPageSize = base::GetPageSize(); ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(valloc_ptr) % kPageSize); ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); ASSERT_GE(aligned_allocs_intercepted_by_size[61], 1u); +#endif // !OS_WIN + +#if !defined(OS_WIN) && !defined(OS_MACOSX) + void* memalign_ptr = memalign(128, 53); + ASSERT_NE(nullptr, memalign_ptr); + ASSERT_EQ(0u, reinterpret_cast<uintptr_t>(memalign_ptr) % 128); + ASSERT_GE(aligned_allocs_intercepted_by_alignment[128], 1u); + ASSERT_GE(aligned_allocs_intercepted_by_size[53], 1u); void* pvalloc_ptr = pvalloc(67); ASSERT_NE(nullptr, pvalloc_ptr); @@ -223,12 +288,9 @@ ASSERT_GE(aligned_allocs_intercepted_by_alignment[kPageSize], 1u); // pvalloc rounds the size up to the next page. ASSERT_GE(aligned_allocs_intercepted_by_size[kPageSize], 1u); -#endif // OS_WIN +#endif // !OS_WIN && !OS_MACOSX - char* realloc_ptr = static_cast<char*>(realloc(nullptr, 71)); - ASSERT_NE(nullptr, realloc_ptr); - ASSERT_GE(reallocs_intercepted_by_size[71], 1u); - ASSERT_GE(reallocs_intercepted_by_addr[Hash(nullptr)], 1u); + char* realloc_ptr = static_cast<char*>(malloc(10)); strcpy(realloc_ptr, "foobar"); void* old_realloc_ptr = realloc_ptr; realloc_ptr = static_cast<char*>(realloc(realloc_ptr, 73)); @@ -242,19 +304,21 @@ free(zero_alloc_ptr); ASSERT_GE(frees_intercepted_by_addr[Hash(zero_alloc_ptr)], 1u); -#if !defined(OS_WIN) +#if !defined(OS_WIN) && !defined(OS_MACOSX) free(memalign_ptr); ASSERT_GE(frees_intercepted_by_addr[Hash(memalign_ptr)], 1u); + free(pvalloc_ptr); + ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u); +#endif // !OS_WIN && !OS_MACOSX + +#if !defined(OS_WIN) free(posix_memalign_ptr); ASSERT_GE(frees_intercepted_by_addr[Hash(posix_memalign_ptr)], 1u); free(valloc_ptr); ASSERT_GE(frees_intercepted_by_addr[Hash(valloc_ptr)], 1u); - - free(pvalloc_ptr); - ASSERT_GE(frees_intercepted_by_addr[Hash(pvalloc_ptr)], 1u); -#endif // OS_WIN +#endif // !OS_WIN free(realloc_ptr); ASSERT_GE(frees_intercepted_by_addr[Hash(realloc_ptr)], 1u); @@ -267,6 +331,41 @@ free(non_hooked_ptr); } +#if defined(OS_MACOSX) +TEST_F(AllocatorShimTest, InterceptLibcSymbolsBatchMallocFree) { + InsertAllocatorDispatch(&g_mock_dispatch); + + unsigned count = 13; + std::vector<void*> results; + results.resize(count); + unsigned result_count = malloc_zone_batch_malloc(malloc_default_zone(), 99, + results.data(), count); + ASSERT_EQ(count, result_count); + ASSERT_EQ(count, batch_mallocs_intercepted_by_size[99]); + + std::vector<void*> results_copy(results); + malloc_zone_batch_free(malloc_default_zone(), results.data(), count); + for (void* result : results_copy) { + ASSERT_GE(batch_frees_intercepted_by_addr[Hash(result)], 1u); + } + RemoveAllocatorDispatchForTesting(&g_mock_dispatch); +} + +TEST_F(AllocatorShimTest, InterceptLibcSymbolsFreeDefiniteSize) { + InsertAllocatorDispatch(&g_mock_dispatch); + + void* alloc_ptr = malloc(19); + ASSERT_NE(nullptr, alloc_ptr); + ASSERT_GE(allocs_intercepted_by_size[19], 1u); + + ChromeMallocZone* default_zone = + reinterpret_cast<ChromeMallocZone*>(malloc_default_zone()); + default_zone->free_definite_size(malloc_default_zone(), alloc_ptr, 19); + ASSERT_GE(free_definite_sizes_intercepted_by_size[19], 1u); + RemoveAllocatorDispatchForTesting(&g_mock_dispatch); +} +#endif // defined(OS_MACOSX) + TEST_F(AllocatorShimTest, InterceptCppSymbols) { InsertAllocatorDispatch(&g_mock_dispatch); @@ -304,8 +403,8 @@ // This test exercises the case of concurrent OOM failure, which would end up // invoking std::new_handler concurrently. This is to cover the CallNewHandler() // paths of allocator_shim.cc and smoke-test its thread safey. -// The test creates kNumThreads threads. Each of them does just a -// realloc(0x420). +// The test creates kNumThreads threads. Each of them mallocs some memory, and +// then does a realloc(<new memory>, 0xFEED). // The shim intercepts such realloc and makes it fail only once on each thread. // We expect to see excactly kNumThreads invocations of the new_handler. TEST_F(AllocatorShimTest, NewHandlerConcurrency) {
diff --git a/base/debug/thread_heap_usage_tracker.cc b/base/debug/thread_heap_usage_tracker.cc index 25af20b0..3761cf9 100644 --- a/base/debug/thread_heap_usage_tracker.cc +++ b/base/debug/thread_heap_usage_tracker.cc
@@ -130,10 +130,46 @@ return self->next->get_size_estimate_function(self->next, address); } +unsigned BatchMallocFn(const AllocatorDispatch* self, + size_t size, + void** results, + unsigned num_requested) { + unsigned count = self->next->batch_malloc_function(self->next, size, results, + num_requested); + for (unsigned i = 0; i < count; ++i) { + RecordAlloc(self->next, results[i], size); + } + return count; +} + +void BatchFreeFn(const AllocatorDispatch* self, + void** to_be_freed, + unsigned num_to_be_freed) { + for (unsigned i = 0; i < num_to_be_freed; ++i) { + if (to_be_freed[i] != nullptr) { + RecordFree(self->next, to_be_freed[i]); + } + } + self->next->batch_free_function(self->next, to_be_freed, num_to_be_freed); +} + +void FreeDefiniteSizeFn(const AllocatorDispatch* self, void* ptr, size_t size) { + if (ptr != nullptr) + RecordFree(self->next, ptr); + self->next->free_definite_size_function(self->next, ptr, size); +} + // The allocator dispatch used to intercept heap operations. -AllocatorDispatch allocator_dispatch = { - &AllocFn, &AllocZeroInitializedFn, &AllocAlignedFn, &ReallocFn, - &FreeFn, &GetSizeEstimateFn, nullptr}; +AllocatorDispatch allocator_dispatch = {&AllocFn, + &AllocZeroInitializedFn, + &AllocAlignedFn, + &ReallocFn, + &FreeFn, + &GetSizeEstimateFn, + &BatchMallocFn, + &BatchFreeFn, + &FreeDefiniteSizeFn, + nullptr}; ThreadHeapUsage* GetOrCreateThreadUsage() { ThreadHeapUsage* allocator_usage =
diff --git a/base/debug/thread_heap_usage_tracker_unittest.cc b/base/debug/thread_heap_usage_tracker_unittest.cc index 6aac4b5..5c03c38 100644 --- a/base/debug/thread_heap_usage_tracker_unittest.cc +++ b/base/debug/thread_heap_usage_tracker_unittest.cc
@@ -206,6 +206,9 @@ &ThreadHeapUsageTrackerTest::OnFreeFn, // free_function &ThreadHeapUsageTrackerTest:: OnGetSizeEstimateFn, // get_size_estimate_function + nullptr, // batch_malloc + nullptr, // batch_free + nullptr, // free_definite_size_function nullptr, // next }; @@ -539,6 +542,10 @@ #if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) TEST(ThreadHeapUsageShimTest, HooksIntoMallocWhenShimAvailable) { +#if defined(OS_MACOSX) + allocator::InitializeAllocatorShim(); +#endif + ASSERT_FALSE(ThreadHeapUsageTracker::IsHeapTrackingEnabled()); ThreadHeapUsageTracker::EnableHeapTracking();
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index 814b9c4..50c8921 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc
@@ -30,159 +30,6 @@ const int32_t kExtendedASCIIStart = 0x80; -// DictionaryHiddenRootValue and ListHiddenRootValue are used in conjunction -// with JSONStringValue as an optimization for reducing the number of string -// copies. When this optimization is active, the parser uses a hidden root to -// keep the original JSON input string live and creates JSONStringValue children -// holding StringPiece references to the input string, avoiding about 2/3rds of -// string memory copies. The real root value is Swap()ed into the new instance. -class DictionaryHiddenRootValue : public DictionaryValue { - public: - DictionaryHiddenRootValue(std::unique_ptr<std::string> json, - std::unique_ptr<Value> root) - : json_(std::move(json)) { - DCHECK(root->IsType(Value::Type::DICTIONARY)); - DictionaryValue::Swap(static_cast<DictionaryValue*>(root.get())); - } - - void Swap(DictionaryValue* other) override { - DVLOG(1) << "Swap()ing a DictionaryValue inefficiently."; - - // First deep copy to convert JSONStringValue to std::string and swap that - // copy with |other|, which contains the new contents of |this|. - std::unique_ptr<DictionaryValue> copy(CreateDeepCopy()); - copy->Swap(other); - - // Then erase the contents of the current dictionary and swap in the - // new contents, originally from |other|. - Clear(); - json_.reset(); - DictionaryValue::Swap(copy.get()); - } - - // Not overriding DictionaryValue::Remove because it just calls through to - // the method below. - - bool RemoveWithoutPathExpansion(StringPiece key, - std::unique_ptr<Value>* out) override { - // If the caller won't take ownership of the removed value, just call up. - if (!out) - return DictionaryValue::RemoveWithoutPathExpansion(key, out); - - DVLOG(1) << "Remove()ing from a DictionaryValue inefficiently."; - - // Otherwise, remove the value while its still "owned" by this and copy it - // to convert any JSONStringValues to std::string. - std::unique_ptr<Value> out_owned; - if (!DictionaryValue::RemoveWithoutPathExpansion(key, &out_owned)) - return false; - - *out = out_owned->CreateDeepCopy(); - - return true; - } - - private: - std::unique_ptr<std::string> json_; - - DISALLOW_COPY_AND_ASSIGN(DictionaryHiddenRootValue); -}; - -class ListHiddenRootValue : public ListValue { - public: - ListHiddenRootValue(std::unique_ptr<std::string> json, - std::unique_ptr<Value> root) - : json_(std::move(json)) { - DCHECK(root->IsType(Value::Type::LIST)); - ListValue::Swap(static_cast<ListValue*>(root.get())); - } - - void Swap(ListValue* other) override { - DVLOG(1) << "Swap()ing a ListValue inefficiently."; - - // First deep copy to convert JSONStringValue to std::string and swap that - // copy with |other|, which contains the new contents of |this|. - std::unique_ptr<ListValue> copy(CreateDeepCopy()); - copy->Swap(other); - - // Then erase the contents of the current list and swap in the new contents, - // originally from |other|. - Clear(); - json_.reset(); - ListValue::Swap(copy.get()); - } - - bool Remove(size_t index, std::unique_ptr<Value>* out) override { - // If the caller won't take ownership of the removed value, just call up. - if (!out) - return ListValue::Remove(index, out); - - DVLOG(1) << "Remove()ing from a ListValue inefficiently."; - - // Otherwise, remove the value while its still "owned" by this and copy it - // to convert any JSONStringValues to std::string. - std::unique_ptr<Value> out_owned; - if (!ListValue::Remove(index, &out_owned)) - return false; - - *out = out_owned->CreateDeepCopy(); - - return true; - } - - private: - std::unique_ptr<std::string> json_; - - DISALLOW_COPY_AND_ASSIGN(ListHiddenRootValue); -}; - -// A variant on StringValue that uses StringPiece instead of copying the string -// into the Value. This can only be stored in a child of hidden root (above), -// otherwise the referenced string will not be guaranteed to outlive it. -class JSONStringValue : public Value { - public: - explicit JSONStringValue(StringPiece piece) - : Value(Type::STRING), string_piece_(piece) {} - - ~JSONStringValue() override { - // Ugly hack that prevents ~Value() from trying to destroy string_value_. - // TODO(crbug.com/646113): Clean this up when StringValue will be removed. - type_ = Type::NONE; - } - - // Overridden from Value: - bool GetAsString(std::string* out_value) const override { - string_piece_.CopyToString(out_value); - return true; - } - bool GetAsString(string16* out_value) const override { - *out_value = UTF8ToUTF16(string_piece_); - return true; - } - // base::Value::GetAsString contains a proper implementation now, so the old - // behavior is copied here. - // TODO(crbug.com/646113): Clean this up when StringValue will be removed. - bool GetAsString(const StringValue** out_value) const override { - return false; - } - bool GetAsString(StringPiece* out_value) const override { - *out_value = string_piece_; - return true; - } - Value* DeepCopy() const override { return new StringValue(string_piece_); } - bool Equals(const Value* other) const override { - std::string other_string; - return other->IsType(Type::STRING) && other->GetAsString(&other_string) && - StringPiece(other_string) == string_piece_; - } - - private: - // The location in the original input stream. - StringPiece string_piece_; - - DISALLOW_COPY_AND_ASSIGN(JSONStringValue); -}; - // Simple class that checks for maximum recursion/"stack overflow." class StackMarker { public: @@ -227,16 +74,7 @@ } std::unique_ptr<Value> JSONParser::Parse(StringPiece input) { - std::unique_ptr<std::string> input_copy; - // If the children of a JSON root can be detached, then hidden roots cannot - // be used, so do not bother copying the input because StringPiece will not - // be used anywhere. - if (!(options_ & JSON_DETACHABLE_CHILDREN)) { - input_copy = MakeUnique<std::string>(input.as_string()); - start_pos_ = input_copy->data(); - } else { - start_pos_ = input.data(); - } + start_pos_ = input.data(); pos_ = start_pos_; end_pos_ = start_pos_ + input.length(); index_ = 0; @@ -270,26 +108,6 @@ } } - // Dictionaries and lists can contain JSONStringValues, so wrap them in a - // hidden root. - if (!(options_ & JSON_DETACHABLE_CHILDREN)) { - if (root->IsType(Value::Type::DICTIONARY)) { - return MakeUnique<DictionaryHiddenRootValue>(std::move(input_copy), - std::move(root)); - } - if (root->IsType(Value::Type::LIST)) { - return MakeUnique<ListHiddenRootValue>(std::move(input_copy), - std::move(root)); - } - if (root->IsType(Value::Type::STRING)) { - // A string type could be a JSONStringValue, but because there's no - // corresponding HiddenRootValue, the memory will be lost. Deep copy to - // preserve it. - return root->CreateDeepCopy(); - } - } - - // All other values can be returned directly. return root; } @@ -622,13 +440,6 @@ if (!ConsumeStringRaw(&string)) return nullptr; - // Create the Value representation, using a hidden root, if configured - // to do so, and if the string can be represented by StringPiece. - if (string.CanBeStringPiece() && !(options_ & JSON_DETACHABLE_CHILDREN)) - return base::MakeUnique<JSONStringValue>(string.AsStringPiece()); - - if (string.CanBeStringPiece()) - string.Convert(); return base::MakeUnique<StringValue>(string.AsString()); }
diff --git a/base/task_scheduler/task_scheduler.h b/base/task_scheduler/task_scheduler.h index 533b7dfd..296e40b 100644 --- a/base/task_scheduler/task_scheduler.h +++ b/base/task_scheduler/task_scheduler.h
@@ -93,7 +93,9 @@ virtual void FlushForTesting() = 0; // Joins all threads. Tasks that are already running are allowed to complete - // their execution. This can only be called once. + // their execution. This can only be called once. Using this task scheduler + // instance to create task runners or post tasks is not permitted during or + // after this call. virtual void JoinForTesting() = 0; // CreateAndSetSimpleTaskScheduler(), CreateAndSetDefaultTaskScheduler(), and
diff --git a/base/test/android/OWNERS b/base/test/android/OWNERS index 85ff7a79..f25aa90 100644 --- a/base/test/android/OWNERS +++ b/base/test/android/OWNERS
@@ -1,3 +1,5 @@ jbudorick@chromium.org nyquist@chromium.org yfriedman@chromium.org + +# COMPONENT: Test>Android
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc index 4683694d..220b93e 100644 --- a/base/trace_event/malloc_dump_provider.cc +++ b/base/trace_event/malloc_dump_provider.cc
@@ -82,14 +82,49 @@ return next->get_size_estimate_function(next, address); } +unsigned HookBatchMalloc(const AllocatorDispatch* self, + size_t size, + void** results, + unsigned num_requested) { + const AllocatorDispatch* const next = self->next; + unsigned count = + next->batch_malloc_function(next, size, results, num_requested); + for (unsigned i = 0; i < count; ++i) { + MallocDumpProvider::GetInstance()->InsertAllocation(results[i], size); + } + return count; +} + +void HookBatchFree(const AllocatorDispatch* self, + void** to_be_freed, + unsigned num_to_be_freed) { + const AllocatorDispatch* const next = self->next; + for (unsigned i = 0; i < num_to_be_freed; ++i) { + MallocDumpProvider::GetInstance()->RemoveAllocation(to_be_freed[i]); + } + next->batch_free_function(next, to_be_freed, num_to_be_freed); +} + +void HookFreeDefiniteSize(const AllocatorDispatch* self, + void* ptr, + size_t size) { + if (ptr) + MallocDumpProvider::GetInstance()->RemoveAllocation(ptr); + const AllocatorDispatch* const next = self->next; + next->free_definite_size_function(next, ptr, size); +} + AllocatorDispatch g_allocator_hooks = { - &HookAlloc, /* alloc_function */ - &HookZeroInitAlloc, /* alloc_zero_initialized_function */ - &HookllocAligned, /* alloc_aligned_function */ - &HookRealloc, /* realloc_function */ - &HookFree, /* free_function */ - &HookGetSizeEstimate, /* get_size_estimate_function */ - nullptr, /* next */ + &HookAlloc, /* alloc_function */ + &HookZeroInitAlloc, /* alloc_zero_initialized_function */ + &HookllocAligned, /* alloc_aligned_function */ + &HookRealloc, /* realloc_function */ + &HookFree, /* free_function */ + &HookGetSizeEstimate, /* get_size_estimate_function */ + &HookBatchMalloc, /* batch_malloc_function */ + &HookBatchFree, /* batch_free_function */ + &HookFreeDefiniteSize, /* free_definite_size_function */ + nullptr, /* next */ }; #endif // BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM)
diff --git a/base/values.cc b/base/values.cc index 145c0c1..96e3aa5 100644 --- a/base/values.cc +++ b/base/values.cc
@@ -353,11 +353,8 @@ return int_value_ == other->int_value_; case Type::DOUBLE: return double_value_ == other->double_value_; - // TODO(crbug.com/646113): Simplify this once JSONStringValue is removed. - case Type::STRING: { - std::string lhs, rhs; - return GetAsString(&lhs) && other->GetAsString(&rhs) && lhs == rhs; - } + case Type::STRING: + return *string_value_ == *(other->string_value_); default: // This method should only be getting called for the above types -- all // subclasses need to provide their own implementation;.
diff --git a/base/values.h b/base/values.h index e021f7be..5c74eb8 100644 --- a/base/values.h +++ b/base/values.h
@@ -152,10 +152,6 @@ // NULLs are considered equal but different from Value::CreateNullValue(). static bool Equals(const Value* a, const Value* b); - protected: - // TODO(crbug.com/646113): Make this private once JSONStringValue is removed. - Type type_; - private: void InternalCopyFundamentalValue(const Value& that); void InternalCopyConstructFrom(const Value& that); @@ -164,6 +160,8 @@ void InternalMoveAssignFrom(Value&& that); void InternalCleanup(); + Type type_; + union { bool bool_value_; int int_value_;
diff --git a/build/android/OWNERS b/build/android/OWNERS index 13e19f5..bdfefea 100644 --- a/build/android/OWNERS +++ b/build/android/OWNERS
@@ -3,3 +3,5 @@ pasko@chromium.org perezju@chromium.org rnephew@chromium.org + +# COMPONENT: Test>Android
diff --git a/build/android/gradle/android.jinja b/build/android/gradle/android.jinja index b4b9340..dbdeaa4b 100644 --- a/build/android/gradle/android.jinja +++ b/build/android/gradle/android.jinja
@@ -15,6 +15,11 @@ "{{ path }}", {% endfor %} ] + res.srcDirs = [ +{% for path in variables.res_dirs %} + "{{ path }}", +{% endfor %} + ] } {% endif %} {% endmacro %}
diff --git a/build/android/gradle/generate_gradle.py b/build/android/gradle/generate_gradle.py index fbe0966..dc3889b 100755 --- a/build/android/gradle/generate_gradle.py +++ b/build/android/gradle/generate_gradle.py
@@ -34,6 +34,7 @@ _SRCJARS_SUBDIR = 'extracted-srcjars' _JNI_LIBS_SUBDIR = 'symlinked-libs' _ARMEABI_SUBDIR = 'armeabi' +_RES_SUBDIR = 'extracted-res' _DEFAULT_TARGETS = [ # TODO(agrieve): Requires alternate android.jar to compile. @@ -212,6 +213,17 @@ os.path.join(self.EntryOutputDir(entry), _SRCJARS_SUBDIR)) return java_dirs + def _GenResDirs(self, entry): + res_dirs = list(entry.DepsInfo().get('owned_resources_dirs', [])) + zips = entry.DepsInfo().get('owned_resources_zips') + if zips: + # These are generated resources that should not be modified. + res_dir = os.path.join(self.EntryOutputDir(entry), _RES_SUBDIR) + for zip_path in _RebasePath(zips): + _ExtractFile(zip_path, res_dir) + res_dirs.append(res_dir) + return res_dirs + def _Relativize(self, entry, paths): return _RebasePath(paths, self.EntryOutputDir(entry)) @@ -240,6 +252,7 @@ entry, android_test_manifest) variables['java_dirs'] = self._Relativize(entry, self._GenJavaDirs(entry)) variables['jni_libs'] = self._Relativize(entry, self._GenJniLibs(entry)) + variables['res_dirs'] = self._Relativize(entry, self._GenResDirs(entry)) deps = [_ProjectEntry.FromBuildConfigPath(p) for p in entry.Gradle()['dependent_android_projects']] variables['android_project_deps'] = [d.ProjectName() for d in deps] @@ -429,6 +442,12 @@ return '\n'.join(lines) +def _ExtractFile(zip_path, extracted_path): + logging.info('Extracting %s to %s', zip_path, extracted_path) + with zipfile.ZipFile(zip_path) as z: + z.extractall(extracted_path) + + def _ExtractSrcjars(entry_output_dir, srcjar_tuples): """Extracts all srcjars to the directory given by the tuples.""" extracted_paths = set(s[1] for s in srcjar_tuples) @@ -437,9 +456,7 @@ shutil.rmtree(extracted_path, True) for srcjar_path, extracted_path in srcjar_tuples: - logging.info('Extracting %s to %s', srcjar_path, extracted_path) - with zipfile.ZipFile(srcjar_path) as z: - z.extractall(extracted_path) + _ExtractFile(srcjar_path, extracted_path) def _FindAllProjectEntries(main_entries):
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py index d636f31d..251df4e 100755 --- a/build/android/gyp/write_build_config.py +++ b/build/android/gyp/write_build_config.py
@@ -50,25 +50,23 @@ assert len(manifests) == 1 self.manifest = manifests[0] - def GetInstrumentation(self): + def GetInstrumentationElements(self): instrumentation_els = self.manifest.getElementsByTagName('instrumentation') if len(instrumentation_els) == 0: return None - if len(instrumentation_els) != 1: - raise Exception( - 'More than one <instrumentation> element found in %s' % self.path) - return instrumentation_els[0] + return instrumentation_els - def CheckInstrumentation(self, expected_package): - instr = self.GetInstrumentation() - if not instr: + def CheckInstrumentationElements(self, expected_package): + instrs = self.GetInstrumentationElements() + if not instrs: raise Exception('No <instrumentation> elements found in %s' % self.path) - instrumented_package = instr.getAttributeNS( - 'http://schemas.android.com/apk/res/android', 'targetPackage') - if instrumented_package != expected_package: - raise Exception( - 'Wrong instrumented package. Expected %s, got %s' - % (expected_package, instrumented_package)) + for instr in instrs: + instrumented_package = instr.getAttributeNS( + 'http://schemas.android.com/apk/res/android', 'targetPackage') + if instrumented_package != expected_package: + raise Exception( + 'Wrong instrumented package. Expected %s, got %s' + % (expected_package, instrumented_package)) def GetPackageName(self): return self.manifest.getAttribute('package') @@ -578,7 +576,7 @@ tested_apk_config = GetDepConfig(options.tested_apk_config) expected_tested_package = tested_apk_config['package_name'] - AndroidManifest(options.android_manifest).CheckInstrumentation( + AndroidManifest(options.android_manifest).CheckInstrumentationElements( expected_tested_package) if options.proguard_enabled: # Add all tested classes to the test's classpath to ensure that the test's @@ -653,9 +651,9 @@ dependency_jars = [c['jar_path'] for c in all_library_deps] manifest = AndroidManifest(options.android_manifest) deps_info['package_name'] = manifest.GetPackageName() - if not options.tested_apk_config and manifest.GetInstrumentation(): + if not options.tested_apk_config and manifest.GetInstrumentationElements(): # This must then have instrumentation only for itself. - manifest.CheckInstrumentation(manifest.GetPackageName()) + manifest.CheckInstrumentationElements(manifest.GetPackageName()) library_paths = [] java_libraries_list = None
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml index 804aaa4..0066fe24 100644 --- a/build/android/lint/suppressions.xml +++ b/build/android/lint/suppressions.xml
@@ -164,6 +164,8 @@ <issue id="LongLogTag" severity="ignore"/> <issue id="MissingApplicationIcon" severity="ignore"/> <issue id="MissingPermission" severity="ignore"/> + <!-- TODO(yolandyan) remove this once all tests are converted to junit4 --> + <issue id="MissingPrefix" severity="ignore"/> <!-- TODO(estevenson) remove this once translations are added for IDS_ACCESSIBILITY_TOOLBAR_BTN_TABSWITCHER_TOGGLE (http://crbug.com/635677)
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py index ce28c44..2800b6f6 100644 --- a/build/android/pylib/instrumentation/instrumentation_test_instance.py +++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -51,7 +51,7 @@ _NATIVE_CRASH_RE = re.compile('(process|native) crash', re.IGNORECASE) _CMDLINE_NAME_SEGMENT_RE = re.compile( r' with(?:out)? \{[^\}]*\}') -_PICKLE_FORMAT_VERSION = 10 +_PICKLE_FORMAT_VERSION = 11 class MissingSizeAnnotationError(test_exception.TestException): @@ -355,6 +355,7 @@ 'class': c['class'], 'annotations': recursive_class_annotations(c), 'methods': [m for m in c['methods'] if is_test_method(m)], + 'superclass': c['superclass'], } return [stripped_test_class(c) for c in p['classes'] @@ -362,7 +363,7 @@ def _GetTestsFromDexdump(test_apk): - d = dexdump.Dump(test_apk) + dump = dexdump.Dump(test_apk) tests = [] def get_test_methods(methods): @@ -374,13 +375,14 @@ 'annotations': {'MediumTest': None}, } for m in methods if m.startswith('test')] - for package_name, package_info in d.iteritems(): + for package_name, package_info in dump.iteritems(): for class_name, class_info in package_info['classes'].iteritems(): if class_name.endswith('Test'): tests.append({ 'class': '%s.%s' % (package_name, class_name), 'annotations': {}, 'methods': get_test_methods(class_info['methods']), + 'superclass': class_info['superclass'], }) return tests @@ -396,6 +398,14 @@ pickle.dump(pickle_data, pickle_file) +class MissingJUnit4RunnerException(test_exception.TestException): + """Raised when JUnit4 runner is not provided or specified in apk manifest""" + + def __init__(self): + super(MissingJUnit4RunnerException, self).__init__( + 'JUnit4 runner is not provided or specified in test apk manifest.') + + class UnmatchedFilterException(test_exception.TestException): """Raised when a user specifies a filter that doesn't match any tests.""" @@ -456,6 +466,7 @@ self._test_jar = None self._test_package = None self._test_runner = None + self._test_runner_junit4 = None self._test_support_apk = None self._initializeApkAttributes(args, error_func) @@ -549,7 +560,24 @@ error_func('Unable to find test JAR: %s' % self._test_jar) self._test_package = self._test_apk.GetPackageName() - self._test_runner = self._test_apk.GetInstrumentationName() + all_instrumentations = self._test_apk.GetAllInstrumentations() + junit3_runners = [ + x for x in all_instrumentations if ('true' not in x.get( + 'chromium-junit4', ''))] + junit4_runners = [ + x for x in all_instrumentations if ('true' in x.get( + 'chromium-junit4', ''))] + + if len(junit3_runners) > 1: + logging.warning('This test apk has more than one JUnit3 instrumentation') + if len(junit4_runners) > 1: + logging.warning('This test apk has more than one JUnit4 instrumentation') + + self._test_runner = ( + junit3_runners[0]['android:name'] if junit3_runners else + self.test_apk.GetInstrumentationName()) + self._test_runner_junit4 = ( + junit4_runners[0]['android:name'] if junit4_runners else None) self._package_info = None if self._apk_under_test: @@ -724,6 +752,10 @@ return self._test_runner @property + def test_runner_junit4(self): + return self._test_runner_junit4 + + @property def timeout_scale(self): return self._timeout_scale @@ -745,6 +777,9 @@ else: tests = GetAllTestsFromApk(self.test_apk.path) inflated_tests = self._ParametrizeTestsWithFlags(self._InflateTests(tests)) + if self._test_runner_junit4 is None and any( + t['is_junit4'] for t in inflated_tests): + raise MissingJUnit4RunnerException() filtered_tests = FilterTests( inflated_tests, self._test_filter, self._annotations, self._excluded_annotations) @@ -765,6 +800,7 @@ 'class': c['class'], 'method': m['method'], 'annotations': a, + 'is_junit4': c['superclass'] == 'java.lang.Object' }) return inflated_tests
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py index 10fe95c..386f289 100755 --- a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py +++ b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
@@ -44,6 +44,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -58,6 +59,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -75,6 +77,7 @@ }, 'class': 'org.chromium.test.SampleTest', 'method': 'testMethod1', + 'is_junit4': True, }, { 'annotations': { @@ -83,6 +86,7 @@ }, 'class': 'org.chromium.test.SampleTest', 'method': 'testMethod2', + 'is_junit4': True, }, { 'annotations': { @@ -91,10 +95,12 @@ }, 'class': 'org.chromium.test.SampleTest2', 'method': 'testMethod1', + 'is_junit4': True, }, ] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -107,6 +113,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -127,12 +134,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': True, 'method': 'testMethod1', }, ] o._test_filter = 'org.chromium.test.SampleTest.testMethod1' o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -145,6 +154,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -159,6 +169,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -175,12 +186,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest2', + 'is_junit4': True, 'method': 'testMethod1', }, ] o._test_filter = 'org.chromium.test.SampleTest2.*' o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -193,6 +206,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -207,6 +221,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -223,6 +238,7 @@ 'MediumTest': None, }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': True, 'method': 'testMethod2', }, { @@ -231,12 +247,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest2', + 'is_junit4': True, 'method': 'testMethod1', }, ] o._test_filter = '*-org.chromium.test.SampleTest.testMethod1' o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -249,6 +267,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -263,6 +282,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -279,6 +299,7 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': True, 'method': 'testMethod1', }, { @@ -287,12 +308,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest2', + 'is_junit4': True, 'method': 'testMethod1', }, ] o._annotations = [('SmallTest', None)] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -305,6 +328,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -319,6 +343,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -335,12 +360,14 @@ 'MediumTest': None, }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': False, 'method': 'testMethod2', }, ] o._excluded_annotations = [('SmallTest', None)] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -353,6 +380,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': { @@ -373,6 +401,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': { @@ -393,12 +422,14 @@ 'TestValue': '1', }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': False, 'method': 'testMethod1', }, ] o._annotations = [('TestValue', '1')] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -411,6 +442,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -425,6 +457,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'java.lang.Object', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -441,12 +474,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest2', + 'is_junit4': True, 'method': 'testMethod1', }, ] o._annotations = [('Feature', 'Bar')] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests() @@ -459,6 +494,7 @@ { 'annotations': {'Feature': {'value': ['Foo']}}, 'class': 'org.chromium.test.SampleTest', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -476,6 +512,7 @@ { 'annotations': {'Feature': {'value': ['Bar']}}, 'class': 'org.chromium.test.SampleTest2', + 'superclass': 'junit.framework.TestCase', 'methods': [ { 'annotations': {'SmallTest': None}, @@ -492,6 +529,7 @@ 'MediumTest': None, }, 'class': 'org.chromium.test.SampleTest', + 'is_junit4': False, 'method': 'testMethod2', }, { @@ -500,12 +538,14 @@ 'SmallTest': None, }, 'class': 'org.chromium.test.SampleTest2', + 'is_junit4': False, 'method': 'testMethod1', }, ] o._annotations = [('Feature', 'Bar'), ('Feature', 'Baz')] o._test_jar = 'path/to/test.jar' + o._test_runner_junit4 = 'J4Runner' with mock.patch(_INSTRUMENTATION_TEST_INSTANCE_PATH % '_GetTestsFromPickle', return_value=raw_tests): actual_tests = o.GetTests()
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py index 645b128..2201657 100644 --- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py +++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -204,6 +204,8 @@ if not self._test_instance.driver_apk: raise Exception('driver_apk does not exist. ' 'Please build it and try again.') + if any(t.get('is_junit4') for t in test): + raise Exception('driver apk does not support JUnit4 tests') def name_and_timeout(t): n = instrumentation_test_instance.GetTestName(t) @@ -224,8 +226,13 @@ else: test_name = instrumentation_test_instance.GetTestName(test) test_display_name = self._GetUniqueTestName(test) - target = '%s/%s' % ( - self._test_instance.test_package, self._test_instance.test_runner) + if test['is_junit4']: + target = '%s/%s' % ( + self._test_instance.test_package, + self._test_instance.test_runner_junit4) + else: + target = '%s/%s' % ( + self._test_instance.test_package, self._test_instance.test_runner) extras['class'] = test_name if 'flags' in test: flags = test['flags']
diff --git a/build/android/pylib/utils/dexdump.py b/build/android/pylib/utils/dexdump.py index 972a22d49..2bb11ce 100644 --- a/build/android/pylib/utils/dexdump.py +++ b/build/android/pylib/utils/dexdump.py
@@ -67,7 +67,12 @@ results = {} for child in root: if child.tag == 'package': - results[child.attrib['name']] = _ParsePackageNode(child) + package_name = child.attrib['name'] + parsed_node = _ParsePackageNode(child) + if package_name in results: + results[package_name]['classes'].update(parsed_node['classes']) + else: + results[package_name] = parsed_node return results @@ -107,4 +112,4 @@ for child in class_node: if child.tag == 'method': methods.append(child.attrib['name']) - return {'methods': methods} + return {'methods': methods, 'superclass': class_node.attrib['extends']}
diff --git a/build/android/pylib/utils/dexdump_test.py b/build/android/pylib/utils/dexdump_test.py index b8b7964..6b2c4542 100755 --- a/build/android/pylib/utils/dexdump_test.py +++ b/build/android/pylib/utils/dexdump_test.py
@@ -78,9 +78,11 @@ 'classes': { 'Class1': { 'methods': ['class1Method1', 'class1Method2'], + 'superclass': 'java.lang.Object', }, 'Class2': { 'methods': ['class2Method1'], + 'superclass': 'java.lang.Object', } }, }, @@ -92,9 +94,9 @@ def testParsePackageNode(self): example_xml_string = ( '<package name="com.foo.bar">' - '<class name="Class1">' + '<class name="Class1" extends="java.lang.Object">' '</class>' - '<class name="Class2">' + '<class name="Class2" extends="java.lang.Object">' '</class>' '</package>') @@ -106,9 +108,11 @@ 'classes': { 'Class1': { 'methods': [], + 'superclass': 'java.lang.Object', }, 'Class2': { 'methods': [], + 'superclass': 'java.lang.Object', }, }, } @@ -116,7 +120,7 @@ def testParseClassNode(self): example_xml_string = ( - '<class name="Class1">' + '<class name="Class1" extends="java.lang.Object">' '<method name="method1">' '</method>' '<method name="method2">' @@ -128,6 +132,7 @@ expected = { 'methods': ['method1', 'method2'], + 'superclass': 'java.lang.Object', } self.assertEquals(expected, actual)
diff --git a/build/android/resource_sizes.py b/build/android/resource_sizes.py index 242ed83..9877cdf 100755 --- a/build/android/resource_sizes.py +++ b/build/android/resource_sizes.py
@@ -23,11 +23,14 @@ import zlib import devil_chromium +from devil.android.sdk import build_tools from devil.utils import cmd_helper +from devil.utils import lazy import method_count from pylib import constants from pylib.constants import host_paths +_AAPT_PATH = lazy.WeakConstant(lambda: build_tools.GetPath('aapt')) _GRIT_PATH = os.path.join(host_paths.DIR_SOURCE_ROOT, 'tools', 'grit') # Prepend the grit module from the source tree so it takes precedence over other @@ -79,10 +82,11 @@ zipfile.ZipInfo._decodeExtra = ( # pylint: disable=protected-access _PatchedDecodeExtra) -# Static initializers expected in official builds. Note that this list is built -# using 'nm' on libchrome.so which results from a GCC official build (i.e. -# Clang is not supported currently). - +# Captures an entire config from aapt output. +_AAPT_CONFIG_PATTERN = r'config %s:(.*?)config [a-zA-Z-]+:' +# Matches string resource entries from aapt output. +_AAPT_ENTRY_RE = re.compile( + r'resource (?P<id>\w{10}) [\w\.]+:string/.*?"(?P<val>.+?)"', re.DOTALL) _BASE_CHART = { 'format_version': '0.1', 'benchmark_name': 'resource_sizes', @@ -98,6 +102,9 @@ def CountStaticInitializers(so_path): + # Static initializers expected in official builds. Note that this list is + # built using 'nm' on libchrome.so which results from a GCC official build + # (i.e. Clang is not supported currently). def get_elf_section_size(readelf_stdout, section_name): # Matches: .ctors PROGBITS 000000000516add0 5169dd0 000010 00 WA 0 0 8 match = re.search(r'\.%s.*$' % re.escape(section_name), @@ -135,6 +142,51 @@ return output.splitlines() +def _NormalizeResourcesArsc(apk_path, num_supported_configs): + """Estimates the expected overhead of untranslated strings in resources.arsc. + + See http://crbug.com/677966 for why this is necessary. + """ + aapt_output = _RunAaptDumpResources(apk_path) + + # en-rUS is in the default config and may be cluttered with non-translatable + # strings, so en-rGB is a better baseline for finding missing translations. + en_strings = _CreateResourceIdValueMap(aapt_output, 'en-rGB') + fr_strings = _CreateResourceIdValueMap(aapt_output, 'fr') + + # en-US and en-GB configs will never be translated. + config_count = num_supported_configs - 2 + + size = 0 + for res_id, string_val in en_strings.iteritems(): + if string_val == fr_strings[res_id]: + string_size = len(string_val) + # 7 bytes is the per-entry overhead (not specific to any string). See + # https://android.googlesource.com/platform/frameworks/base.git/+/android-4.2.2_r1/tools/aapt/StringPool.cpp#414. + # The 1.5 factor was determined experimentally and is meant to account for + # other languages generally having longer strings than english. + size += config_count * (7 + string_size * 1.5) + + return size + + +def _CreateResourceIdValueMap(aapt_output, lang): + """Return a map of resource ids to string values for the given |lang|.""" + config_re = _AAPT_CONFIG_PATTERN % lang + return {entry.group('id'): entry.group('val') + for config_section in re.finditer(config_re, aapt_output, re.DOTALL) + for entry in re.finditer(_AAPT_ENTRY_RE, config_section.group(0))} + + +def _RunAaptDumpResources(apk_path): + cmd = [_AAPT_PATH.read(), 'dump', '--values', 'resources', apk_path] + status, output = cmd_helper.GetCmdStatusAndOutput(cmd) + if status != 0: + raise Exception('Failed running aapt command: "%s" with output "%s".' % + (' '.join(cmd), output)) + return output + + def ReportPerfResult(chart_data, graph_title, trace_title, value, units, improvement_direction='down', important=True): """Outputs test results in correct format. @@ -323,14 +375,15 @@ # Avoid noise caused when strings change and translations haven't yet been # updated. english_pak = translations.FindByPattern(r'.*/en[-_][Uu][Ss]\.l?pak') - if english_pak: - # TODO(agrieve): This should also analyze .arsc file to remove non-en - # configs. http://crbug.com/677966 + num_translations = translations.GetNumEntries() + if english_pak and num_translations > 1: normalized_apk_size -= translations.ComputeZippedSize() # 1.17 found by looking at Chrome.apk and seeing how much smaller en-US.pak # is relative to the average locale .pak. normalized_apk_size += int( - english_pak.compress_size * translations.GetNumEntries() * 1.17) + english_pak.compress_size * num_translations * 1.17) + normalized_apk_size += int( + _NormalizeResourcesArsc(apk_filename, num_translations)) ReportPerfResult(chartjson, apk_basename + '_Specifics', 'normalized apk size', normalized_apk_size, 'bytes')
diff --git a/build/config/allocator.gni b/build/config/allocator.gni index f723e4d..68f4e6b 100644 --- a/build/config/allocator.gni +++ b/build/config/allocator.gni
@@ -17,7 +17,7 @@ # the shim. NaCl in particular does seem to link some binaries statically # against the debug CRT with "is_nacl=false". if ((is_linux || is_android || (is_win && !is_component_build && !is_debug)) && - !is_asan && !is_lsan && !is_tsan && !is_msan) { + !is_asan && !is_lsan && !is_tsan && !is_msan) { _default_use_experimental_allocator_shim = true } else { _default_use_experimental_allocator_shim = false @@ -42,10 +42,12 @@ assert(use_allocator == "none" || use_allocator == "tcmalloc") assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.") +assert(!is_mac || use_allocator == "none", "Tcmalloc doesn't work on macOS.") -assert( - !use_experimental_allocator_shim || is_linux || is_android || is_win, - "use_experimental_allocator_shim supported only on Linux, Android and Windows targets") +assert(!use_experimental_allocator_shim || is_linux || is_android || is_win || + is_mac, + "use_experimental_allocator_shim supported only on Linux, Android, " + + "Windows and macOS targets") if (is_win && use_experimental_allocator_shim) { assert(!is_component_build,
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 4487e63a..16c8a7a 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -219,6 +219,26 @@ } } + # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for + # deterministic build. See https://crbug.com/314403 + if (!is_official_build) { + if (is_win && !is_clang) { + cflags += [ + "/wd4117", # Trying to define or undefine a predefined macro. + "/D__DATE__=", + "/D__TIME__=", + "/D__TIMESTAMP__=", + ] + } else { + cflags += [ + "-Wno-builtin-macro-redefined", + "-D__DATE__=", + "-D__TIME__=", + "-D__TIMESTAMP__=", + ] + } + } + if (is_clang && is_debug) { # Allow comparing the address of references and 'this' against 0 # in debug builds. Technically, these can never be null in
diff --git a/build/config/sanitizers/OWNERS b/build/config/sanitizers/OWNERS new file mode 100644 index 0000000..4116061 --- /dev/null +++ b/build/config/sanitizers/OWNERS
@@ -0,0 +1 @@ +ochang@chromium.org
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index a0e9940..e1528de 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni
@@ -139,7 +139,7 @@ asan_globals = !is_mac } -if (use_afl && sanitizer_coverage_flags == "") { +if ((use_afl || use_libfuzzer) && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "trace-pc-guard" } else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "edge,indirect-calls,8bit-counters" @@ -184,3 +184,8 @@ assert(!is_msan || (is_linux && current_cpu == "x64"), "MSan currently only works on 64-bit Linux and ChromeOS builds.") + +# ASAN build on Windows is not working in debug mode. Intercepting memory +# allocation functions is hard on Windows and not yet implemented in LLVM. +assert(!is_win || !is_debug || !is_asan, + "ASan on Windows doesn't work in debug (set is_debug=false).")
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index e611f47..d4c84029 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -263,6 +263,7 @@ "playback/float_clip_display_item.h", "playback/image_hijack_canvas.cc", "playback/image_hijack_canvas.h", + "playback/image_id.h", "playback/largest_display_item.cc", "playback/largest_display_item.h", "playback/raster_source.cc",
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc index 9365c4f1..5e30ac1 100644 --- a/cc/animation/element_animations.cc +++ b/cc/animation/element_animations.cc
@@ -241,6 +241,8 @@ *bounds = gfx::BoxF(); for (auto& player : players_list_) { + if (!player.HasTransformAnimationThatInflatesBounds()) + continue; gfx::BoxF player_bounds; bool success = player.TransformAnimationBoundsForBox(box, &player_bounds); if (!success)
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc index 0871dc7..60a99c21 100644 --- a/cc/animation/element_animations_unittest.cc +++ b/cc/animation/element_animations_unittest.cc
@@ -1789,6 +1789,43 @@ EXPECT_FALSE(player_impl_->TransformAnimationBoundsForBox(box, &bounds)); } +TEST_F(ElementAnimationsTest, TransformAnimationBoundsTwoPlayers) { + AttachTimelinePlayerLayer(); + CreateImplTimelineAndPlayer(); + + scoped_refptr<AnimationPlayer> player2 = + AnimationPlayer::Create(AnimationIdProvider::NextPlayerId()); + timeline_->AttachPlayer(player2); + player2->AttachElement(element_id_); + + std::unique_ptr<KeyframedTransformAnimationCurve> curve( + KeyframedTransformAnimationCurve::Create()); + + TransformOperations operations; + curve->AddKeyframe( + TransformKeyframe::Create(base::TimeDelta(), operations, nullptr)); + operations.AppendScale(2.0, 3.0, 4.0); + curve->AddKeyframe(TransformKeyframe::Create( + base::TimeDelta::FromSecondsD(1.0), operations, nullptr)); + + std::unique_ptr<Animation> animation( + Animation::Create(std::move(curve), 1, 1, TargetProperty::TRANSFORM)); + player2->AddAnimation(std::move(animation)); + + gfx::BoxF box(1.f, 2.f, -1.f, 3.f, 4.f, 5.f); + gfx::BoxF bounds; + + EXPECT_FALSE(player_impl_->HasTransformAnimationThatInflatesBounds()); + EXPECT_TRUE(player2->TransformAnimationBoundsForBox(box, &bounds)); + EXPECT_EQ(gfx::BoxF(1.f, 2.f, -4.f, 7.f, 16.f, 20.f).ToString(), + bounds.ToString()); + + EXPECT_TRUE( + element_animations_->TransformAnimationBoundsForBox(box, &bounds)); + EXPECT_EQ(gfx::BoxF(1.f, 2.f, -4.f, 7.f, 16.f, 20.f).ToString(), + bounds.ToString()); +} + // Tests that AbortAnimations aborts all animations targeting the specified // property. TEST_F(ElementAnimationsTest, AbortAnimations) {
diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc index 751d32f..02decbd 100644 --- a/cc/layers/video_frame_provider_client_impl.cc +++ b/cc/layers/video_frame_provider_client_impl.cc
@@ -127,6 +127,8 @@ DCHECK(!stopped_); client_->RemoveVideoFrameController(this); rendering_ = false; + if (active_video_layer_) + active_video_layer_->SetNeedsRedraw(); } void VideoFrameProviderClientImpl::DidReceiveFrame() {
diff --git a/cc/layers/video_frame_provider_client_impl_unittest.cc b/cc/layers/video_frame_provider_client_impl_unittest.cc index eaa0e6f..9d376ae 100644 --- a/cc/layers/video_frame_provider_client_impl_unittest.cc +++ b/cc/layers/video_frame_provider_client_impl_unittest.cc
@@ -102,6 +102,14 @@ StopRendering(); } +TEST_F(VideoFrameProviderClientImplTest, StopRenderingUpdateDamage) { + CreateActiveVideoLayer(); + StartRendering(); + EXPECT_EQ(gfx::Rect(), video_layer_impl_->update_rect()); + StopRendering(); + EXPECT_NE(gfx::Rect(), video_layer_impl_->update_rect()); +} + TEST_F(VideoFrameProviderClientImplTest, StopUsingProvider) { ASSERT_TRUE(client_impl_->get_provider_for_testing()); StartRendering(); @@ -110,6 +118,17 @@ ASSERT_FALSE(client_impl_->get_provider_for_testing()); } +TEST_F(VideoFrameProviderClientImplTest, StopUsingProviderUpdateDamage) { + CreateActiveVideoLayer(); + ASSERT_TRUE(client_impl_->get_provider_for_testing()); + StartRendering(); + EXPECT_CALL(*this, RemoveVideoFrameController(_)); + EXPECT_EQ(gfx::Rect(), video_layer_impl_->update_rect()); + client_impl_->StopUsingProvider(); + EXPECT_NE(gfx::Rect(), video_layer_impl_->update_rect()); + ASSERT_FALSE(client_impl_->get_provider_for_testing()); +} + TEST_F(VideoFrameProviderClientImplTest, FrameAcquisition) { CreateActiveVideoLayer(); StartRenderingAndRenderFrame();
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 59bb170..9ea1110 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc
@@ -1280,17 +1280,18 @@ } if (params->filter_image) { - GLuint filter_image_id = skia::GrBackendObjectToGrGLTextureInfo( - params->filter_image->getTextureHandle(true)) - ->fID; + GrSurfaceOrigin origin; + GLuint filter_image_id = + skia::GrBackendObjectToGrGLTextureInfo( + params->filter_image->getTextureHandle(true, &origin)) + ->fID; DCHECK(filter_image_id); DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); gl_->BindTexture(GL_TEXTURE_2D, filter_image_id); gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - params->source_needs_flip = params->filter_image->getTexture()->origin() == - kBottomLeft_GrSurfaceOrigin; + params->source_needs_flip = kBottomLeft_GrSurfaceOrigin == origin; } else { params->contents_resource_lock = base::MakeUnique<ResourceProvider::ScopedSamplerGL>(
diff --git a/cc/playback/discardable_image_map.cc b/cc/playback/discardable_image_map.cc index 29201d6f..7e1abd6 100644 --- a/cc/playback/discardable_image_map.cc +++ b/cc/playback/discardable_image_map.cc
@@ -62,9 +62,11 @@ DiscardableImagesMetadataCanvas( int width, int height, - std::vector<std::pair<DrawImage, gfx::Rect>>* image_set) + std::vector<std::pair<DrawImage, gfx::Rect>>* image_set, + std::unordered_map<ImageId, gfx::Rect>* image_id_to_rect) : SkNWayCanvas(width, height), image_set_(image_set), + image_id_to_rect_(image_id_to_rect), canvas_bounds_(SkRect::MakeIWH(width, height)), canvas_size_(width, height) {} @@ -198,9 +200,12 @@ SkIRect src_irect; src_rect.roundOut(&src_irect); + gfx::Rect image_rect = SafeClampPaintRectToSize(paint_rect, canvas_size_); + + (*image_id_to_rect_)[image->uniqueID()].Union(image_rect); image_set_->push_back(std::make_pair( DrawImage(std::move(image), src_irect, filter_quality, matrix), - SafeClampPaintRectToSize(paint_rect, canvas_size_))); + image_rect)); } // Currently this function only handles extracting images from SkImageShaders @@ -224,6 +229,7 @@ } std::vector<std::pair<DrawImage, gfx::Rect>>* image_set_; + std::unordered_map<ImageId, gfx::Rect>* image_id_to_rect_; const SkRect canvas_bounds_; const gfx::Size canvas_size_; std::vector<SkPaint> saved_paints_; @@ -239,7 +245,7 @@ const gfx::Size& bounds) { DCHECK(all_images_.empty()); return base::MakeUnique<DiscardableImagesMetadataCanvas>( - bounds.width(), bounds.height(), &all_images_); + bounds.width(), bounds.height(), &all_images_, &image_id_to_rect_); } void DiscardableImageMap::EndGeneratingMetadata() { @@ -259,6 +265,11 @@ images->push_back(all_images_[index].first.ApplyScale(contents_scale)); } +gfx::Rect DiscardableImageMap::GetRectForImage(ImageId image_id) const { + const auto& it = image_id_to_rect_.find(image_id); + return it == image_id_to_rect_.end() ? gfx::Rect() : it->second; +} + DiscardableImageMap::ScopedMetadataGenerator::ScopedMetadataGenerator( DiscardableImageMap* image_map, const gfx::Size& bounds)
diff --git a/cc/playback/discardable_image_map.h b/cc/playback/discardable_image_map.h index b521fff..abbf08bc 100644 --- a/cc/playback/discardable_image_map.h +++ b/cc/playback/discardable_image_map.h
@@ -5,12 +5,14 @@ #ifndef CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ #define CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ +#include <unordered_map> #include <utility> #include <vector> #include "cc/base/cc_export.h" #include "cc/base/rtree.h" #include "cc/playback/draw_image.h" +#include "cc/playback/image_id.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "ui/gfx/geometry/rect.h" @@ -46,6 +48,7 @@ void GetDiscardableImagesInRect(const gfx::Rect& rect, float contents_scale, std::vector<DrawImage>* images) const; + gfx::Rect GetRectForImage(ImageId image_id) const; private: friend class ScopedMetadataGenerator; @@ -55,6 +58,8 @@ void EndGeneratingMetadata(); std::vector<std::pair<DrawImage, gfx::Rect>> all_images_; + std::unordered_map<ImageId, gfx::Rect> image_id_to_rect_; + RTree images_rtree_; };
diff --git a/cc/playback/discardable_image_map_unittest.cc b/cc/playback/discardable_image_map_unittest.cc index e56f158..926d8aea 100644 --- a/cc/playback/discardable_image_map_unittest.cc +++ b/cc/playback/discardable_image_map_unittest.cc
@@ -111,6 +111,8 @@ << y; EXPECT_EQ(gfx::Rect(x * 512 + 6, y * 512 + 6, 500, 500), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); } else { EXPECT_EQ(0u, images.size()) << x << " " << y; } @@ -121,16 +123,28 @@ std::vector<PositionScaleDrawImage> images = GetDiscardableImagesInRect(image_map, gfx::Rect(512, 512, 2048, 2048)); EXPECT_EQ(4u, images.size()); + EXPECT_TRUE(images[0].image == discardable_image[1][2]); EXPECT_EQ(gfx::Rect(2 * 512 + 6, 512 + 6, 500, 500), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); + EXPECT_TRUE(images[1].image == discardable_image[2][1]); EXPECT_EQ(gfx::Rect(512 + 6, 2 * 512 + 6, 500, 500), images[1].image_rect); + EXPECT_EQ(images[1].image_rect, + image_map.GetRectForImage(images[1].image->uniqueID())); + EXPECT_TRUE(images[2].image == discardable_image[2][3]); EXPECT_EQ(gfx::Rect(3 * 512 + 6, 2 * 512 + 6, 500, 500), images[2].image_rect); + EXPECT_EQ(images[2].image_rect, + image_map.GetRectForImage(images[2].image->uniqueID())); + EXPECT_TRUE(images[3].image == discardable_image[3][2]); EXPECT_EQ(gfx::Rect(2 * 512 + 6, 3 * 512 + 6, 500, 500), images[3].image_rect); + EXPECT_EQ(images[3].image_rect, + image_map.GetRectForImage(images[3].image->uniqueID())); } TEST_F(DiscardableImageMapTest, GetDiscardableImagesInRectNonZeroLayer) { @@ -184,6 +198,8 @@ << y; EXPECT_EQ(gfx::Rect(1024 + x * 512 + 6, y * 512 + 6, 500, 500), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); } else { EXPECT_EQ(0u, images.size()) << x << " " << y; } @@ -194,18 +210,30 @@ std::vector<PositionScaleDrawImage> images = GetDiscardableImagesInRect( image_map, gfx::Rect(1024 + 512, 512, 2048, 2048)); EXPECT_EQ(4u, images.size()); + EXPECT_TRUE(images[0].image == discardable_image[1][2]); EXPECT_EQ(gfx::Rect(1024 + 2 * 512 + 6, 512 + 6, 500, 500), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); + EXPECT_TRUE(images[1].image == discardable_image[2][1]); EXPECT_EQ(gfx::Rect(1024 + 512 + 6, 2 * 512 + 6, 500, 500), images[1].image_rect); + EXPECT_EQ(images[1].image_rect, + image_map.GetRectForImage(images[1].image->uniqueID())); + EXPECT_TRUE(images[2].image == discardable_image[2][3]); EXPECT_EQ(gfx::Rect(1024 + 3 * 512 + 6, 2 * 512 + 6, 500, 500), images[2].image_rect); + EXPECT_EQ(images[2].image_rect, + image_map.GetRectForImage(images[2].image->uniqueID())); + EXPECT_TRUE(images[3].image == discardable_image[3][2]); EXPECT_EQ(gfx::Rect(1024 + 2 * 512 + 6, 3 * 512 + 6, 500, 500), images[3].image_rect); + EXPECT_EQ(images[3].image_rect, + image_map.GetRectForImage(images[3].image->uniqueID())); } // Non intersecting rects @@ -229,6 +257,12 @@ image_map, gfx::Rect(3500, 1100, 1000, 1000)); EXPECT_EQ(0u, images.size()); } + + // Image not present in the list. + { + sk_sp<SkImage> image = CreateDiscardableImage(gfx::Size(500, 500)); + EXPECT_EQ(gfx::Rect(), image_map.GetRectForImage(image->uniqueID())); + } } TEST_F(DiscardableImageMapTest, GetDiscardableImagesInRectOnePixelQuery) { @@ -280,6 +314,8 @@ << y; EXPECT_EQ(gfx::Rect(x * 512 + 6, y * 512 + 6, 500, 500), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); } else { EXPECT_EQ(0u, images.size()) << x << " " << y; } @@ -313,6 +349,8 @@ EXPECT_EQ(1u, images.size()); EXPECT_TRUE(images[0].image == discardable_image); EXPECT_EQ(gfx::Rect(0, 0, 2048, 2048), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); } TEST_F(DiscardableImageMapTest, PaintDestroyedWhileImageIsDrawn) { @@ -368,6 +406,8 @@ EXPECT_EQ(1u, images.size()); EXPECT_TRUE(images[0].image == discardable_image); EXPECT_EQ(gfx::Rect(42, 42, 2006, 2006), images[0].image_rect); + EXPECT_EQ(images[0].image_rect, + image_map.GetRectForImage(images[0].image->uniqueID())); } TEST_F(DiscardableImageMapTest, GetDiscardableImagesInRectMaxImageMaxLayer) { @@ -423,6 +463,9 @@ EXPECT_EQ(gfx::Rect(0, 500, expected10k, dimension - 500), images[1].image_rect); EXPECT_EQ(gfx::Rect(0, 0, dimension, dimension), images[0].image_rect); + + EXPECT_EQ(gfx::Rect(0, 0, dimension, dimension), + image_map.GetRectForImage(discardable_image->uniqueID())); } TEST_F(DiscardableImageMapTest, GetDiscardableImagesRectInBounds) { @@ -465,6 +508,15 @@ images = GetDiscardableImagesInRect(image_map, gfx::Rect(0, 500, 1, 1)); EXPECT_EQ(1u, images.size()); EXPECT_EQ(gfx::Rect(0, 500, 1000, 100), images[0].image_rect); + + gfx::Rect discardable_image_rect; + discardable_image_rect.Union(gfx::Rect(0, 0, 90, 89)); + discardable_image_rect.Union(gfx::Rect(950, 951, 50, 49)); + EXPECT_EQ(discardable_image_rect, + image_map.GetRectForImage(discardable_image->uniqueID())); + + EXPECT_EQ(gfx::Rect(0, 500, 1000, 100), + image_map.GetRectForImage(long_discardable_image->uniqueID())); } TEST_F(DiscardableImageMapTest, GetDiscardableImagesInShader) {
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc index 69ed70df..722d6230 100644 --- a/cc/playback/display_item_list.cc +++ b/cc/playback/display_item_list.cc
@@ -262,4 +262,8 @@ image_map_.GetDiscardableImagesInRect(rect, contents_scale, images); } +gfx::Rect DisplayItemList::GetRectForImage(ImageId image_id) const { + return image_map_.GetRectForImage(image_id); +} + } // namespace cc
diff --git a/cc/playback/display_item_list.h b/cc/playback/display_item_list.h index fcfccd9f..d2b194c 100644 --- a/cc/playback/display_item_list.h +++ b/cc/playback/display_item_list.h
@@ -19,6 +19,7 @@ #include "cc/base/rtree.h" #include "cc/playback/discardable_image_map.h" #include "cc/playback/display_item.h" +#include "cc/playback/image_id.h" #include "third_party/skia/include/core/SkPicture.h" #include "ui/gfx/color_space.h" #include "ui/gfx/geometry/rect.h" @@ -149,6 +150,7 @@ void GetDiscardableImagesInRect(const gfx::Rect& rect, float contents_scale, std::vector<DrawImage>* images); + gfx::Rect GetRectForImage(ImageId image_id) const; void SetRetainVisualRectsForTesting(bool retain) { retain_visual_rects_ = retain;
diff --git a/cc/playback/image_id.h b/cc/playback/image_id.h new file mode 100644 index 0000000..c29810b --- /dev/null +++ b/cc/playback/image_id.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 CC_PLAYBACK_IMAGE_ID_H_ +#define CC_PLAYBACK_IMAGE_ID_H_ + +namespace cc { + +using ImageId = uint32_t; + +} // namespace cc + +#endif // CC_PLAYBACK_IMAGE_ID_H_
diff --git a/cc/playback/raster_source.cc b/cc/playback/raster_source.cc index e108be3..06b6788 100644 --- a/cc/playback/raster_source.cc +++ b/cc/playback/raster_source.cc
@@ -247,6 +247,10 @@ display_list_->GetDiscardableImagesInRect(layer_rect, contents_scale, images); } +gfx::Rect RasterSource::GetRectForImage(ImageId image_id) const { + return display_list_->GetRectForImage(image_id); +} + bool RasterSource::CoversRect(const gfx::Rect& layer_rect) const { if (size_.IsEmpty()) return false;
diff --git a/cc/playback/raster_source.h b/cc/playback/raster_source.h index 471f7ba..29ca3889 100644 --- a/cc/playback/raster_source.h +++ b/cc/playback/raster_source.h
@@ -13,6 +13,7 @@ #include "base/macros.h" #include "cc/base/cc_export.h" #include "cc/debug/rendering_stats_instrumentation.h" +#include "cc/playback/image_id.h" #include "cc/playback/recording_source.h" #include "skia/ext/analysis_canvas.h" #include "third_party/skia/include/core/SkPicture.h" @@ -107,6 +108,8 @@ // Valid rectangle in which everything is recorded and can be rastered from. virtual gfx::Rect RecordedViewport() const; + gfx::Rect GetRectForImage(ImageId image_id) const; + // Tracing functionality. virtual void DidBeginTracing(); virtual void AsValueInto(base::trace_event::TracedValue* array) const;
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 0ecc9f76..4fe0d58 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -1344,6 +1344,7 @@ "//chrome/browser/resources:options_resources", "//chrome/browser/resources:password_manager_internals_resources", "//chrome/browser/resources:policy_resources", + "//chrome/browser/resources:quota_internals_resources", "//chrome/browser/resources:settings_resources", "//chrome/browser/resources:task_scheduler_internals_resources", "//chrome/browser/resources:translate_internals_resources", @@ -1355,10 +1356,8 @@ } if (enable_extensions) { - public_deps += [ - "//chrome/browser/resources:quota_internals_resources", - "//chrome/browser/resources:sync_file_system_internals_resources", - ] + public_deps += + [ "//chrome/browser/resources:sync_file_system_internals_resources" ] } }
diff --git a/chrome/VERSION b/chrome/VERSION index b585f977..12ba67a2 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=58 MINOR=0 -BUILD=3000 +BUILD=3001 PATCH=0
diff --git a/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml b/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml new file mode 100644 index 0000000..97c1170 --- /dev/null +++ b/chrome/android/java/res/layout/clear_browsing_data_tab_content.xml
@@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<!-- Used by ClearBrowsingDataPreferencesTab to replace the default layout + of a PreferenceFragment and add a footer button. --> + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <ListView + android:id="@android:id/list" + android:layout_width="match_parent" + android:layout_weight="1" + android:layout_height="0dp"/> + + <View style="@style/Divider"/> + + <Button + android:id="@+id/clear_button" + style="?android:attr/buttonBarButtonStyle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:focusable="true" + android:text="@string/clear_data_delete" /> + +</LinearLayout>
diff --git a/chrome/android/java/res/layout/clear_browsing_data_tabs.xml b/chrome/android/java/res/layout/clear_browsing_data_tabs.xml index 81ad215..0168590 100644 --- a/chrome/android/java/res/layout/clear_browsing_data_tabs.xml +++ b/chrome/android/java/res/layout/clear_browsing_data_tabs.xml
@@ -3,6 +3,8 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> +<!-- Layout used by ClearBrowsingDataTabsFragment --> + <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" @@ -14,8 +16,11 @@ android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> + <!-- RTL is handled manually in ClearBrowsingDataTabsFragment because + it is not working correctly with a ViewPager --> <android.support.design.widget.TabLayout android:id="@+id/clear_browsing_data_tabs" + android:layoutDirection="ltr" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabMode="fixed"
diff --git a/chrome/android/java/res/layout/divider_preference.xml b/chrome/android/java/res/layout/divider_preference.xml index 279ef8b..a0407e3 100644 --- a/chrome/android/java/res/layout/divider_preference.xml +++ b/chrome/android/java/res/layout/divider_preference.xml
@@ -3,7 +3,4 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> -<View xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="#E0E0E0" /> +<View style="@style/Divider"/>
diff --git a/chrome/android/java/res/layout/preference_spinner.xml b/chrome/android/java/res/layout/preference_spinner.xml index 048ae53..37605bfa 100644 --- a/chrome/android/java/res/layout/preference_spinner.xml +++ b/chrome/android/java/res/layout/preference_spinner.xml
@@ -7,7 +7,6 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:chrome="http://schemas.android.com/apk/res-auto" style="@style/PreferenceLayout" android:layout_width="match_parent" android:layout_height="wrap_content"
diff --git a/chrome/android/java/res/layout/preference_spinner_single_line.xml b/chrome/android/java/res/layout/preference_spinner_single_line.xml new file mode 100644 index 0000000..d5f0efa --- /dev/null +++ b/chrome/android/java/res/layout/preference_spinner_single_line.xml
@@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<!-- Layout used by SpinnerPreference if its singleLine is set to true. --> + +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + style="@style/PreferenceLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/title" + style="@style/PreferenceTitle" + android:textAlignment="viewStart" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentStart="true" + android:layout_toStartOf="@id/spinner" /> + + <Spinner + android:id="@+id/spinner" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentEnd="true" /> +</RelativeLayout>
diff --git a/chrome/android/java/res/values-v17/styles.xml b/chrome/android/java/res/values-v17/styles.xml index 00b2b36..64a909a 100644 --- a/chrome/android/java/res/values-v17/styles.xml +++ b/chrome/android/java/res/values-v17/styles.xml
@@ -133,7 +133,7 @@ </style> <style name="PreferenceScreenLayout"> <item name="android:paddingTop">16dp</item> - + <!-- Additional padding is applied to each of the controls inside the layout, making this a 16dp padding overall. --> <item name="android:paddingStart">@dimen/pref_autofill_content_spacing</item> @@ -164,6 +164,11 @@ <item name="android:layout_marginTop">2dp</item> <item name="android:background">@color/google_grey_600</item> </style> + <style name="Divider"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">1dp</item> + <item name="android:background">@color/google_grey_300</item> + </style> <style name="ThemeWithActionBar" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:windowBackground">@drawable/action_bar_activity_bg</item> @@ -329,7 +334,7 @@ <item name="android:paddingEnd">0dp</item> <item name="externalRouteEnabledDrawable">@drawable/ic_cast_dark_chrome</item> </style> - + <!-- First Run Experience --> <style name="FreTitle"> <item name="android:layout_width">wrap_content</item>
diff --git a/chrome/android/java/res/values/attrs.xml b/chrome/android/java/res/values/attrs.xml index cb74a3c..e4c10fae 100644 --- a/chrome/android/java/res/values/attrs.xml +++ b/chrome/android/java/res/values/attrs.xml
@@ -74,4 +74,8 @@ to each other. --> <attr name="noBottomSpacing" format="boolean" /> </declare-styleable> + + <declare-styleable name="SpinnerPreference"> + <attr name="singleLine" format="boolean" /> + </declare-styleable> </resources>
diff --git a/chrome/android/java/res/xml/account_management_preferences.xml b/chrome/android/java/res/xml/account_management_preferences.xml index e5435de0..4b4b09cb 100644 --- a/chrome/android/java/res/xml/account_management_preferences.xml +++ b/chrome/android/java/res/xml/account_management_preferences.xml
@@ -30,10 +30,6 @@ android:key="child_content" android:title="@string/account_management_child_content_title" android:order="1003" /> - <Preference - android:key="child_safe_sites" - android:title="@string/account_management_child_safe_sites_title" - android:order="1004" /> <org.chromium.chrome.browser.preferences.SyncPreference android:key="sync_settings"
diff --git a/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml b/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml new file mode 100644 index 0000000..f3725a32 --- /dev/null +++ b/chrome/android/java/res/xml/clear_browsing_data_preferences_tab.xml
@@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> + +<PreferenceScreen + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:chrome="http://schemas.android.com/apk/res-auto"> + + <org.chromium.chrome.browser.preferences.SpinnerPreference + android:key="time_period_spinner" + android:persistent="false" + android:title="@string/clear_browsing_data_period_title" + chrome:singleLine="true" /> + + <Preference android:layout="@layout/divider_preference" /> + + <org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference + android:key="clear_history_checkbox" + android:persistent="false" + android:title="@string/clear_history_title" /> + + <org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference + android:key="clear_cookies_checkbox" + android:persistent="false" + android:title="@string/clear_cookies_and_site_data_title" + android:summaryOn="@string/clear_cookies_and_site_data_summary" + android:summaryOff="@string/clear_cookies_and_site_data_summary" /> + + <org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference + android:key="clear_cache_checkbox" + android:persistent="false" + android:title="@string/clear_cache_title" /> + + <org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference + android:key="clear_passwords_checkbox" + android:persistent="false" + android:title="@string/clear_passwords_title" /> + + <org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference + android:key="clear_form_data_checkbox" + android:persistent="false" + android:title="@string/clear_form_data_title" /> + +</PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 8df645a..ca9f1157 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -340,6 +340,7 @@ if (mBottomSheet != null) { mBottomSheet.setTabModelSelector(mTabModelSelector); + mBottomSheet.setFullscreenManager(mFullscreenManager); } ((BottomContainer) findViewById(R.id.bottom_container)).initialize(mFullscreenManager); } @@ -1729,10 +1730,7 @@ NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_HISTORY_MANAGER); } RecordUserAction.record("MobileMenuHistory"); - if (!HistoryManagerUtils.showHistoryManager(this, currentTab)) { - currentTab.loadUrl( - new LoadUrlParams(UrlConstants.HISTORY_URL, PageTransition.AUTO_TOPLEVEL)); - } + HistoryManagerUtils.showHistoryManager(this, currentTab); StartupMetrics.getInstance().recordOpenedHistory(); } else if (id == R.id.share_menu_id || id == R.id.direct_share_menu_id) { onShareMenuItemSelected(id == R.id.direct_share_menu_id,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java index f4f43ee..d243419 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -44,6 +44,7 @@ import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.IntentHandler.ExternalAppId; import org.chromium.chrome.browser.KeyboardShortcuts; +import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.WarmupManager; import org.chromium.chrome.browser.WebContentsFactory; import org.chromium.chrome.browser.appmenu.AppMenuPropertiesDelegate; @@ -990,9 +991,23 @@ */ private String getUrlToLoad() { String url = IntentHandler.getUrlFromIntent(getIntent()); + + // Intents fired for media viewers have an additional file:// URI passed along so that the + // tab can display the actual filename to the user when it is loaded. + if (mIntentDataProvider.isMediaViewer()) { + String mediaViewerUrl = mIntentDataProvider.getMediaViewerUrl(); + if (!TextUtils.isEmpty(mediaViewerUrl)) { + Uri mediaViewerUri = Uri.parse(mediaViewerUrl); + if (UrlConstants.FILE_SCHEME.equals(mediaViewerUri.getScheme())) { + url = mediaViewerUrl; + } + } + } + if (!TextUtils.isEmpty(url)) { url = DataReductionProxySettings.getInstance().maybeRewriteWebliteUrl(url); } + return url; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java index abc15768..d8d3459 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -58,6 +58,10 @@ public static final String EXTRA_IS_MEDIA_VIEWER = "org.chromium.chrome.browser.customtabs.IS_MEDIA_VIEWER"; + /** URL that should be loaded in place of the URL passed along in the data. */ + public static final String EXTRA_MEDIA_VIEWER_URL = + "org.chromium.chrome.browser.customtabs.MEDIA_VIEWER_URL"; + /** Indicates that the Custom Tab should style itself as an info page. */ public static final String EXTRA_IS_INFO_PAGE = "org.chromium.chrome.browser.customtabs.IS_INFO_PAGE"; @@ -93,6 +97,7 @@ private final Intent mKeepAliveServiceIntent; private final int mTitleVisibilityState; private final boolean mIsMediaViewer; + private final String mMediaViewerUrl; private final boolean mIsInfoPage; private final int mInitialBackgroundColor; private final boolean mDisableStar; @@ -178,6 +183,8 @@ CustomTabsIntent.EXTRA_REMOTEVIEWS_PENDINGINTENT); mIsMediaViewer = mIsTrustedIntent && IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_MEDIA_VIEWER, false); + mMediaViewerUrl = mIsMediaViewer + ? IntentUtils.safeGetStringExtra(intent, EXTRA_MEDIA_VIEWER_URL) : null; mIsInfoPage = mIsTrustedIntent && IntentUtils.safeGetBooleanExtra(intent, EXTRA_IS_INFO_PAGE, false); mDisableStar = IntentUtils.safeGetBooleanExtra(intent, EXTRA_DISABLE_STAR_BUTTON, false); @@ -485,6 +492,13 @@ } /** + * @return See {@link #EXTRA_MEDIA_VIEWER_URL}. + */ + String getMediaViewerUrl() { + return mMediaViewerUrl; + } + + /** * @return If the Custom Tab is an info page. * See {@link #EXTRA_IS_INFO_PAGE}. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java index d3449c2..f7d8794d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
@@ -76,6 +76,7 @@ protected static final String PENDING_OMA_DOWNLOADS = "PendingOMADownloads"; private static final String UNKNOWN_MIME_TYPE = "application/unknown"; private static final String DOWNLOAD_UMA_ENTRY = "DownloadUmaEntry"; + private static final String DOWNLOAD_RETRY_COUNT_FILE_NAME = "DownloadRetryCount"; private static final long UPDATE_DELAY_MILLIS = 1000; // Wait 10 seconds to resume all downloads, so that we won't impact tab loading. private static final long RESUME_DELAY_MILLIS = 10000; @@ -132,6 +133,7 @@ private NetworkChangeNotifierAutoDetect mNetworkChangeNotifier; // Flag to track if we need to post a task to update download notifications. private boolean mIsUIUpdateScheduled; + private int mAutoResumptionLimit = -1; /** * Class representing progress of a download. @@ -287,6 +289,13 @@ } } + /** + * Pre-load shared prefs to avoid being blocked on the disk access async task in the future. + */ + public static void warmUpSharedPrefs(Context context) { + getAutoRetryCountSharedPreference(context); + } + public DownloadNotifier getDownloadNotifier() { return mDownloadNotifier; } @@ -751,6 +760,7 @@ case DOWNLOAD_STATUS_CANCELLED: recordDownloadFinishedUMA(downloadStatus, downloadItem.getId(), downloadItem.getDownloadInfo().getBytesReceived()); + clearDownloadRetryCount(downloadItem.getId()); break; case DOWNLOAD_STATUS_INTERRUPTED: entry = getUmaStatsEntry(downloadItem.getId()); @@ -1106,11 +1116,6 @@ } } - /** - * Called to resume a paused download. - * @param item Download item to resume. - * @param hasUserGesture Whether the resumption is triggered by user gesture. - */ @Override public void resumeDownload(DownloadItem item, boolean hasUserGesture) { DownloadProgress progress = mDownloadProgressMap.get(item.getId()); @@ -1136,6 +1141,14 @@ if (!progress.mCanDownloadWhileMetered) { progress.mCanDownloadWhileMetered = isActiveNetworkMetered(mContext); } + clearDownloadRetryCount(item.getId()); + } else { + int count = incrementAndReturnDownloadRetryCount(item.getId()); + if (count > getAutoResumptionLimit()) { + removeAutoResumableDownload(item.getId()); + onDownloadInterrupted(item.getDownloadInfo(), false); + return; + } } nativeResumeDownload(getNativeDownloadManagerService(), item.getId(), item.getDownloadInfo().isOffTheRecord()); @@ -1676,6 +1689,49 @@ } } + /** + * Returns the SharedPreferences for download retry count. + * @return The SharedPreferences to use. + */ + private static SharedPreferences getAutoRetryCountSharedPreference(Context context) { + return context.getSharedPreferences(DOWNLOAD_RETRY_COUNT_FILE_NAME, Context.MODE_PRIVATE); + } + + /** + * Increments the interruption count for a download. If the interruption count reaches a certain + * threshold, the download will no longer auto resume unless user click the resume button + * to clear the count. + * @param downloadGuid Download GUID. + * @return The interruption count of the download, after incrementation. + */ + private int incrementAndReturnDownloadRetryCount(String downloadGuid) { + SharedPreferences sharedPrefs = getAutoRetryCountSharedPreference(mContext); + int count = sharedPrefs.getInt(downloadGuid, 0); + count++; + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.putInt(downloadGuid, count); + editor.apply(); + return count; + } + + /** + * clears the interruption count for a download. + * @param downloadGuid Download GUID. + */ + private void clearDownloadRetryCount(String downloadGuid) { + SharedPreferences sharedPrefs = getAutoRetryCountSharedPreference(mContext); + SharedPreferences.Editor editor = sharedPrefs.edit(); + editor.remove(downloadGuid); + editor.apply(); + } + + int getAutoResumptionLimit() { + if (mAutoResumptionLimit < 0) { + mAutoResumptionLimit = nativeGetAutoResumptionLimit(); + } + return mAutoResumptionLimit; + } + @Override public void onMaxBandwidthChanged(double maxBandwidthMbps) {} @@ -1692,6 +1748,7 @@ public void purgeActiveNetworkList(long[] activeNetIds) {} private static native boolean nativeIsSupportedMimeType(String mimeType); + private static native int nativeGetAutoResumptionLimit(); private native long nativeInit(); private native void nativeResumeDownload(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java index d96cf6d..13953ad 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
@@ -367,15 +367,16 @@ /** * Creates an Intent that allows viewing the given file in an internal media viewer. - * @param fileUri URI pointing at the file, ideally in file:// form. - * @param shareUri URI pointing at the file, ideally in content:// form. - * @param mimeType MIME type of the file. + * @param fileUri URI pointing at the file, ideally in file:// form. Used only when + * the media viewer is trying to locate the file on disk. + * @param contentUri content:// URI pointing at the file. + * @param mimeType MIME type of the file. * @return Intent that can be fired to open the file. */ public static Intent getMediaViewerIntentForDownloadItem( - Uri fileUri, Uri shareUri, String mimeType) { + Uri fileUri, Uri contentUri, String mimeType) { Context context = ContextUtils.getApplicationContext(); - Intent viewIntent = createViewIntentForDownloadItem(fileUri, mimeType); + Intent viewIntent = createViewIntentForDownloadItem(contentUri, mimeType); Bitmap closeIcon = BitmapFactory.decodeResource( context.getResources(), R.drawable.ic_arrow_back_white_24dp); @@ -399,7 +400,7 @@ // Create a PendingIntent that shares the file with external apps. PendingIntent pendingShareIntent = PendingIntent.getActivity( - context, 0, createShareIntent(shareUri, mimeType), 0); + context, 0, createShareIntent(contentUri, mimeType), 0); builder.setActionButton( shareIcon, context.getString(R.string.share), pendingShareIntent, true); @@ -415,8 +416,9 @@ // Build up the Intent further. Intent intent = builder.build().intent; intent.setPackage(context.getPackageName()); - intent.setData(fileUri); + intent.setData(contentUri); intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_MEDIA_VIEWER, true); + intent.putExtra(CustomTabIntentDataProvider.EXTRA_MEDIA_VIEWER_URL, fileUri.toString()); intent.putExtra( CustomTabIntentDataProvider.EXTRA_INITIAL_BACKGROUND_COLOR, mediaColor); intent.putExtra( @@ -466,7 +468,7 @@ */ public static boolean openFile(File file, String mimeType, boolean isOffTheRecord) { Context context = ContextUtils.getApplicationContext(); - Intent viewIntent = createViewIntentForDownloadItem(Uri.fromFile(file), mimeType); + Intent viewIntent = createViewIntentForDownloadItem(getUriForItem(file), mimeType); DownloadManagerService service = DownloadManagerService.getDownloadManagerService(context); // Check if Chrome should open the file itself. @@ -474,11 +476,11 @@ // Share URIs use the content:// scheme when able, which looks bad when displayed // in the URL bar. Uri fileUri = Uri.fromFile(file); - Uri shareUri = getUriForItem(file); + Uri contentUri = getUriForItem(file); String normalizedMimeType = Intent.normalizeMimeType(mimeType); Intent intent = - getMediaViewerIntentForDownloadItem(fileUri, shareUri, normalizedMimeType); + getMediaViewerIntentForDownloadItem(fileUri, contentUri, normalizedMimeType); IntentHandler.startActivityForTrustedIntent(intent); return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java index 8ffecbf..135d741a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManagerUtils.java
@@ -15,6 +15,7 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.ui.base.DeviceFormFactor; +import org.chromium.ui.base.PageTransition; /** * Utility methods for the browsing history manager. @@ -37,10 +38,13 @@ } /** - * @return Whether the Android-specific browsing history UI is was shown. + * Opens the browsing history manager. */ - public static boolean showHistoryManager(Activity activity, Tab tab) { - if (!isAndroidHistoryManagerEnabled()) return false; + public static void showHistoryManager(Activity activity, Tab tab) { + if (!isAndroidHistoryManagerEnabled()) { + tab.loadUrl(new LoadUrlParams(UrlConstants.HISTORY_URL, PageTransition.AUTO_TOPLEVEL)); + return; + } Context appContext = ContextUtils.getApplicationContext(); if (DeviceFormFactor.isTablet(appContext)) { @@ -53,6 +57,5 @@ intent.putExtra(IntentHandler.EXTRA_PARENT_COMPONENT, activity.getComponentName()); activity.startActivity(intent); } - return true; } -} \ No newline at end of file +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java index f1a96ad..963f68f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
@@ -37,6 +37,7 @@ import org.chromium.chrome.browser.FileProviderHelper; import org.chromium.chrome.browser.crash.MinidumpDirectoryObserver; import org.chromium.chrome.browser.device.DeviceClassManager; +import org.chromium.chrome.browser.download.DownloadManagerService; import org.chromium.chrome.browser.services.GoogleServicesManager; import org.chromium.chrome.browser.tabmodel.document.DocumentTabModelImpl; import org.chromium.chrome.browser.webapps.ActivityAssigner; @@ -169,6 +170,7 @@ ContextUtils.getAppSharedPreferences(); DocumentTabModelImpl.warmUpSharedPrefs(mApplication); ActivityAssigner.warmUpSharedPrefs(mApplication); + DownloadManagerService.warmUpSharedPrefs(mApplication); return null; } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); @@ -176,6 +178,7 @@ ContextUtils.getAppSharedPreferences(); DocumentTabModelImpl.warmUpSharedPrefs(mApplication); ActivityAssigner.warmUpSharedPrefs(mApplication); + DownloadManagerService.warmUpSharedPrefs(mApplication); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java index d2fc46f..5c3e941 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
@@ -12,9 +12,9 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.RecordUserAction; -import org.chromium.chrome.browser.UrlConstants; import org.chromium.chrome.browser.favicon.FaviconHelper; import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; +import org.chromium.chrome.browser.history.HistoryManagerUtils; import org.chromium.chrome.browser.invalidation.InvalidationController; import org.chromium.chrome.browser.metrics.StartupMetrics; import org.chromium.chrome.browser.ntp.ForeignSessionHelper.ForeignSession; @@ -27,7 +27,6 @@ import org.chromium.components.signin.ChromeSigninController; import org.chromium.components.sync.AndroidSyncSettings; import org.chromium.components.sync.AndroidSyncSettings.AndroidSyncSettingsObserver; -import org.chromium.content_public.browser.LoadUrlParams; import java.util.Collections; import java.util.List; @@ -203,7 +202,7 @@ */ public void openHistoryPage() { if (mIsDestroyed) return; - mTab.loadUrl(new LoadUrlParams(UrlConstants.HISTORY_URL)); + HistoryManagerUtils.showHistoryManager(mTab.getActivity(), mTab); StartupMetrics.getInstance().recordOpenedHistory(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java index 585082c..69e98bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java
@@ -5,6 +5,9 @@ package org.chromium.chrome.browser.ntp.cards; import android.support.annotation.CallSuper; +import android.support.annotation.Nullable; + +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; /** * A node in the tree that has a parent and can notify it about changes. @@ -35,8 +38,9 @@ return mNumItems; } - protected void notifyItemRangeChanged(int index, int count, Object payload) { - if (mParent != null) mParent.onItemRangeChanged(this, index, count, payload); + protected void notifyItemRangeChanged( + int index, int count, @Nullable PartialBindCallback callback) { + if (mParent != null) mParent.onItemRangeChanged(this, index, count, callback); } protected void notifyItemRangeChanged(int index, int count) { @@ -55,8 +59,8 @@ if (mParent != null) mParent.onItemRangeRemoved(this, index, count); } - protected void notifyItemChanged(int index, Object payload) { - notifyItemRangeChanged(index, 1, payload); + protected void notifyItemChanged(int index, @Nullable PartialBindCallback callback) { + notifyItemRangeChanged(index, 1, callback); } protected void notifyItemChanged(int index) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java index 93df5b6..b80d3024 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
@@ -4,8 +4,11 @@ package org.chromium.chrome.browser.ntp.cards; +import android.support.annotation.Nullable; + import org.chromium.base.Callback; import org.chromium.base.VisibleForTesting; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; import java.util.ArrayList; @@ -104,8 +107,9 @@ } @Override - public void onItemRangeChanged(TreeNode child, int index, int count, Object payload) { - notifyItemRangeChanged(getStartingOffsetForChild(child) + index, count, payload); + public void onItemRangeChanged( + TreeNode child, int index, int count, @Nullable PartialBindCallback callback) { + notifyItemRangeChanged(getStartingOffsetForChild(child) + index, count, callback); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index 80e9851..01f903d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -13,11 +13,11 @@ import org.chromium.base.Callback; import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.ntp.ContextMenuManager; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; import org.chromium.chrome.browser.ntp.snippets.SectionHeaderViewHolder; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; -import org.chromium.chrome.browser.suggestions.PartialUpdateId; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; import org.chromium.chrome.browser.widget.displaystyle.UiConfig; @@ -148,20 +148,8 @@ } for (Object payload : payloads) { - @PartialUpdateId - int updateId = (int) payload; - - switch (updateId) { - case PartialUpdateId.OFFLINE_BADGE: - assert holder instanceof SnippetArticleViewHolder; - ((SnippetArticleViewHolder) holder).refreshOfflineBadgeVisibility(); - break; - case PartialUpdateId.CARD_BACKGROUND: - holder.updateLayoutParams(); - break; - default: - assert false; // Unknown payload - } + assert payload instanceof PartialBindCallback; + ((PartialBindCallback) payload).onResult(holder); } } @@ -209,10 +197,10 @@ } @Override - public void onItemRangeChanged( - TreeNode child, int itemPosition, int itemCount, Object payload) { + public void onItemRangeChanged(TreeNode child, int itemPosition, int itemCount, + @Nullable PartialBindCallback callback) { assert child == mRoot; - notifyItemRangeChanged(itemPosition, itemCount, payload); + notifyItemRangeChanged(itemPosition, itemCount, callback); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java index dbcb00b..d3ff538 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
@@ -56,6 +56,14 @@ private static final int PEEKING_CARD_ANIMATION_TIME_MS = 1000; private static final int PEEKING_CARD_ANIMATION_START_DELAY_MS = 300; + /** + * A single instance of {@link ResetForDismissCallback} that can be reused as it has no + * state. + */ + public static final NewTabPageViewHolder.PartialBindCallback RESET_FOR_DISMISS_CALLBACK = + new ResetForDismissCallback(); + + private final GestureDetector mGestureDetector; private final LinearLayoutManager mLayoutManager; @@ -705,4 +713,15 @@ } return viewHolders; } + + /** + * Callback to reset a card's properties affected by swipe to dismiss. + */ + private static class ResetForDismissCallback extends NewTabPageViewHolder.PartialBindCallback { + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof CardViewHolder; + ((CardViewHolder) holder).getRecyclerView().updateViewStateForDismiss(0, holder); + } + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java index 75248d29..add59f29f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageViewHolder.java
@@ -7,12 +7,21 @@ import android.support.v7.widget.RecyclerView; import android.view.View; +import org.chromium.base.Callback; + /** * Holds metadata about an item we want to display on the NTP. An item can be anything that will be * displayed on the NTP {@link RecyclerView}. */ public class NewTabPageViewHolder extends RecyclerView.ViewHolder { /** + * A single instance of {@link UpdateLayoutParamsCallback} that can be reused as it has no + * state. + */ + public static final UpdateLayoutParamsCallback UPDATE_LAYOUT_PARAMS_CALLBACK = + new UpdateLayoutParamsCallback(); + + /** * Constructs a {@link NewTabPageViewHolder} used to display an part of the NTP (e.g., header, * article snippet, above-the-fold view, etc.) * @@ -39,4 +48,24 @@ protected RecyclerView.LayoutParams getParams() { return (RecyclerView.LayoutParams) itemView.getLayoutParams(); } + + /** + * A callback to perform a partial bind on a {@link NewTabPageViewHolder}. + * @see org.chromium.chrome.browser.ntp.cards.InnerNode#notifyItemChanged(int, + * PartialBindCallback) + * + * This empty class is used to strengthen type assertions, as those would be less useful with a + * generic class due to type erasure. + */ + public abstract static class PartialBindCallback extends Callback<NewTabPageViewHolder> {} + + /** + * Callback to update the layout params for the view holder. + */ + public static class UpdateLayoutParamsCallback extends PartialBindCallback { + @Override + public void onResult(NewTabPageViewHolder holder) { + holder.updateLayoutParams(); + } + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NodeParent.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NodeParent.java index 963e28c..f23e68af 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NodeParent.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NodeParent.java
@@ -4,6 +4,10 @@ package org.chromium.chrome.browser.ntp.cards; +import android.support.annotation.Nullable; + +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; + /** * Interface to allow propagating change events upwards in the tree. */ @@ -15,10 +19,11 @@ * @param index The starting position of the range of changed items, relative to the * {@code child}. * @param count The number of changed items. - * @param payload Optional parameter, use {@code null} to identify a "full" update. + * @param callback Optional parameter, use {@code null} to identify a "full" update. * @see android.support.v7.widget.RecyclerView.Adapter#notifyItemRangeChanged(int, int, Object) */ - void onItemRangeChanged(TreeNode child, int index, int count, Object payload); + void onItemRangeChanged( + TreeNode child, int index, int count, @Nullable PartialBindCallback callback); /** * Notifies that {@code count} items starting at position {@code index} under the {@code child}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java index e5bebb4..68c846ed 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
@@ -19,7 +19,6 @@ import org.chromium.chrome.browser.offlinepages.ClientId; import org.chromium.chrome.browser.offlinepages.OfflinePageBridge; import org.chromium.chrome.browser.offlinepages.OfflinePageItem; -import org.chromium.chrome.browser.suggestions.PartialUpdateId; import org.chromium.chrome.browser.suggestions.SuggestionsRanker; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; @@ -115,7 +114,7 @@ }; mOfflinePageBridge.addObserver(mOfflinePageObserver); - refreshChildrenVisibility(); + mStatus.setVisible(!hasSuggestions()); } private static class SuggestionsList extends ChildNode implements Iterable<SnippetArticle> { @@ -229,7 +228,8 @@ article.setOfflinePageOfflineId(newId); if ((oldId == null) == (newId == null)) return; - notifyItemChanged(index, PartialUpdateId.OFFLINE_BADGE); + notifyItemChanged( + index, SnippetArticleViewHolder.REFRESH_OFFLINE_BADGE_VISIBILITY_CALLBACK); } } @@ -240,8 +240,15 @@ super.detach(); } - private void refreshChildrenVisibility() { - mStatus.setVisible(!hasSuggestions()); + private void onSuggestionsListCountChanged(int oldSuggestionsCount) { + int newSuggestionsCount = getSuggestionsCount(); + if ((newSuggestionsCount == 0) == (oldSuggestionsCount == 0)) return; + + mStatus.setVisible(newSuggestionsCount == 0); + + // When the ActionItem stops being dismissable, it is possible that it was being interacted + // with. We need to reset the view's related property changes. + mMoreButton.notifyItemChanged(0, NewTabPageRecyclerView.RESET_FOR_DISMISS_CALLBACK); } @Override @@ -258,7 +265,13 @@ @Override public void onItemRangeRemoved(TreeNode child, int index, int count) { super.onItemRangeRemoved(child, index, count); - if (child == mSuggestionsList) refreshChildrenVisibility(); + if (child == mSuggestionsList) onSuggestionsListCountChanged(getSuggestionsCount() + count); + } + + @Override + public void onItemRangeInserted(TreeNode child, int index, int count) { + super.onItemRangeInserted(child, index, count); + if (child == mSuggestionsList) onSuggestionsListCountChanged(getSuggestionsCount() - count); } @Override @@ -276,9 +289,13 @@ /** Sends a notification to the items at the provided indices to refresh their background. */ private void notifyNeighboursModified(int aboveNeighbour, int belowNeighbour) { assert aboveNeighbour < belowNeighbour; - if (aboveNeighbour >= 0) notifyItemChanged(aboveNeighbour, PartialUpdateId.CARD_BACKGROUND); + + if (aboveNeighbour >= 0) { + notifyItemChanged(aboveNeighbour, NewTabPageViewHolder.UPDATE_LAYOUT_PARAMS_CALLBACK); + } + if (belowNeighbour < getItemCount()) { - notifyItemChanged(belowNeighbour, PartialUpdateId.CARD_BACKGROUND); + notifyItemChanged(belowNeighbour, NewTabPageViewHolder.UPDATE_LAYOUT_PARAMS_CALLBACK); } } @@ -403,8 +420,6 @@ updateSnippetOfflineAvailability(article); } } - - refreshChildrenVisibility(); } private void updateSnippetOfflineAvailability(final SnippetArticle article) { @@ -443,7 +458,6 @@ public void setStatus(@CategoryStatusEnum int status) { if (!SnippetsBridge.isCategoryStatusAvailable(status)) mSuggestionsList.clear(); mProgressIndicator.setVisible(SnippetsBridge.isCategoryLoading(status)); - refreshChildrenVisibility(); } @CategoryInt
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java index 6ee4d579..0915049 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java
@@ -33,6 +33,7 @@ import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters; import org.chromium.chrome.browser.ntp.cards.ImpressionTracker; import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder; import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; import org.chromium.chrome.browser.suggestions.SuggestionsUiDelegate; import org.chromium.chrome.browser.widget.displaystyle.DisplayStyleObserver; @@ -48,6 +49,13 @@ * A class that represents the view for a single card snippet. */ public class SnippetArticleViewHolder extends CardViewHolder implements ImpressionTracker.Listener { + /** + * A single instance of {@link RefreshOfflineBadgeVisibilityCallback} that can be reused as it + * has no state. + */ + public static final RefreshOfflineBadgeVisibilityCallback + REFRESH_OFFLINE_BADGE_VISIBILITY_CALLBACK = new RefreshOfflineBadgeVisibilityCallback(); + private static final String PUBLISHER_FORMAT_STRING = "%s - %s"; private static final int FADE_IN_ANIMATION_TIME_MS = 300; private static final int[] FAVICON_SERVICE_SUPPORTED_SIZES = {16, 24, 32, 48, 64}; @@ -253,7 +261,7 @@ } /** Updates the visibility of the card's offline badge by checking the bound article's info. */ - public void refreshOfflineBadgeVisibility() { + private void refreshOfflineBadgeVisibility() { if (!SnippetsConfig.isOfflineBadgeEnabled()) return; boolean visible = mArticle.getOfflinePageOfflineId() != null || mArticle.mIsAssetDownload; if (visible == (mOfflineBadge.getVisibility() == View.VISIBLE)) return; @@ -383,4 +391,15 @@ mPublisherTextView, drawable, null, null, null); mPublisherTextView.setVisibility(View.VISIBLE); } + + /** + * Callback to refresh the offline badge visibility. + */ + public static class RefreshOfflineBadgeVisibilityCallback extends PartialBindCallback { + @Override + public void onResult(NewTabPageViewHolder holder) { + assert holder instanceof SnippetArticleViewHolder; + ((SnippetArticleViewHolder) holder).refreshOfflineBadgeVisibility(); + } + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java index 5006857..537b8695 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
@@ -214,7 +214,9 @@ // by a command line intent) // 3.) Simultaneously moving one of the selection handles left and right. This will // occasionally throw an AssertionError on the bounds of the selection. - Selection.setSelection(mUrlBar.getText(), 0); + if (!mUrlBar.scrollToTLD()) { + Selection.setSelection(mUrlBar.getText(), 0); + } // The animation rendering may not yet be 100% complete and hiding the keyboard makes // the animation quite choppy.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java index 4130191..696693b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
@@ -845,21 +845,18 @@ mAccessibilityTextOverride = accessibilityOverride; } - private void scrollToTLD() { + /** + * Scroll to ensure the TLD is visible. + * @return Whether the TLD was discovered and successfully scrolled to. + */ + public boolean scrollToTLD() { Editable url = getText(); - if (url == null || url.length() < 1) return; + if (url == null || url.length() < 1) return false; String urlString = url.toString(); - URL javaUrl; - try { - javaUrl = new URL(urlString); - } catch (MalformedURLException mue) { - return; - } - String host = javaUrl.getHost(); - if (host == null || host.isEmpty()) return; - int hostStart = urlString.indexOf(host); - int hostEnd = hostStart + host.length(); - setSelection(hostEnd); + String prePath = LocationBarLayout.splitPathFromUrlDisplayText(urlString).first; + if (prePath == null || prePath.isEmpty()) return false; + setSelection(prePath.length()); + return true; } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java index def7a49..17221103 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java
@@ -726,8 +726,24 @@ ignoredDomains, ignoredDomainReasons); } - /* - * Whether browser history can be deleted by the user. + /** + * @return The index of the tab last visited by the user in the CBD dialog. + * Index 0 is for the basic tab, 1 is the advanced tab. + */ + public int getLastSelectedClearBrowsingDataTab() { + return nativeGetLastClearBrowsingDataTab(); + } + + /** + * Set the index of the tab last visited by the user. + * @param tabIndex The last visited tab index, 0 for basic, 1 for advanced. + */ + public void setLastSelectedClearBrowsingDataTab(int tabIndex) { + nativeSetLastClearBrowsingDataTab(tabIndex); + } + + /** + * @return Whether browser history can be deleted by the user. */ public boolean canDeleteBrowsingHistory() { return nativeCanDeleteBrowsingHistory(); @@ -1090,6 +1106,8 @@ private native void nativeClearBrowsingData(int[] dataTypes, int timePeriod, String[] blacklistDomains, int[] blacklistedDomainReasons, String[] ignoredDomains, int[] ignoredDomainReasons); + private native int nativeGetLastClearBrowsingDataTab(); + private native void nativeSetLastClearBrowsingDataTab(int lastTab); private native void nativeRequestInfoAboutOtherFormsOfBrowsingHistory( OtherFormsOfBrowsingHistoryListener listener); private native boolean nativeCanDeleteBrowsingHistory();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SpinnerPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SpinnerPreference.java index 1ad2a640..29da31a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SpinnerPreference.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SpinnerPreference.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser.preferences; import android.content.Context; +import android.content.res.TypedArray; import android.preference.Preference; import android.util.AttributeSet; import android.view.View; @@ -30,7 +31,13 @@ */ public SpinnerPreference(Context context, AttributeSet attrs) { super(context, attrs); - setLayoutResource(R.layout.preference_spinner); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SpinnerPreference); + boolean single_line = a.getBoolean(R.styleable.SpinnerPreference_singleLine, false); + if (single_line) { + setLayoutResource(R.layout.preference_spinner_single_line); + } else { + setLayoutResource(R.layout.preference_spinner); + } } /** @@ -40,8 +47,7 @@ * @param selectedIndex Index of the initially selected option. */ public void setOptions(Object[] options, int selectedIndex) { - mAdapter = new ArrayAdapter<Object>( - getContext(), android.R.layout.simple_spinner_item, options); + mAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_item, options); mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mSelectedIndex = selectedIndex; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SyncPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SyncPreference.java index 5937157..9ba2cfa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SyncPreference.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SyncPreference.java
@@ -14,7 +14,6 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.BuildInfo; import org.chromium.chrome.R; -import org.chromium.chrome.browser.childaccounts.ChildAccountService; import org.chromium.chrome.browser.sync.GoogleServiceAuthError; import org.chromium.chrome.browser.sync.ProfileSyncService; import org.chromium.components.signin.ChromeSigninController; @@ -88,10 +87,6 @@ ProfileSyncService profileSyncService = ProfileSyncService.get(); Resources res = context.getResources(); - if (ChildAccountService.isChildAccount()) { - return res.getString(R.string.kids_account); - } - if (!AndroidSyncSettings.isMasterSyncEnabled(context)) { return res.getString(R.string.sync_android_master_sync_disabled); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java index 82b5794..800535b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
@@ -238,7 +238,10 @@ // important domains from being cleared. private ConfirmImportantSitesDialogFragment mConfirmImportantSitesDialog; - private final EnumSet<DialogOption> getSelectedOptions() { + /** + * @return The currently selected DialogOptions. + */ + protected final EnumSet<DialogOption> getSelectedOptions() { EnumSet<DialogOption> selected = EnumSet.noneOf(DialogOption.class); for (Item item : mItems) { if (item.isSelected()) selected.add(item.getOption()); @@ -319,6 +322,7 @@ /** * Decides whether a given dialog option should be selected when the dialog is initialized. + * * @param option The option in question. * @return boolean Whether the given option should be preselected. */ @@ -382,18 +386,26 @@ @Override public boolean onPreferenceClick(Preference preference) { if (preference.getKey().equals(PREF_CLEAR_BUTTON)) { - if (shouldShowImportantSitesDialog()) { - showImportantDialogThenClear(); - return true; - } - // If sites haven't been fetched, just clear the browsing data regularly rather than - // waiting to show the important sites dialog. - clearBrowsingData(getSelectedOptions(), null, null, null, null); + onClearButtonClicked(); return true; } return false; } + /** + * Either shows the important sites dialog or clears browsing data according to the selected + * options. + */ + protected final void onClearButtonClicked() { + if (shouldShowImportantSitesDialog()) { + showImportantDialogThenClear(); + return; + } + // If sites haven't been fetched, just clear the browsing data regularly rather than + // waiting to show the important sites dialog. + clearBrowsingData(getSelectedOptions(), null, null, null, null); + } + @Override public boolean onPreferenceChange(Preference preference, Object value) { if (preference.getKey().equals(PREF_TIME_RANGE)) { @@ -413,13 +425,20 @@ /** * Disable the "Clear" button if none of the options are selected. Otherwise, enable it. */ - private void updateButtonState() { + protected void updateButtonState() { ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON); if (clearButton == null) return; boolean isEnabled = !getSelectedOptions().isEmpty(); clearButton.setEnabled(isEnabled); } + /** + * @return The id of the preference xml that should be displayed. + */ + protected int getPreferenceXmlId() { + return R.xml.clear_browsing_data_preferences; + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -427,7 +446,7 @@ mMaxImportantSites = PrefServiceBridge.getMaxImportantSites(); PrefServiceBridge.getInstance().requestInfoAboutOtherFormsOfBrowsingHistory(this); getActivity().setTitle(R.string.clear_browsing_data_title); - addPreferencesFromResource(R.xml.clear_browsing_data_preferences); + addPreferencesFromResource(getPreferenceXmlId()); DialogOption[] options = getDialogOptions(); mItems = new Item[options.length]; for (int i = 0; i < options.length; i++) { @@ -473,11 +492,28 @@ assert spinnerOptionIndex != -1; spinner.setOptions(spinnerOptions, spinnerOptionIndex); - // The "Clear" button. + initClearButtonPreference(); + initFootnote(); + + if (ChromeFeatureList.isEnabled(ChromeFeatureList.IMPORTANT_SITES_IN_CBD)) { + PrefServiceBridge.fetchImportantSites(this); + } + } + + /** + * Initialize the ButtonPreference. + */ + protected void initClearButtonPreference() { ButtonPreference clearButton = (ButtonPreference) findPreference(PREF_CLEAR_BUTTON); clearButton.setOnPreferenceClickListener(this); clearButton.setShouldDisableView(true); + } + /** + * Set the texts that notify the user about data in their google account and that deleting + * cookies doesn't sign you out of chrome. + */ + protected void initFootnote() { // The general information footnote informs users about data that will not be deleted. // If the user is signed in, it also informs users about the behavior of synced deletions. // and we show an additional Google-specific footnote. This footnote informs users that they @@ -512,9 +548,6 @@ getPreferenceScreen().removePreference(google_summary); general_summary.setSummary(R.string.clear_browsing_data_footnote_site_settings); } - if (ChromeFeatureList.isEnabled(ChromeFeatureList.IMPORTANT_SITES_IN_CBD)) { - PrefServiceBridge.fetchImportantSites(this); - } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java index 9e5c715..76c7f1b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java
@@ -8,6 +8,6 @@ * A more advanced version of {@link ClearBrowsingDataPreferences} with more dialog options and less * explanatory text. */ -public class ClearBrowsingDataPreferencesAdvanced extends ClearBrowsingDataPreferences { +public class ClearBrowsingDataPreferencesAdvanced extends ClearBrowsingDataPreferencesTab { // TODO(dullweber): Add more options. }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java index 550ab51..2a4cb11 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java
@@ -8,12 +8,12 @@ * A simpler version of {@link ClearBrowsingDataPreferences} with fewer dialog options and more * explanatory text. */ -public class ClearBrowsingDataPreferencesBasic extends ClearBrowsingDataPreferences { +public class ClearBrowsingDataPreferencesBasic extends ClearBrowsingDataPreferencesTab { @Override protected DialogOption[] getDialogOptions() { return new DialogOption[] { DialogOption.CLEAR_HISTORY, DialogOption.CLEAR_COOKIES_AND_SITE_DATA, - DialogOption.CLEAR_CACHE, + DialogOption.CLEAR_CACHE }; } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTab.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTab.java new file mode 100644 index 0000000..6ed9382 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTab.java
@@ -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. + +package org.chromium.chrome.browser.preferences.privacy; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; + +import org.chromium.chrome.R; + +/** + * The base class for a clear browsing data tab. + */ +public class ClearBrowsingDataPreferencesTab extends ClearBrowsingDataPreferences { + @Override + public View onCreateView( + LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + // Replace default preferences view with custom XML that contains a footer. + View view = inflater.inflate(R.layout.clear_browsing_data_tab_content, container, false); + + Button clearButton = (Button) view.findViewById(R.id.clear_button); + clearButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onClearButtonClicked(); + } + }); + + return view; + } + + @Override + protected int getPreferenceXmlId() { + return R.xml.clear_browsing_data_preferences_tab; + } + + @Override + protected void initClearButtonPreference() { + // This view has a Button instead of a ButtonPreference. The Button can only be initialized + // while or after onCreateView was called. + } + + @Override + protected void initFootnote() { + // This view doesn't have a footnote. + } + + @Override + protected void updateButtonState() { + // The clear button in this view is part of the footer, so it can't be a PreferenceButton + // like the clear button in ClearBrowsingDataPreferences. This makes it necessary to have a + // different listener and a different method to disable the button. + Button clearButton = (Button) getView().findViewById(R.id.clear_button); + boolean isEnabled = !getSelectedOptions().isEmpty(); + clearButton.setEnabled(isEnabled); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java index cec1dc5..6fd0b20 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java
@@ -10,6 +10,8 @@ import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v13.app.FragmentPagerAdapter; +import android.support.v4.text.TextUtilsCompat; +import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; @@ -17,13 +19,16 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.preferences.Preferences; +import java.util.Locale; + /** * Fragment with a {@link TabLayout} containing a basic and an advanced version of the CBD dialog. */ public class ClearBrowsingDataTabsFragment extends Fragment { - public static final String TAG = ClearBrowsingDataTabsFragment.class.getSimpleName(); + public static final int CBD_TAB_COUNT = 2; public ClearBrowsingDataTabsFragment() {} @@ -36,6 +41,21 @@ super.onCreate(savedInstanceState); } + /* + * RTL is broken for ViewPager: https://code.google.com/p/android/issues/detail?id=56831 + * This class works around this issue by inserting the tabs in inverse order if RTL is active. + * The TabLayout needs to be set to LTR for this to work. + * TODO(dullweber): Extract the RTL code into a wrapper class if other places in Chromium need + * it as well. + */ + private static int adjustIndexForDirectionality(int index) { + if (TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) + == ViewCompat.LAYOUT_DIRECTION_RTL) { + return CBD_TAB_COUNT - 1 - index; + } + return index; + } + @Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -50,6 +70,13 @@ // Give the TabLayout the ViewPager. TabLayout tabLayout = (TabLayout) view.findViewById(R.id.clear_browsing_data_tabs); tabLayout.setupWithViewPager(viewPager); + tabLayout.addOnTabSelectedListener(new TabSelectListener()); + int tabIndex = adjustIndexForDirectionality( + PrefServiceBridge.getInstance().getLastSelectedClearBrowsingDataTab()); + TabLayout.Tab tab = tabLayout.getTabAt(tabIndex); + if (tab != null) { + tab.select(); + } // Remove elevation to avoid shadow between title and tabs. Preferences activity = (Preferences) getActivity(); @@ -68,11 +95,12 @@ @Override public int getCount() { - return 2; + return CBD_TAB_COUNT; } @Override public Fragment getItem(int position) { + position = adjustIndexForDirectionality(position); switch (position) { case 0: return new ClearBrowsingDataPreferencesBasic(); @@ -85,6 +113,7 @@ @Override public CharSequence getPageTitle(int position) { + position = adjustIndexForDirectionality(position); switch (position) { case 0: return mContext.getString(R.string.clear_browsing_data_basic_tab_title); @@ -95,4 +124,18 @@ } } } + + private static class TabSelectListener implements TabLayout.OnTabSelectedListener { + @Override + public void onTabSelected(TabLayout.Tab tab) { + int tabIndex = adjustIndexForDirectionality(tab.getPosition()); + PrefServiceBridge.getInstance().setLastSelectedClearBrowsingDataTab(tabIndex); + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) {} + + @Override + public void onTabReselected(TabLayout.Tab tab) {} + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java index 3af81512..1d04f639 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java
@@ -108,7 +108,6 @@ public static final String PREF_PARENTAL_SETTINGS = "parental_settings"; public static final String PREF_PARENT_ACCOUNTS = "parent_accounts"; public static final String PREF_CHILD_CONTENT = "child_content"; - public static final String PREF_CHILD_SAFE_SITES = "child_safe_sites"; public static final String PREF_GOOGLE_ACTIVITY_CONTROLS = "google_activity_controls"; public static final String PREF_SYNC_SETTINGS = "sync_settings"; @@ -355,7 +354,6 @@ private void configureChildAccountPreferences() { Preference parentAccounts = findPreference(PREF_PARENT_ACCOUNTS); Preference childContent = findPreference(PREF_CHILD_CONTENT); - Preference childSafeSites = findPreference(PREF_CHILD_SAFE_SITES); if (ChildAccountService.isChildAccount()) { Resources res = getActivity().getResources(); PrefServiceBridge prefService = PrefServiceBridge.getInstance(); @@ -376,26 +374,22 @@ parentAccounts.setSummary(parentText); parentAccounts.setSelectable(false); - final boolean unapprovedContentBlocked = - prefService.getDefaultSupervisedUserFilteringBehavior() - == PrefServiceBridge.SUPERVISED_USER_FILTERING_BLOCK; - final String contentText = res.getString( - unapprovedContentBlocked ? R.string.account_management_child_content_approved - : R.string.account_management_child_content_all); - childContent.setSummary(contentText); + final int childContentSummary; + int defaultBehavior = prefService.getDefaultSupervisedUserFilteringBehavior(); + if (defaultBehavior == PrefServiceBridge.SUPERVISED_USER_FILTERING_BLOCK) { + childContentSummary = R.string.account_management_child_content_approved; + } else if (prefService.isSupervisedUserSafeSitesEnabled()) { + childContentSummary = R.string.account_management_child_content_filter_mature; + } else { + childContentSummary = R.string.account_management_child_content_all; + } + childContent.setSummary(childContentSummary); childContent.setSelectable(false); - - final String safeSitesText = res.getString( - prefService.isSupervisedUserSafeSitesEnabled() - ? R.string.text_on : R.string.text_off); - childSafeSites.setSummary(safeSitesText); - childSafeSites.setSelectable(false); } else { PreferenceScreen prefScreen = getPreferenceScreen(); prefScreen.removePreference(findPreference(PREF_PARENTAL_SETTINGS)); prefScreen.removePreference(parentAccounts); prefScreen.removePreference(childContent); - prefScreen.removePreference(childSafeSites); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java deleted file mode 100644 index def5a2a..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.suggestions; - -import android.support.annotation.IntDef; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * Payloads to be passed to mark the different types of partial binds that can be made on view - * holders - * @see org.chromium.chrome.browser.ntp.cards.InnerNode#notifyItemChanged(int, Object) - */ -@IntDef({PartialUpdateId.OFFLINE_BADGE, PartialUpdateId.CARD_BACKGROUND}) -@Retention(RetentionPolicy.SOURCE) -public @interface PartialUpdateId { - /** Marks a request to update a suggestion's offline badge. */ - int OFFLINE_BADGE = 1; - - /** - * Marks a request to update a card's background. Will no-op if received by a non card - * view holder. - * @see org.chromium.chrome.browser.ntp.cards.CardViewHolder#updateLayoutParams() - */ - int CARD_BACKGROUND = 2; -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java index 8d1de1f..e5571dc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java
@@ -57,4 +57,19 @@ * Handles a change in page load progress. */ void onLoadProgressChanged(double progress); + + /** + * Passes a list of tabs to the VR UI. + */ + void onTabListCreated(Tab[] mainTabs, Tab[] incognitoTabs); + + /** + * Handles updating the UI for a tab that's had its title changed. + */ + void onTabUpdated(boolean incognito, int id, String title); + + /** + * Handles updating the UI for a tab that's been removed. + */ + void onTabRemoved(boolean incognito, int id); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java index acead93..649c19e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -36,7 +36,9 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabObserver; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; +import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; +import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabObserver; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -83,6 +85,7 @@ private final ChromeTabbedActivity mActivity; private TabObserver mTabObserver; + private TabModelSelectorTabObserver mTabModelSelectorTabObserver; private TabModelSelectorObserver mTabModelSelectorObserver; private Intent mEnterVRIntent; @@ -116,11 +119,16 @@ * at runtime. */ // TODO(bshe): Find a place to call this function again, i.e. page refresh or onResume. + // TODO(mthiesse): Clean this function up, lots of duplicated code. private void updateVrSupportLevel() { if (mVrClassesWrapper == null || !isVrCoreCompatible()) { mVrSupportLevel = VR_NOT_AVAILABLE; mEnterVRIntent = null; mTabObserver = null; + if (mTabModelSelectorTabObserver != null) { + mTabModelSelectorTabObserver.destroy(); + mTabModelSelectorTabObserver = null; + } mTabModelSelectorObserver = null; return; } @@ -143,6 +151,10 @@ mVrSupportLevel = VR_NOT_AVAILABLE; mEnterVRIntent = null; mTabObserver = null; + if (mTabModelSelectorTabObserver != null) { + mTabModelSelectorTabObserver.destroy(); + mTabModelSelectorTabObserver = null; + } mTabModelSelectorObserver = null; return; } @@ -167,8 +179,8 @@ @Override public void onWebContentsSwapped( Tab tab, boolean didStartLoad, boolean didFinishLoad) { - // TODO(mthiesse): Update the native WebContents pointer and compositor. - shutdownVR(false, mVrSupportLevel == VR_DAYDREAM /* showTransition */); + // swapTab might be slightly overkill, but best to be on the safe side. + mVrShell.swapTab(tab); } @Override @@ -184,6 +196,11 @@ public void onChange() { swapToForegroundTab(); } + + @Override + public void onNewTabCreated(Tab tab) { + mVrShell.onTabUpdated(tab.isIncognito(), tab.getId(), tab.getTitle()); + } }; } @@ -301,7 +318,34 @@ mVrShell.resume(); mTab.updateFullscreenEnabledState(); setEnterVRResult(true, requestedWebVR); + createTabList(); mActivity.getTabModelSelector().addObserver(mTabModelSelectorObserver); + createTabModelSelectorTabObserver(); + } + + private void createTabModelSelectorTabObserver() { + assert mTabModelSelectorTabObserver == null; + mTabModelSelectorTabObserver = new TabModelSelectorTabObserver( + mActivity.getTabModelSelector()) { + @Override + public void onTitleUpdated(Tab tab) { + mVrShell.onTabUpdated(tab.isIncognito(), tab.getId(), tab.getTitle()); + } + + @Override + public void onClosingStateChanged(Tab tab, boolean closing) { + if (closing) { + mVrShell.onTabRemoved(tab.isIncognito(), tab.getId()); + } else { + mVrShell.onTabUpdated(tab.isIncognito(), tab.getId(), tab.getTitle()); + } + } + + @Override + public void onDestroyed(Tab tab) { + mVrShell.onTabRemoved(tab.isIncognito(), tab.getId()); + } + }; } private void setEnterVRResult(boolean success, boolean requestedWebVR) { @@ -328,6 +372,22 @@ mTab.updateFullscreenEnabledState(); } + private void createTabList() { + TabModel main = mActivity.getTabModelSelector().getModel(false); + int count = main.getCount(); + Tab[] mainTabs = new Tab[count]; + for (int i = 0; i < count; ++i) { + mainTabs[i] = main.getTabAt(i); + } + TabModel incognito = mActivity.getTabModelSelector().getModel(true); + count = incognito.getCount(); + Tab[] incognitoTabs = new Tab[count]; + for (int i = 0; i < count; ++i) { + incognitoTabs[i] = incognito.getTabAt(i); + } + mVrShell.onTabListCreated(mainTabs, incognitoTabs); + } + private boolean canEnterVR(Tab tab) { if (!LibraryLoader.isInitialized()) { return false; @@ -439,9 +499,6 @@ mRequestedWebVR = false; } - // TODO(bshe): Ideally, we do not need two gvr context exist at the same time. We can - // probably shutdown non presenting gvr when presenting and create a new one after exit - // presenting. See crbug.com/655242 StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); try { nativeOnResume(mNativeVrShellDelegate); @@ -574,6 +631,8 @@ mLastVRExit = SystemClock.uptimeMillis(); } mActivity.getTabModelSelector().removeObserver(mTabModelSelectorObserver); + mTabModelSelectorTabObserver.destroy(); + mTabModelSelectorTabObserver = null; mActivity.setRequestedOrientation(mRestoreOrientation); mVrShell.pause(); removeVrViews();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java index 6757f218..3da0388 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
@@ -357,6 +357,21 @@ // multiple times. } + @Override + public void onTabListCreated(Tab[] mainTabs, Tab[] incognitoTabs) { + nativeOnTabListCreated(mNativeVrShell, mainTabs, incognitoTabs); + } + + @Override + public void onTabUpdated(boolean incognito, int id, String title) { + nativeOnTabUpdated(mNativeVrShell, incognito, id, title); + } + + @Override + public void onTabRemoved(boolean incognito, int id) { + nativeOnTabRemoved(mNativeVrShell, incognito, id); + } + private native long nativeInit(WebContents contentWebContents, long nativeContentWindowAndroid, WebContents uiWebContents, long nativeUiWindowAndroid, boolean forWebVR, VrShellDelegate delegate, long gvrApi, boolean reprojectedRendering); @@ -373,4 +388,9 @@ private native void nativeUIPhysicalBoundsChanged(long nativeVrShell, int width, int height, float dpr); private native void nativeSetWebVrMode(long nativeVrShell, boolean enabled); + private native void nativeOnTabListCreated(long nativeVrShell, Tab[] mainTabs, + Tab[] incognitoTabs); + private native void nativeOnTabUpdated(long nativeVrShell, boolean incognito, int id, + String title); + private native void nativeOnTabRemoved(long nativeVrShell, boolean incognito, int id); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java index e32b4bb..d492c5d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/BottomSheet.java
@@ -21,7 +21,9 @@ import android.view.animation.Interpolator; import android.widget.FrameLayout; +import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; +import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; import org.chromium.chrome.browser.suggestions.SuggestionsBottomSheetContent; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.util.MathUtils; @@ -104,6 +106,9 @@ /** Used for getting the current tab. */ private TabModelSelector mTabModelSelector; + /** The fullscreen manager for information about toolbar offsets. */ + private ChromeFullscreenManager mFullscreenManager; + /** A handle to the content being shown by the sheet. */ private BottomSheetContent mSheetContent; @@ -113,6 +118,9 @@ /** A handle to the toolbar control container. */ private View mControlContainer; + /** A placeholder for if there is no content in the bottom sheet. */ + private View mPlaceholder; + /** A handle to the FrameLayout that holds the content of the bottom sheet. */ private FrameLayout mBottomSheetContentContainer; @@ -242,6 +250,8 @@ @Override public boolean onInterceptTouchEvent(MotionEvent e) { + if (isToolbarAndroidViewHidden()) return false; + // The incoming motion event may have been adjusted by the view sending it down. Create a // motion event with the raw (x, y) coordinates of the original so the gesture detector // functions properly. @@ -251,6 +261,8 @@ @Override public boolean onTouchEvent(MotionEvent e) { + if (isToolbarAndroidViewHidden()) return false; + // The down event is interpreted above in onInterceptTouchEvent, it does not need to be // interpreted a second time. if (e.getActionMasked() != MotionEvent.ACTION_DOWN) { @@ -294,6 +306,20 @@ } /** + * @param fullscreenManager Chrome's fullscreen manager for information about toolbar offsets. + */ + public void setFullscreenManager(ChromeFullscreenManager fullscreenManager) { + mFullscreenManager = fullscreenManager; + } + + /** + * @return Whether or not the toolbar Android View is hidden due to being scrolled off-screen. + */ + private boolean isToolbarAndroidViewHidden() { + return mFullscreenManager == null || mFullscreenManager.getBottomControlOffset() > 0; + } + + /** * Adds layout change listeners to the views that the bottom sheet depends on. Namely the * heights of the root view and control container are important as they are used in many of the * calculations in this class. @@ -342,6 +368,13 @@ setSheetState(mCurrentState, false); } }); + + mPlaceholder = new View(getContext()); + LayoutParams placeHolderParams = + new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); + mPlaceholder.setBackgroundColor( + ApiCompatibilityUtils.getColor(getResources(), android.R.color.white)); + mBottomSheetContentContainer.addView(mPlaceholder, placeHolderParams); } /** @@ -384,8 +417,12 @@ mSheetContent = null; } - if (content == null) return; + if (content == null) { + mBottomSheetContentContainer.addView(mPlaceholder); + return; + } + mBottomSheetContentContainer.removeView(mPlaceholder); mSheetContent = content; mBottomSheetContentContainer.addView(mSheetContent.getScrollingContentView()); } @@ -425,6 +462,8 @@ MarginLayoutParams toolbarShadowParams = (MarginLayoutParams) findViewById(R.id.toolbar_shadow).getLayoutParams(); toolbarShadowParams.topMargin = (int) mToolbarHeight; + + mBottomSheetContentContainer.requestLayout(); } /**
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index e0a921bf..8fca2d2f 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -743,10 +743,10 @@ <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_ALLOW_DSE_ADDRESS_BAR" desc="Summary text explaining that Chrome will allow the default search engine to access the user's location, but only when the user searches directly from the address bar. e.g. Location access: Allow (for address bar searches)"> Allow (for address bar searches) </message> - <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_ALLOW_DSE" desc="Summary text explaining that Chrome will allow the default search engine to access the user's location, both when performed from the address bar and from Google search result pages. e.g. Location access: Allow for Google searches"> + <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_ALLOW_DSE" desc="Summary text explaining that Chrome will allow the default search engine to access the user's location, both when performed from the address bar and from search result pages. e.g. Location access: Allow for current search engine"> Allow for current search engine </message> - <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_BLOCK_DSE" desc="Summary text explaining that Chrome will allow the default search engine to access the user's location, both when performed from the address bar and from Google search result pages. e.g. Location access: Allow for Google searches"> + <message name="IDS_WEBSITE_SETTINGS_PERMISSIONS_BLOCK_DSE" desc="Summary text explaining that Chrome will block the default search engine from accessing the user's location, both when performed from the address bar and from search result pages. e.g. Location access: Block for current search engine"> Block for current search engine </message> <message name="IDS_WEBSITE_RESET" desc="The label for the button allowing users to clear all data and reset the permissions for a website."> @@ -964,9 +964,6 @@ </message> <!-- Child accounts --> - <message name="IDS_KIDS_ACCOUNT" desc="Identifies an account as a child account."> - This is a kid’s account - </message> <message name="IDS_ACCOUNT_MANAGEMENT_PARENTAL_SETTINGS" desc="Title of parental settings section of account page for child account."> Parental Settings </message> @@ -983,14 +980,15 @@ Content </message> <message name="IDS_ACCOUNT_MANAGEMENT_CHILD_CONTENT_APPROVED" desc="Setting that permits child accounts to visit only sites approved by their parents."> - Only approved sites + Only allow certain sites + </message> + <message name="IDS_ACCOUNT_MANAGEMENT_CHILD_CONTENT_FILTER_MATURE" desc="Setting that permits child accounts to visit any websites that don't have mature contents. As the filter is not perfect, the browser can only attempt to block these sites."> + Try to block mature sites </message> <message name="IDS_ACCOUNT_MANAGEMENT_CHILD_CONTENT_ALL" desc="Setting that permits child accounts to visit any websites."> - Uncontrolled + Allow all sites </message> - <message name="IDS_ACCOUNT_MANAGEMENT_CHILD_SAFE_SITES_TITLE" desc="Title of Google SafeSites, which blocks inappropriate or explicit websites."> - Google SafeSites filter - </message> + <message name="IDS_POWERED_BY_CHROME_MESSAGE" desc="A message indicating that the current page is running in Chrome."> Powered by Chrome </message>
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 8f85c38..bf67c939 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -821,6 +821,7 @@ "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java", "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesAdvanced.java", "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesBasic.java", + "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTab.java", "java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataTabsFragment.java", "java/src/org/chromium/chrome/browser/preferences/privacy/ConfirmImportantSitesDialogFragment.java", "java/src/org/chromium/chrome/browser/preferences/privacy/ContextualSearchPreferenceFragment.java", @@ -920,7 +921,6 @@ "java/src/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java", "java/src/org/chromium/chrome/browser/ssl/SecurityStateModel.java", "java/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsActivity.java", - "java/src/org/chromium/chrome/browser/suggestions/PartialUpdateId.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegate.java", "java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java",
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java index b9fb3c3..9bbc0f3 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/InnerNodeTest.java
@@ -25,6 +25,7 @@ import org.mockito.MockitoAnnotations; import org.robolectric.annotation.Config; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; import org.chromium.testing.local.LocalRobolectricTestRunner; @@ -217,7 +218,8 @@ } @Override - public void onItemRangeChanged(TreeNode child, int index, int count, Object payload) { + public void onItemRangeChanged( + TreeNode child, int index, int count, PartialBindCallback callback) { checkCount(child); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java index 96db4e3..30cba140 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSectionTest.java
@@ -15,6 +15,8 @@ import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.same; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; @@ -40,11 +42,11 @@ import org.chromium.chrome.browser.DisableHistogramsRule; import org.chromium.chrome.browser.EnableFeatures; import org.chromium.chrome.browser.ntp.cards.ContentSuggestionsTestUtils.CategoryInfoBuilder; +import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.UpdateLayoutParamsCallback; import org.chromium.chrome.browser.ntp.snippets.CategoryStatus; import org.chromium.chrome.browser.ntp.snippets.SnippetArticle; import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; import org.chromium.chrome.browser.offlinepages.OfflinePageItem; -import org.chromium.chrome.browser.suggestions.PartialUpdateId; import org.chromium.chrome.browser.suggestions.SuggestionsMetricsReporter; import org.chromium.chrome.browser.suggestions.SuggestionsNavigationDelegate; import org.chromium.chrome.browser.suggestions.SuggestionsRanker; @@ -595,7 +597,8 @@ // Remove the first card. The second one should get the update. section.removeSuggestionById(suggestions.get(0).mIdWithinCategory); - verify(mParent).onItemRangeChanged(section, 1, 1, PartialUpdateId.CARD_BACKGROUND); + verify(mParent).onItemRangeChanged( + same(section), eq(1), eq(1), any(UpdateLayoutParamsCallback.class)); } @Test @@ -608,7 +611,8 @@ // Remove the last card. The penultimate one should get the update. section.removeSuggestionById(suggestions.get(4).mIdWithinCategory); - verify(mParent).onItemRangeChanged(section, 4, 1, PartialUpdateId.CARD_BACKGROUND); + verify(mParent).onItemRangeChanged( + same(section), eq(4), eq(1), any(UpdateLayoutParamsCallback.class)); } @Test @@ -621,7 +625,8 @@ // Remove the last card. The penultimate one should get the update. section.removeSuggestionById(suggestions.get(1).mIdWithinCategory); - verify(mParent).onItemRangeChanged(section, 1, 1, PartialUpdateId.CARD_BACKGROUND); + verify(mParent).onItemRangeChanged( + same(section), eq(1), eq(1), any(UpdateLayoutParamsCallback.class)); } @Test @@ -662,7 +667,8 @@ section.setSuggestions(createDummySuggestions(2, /* categoryId = */ 42, "new"), CategoryStatus.AVAILABLE, /* replaceExisting = */ false); - verify(mParent).onItemRangeChanged(section, 5, 1, PartialUpdateId.CARD_BACKGROUND); + verify(mParent).onItemRangeChanged( + same(section), eq(5), eq(1), any(UpdateLayoutParamsCallback.class)); } private SuggestionsSection createSectionWithSuggestions(List<SnippetArticle> snippets) {
diff --git a/chrome/app/DEPS b/chrome/app/DEPS index 417fa0e..cab9bd2 100644 --- a/chrome/app/DEPS +++ b/chrome/app/DEPS
@@ -34,7 +34,5 @@ "+remoting/client/plugin", "+sandbox", "+services/service_manager/runner/common/client_util.h", - "+syzygy/kasko/api", "+third_party/crashpad/crashpad", - "+third_party/kasko", ]
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ccf4d0a4..9cfc2acd 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -7498,9 +7498,6 @@ <message name="IDS_ACCNAME_ZOOM" desc="The accessible name for the zoom button."> Zoom </message> - <message name="IDS_ACCNAME_OPEN_PDF_IN_READER" desc="The accessible name for the Open PDF in Reader button."> - Open PDF in Reader - </message> <message name="IDS_ACCNAME_FIND" desc="The accessible name for the find button."> Find </message> @@ -12850,54 +12847,6 @@ Ignore </message> - <!-- PDF reader related strings. Not used on Android --> - <if expr="not is_android"> - <!-- PDF with unsupported feature bubble --> - <message name="IDS_PDF_BUBBLE_MESSAGE" desc="Message for the bubble when a user views a PDF with an unsupported feature"> - Parts of this PDF document could not be displayed. - </message> - <message name="IDS_PDF_BUBBLE_OPEN_IN_READER_LINK" desc="Title of the link to open a PDF with an unsupported feature in Adobe Reader"> - Open in Adobe Reader - </message> - <message name="IDS_PDF_BUBBLE_INSTALL_READER_LINK" desc="Title of the link to open a PDF with an unsupported feature in Adobe Reader"> - Install Adobe Reader - </message> - <if expr="is_win"> - <message name="IDS_PDF_BUBBLE_METRO_MODE_LINK" desc="Title of the link to restart Chrome on Windows 8 in metro mode when viewing a PDF with an unsupported feature."> - Relaunch Chrome on the desktop - </message> - </if> - <message name="IDS_PDF_INFOBAR_QUESTION_ALWAYS_USE_READER" desc="Question asked on the info bar when a user opens a PDF with Reader and we want to ask them if they always want to use it for viewing PDF files."> - Use Adobe Reader as your default PDF viewer? - </message> - <message name="IDS_PDF_INFOBAR_ALWAYS_USE_READER_BUTTON" desc="The label of the 'always' button on the infobar that asks the user if they want to set Adobe Reader as default."> - Always - </message> - <message name="IDS_PDF_PASSWORD_DIALOG_TITLE" desc="The title of the dialog requesting a password to open a protected PDF."> - Password required - </message> - - <!-- Adobe Reader is out of date Blocking Page --> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_TITLE" desc="The title of the Adobe Reader out of date blocking page."> - Adobe Reader Out Of Date - </message> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_BODY" desc="The body of the Adobe Reader out of date blocking page."> - Adobe Reader is out of date and may be insecure. - </message> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_UPDATE" desc="The name of the radio button option to go to the Adobe Reader installer website."> - Update Adobe Reader now - </message> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_PROCEED" desc="The name of the radio button to proceed to open the PDF with the out of date Adobe Reader."> - Proceed without updating Adobe Reader (not recommended) - </message> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_OK" desc="OK button text of the Adobe Reader out of date blocking page."> - OK - </message> - <message name="IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_CANCEL" desc="Cancel button text of the Adobe Reader out of date blocking page."> - Cancel - </message> - </if> - <!-- Media Capture messages --> <message name="IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO" desc="Question asked on the info bar whenever a web page requests access to the computer's microphone and camera."> <ph name="HOST">$1<ex>html5rocks.com</ex></ph> wants to use your camera and microphone.
diff --git a/chrome/app/mash/BUILD.gn b/chrome/app/mash/BUILD.gn index c738779..2e2b7b3 100644 --- a/chrome/app/mash/BUILD.gn +++ b/chrome/app/mash/BUILD.gn
@@ -29,6 +29,7 @@ "//services/service_manager/runner/common", "//services/service_manager/runner/host:lib", "//services/service_manager/standalone", + "//services/ui/public/interfaces:constants", "//url", ]
diff --git a/chrome/app/mash/chrome_mash_manifest.json b/chrome/app/mash/chrome_mash_manifest.json index f550255..c3a87d2a 100644 --- a/chrome/app/mash/chrome_mash_manifest.json +++ b/chrome/app/mash/chrome_mash_manifest.json
@@ -18,7 +18,8 @@ "service_manager": [ "service_manager:instance_per_child" ], "catalog": [ "control" ], "ash": [ "app" ], - "quick_launch": [ "app" ] + "quick_launch": [ "app" ], + "ui": [ "app" ] } } }
diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc index cf7c891..e05f7ecf 100644 --- a/chrome/app/mash/mash_runner.cc +++ b/chrome/app/mash/mash_runner.cc
@@ -50,6 +50,7 @@ #include "services/service_manager/runner/common/client_util.h" #include "services/service_manager/runner/common/switches.h" #include "services/service_manager/runner/init.h" +#include "services/ui/public/interfaces/constants.mojom.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" @@ -155,13 +156,13 @@ DCHECK(exit_value); DCHECK(run_loop); - // TODO(jamescook): Also shut down if the window server dies. - if (identity.name() != mash::common::GetWindowManagerServiceName()) + if (identity.name() != mash::common::GetWindowManagerServiceName() && + identity.name() != ui::mojom::kServiceName) { return; + } - if (!run_loop->running()) - return; - + LOG(ERROR) << "Main process exiting because service " << identity.name() + << " quit unexpectedly."; *exit_value = 1; run_loop->Quit(); } @@ -224,8 +225,9 @@ background_service_manager.SetInstanceQuitCallback( base::Bind(&OnInstanceQuitInMain, &run_loop, &exit_value)); - // Ping services that we know we want to launch on startup. - // TODO(jamescook): Start the window server / ui service explicitly. + // Ping services that we know we want to launch on startup (UI service, + // window manager, quick launch app). + context_->connector()->Connect(ui::mojom::kServiceName); context_->connector()->Connect(mash::common::GetWindowManagerServiceName()); context_->connector()->Connect(mash::quick_launch::mojom::kServiceName);
diff --git a/chrome/app/nibs/DownloadShelf.xib b/chrome/app/nibs/DownloadShelf.xib index b73708cb..257e80e 100644 --- a/chrome/app/nibs/DownloadShelf.xib +++ b/chrome/app/nibs/DownloadShelf.xib
@@ -69,6 +69,7 @@ </subviews> <connections> <outlet property="delegate_" destination="-2" id="23"/> + <outlet property="closeButton_" destination="3" id="41"/> </connections> </customView> <customObject id="28" customClass="ChromeUILocalizer"/>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index cf3abaf..d74a83df 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1254,6 +1254,15 @@ <message name="IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_ALL" desc="Title for list of all other (non preferred) networks."> All networks </message> + <message name="IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_ADD_PREFERRED" desc="Settings > Internet > Known networks > Dropdown menu item to add a network to the list of preferred networks."> + Add to preferred + </message> + <message name="IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_REMOVE_PREFERRED" desc="Settings > Internet > Known networks > Dropdown menu item to remove a network from the list of preferred networks."> + Remove from preferred + </message> + <message name="IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_FORGET" desc="Settings > Internet > Known networks > Dropdown menu item to forget a known network."> + Forget + </message> <!-- Strings translating ONC (Open Network Configuration) properties --> <!-- and translatable values. See onc_spec.html for more information. --> @@ -1458,6 +1467,9 @@ <message name="IDS_SETTINGS_LANGUAGES_OFFER_TO_TRANSLATE_IN_THIS_LANGUAGE" desc="The label for a checkbox which indicates whether or not pages in this language should be translated by default."> Offer to translate pages in this language </message> + <message name="IDS_SETTINGS_LANGUAGES_OFFER_TO_ENABLE_TRANSLATE" desc="The label of the check-box that enables the prompt to translate a page."> + Offer to translate pages that aren't in a language you read. + </message> <if expr="chromeos"> <message name="IDS_SETTINGS_LANGUAGES_INPUT_METHODS_LIST_TITLE" desc="Title for the current input method in the header for the collapsible list of enabled input methods (keyboard layouts and input method editors)."> Input method
diff --git a/chrome/app/version_assembly/version_assembly_manifest.template b/chrome/app/version_assembly/version_assembly_manifest.template index 4ed10ad..9bd1fc5 100644 --- a/chrome/app/version_assembly/version_assembly_manifest.template +++ b/chrome/app/version_assembly/version_assembly_manifest.template
@@ -5,5 +5,4 @@ version='@MAJOR@.@MINOR@.@BUILD@.@PATCH@' type='win32'/> <file name='chrome_elf.dll'/> - <file name='kasko.dll'/> -</assembly> \ No newline at end of file +</assembly>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 118bea9..f91e7cb 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1324,6 +1324,8 @@ "web_data_service_factory.h", "webshare/share_service_impl.cc", "webshare/share_service_impl.h", + "webshare/share_target_pref_helper.cc", + "webshare/share_target_pref_helper.h", "win/app_icon.cc", "win/app_icon.h", "win/browser_util.cc", @@ -1560,7 +1562,6 @@ "//third_party/WebKit/public:resources", "//third_party/cacheinvalidation", "//third_party/icu", - "//third_party/kasko", "//third_party/leveldatabase", "//third_party/libaddressinput", "//third_party/libjingle",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index f71b3df..f0ab41b 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS
@@ -51,11 +51,9 @@ "+services/shape_detection/public/interfaces", "+services/ui/public", "+skia/ext", - "+syzygy/kasko", "+third_party/boringssl/src/include", "+third_party/crashpad", "+third_party/cros_system_api", - "+third_party/kasko", # chrome only needs switches from cc. All usage of the compositor is from # content. Definitely don't include generic stuff from cc/base here, if this
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index 9854124..b2d6c90 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -95,6 +95,9 @@ const base::Feature kContextualSearchSingleActions{ "ContextualSearchSingleActions", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kDownloadAutoResumptionThrottling{ + "DownloadAutoResumptionThrottling", base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kImportantSitesInCBD{"ImportantSitesInCBD", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index c702a3c6..47b5de4 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -20,6 +20,7 @@ extern const base::Feature kCCTPostMessageAPI; extern const base::Feature kChromeHomeFeature; extern const base::Feature kContextualSearchSingleActions; +extern const base::Feature kDownloadAutoResumptionThrottling; extern const base::Feature kImportantSitesInCBD; extern const base::Feature kImprovedA2HS; extern const base::Feature kNativeAndroidHistoryManager;
diff --git a/chrome/browser/android/download/download_manager_service.cc b/chrome/browser/android/download/download_manager_service.cc index d274f2b6..65ebf67 100644 --- a/chrome/browser/android/download/download_manager_service.cc +++ b/chrome/browser/android/download/download_manager_service.cc
@@ -7,19 +7,23 @@ #include "base/android/jni_string.h" #include "base/location.h" #include "base/single_thread_task_runner.h" +#include "base/strings/string_number_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" +#include "chrome/browser/android/chrome_feature_list.h" #include "chrome/browser/android/download/download_controller.h" #include "chrome/browser/download/download_service.h" #include "chrome/browser/download/download_service_factory.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/grit/generated_resources.h" #include "components/mime_util/mime_util.h" +#include "components/variations/variations_associated_data.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/download_item.h" #include "jni/DownloadInfo_jni.h" #include "jni/DownloadItem_jni.h" #include "jni/DownloadManagerService_jni.h" + #include "ui/base/l10n/l10n_util.h" using base::android::JavaParamRef; @@ -32,6 +36,10 @@ // The remaining time for a download item if it cannot be calculated. long kUnknownRemainingTime = -1; +// Finch flag for controlling auto resumption limit. +int kDefaultAutoResumptionLimit = 5; +const char kAutoResumptionLimitVariation[] = "AutoResumptionLimit"; + bool ShouldShowDownloadItem(content::DownloadItem* item) { return !item->IsTemporary(); } @@ -445,3 +453,18 @@ std::string mime_type = ConvertJavaStringToUTF8(env, jmime_type); return mime_util::IsSupportedMimeType(mime_type); } + +// static +jint GetAutoResumptionLimit(JNIEnv* env, + const JavaParamRef<jclass>& clazz) { + std::string variation = variations::GetVariationParamValueByFeature( + chrome::android::kDownloadAutoResumptionThrottling, + kAutoResumptionLimitVariation); + int auto_resumption_limit; + if (!variation.empty() && + base::StringToInt(variation, &auto_resumption_limit)) { + return auto_resumption_limit; + } + + return kDefaultAutoResumptionLimit; +}
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc index 7f50a0b..1648ab1 100644 --- a/chrome/browser/android/preferences/pref_service_bridge.cc +++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -589,6 +589,21 @@ time_period); } +static jint GetLastClearBrowsingDataTab(JNIEnv* env, + const JavaParamRef<jobject>& obj) { + return GetPrefService()->GetInteger( + browsing_data::prefs::kLastClearBrowsingDataTab); +} + +static void SetLastClearBrowsingDataTab(JNIEnv* env, + const JavaParamRef<jobject>& obj, + jint tab_index) { + DCHECK_GE(tab_index, 0); + DCHECK_LT(tab_index, 2); + GetPrefService()->SetInteger(browsing_data::prefs::kLastClearBrowsingDataTab, + tab_index); +} + static void ClearBrowsingData( JNIEnv* env, const JavaParamRef<jobject>& obj,
diff --git a/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc b/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc index 4374579..fc19572 100644 --- a/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc +++ b/chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.cc
@@ -87,11 +87,6 @@ if (!ShouldShowDisclosureForUrl(gurl)) return; - // Check that the Chrome app has geolocation permission. - JNIEnv* env = base::android::AttachCurrentThread(); - if (!Java_GeolocationHeader_hasGeolocationPermission(env)) - return; - // Don't show the infobar if the user has dismissed it, or they've seen it // enough times already. PrefService* prefs = GetProfile()->GetPrefs(); @@ -135,6 +130,11 @@ if (!service->GetDSEGeolocationSetting()) return; + // Check that the Chrome app has geolocation permission. + JNIEnv* env = base::android::AttachCurrentThread(); + if (!Java_GeolocationHeader_hasGeolocationPermission(env)) + return; + // All good, let's show the disclosure and increment the shown count. SearchGeolocationDisclosureInfoBarDelegate::Create(web_contents(), gurl); shown_count++;
diff --git a/chrome/browser/android/vr_shell/BUILD.gn b/chrome/browser/android/vr_shell/BUILD.gn index 0d0abfb..067601f 100644 --- a/chrome/browser/android/vr_shell/BUILD.gn +++ b/chrome/browser/android/vr_shell/BUILD.gn
@@ -71,6 +71,7 @@ "//components/security_state/core", "//content/public/browser", "//content/public/common", + "//device/gamepad", "//device/vr", "//ui/android", "//ui/base",
diff --git a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc index 8a095d2d..7f3a2a2 100644 --- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc +++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
@@ -6,6 +6,7 @@ #include "base/callback_helpers.h" #include "chrome/browser/android/vr_shell/vr_shell.h" +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h" namespace vr_shell { @@ -13,25 +14,17 @@ static constexpr long kPredictionTimeWithoutVsyncNanos = 50000000; } // namespace -NonPresentingGvrDelegate::NonPresentingGvrDelegate(long context) +NonPresentingGvrDelegate::NonPresentingGvrDelegate(gvr_context* context) : task_runner_(base::ThreadTaskRunnerHandle::Get()), binding_(this), weak_ptr_factory_(this) { - gvr_api_ = gvr::GvrApi::WrapNonOwned(reinterpret_cast<gvr_context*>(context)); + gvr_api_ = gvr::GvrApi::WrapNonOwned(context); } NonPresentingGvrDelegate::~NonPresentingGvrDelegate() { StopVSyncLoop(); } -gvr::Sizei NonPresentingGvrDelegate::GetWebVRCompositorSurfaceSize() { - return device::kInvalidRenderTargetSize; -} - -gvr::GvrApi* NonPresentingGvrDelegate::gvr_api() { - return gvr_api_.get(); -} - void NonPresentingGvrDelegate::OnVRVsyncProviderRequest( device::mojom::VRVSyncProviderRequest request) { binding_.Close(); @@ -142,4 +135,22 @@ callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1); } +bool NonPresentingGvrDelegate::SupportsPresentation() { + return false; +} + +void NonPresentingGvrDelegate::ResetPose() { + // Should never call RecenterTracking when using with Daydream viewers. On + // those devices recentering should only be done via the controller. + if (gvr_api_ && gvr_api_->GetViewerType() == GVR_VIEWER_TYPE_CARDBOARD) + gvr_api_->RecenterTracking(); +} + +void NonPresentingGvrDelegate::CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) { + callback.Run(VrShell::CreateVRDisplayInfo( + gvr_api_.get(), device::kInvalidRenderTargetSize, device_id)); +} + } // namespace vr_shell
diff --git a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h index bf6d4d10..107be75 100644 --- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h +++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h
@@ -12,6 +12,7 @@ #include "device/vr/android/gvr/gvr_delegate.h" #include "device/vr/vr_service.mojom.h" #include "mojo/public/cpp/bindings/binding.h" +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" namespace vr_shell { @@ -19,7 +20,7 @@ class NonPresentingGvrDelegate : public device::GvrDelegate, public device::mojom::VRVSyncProvider { public: - explicit NonPresentingGvrDelegate(long context); + explicit NonPresentingGvrDelegate(gvr_context* context); ~NonPresentingGvrDelegate() override; @@ -29,13 +30,15 @@ void UpdateWebVRTextureBounds(int16_t frame_index, const gvr::Rectf& left_bounds, const gvr::Rectf& right_bounds) override {} - void SetWebVRRenderSurfaceSize(int width, int height) override {} - gvr::Sizei GetWebVRCompositorSurfaceSize() override; - gvr::GvrApi* gvr_api() override; void OnVRVsyncProviderRequest( device::mojom::VRVSyncProviderRequest request) override; void UpdateVSyncInterval(long timebase_nanos, double interval_seconds) override; + bool SupportsPresentation() override; + void ResetPose() override; + void CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) override; void Pause(); void Resume();
diff --git a/chrome/browser/android/vr_shell/ui_interface.cc b/chrome/browser/android/vr_shell/ui_interface.cc index 215cfa7a..62d56055 100644 --- a/chrome/browser/android/vr_shell/ui_interface.cc +++ b/chrome/browser/android/vr_shell/ui_interface.cc
@@ -74,8 +74,42 @@ FlushUpdates(); } +void UiInterface::InitTabList() { + tab_list_ = base::MakeUnique<base::ListValue>(); +} + +void UiInterface::AppendToTabList(bool incognito, + int id, + const base::string16& title) { + auto dict = base::MakeUnique<base::DictionaryValue>(); + dict->SetBoolean("incognito", incognito); + dict->SetInteger("id", id); + dict->SetString("title", title); + tab_list_->Append(std::move(dict)); +} + +void UiInterface::FlushTabList() { + updates_.Set("setTabs", std::move(tab_list_)); + FlushUpdates(); +} + +void UiInterface::UpdateTab(bool incognito, int id, const std::string& title) { + auto details = base::MakeUnique<base::DictionaryValue>(); + details->SetBoolean("incognito", incognito); + details->SetInteger("id", id); + details->SetString("title", title); + updates_.Set("updateTab", std::move(details)); +} + +void UiInterface::RemoveTab(bool incognito, int id) { + auto details = base::MakeUnique<base::DictionaryValue>(); + details->SetBoolean("incognito", incognito); + details->SetInteger("id", id); + updates_.Set("removeTab", std::move(details)); +} + void UiInterface::SetURL(const GURL& url) { - std::unique_ptr<base::DictionaryValue> details(new base::DictionaryValue); + auto details = base::MakeUnique<base::DictionaryValue>(); details->SetString("host", url.host()); details->SetString("path", url.path());
diff --git a/chrome/browser/android/vr_shell/ui_interface.h b/chrome/browser/android/vr_shell/ui_interface.h index d31995d8..0fade99f 100644 --- a/chrome/browser/android/vr_shell/ui_interface.h +++ b/chrome/browser/android/vr_shell/ui_interface.h
@@ -43,6 +43,11 @@ void SetWebVRSecureOrigin(bool secure); void SetLoading(bool loading); void SetLoadProgress(double progress); + void InitTabList(); + void AppendToTabList(bool incognito, int id, const base::string16& title); + void FlushTabList(); + void UpdateTab(bool incognito, int id, const std::string& title); + void RemoveTab(bool incognito, int id); void SetURL(const GURL& url); // Omnibox input and output handling. @@ -63,6 +68,7 @@ UiCommandHandler* handler_; bool loaded_ = false; base::DictionaryValue updates_; + std::unique_ptr<base::ListValue> tab_list_; std::unique_ptr<VrOmnibox> omnibox_;
diff --git a/chrome/browser/android/vr_shell/vr_compositor.cc b/chrome/browser/android/vr_shell/vr_compositor.cc index e386d90..f22271a 100644 --- a/chrome/browser/android/vr_shell/vr_compositor.cc +++ b/chrome/browser/android/vr_shell/vr_compositor.cc
@@ -59,8 +59,7 @@ } void VrCompositor::SetWindowBounds(gfx::Size size) { - bounds_ = size; - compositor_->SetWindowBounds(bounds_); + compositor_->SetWindowBounds(size); } void VrCompositor::SurfaceChanged(jobject surface) {
diff --git a/chrome/browser/android/vr_shell/vr_compositor.h b/chrome/browser/android/vr_shell/vr_compositor.h index 7238ad8..20aac81 100644 --- a/chrome/browser/android/vr_shell/vr_compositor.h +++ b/chrome/browser/android/vr_shell/vr_compositor.h
@@ -36,7 +36,6 @@ void SurfaceDestroyed(); void SetWindowBounds(gfx::Size size); - gfx::Size GetWindowBounds() { return bounds_; } void SurfaceChanged(jobject surface); void SetLayer(content::WebContents* web_contents); @@ -48,7 +47,6 @@ void RestoreLayer(); std::unique_ptr<content::Compositor> compositor_; - gfx::Size bounds_; cc::Layer* layer_ = nullptr; cc::Layer* layer_parent_ = nullptr;
diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.h b/chrome/browser/android/vr_shell/vr_gl_thread.h index 0fcb754..763174d6b 100644 --- a/chrome/browser/android/vr_shell/vr_gl_thread.h +++ b/chrome/browser/android/vr_shell/vr_gl_thread.h
@@ -31,7 +31,6 @@ ~VrGLThread() override; base::WeakPtr<VrShellGl> GetVrShellGl() { return weak_vr_shell_gl_; } - VrShellGl* GetVrShellGlUnsafe() { return vr_shell_gl_.get(); } protected: void Init() override;
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc index d02f727..1f2b53c8 100644 --- a/chrome/browser/android/vr_shell/vr_shell.cc +++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -9,6 +9,7 @@ #include <string> #include <utility> +#include "base/android/jni_string.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/threading/platform_thread.h" @@ -16,6 +17,7 @@ #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" +#include "chrome/browser/android/tab_android.h" #include "chrome/browser/android/vr_shell/ui_interface.h" #include "chrome/browser/android/vr_shell/vr_compositor.h" #include "chrome/browser/android/vr_shell/vr_gl_thread.h" @@ -30,6 +32,7 @@ #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" #include "content/public/common/referrer.h" +#include "device/vr/android/gvr/gvr_device.h" #include "device/vr/android/gvr/gvr_device_provider.h" #include "jni/VrShellImpl_jni.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" @@ -78,6 +81,7 @@ metrics_helper_(base::MakeUnique<VrMetricsHelper>(main_contents_)), main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), reprojected_rendering_(reprojected_rendering), + gvr_api_(gvr_api), weak_ptr_factory_(this) { DCHECK(g_instance == nullptr); g_instance = this; @@ -233,21 +237,45 @@ } } -void VrShell::OnLoadProgressChanged( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj, - double progress) { +void VrShell::OnLoadProgressChanged(JNIEnv* env, + const JavaParamRef<jobject>& obj, + double progress) { html_interface_->SetLoadProgress(progress); } -void VrShell::SetWebVRRenderSurfaceSize(int width, int height) { - // TODO(klausw,crbug.com/655722): Change the GVR render size and set the WebVR - // render surface size. +void VrShell::OnTabListCreated(JNIEnv* env, + const JavaParamRef<jobject>& obj, + jobjectArray tabs, + jobjectArray incognito_tabs) { + html_interface_->InitTabList(); + ProcessTabArray(env, tabs, false); + ProcessTabArray(env, incognito_tabs, true); + html_interface_->FlushTabList(); } -gvr::Sizei VrShell::GetWebVRCompositorSurfaceSize() { - const gfx::Size& size = content_compositor_->GetWindowBounds(); - return {size.width(), size.height()}; +void VrShell::ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito) { + size_t len = env->GetArrayLength(tabs); + for (size_t i = 0; i < len; ++i) { + jobject jtab = env->GetObjectArrayElement(tabs, i); + TabAndroid* tab = + TabAndroid::GetNativeTab(env, JavaParamRef<jobject>(env, jtab)); + html_interface_->AppendToTabList(incognito, tab->GetAndroidId(), + tab->GetTitle()); + } +} + +void VrShell::OnTabUpdated(JNIEnv* env, + const JavaParamRef<jobject>& obj, + jboolean incognito, jint id, jstring jtitle) { + std::string title; + base::android::ConvertJavaStringToUTF8(env, jtitle, &title); + html_interface_->UpdateTab(incognito, id, title); +} + +void VrShell::OnTabRemoved(JNIEnv* env, + const JavaParamRef<jobject>& obj, + jboolean incognito, jint id) { + html_interface_->RemoveTab(incognito, id); } void VrShell::SetWebVRSecureOrigin(bool secure_origin) { @@ -265,14 +293,21 @@ left_bounds, right_bounds)); } -// TODO(mthiesse): Do not expose GVR API outside of GL thread. -// It's not thread-safe. -gvr::GvrApi* VrShell::gvr_api() { - if (gl_thread_->GetVrShellGlUnsafe()) { - return gl_thread_->GetVrShellGlUnsafe()->gvr_api(); - } - CHECK(false); - return nullptr; +bool VrShell::SupportsPresentation() { + return true; +} + +void VrShell::ResetPose() { + gl_thread_->task_runner()->PostTask( + FROM_HERE, base::Bind(&VrShellGl::ResetPose, gl_thread_->GetVrShellGl())); +} + +void VrShell::CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) { + PostToGlThreadWhenReady(base::Bind(&VrShellGl::CreateVRDisplayInfo, + gl_thread_->GetVrShellGl(), + callback, device_id)); } void VrShell::SurfacesChanged(jobject content_surface, jobject ui_surface) { @@ -281,7 +316,7 @@ } void VrShell::GvrDelegateReady() { - delegate_provider_->SetDelegate(this); + delegate_provider_->SetDelegate(this, gvr_api_); } void VrShell::AppButtonPressed() { @@ -293,9 +328,9 @@ if (html_interface_->GetMode() == UiInterface::Mode::WEB_VR) { if (delegate_provider_->device_provider()) { if (html_interface_->GetMenuMode()) { - delegate_provider_->device_provider()->OnDisplayBlur(); + delegate_provider_->device_provider()->Device()->OnBlur(); } else { - delegate_provider_->device_provider()->OnDisplayFocus(); + delegate_provider_->device_provider()->Device()->OnFocus(); } } } @@ -498,6 +533,55 @@ return pose; } +device::mojom::VRDisplayInfoPtr VrShell::CreateVRDisplayInfo( + gvr::GvrApi* gvr_api, gvr::Sizei compositor_size, uint32_t device_id) { + TRACE_EVENT0("input", "GvrDevice::GetVRDevice"); + + device::mojom::VRDisplayInfoPtr device = device::mojom::VRDisplayInfo::New(); + + device->index = device_id; + + device->capabilities = device::mojom::VRDisplayCapabilities::New(); + device->capabilities->hasOrientation = true; + device->capabilities->hasPosition = false; + device->capabilities->hasExternalDisplay = false; + device->capabilities->canPresent = true; + + std::string vendor = gvr_api->GetViewerVendor(); + std::string model = gvr_api->GetViewerModel(); + device->displayName = vendor + " " + model; + + gvr::BufferViewportList gvr_buffer_viewports = + gvr_api->CreateEmptyBufferViewportList(); + gvr_buffer_viewports.SetToRecommendedBufferViewports(); + + device->leftEye = device::mojom::VREyeParameters::New(); + device->rightEye = device::mojom::VREyeParameters::New(); + for (auto eye : {GVR_LEFT_EYE, GVR_RIGHT_EYE}) { + device::mojom::VREyeParametersPtr& eye_params = + (eye == GVR_LEFT_EYE) ? device->leftEye : device->rightEye; + eye_params->fieldOfView = device::mojom::VRFieldOfView::New(); + eye_params->offset.resize(3); + eye_params->renderWidth = compositor_size.width / 2; + eye_params->renderHeight = compositor_size.height; + + gvr::BufferViewport eye_viewport = gvr_api->CreateBufferViewport(); + gvr_buffer_viewports.GetBufferViewport(eye, &eye_viewport); + gvr::Rectf eye_fov = eye_viewport.GetSourceFov(); + eye_params->fieldOfView->upDegrees = eye_fov.top; + eye_params->fieldOfView->downDegrees = eye_fov.bottom; + eye_params->fieldOfView->leftDegrees = eye_fov.left; + eye_params->fieldOfView->rightDegrees = eye_fov.right; + + gvr::Mat4f eye_mat = gvr_api->GetEyeFromHeadMatrix(eye); + eye_params->offset[0] = -eye_mat.m[0][3]; + eye_params->offset[1] = -eye_mat.m[1][3]; + eye_params->offset[2] = -eye_mat.m[2][3]; + } + + return device; +} + // ---------------------------------------------------------------------------- // Native JNI methods // ---------------------------------------------------------------------------- @@ -514,7 +598,7 @@ reinterpret_cast<ui::WindowAndroid*>(content_window_android), content::WebContents::FromJavaWebContents(ui_web_contents), reinterpret_cast<ui::WindowAndroid*>(ui_window_android), - for_web_vr, VrShellDelegate::GetNativeDelegate(env, delegate), + for_web_vr, VrShellDelegate::GetNativeVrShellDelegate(env, delegate), reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); }
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h index 6a4eb6b..54f84d0 100644 --- a/chrome/browser/android/vr_shell/vr_shell.h +++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -93,6 +93,15 @@ void OnLoadProgressChanged(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, double progress); + void OnTabListCreated(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jobjectArray tabs, jobjectArray incognito_tabs); + void OnTabUpdated(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jboolean incognito, jint id, jstring jtitle); + void OnTabRemoved(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jboolean incognito, jint id); void ContentWebContentsDestroyed(); // Called when our WebContents have been hidden. Usually a sign that something @@ -137,7 +146,12 @@ void ProcessUIGesture(std::unique_ptr<blink::WebInputEvent> event); void ProcessContentGesture(std::unique_ptr<blink::WebInputEvent> event); + // TODO(mthiesse): Find a better place for these functions to live. static device::mojom::VRPosePtr VRPosePtrFromGvrPose(gvr::Mat4f head_mat); + static device::mojom::VRDisplayInfoPtr CreateVRDisplayInfo( + gvr::GvrApi* gvr_api, + gvr::Sizei compositor_size, + uint32_t device_id); private: ~VrShell() override; @@ -155,13 +169,17 @@ void UpdateWebVRTextureBounds(int16_t frame_index, const gvr::Rectf& left_bounds, const gvr::Rectf& right_bounds) override; - gvr::GvrApi* gvr_api() override; - void SetWebVRRenderSurfaceSize(int width, int height) override; - gvr::Sizei GetWebVRCompositorSurfaceSize() override; void OnVRVsyncProviderRequest( device::mojom::VRVSyncProviderRequest request) override; void UpdateVSyncInterval(long timebase_nanos, double interval_seconds) override; + bool SupportsPresentation() override; + void ResetPose() override; + void CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) override; + + void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); std::unique_ptr<UiInterface> html_interface_; @@ -183,6 +201,10 @@ std::unique_ptr<VrGLThread> gl_thread_; bool reprojected_rendering_; + // TODO(mthiesse): Remove the need for this to be stored here. + // crbug.com/674594 + gvr_context* gvr_api_; + base::WeakPtrFactory<VrShell> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(VrShell);
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc index 2d1a5088..6a0cc04 100644 --- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc +++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -6,7 +6,9 @@ #include "base/android/jni_android.h" #include "chrome/browser/android/vr_shell/non_presenting_gvr_delegate.h" +#include "device/vr/android/gvr/gvr_device.h" #include "device/vr/android/gvr/gvr_device_provider.h" +#include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h" #include "jni/VrShellDelegate_jni.h" using base::android::JavaParamRef; @@ -23,35 +25,49 @@ VrShellDelegate::~VrShellDelegate() { GvrDelegateProvider::SetInstance(nullptr); if (device_provider_) { - device_provider_->OnNonPresentingDelegateRemoved(); + device_provider_->Device()->OnDelegateChanged(); } } -VrShellDelegate* VrShellDelegate::GetNativeDelegate( +VrShellDelegate* VrShellDelegate::GetNativeVrShellDelegate( JNIEnv* env, jobject jdelegate) { long native_delegate = Java_VrShellDelegate_getNativePointer(env, jdelegate); return reinterpret_cast<VrShellDelegate*>(native_delegate); } -void VrShellDelegate::SetDelegate(device::GvrDelegate* delegate) { +void VrShellDelegate::SetDelegate(device::GvrDelegate* delegate, + gvr_context* context) { + context_ = context; delegate_ = delegate; + // Clean up the non-presenting delegate. if (non_presenting_delegate_) { device::mojom::VRVSyncProviderRequest request = non_presenting_delegate_->OnSwitchToPresentingDelegate(); if (request.is_pending()) delegate->OnVRVsyncProviderRequest(std::move(request)); + non_presenting_delegate_ = nullptr; + JNIEnv* env = AttachCurrentThread(); + Java_VrShellDelegate_shutdownNonPresentingNativeContext( + env, j_vr_shell_delegate_.obj()); } if (device_provider_) { - device_provider_->OnGvrDelegateReady(delegate_); + device::GvrDevice* device = device_provider_->Device(); + device::GamepadDataFetcherManager::GetInstance()->AddFactory( + new device::GvrGamepadDataFetcher::Factory(context, device->id())); + device->OnDelegateChanged(); } + delegate_->UpdateVSyncInterval(timebase_nanos_, interval_seconds_); } void VrShellDelegate::RemoveDelegate() { - if (device_provider_) { - device_provider_->OnGvrDelegateRemoved(); - } delegate_ = nullptr; + device::GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory( + device::GAMEPAD_SOURCE_GVR); + if (device_provider_) { + CreateNonPresentingDelegate(); + device_provider_->Device()->OnDelegateChanged(); + } } void VrShellDelegate::SetPresentResult(JNIEnv* env, @@ -65,7 +81,8 @@ void VrShellDelegate::DisplayActivate(JNIEnv* env, const JavaParamRef<jobject>& obj) { if (device_provider_) { - device_provider_->OnDisplayActivate(); + device_provider_->Device()->OnActivate( + device::mojom::VRDisplayEventReason::MOUNTED); } } @@ -101,10 +118,20 @@ void VrShellDelegate::SetDeviceProvider( device::GvrDeviceProvider* device_provider) { + CHECK(!device_provider_); device_provider_ = device_provider; - if (device_provider_ && delegate_) { - device_provider_->OnGvrDelegateReady(delegate_); - } + if (!delegate_) + CreateNonPresentingDelegate(); + device_provider_->Device()->OnDelegateChanged(); +} + +void VrShellDelegate::ClearDeviceProvider() { + non_presenting_delegate_ = nullptr; + JNIEnv* env = AttachCurrentThread(); + Java_VrShellDelegate_shutdownNonPresentingNativeContext( + env, j_vr_shell_delegate_.obj()); + device_provider_->Device()->OnDelegateChanged(); + device_provider_ = nullptr; } void VrShellDelegate::RequestWebVRPresent( @@ -141,33 +168,29 @@ void VrShellDelegate::OnVRVsyncProviderRequest( device::mojom::VRVSyncProviderRequest request) { - GetNonPresentingDelegate()->OnVRVsyncProviderRequest(std::move(request)); + GetDelegate()->OnVRVsyncProviderRequest(std::move(request)); } -device::GvrDelegate* VrShellDelegate::GetNonPresentingDelegate() { - if (!non_presenting_delegate_) { - JNIEnv* env = AttachCurrentThread(); - jlong context = Java_VrShellDelegate_createNonPresentingNativeContext( - env, j_vr_shell_delegate_.obj()); - if (!context) - return nullptr; +void VrShellDelegate::CreateNonPresentingDelegate() { + JNIEnv* env = AttachCurrentThread(); + gvr_context* context = reinterpret_cast<gvr_context*>( + Java_VrShellDelegate_createNonPresentingNativeContext( + env, j_vr_shell_delegate_.obj())); + if (!context) + return; + context_ = context; + non_presenting_delegate_ = + base::MakeUnique<NonPresentingGvrDelegate>(context); + non_presenting_delegate_->UpdateVSyncInterval(timebase_nanos_, + interval_seconds_); +} - non_presenting_delegate_.reset(new NonPresentingGvrDelegate(context)); - non_presenting_delegate_->UpdateVSyncInterval(timebase_nanos_, - interval_seconds_); - } +device::GvrDelegate* VrShellDelegate::GetDelegate() { + if (delegate_) + return delegate_; return non_presenting_delegate_.get(); } -void VrShellDelegate::DestroyNonPresentingDelegate() { - if (non_presenting_delegate_) { - non_presenting_delegate_.reset(nullptr); - JNIEnv* env = AttachCurrentThread(); - Java_VrShellDelegate_shutdownNonPresentingNativeContext( - env, j_vr_shell_delegate_.obj()); - } -} - void VrShellDelegate::SetListeningForActivate(bool listening) { JNIEnv* env = AttachCurrentThread(); Java_VrShellDelegate_setListeningForWebVrActivate(
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.h b/chrome/browser/android/vr_shell/vr_shell_delegate.h index 8067a41..de0e2c0 100644 --- a/chrome/browser/android/vr_shell/vr_shell_delegate.h +++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -25,9 +25,10 @@ VrShellDelegate(JNIEnv* env, jobject obj); ~VrShellDelegate() override; - static VrShellDelegate* GetNativeDelegate(JNIEnv* env, jobject jdelegate); + static VrShellDelegate* GetNativeVrShellDelegate(JNIEnv* env, + jobject jdelegate); - void SetDelegate(device::GvrDelegate* delegate); + void SetDelegate(device::GvrDelegate* delegate, gvr_context* context); void RemoveDelegate(); void SetPresentResult(JNIEnv* env, @@ -49,12 +50,14 @@ private: // device::GvrDelegateProvider implementation void SetDeviceProvider(device::GvrDeviceProvider* device_provider) override; + void ClearDeviceProvider() override; void RequestWebVRPresent(const base::Callback<void(bool)>& callback) override; void ExitWebVRPresent() override; - device::GvrDelegate* GetNonPresentingDelegate() override; - void DestroyNonPresentingDelegate() override; + device::GvrDelegate* GetDelegate() override; void SetListeningForActivate(bool listening) override; + void CreateNonPresentingDelegate(); + std::unique_ptr<NonPresentingGvrDelegate> non_presenting_delegate_; base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; device::GvrDeviceProvider* device_provider_ = nullptr; @@ -63,6 +66,10 @@ long timebase_nanos_ = 0; double interval_seconds_ = 0; + // TODO(mthiesse): Remove the need for this to be stored here. + // crbug.com/674594 + gvr_context* context_ = nullptr; + base::WeakPtrFactory<VrShellDelegate> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(VrShellDelegate);
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc index 78bc7f8..55a451927 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.cc +++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -154,6 +154,12 @@ std::chrono::steady_clock::now().time_since_epoch()).count(); } +void RunVRDisplayInfoCallback( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + device::mojom::VRDisplayInfoPtr info) { + callback.Run(std::move(info)); +} + } // namespace VrShellGl::VrShellGl( @@ -946,10 +952,6 @@ } } -gvr::GvrApi* VrShellGl::gvr_api() { - return gvr_api_.get(); -} - void VrShellGl::ContentBoundsChanged(int width, int height) { TRACE_EVENT0("gpu", "VrShellGl::ContentBoundsChanged"); content_tex_css_width_ = width; @@ -1057,4 +1059,21 @@ callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, frame_index); } +void VrShellGl::ResetPose() { + // Should never call RecenterTracking when using with Daydream viewers. On + // those devices recentering should only be done via the controller. + if (gvr_api_ && gvr_api_->GetViewerType() == GVR_VIEWER_TYPE_CARDBOARD) + gvr_api_->RecenterTracking(); +} + +void VrShellGl::CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) { + device::mojom::VRDisplayInfoPtr info = VrShell::CreateVRDisplayInfo( + gvr_api_.get(), content_tex_physical_size_, device_id); + main_thread_task_runner_->PostTask( + FROM_HERE, + base::Bind(&RunVRDisplayInfoCallback, callback, base::Passed(&info))); +} + } // namespace vr_shell
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.h b/chrome/browser/android/vr_shell/vr_shell_gl.h index cc9a2e72..55236b7 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.h +++ b/chrome/browser/android/vr_shell/vr_shell_gl.h
@@ -80,7 +80,6 @@ void UpdateWebVRTextureBounds(int16_t frame_index, const gvr::Rectf& left_bounds, const gvr::Rectf& right_bounds); - gvr::GvrApi* gvr_api(); void SetGvrPoseForWebVr(const gvr::Mat4f& pose, uint32_t pose_num); gvr::Sizei GetWebVRCompositorSurfaceSize(); @@ -89,6 +88,10 @@ void UpdateVSyncInterval(long timebase_nanos, double interval_seconds); void OnRequest(device::mojom::VRVSyncProviderRequest request); + void ResetPose(); + void CreateVRDisplayInfo( + const base::Callback<void(device::mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id); private: void GvrInit(gvr_context* gvr_api);
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index dd3a9b6..1e0113dc 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc
@@ -77,10 +77,6 @@ #include "chrome/browser/google/did_run_updater_win.h" #endif -#if BUILDFLAG(ENABLE_KASKO) -#include "syzygy/kasko/api/reporter.h" -#endif - namespace { typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( @@ -114,41 +110,6 @@ base::string16 GetLocalizedString(int installer_string_id) override; }; -#if BUILDFLAG(ENABLE_KASKO) -void ObserveFailedCrashReportDirectory(const base::FilePath& path, bool error) { - DCHECK(!error); - if (error) - return; - base::FileEnumerator enumerator(path, true, base::FileEnumerator::FILES); - for (base::FilePath report_file = enumerator.Next(); !report_file.empty(); - report_file = enumerator.Next()) { - if (report_file.Extension() == - kasko::api::kPermanentFailureMinidumpExtension) { - UMA_HISTOGRAM_BOOLEAN("CrashReport.PermanentUploadFailure", true); - } - bool result = base::DeleteFile(report_file, false); - DCHECK(result); - } -} - -void StartFailedKaskoCrashReportWatcher(base::FilePathWatcher* watcher) { - base::FilePath watcher_data_directory; - if (!PathService::Get(chrome::DIR_WATCHER_DATA, &watcher_data_directory)) { - NOTREACHED(); - } else { - base::FilePath permanent_failure_directory = - watcher_data_directory.Append(kPermanentlyFailedReportsSubdir); - if (!watcher->Watch(permanent_failure_directory, true, - base::Bind(&ObserveFailedCrashReportDirectory))) { - NOTREACHED(); - } - - // Call it once to observe any files present prior to the Watch() call. - ObserveFailedCrashReportDirectory(permanent_failure_directory, false); - } -} -#endif // BUILDFLAG(ENABLE_KASKO) - void DetectFaultTolerantHeap() { enum FTHFlags { FTH_HKLM = 1, @@ -406,18 +367,6 @@ InitializeChromeElf(); -#if BUILDFLAG(ENABLE_KASKO) - content::BrowserThread::PostDelayedTask( - content::BrowserThread::FILE, FROM_HERE, - base::Bind(&StartFailedKaskoCrashReportWatcher, - base::Unretained(&failed_kasko_crash_report_watcher_)), - base::TimeDelta::FromMinutes(5)); -#endif // BUILDFLAG(ENABLE_KASKO) - -#if defined(GOOGLE_CHROME_BUILD) - did_run_updater_.reset(new DidRunUpdater); -#endif - // Record UMA data about whether the fault-tolerant heap is enabled. // Use a delayed task to minimize the impact on startup time. content::BrowserThread::PostDelayedTask(
diff --git a/chrome/browser/chrome_browser_main_win.h b/chrome/browser/chrome_browser_main_win.h index 68ad182..22b29f0 100644 --- a/chrome/browser/chrome_browser_main_win.h +++ b/chrome/browser/chrome_browser_main_win.h
@@ -10,7 +10,6 @@ #include "base/files/file_path_watcher.h" #include "base/macros.h" #include "chrome/browser/chrome_browser_main.h" -#include "third_party/kasko/kasko_features.h" class DidRunUpdater; class ModuleWatcher; @@ -74,10 +73,6 @@ #if defined(GOOGLE_CHROME_BUILD) std::unique_ptr<DidRunUpdater> did_run_updater_; #endif -#if BUILDFLAG(ENABLE_KASKO) - // Cleans up Kasko crash reports that exceeded the maximum upload attempts. - base::FilePathWatcher failed_kasko_crash_report_watcher_; -#endif std::unique_ptr<ModuleWatcher> module_watcher_;
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc index f31f3593..ed2636b 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager.cc +++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -280,10 +280,10 @@ // For backwards compatibility, use NETWORK_ERROR for // CHROME_SERVER_COMMUNICATION_ERROR case. UpdateOptInCancelUMA(OptInCancelReason::NETWORK_ERROR); - } else if (!sign_in_time_.is_null()) { + } else if (!sign_in_start_time_.is_null()) { arc_sign_in_timer_.Stop(); - UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, + UpdateProvisioningTiming(base::Time::Now() - sign_in_start_time_, result == ProvisioningResult::SUCCESS, policy_util::IsAccountManaged(profile_)); UpdateProvisioningResultUMA(result, @@ -678,6 +678,8 @@ // Arc must be started only if no pending data removal request exists. DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); + arc_start_time_ = base::Time::Now(); + provisioning_reported_ = false; arc_session_runner_->RequestStart(); @@ -845,7 +847,7 @@ switch (result) { case policy::AndroidManagementClient::Result::UNMANAGED: VLOG(1) << "Starting ARC for first sign in."; - sign_in_time_ = base::Time::Now(); + sign_in_start_time_ = base::Time::Now(); arc_sign_in_timer_.Start( FROM_HERE, kArcSignInTimeout, base::Bind(&ArcSessionManager::OnArcSignInTimeout,
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.h b/chrome/browser/chromeos/arc/arc_session_manager.h index 7984d74..0bb3697 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager.h +++ b/chrome/browser/chromeos/arc/arc_session_manager.h
@@ -216,6 +216,14 @@ void OnProvisioningFinished(ProvisioningResult result); + // Returns the time when the sign in process started, or a null time if + // signing in didn't happen during this session. + base::Time sign_in_start_time() const { return sign_in_start_time_; } + + // Returns the time when ARC was about to start, or a null time if ARC has not + // been started yet. + base::Time arc_start_time() const { return arc_start_time_; } + // Injectors for testing. void SetArcSessionRunnerForTesting( std::unique_ptr<ArcSessionRunner> arc_session_runner); @@ -275,9 +283,13 @@ std::unique_ptr<ArcAuthContext> context_; std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_; - base::Time sign_in_time_; + // The time when the sign in process started. + base::Time sign_in_start_time_; + // The time when ARC was about to start. + base::Time arc_start_time_; base::Closure attempt_user_exit_callback_; + // Must be the last member. base::WeakPtrFactory<ArcSessionManager> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ArcSessionManager);
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc index 491a4c19..c5685268 100644 --- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -290,6 +290,8 @@ ASSERT_TRUE(arc_session_manager()->IsSessionStopped()); ASSERT_EQ(ArcSessionManager::State::NOT_INITIALIZED, arc_session_manager()->state()); + EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); + EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null()); arc_session_manager()->OnPrimaryUserProfilePrepared(profile()); @@ -307,6 +309,9 @@ // CHECKING_ANDROID_MANAGEMENT, when we extract ArcSessionManager. arc_session_manager()->StartArc(); + EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); + EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null()); + ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); ASSERT_TRUE(arc_session_manager()->IsSessionRunning()); @@ -390,22 +395,28 @@ TEST_F(ArcSessionManagerTest, SignInStatus) { PrefService* const prefs = profile()->GetPrefs(); + EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); + EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null()); + EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); prefs->SetBoolean(prefs::kArcEnabled, true); arc_session_manager()->OnPrimaryUserProfilePrepared(profile()); EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, arc_session_manager()->state()); + // Emulate to accept the terms of service. prefs->SetBoolean(prefs::kArcTermsAccepted, true); arc_session_manager()->StartArc(); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); + EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null()); arc_session_manager()->OnProvisioningFinished(ProvisioningResult::SUCCESS); EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn)); EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); + EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); // Second start, no fetching code is expected. arc_session_manager()->Shutdown();
diff --git a/chrome/browser/chromeos/arc/policy/arc_policy_bridge.cc b/chrome/browser/chromeos/arc/policy/arc_policy_bridge.cc index 52917c45a0..cdc0e02 100644 --- a/chrome/browser/chromeos/arc/policy/arc_policy_bridge.cc +++ b/chrome/browser/chromeos/arc/policy/arc_policy_bridge.cc
@@ -7,11 +7,16 @@ #include <memory> #include <utility> +#include "base/bind.h" #include "base/json/json_reader.h" #include "base/json/json_string_value_serializer.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/metrics/histogram_macros.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" #include "base/values.h" +#include "chrome/browser/chromeos/arc/arc_session_manager.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/policy/profile_policy_connector_factory.h" @@ -27,6 +32,8 @@ #include "components/prefs/pref_service.h" #include "components/safe_json/safe_json_parser.h" #include "components/user_manager/user.h" +#include "components/user_manager/user_manager.h" +#include "crypto/sha2.h" namespace arc { @@ -244,10 +251,53 @@ return policy_json; } +Profile* GetProfile() { + const user_manager::User* const primary_user = + user_manager::UserManager::Get()->GetPrimaryUser(); + return chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); +} + +void OnReportComplianceParseFailure( + const ArcPolicyBridge::ReportComplianceCallback& callback, + const std::string& error) { + callback.Run(kPolicyNonCompliantJson); +} + +void UpdateFirstComplianceSinceSignInTiming( + const base::TimeDelta& elapsed_time) { + UMA_HISTOGRAM_CUSTOM_TIMES("Arc.FirstComplianceReportTime.SinceSignIn", + elapsed_time, base::TimeDelta::FromSeconds(1), + base::TimeDelta::FromMinutes(10), 50); +} + +void UpdateFirstComplianceSinceStartupTiming( + const base::TimeDelta& elapsed_time) { + UMA_HISTOGRAM_CUSTOM_TIMES("Arc.FirstComplianceReportTime.SinceStartup", + elapsed_time, base::TimeDelta::FromSeconds(1), + base::TimeDelta::FromMinutes(10), 50); +} + +void UpdateComplianceSinceUpdateTiming(const base::TimeDelta& elapsed_time) { + UMA_HISTOGRAM_CUSTOM_TIMES("Arc.ComplianceReportSinceUpdateNotificationTime", + elapsed_time, + base::TimeDelta::FromMilliseconds(100), + base::TimeDelta::FromMinutes(10), 50); +} + +// Returns the SHA-256 hash of the JSON dump of the ARC policies, in the textual +// hex dump format. Note that no specific JSON normalization is performed, as +// the spurious hash mismatches, even if they occur (which is unlikely), would +// only result in some UMA metrics not being sent. +std::string GetPoliciesHash(const std::string& json_policies) { + const std::string hash_bits = crypto::SHA256HashString(json_policies); + return base::ToLowerASCII( + base::HexEncode(hash_bits.c_str(), hash_bits.length())); +} + } // namespace ArcPolicyBridge::ArcPolicyBridge(ArcBridgeService* bridge_service) - : ArcService(bridge_service), binding_(this) { + : ArcService(bridge_service), binding_(this), weak_ptr_factory_(this) { VLOG(2) << "ArcPolicyBridge::ArcPolicyBridge"; arc_bridge_service()->policy()->AddObserver(this); } @@ -256,7 +306,8 @@ policy::PolicyService* policy_service) : ArcService(bridge_service), binding_(this), - policy_service_(policy_service) { + policy_service_(policy_service), + weak_ptr_factory_(this) { VLOG(2) << "ArcPolicyBridge::ArcPolicyBridge(bridge_service, policy_service)"; arc_bridge_service()->policy()->AddObserver(this); } @@ -282,6 +333,7 @@ InitializePolicyService(); } policy_service_->AddObserver(policy::POLICY_DOMAIN_CHROME, this); + initial_policies_hash_ = GetPoliciesHash(GetCurrentJSONPolicies()); mojom::PolicyInstance* const policy_instance = ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->policy(), Init); @@ -293,35 +345,67 @@ VLOG(1) << "ArcPolicyBridge::OnPolicyInstanceClosed"; policy_service_->RemoveObserver(policy::POLICY_DOMAIN_CHROME, this); policy_service_ = nullptr; + initial_policies_hash_.clear(); } void ArcPolicyBridge::GetPolicies(const GetPoliciesCallback& callback) { VLOG(1) << "ArcPolicyBridge::GetPolicies"; - if (!is_managed_) { - callback.Run(std::string()); + callback.Run(GetCurrentJSONPolicies()); +} + +void ArcPolicyBridge::ReportCompliance( + const std::string& request, + const ReportComplianceCallback& callback) { + VLOG(1) << "ArcPolicyBridge::ReportCompliance"; + safe_json::SafeJsonParser::Parse( + request, base::Bind(&ArcPolicyBridge::OnReportComplianceParseSuccess, + weak_ptr_factory_.GetWeakPtr(), callback), + base::Bind(&OnReportComplianceParseFailure, callback)); +} + +void ArcPolicyBridge::OnPolicyUpdated(const policy::PolicyNamespace& ns, + const policy::PolicyMap& previous, + const policy::PolicyMap& current) { + VLOG(1) << "ArcPolicyBridge::OnPolicyUpdated"; + auto* instance = ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->policy(), + OnPolicyUpdated); + if (!instance) return; + + const std::string policies_hash = GetPoliciesHash(GetCurrentJSONPolicies()); + if (policies_hash != update_notification_policies_hash_) { + update_notification_policies_hash_ = policies_hash; + update_notification_time_ = base::Time::Now(); + compliance_since_update_timing_reported_ = false; } + + instance->OnPolicyUpdated(); +} + +void ArcPolicyBridge::InitializePolicyService() { + auto* profile_policy_connector = + policy::ProfilePolicyConnectorFactory::GetForBrowserContext(GetProfile()); + policy_service_ = profile_policy_connector->policy_service(); + is_managed_ = profile_policy_connector->IsManaged(); +} + +std::string ArcPolicyBridge::GetCurrentJSONPolicies() const { + if (!is_managed_) + return std::string(); const policy::PolicyNamespace policy_namespace(policy::POLICY_DOMAIN_CHROME, std::string()); const policy::PolicyMap& policy_map = policy_service_->GetPolicies(policy_namespace); - callback.Run(GetFilteredJSONPolicies(policy_map)); + return GetFilteredJSONPolicies(policy_map); } -void OnReportComplianceParseSuccess( +void ArcPolicyBridge::OnReportComplianceParseSuccess( const ArcPolicyBridge::ReportComplianceCallback& callback, std::unique_ptr<base::Value> parsed_json) { const base::DictionaryValue* dict; - if (!parsed_json || !parsed_json->GetAsDictionary(&dict)) { - callback.Run(kPolicyNonCompliantJson); - return; - } - - const user_manager::User* const primary_user = - user_manager::UserManager::Get()->GetPrimaryUser(); - Profile* const profile = - chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); - if (!dict || !profile) { + Profile* const profile = GetProfile(); + if (!profile || !parsed_json || !parsed_json->GetAsDictionary(&dict) || + !dict) { callback.Run(kPolicyNonCompliantJson); return; } @@ -345,43 +429,40 @@ } profile->GetPrefs()->SetBoolean(prefs::kArcPolicyCompliant, compliant); callback.Run(compliant ? kPolicyCompliantJson : kPolicyNonCompliantJson); + + UpdateComplianceReportMetrics(dict); } -void OnReportComplianceParseFailure( - const ArcPolicyBridge::ReportComplianceCallback& callback, - const std::string& error) { - callback.Run(kPolicyNonCompliantJson); -} - -void ArcPolicyBridge::ReportCompliance( - const std::string& request, - const ReportComplianceCallback& callback) { - VLOG(1) << "ArcPolicyBridge::ReportCompliance"; - safe_json::SafeJsonParser::Parse( - request, base::Bind(&OnReportComplianceParseSuccess, callback), - base::Bind(&OnReportComplianceParseFailure, callback)); -} - -void ArcPolicyBridge::OnPolicyUpdated(const policy::PolicyNamespace& ns, - const policy::PolicyMap& previous, - const policy::PolicyMap& current) { - VLOG(1) << "ArcPolicyBridge::OnPolicyUpdated"; - auto* instance = ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service()->policy(), - OnPolicyUpdated); - if (!instance) +void ArcPolicyBridge::UpdateComplianceReportMetrics( + const base::DictionaryValue* report) { + bool is_arc_plus_plus_report_successful = false; + report->GetBoolean("isArcPlusPlusReportSuccessful", + &is_arc_plus_plus_report_successful); + std::string reported_policies_hash; + report->GetString("policyHash", &reported_policies_hash); + if (!is_arc_plus_plus_report_successful || reported_policies_hash.empty()) return; - instance->OnPolicyUpdated(); -} -void ArcPolicyBridge::InitializePolicyService() { - const user_manager::User* const primary_user = - user_manager::UserManager::Get()->GetPrimaryUser(); - Profile* const profile = - chromeos::ProfileHelper::Get()->GetProfileByUser(primary_user); - auto* profile_policy_connector = - policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile); - policy_service_ = profile_policy_connector->policy_service(); - is_managed_ = profile_policy_connector->IsManaged(); + const base::Time now = base::Time::Now(); + ArcSessionManager* const session_manager = ArcSessionManager::Get(); + + if (reported_policies_hash == initial_policies_hash_ && + !first_compliance_timing_reported_) { + const base::Time sign_in_start_time = session_manager->sign_in_start_time(); + if (!sign_in_start_time.is_null()) { + UpdateFirstComplianceSinceSignInTiming(now - sign_in_start_time); + } else { + UpdateFirstComplianceSinceStartupTiming( + now - session_manager->arc_start_time()); + } + first_compliance_timing_reported_ = true; + } + + if (reported_policies_hash == update_notification_policies_hash_ && + !compliance_since_update_timing_reported_) { + UpdateComplianceSinceUpdateTiming(now - update_notification_time_); + compliance_since_update_timing_reported_ = true; + } } } // namespace arc
diff --git a/chrome/browser/chromeos/arc/policy/arc_policy_bridge.h b/chrome/browser/chromeos/arc/policy/arc_policy_bridge.h index 9c889b2..2e1c0854 100644 --- a/chrome/browser/chromeos/arc/policy/arc_policy_bridge.h +++ b/chrome/browser/chromeos/arc/policy/arc_policy_bridge.h
@@ -8,9 +8,12 @@ #include <string> #include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/time/time.h" #include "components/arc/arc_service.h" #include "components/arc/common/policy.mojom.h" #include "components/arc/instance_holder.h" +#include "components/policy/core/common/policy_namespace.h" #include "components/policy/core/common/policy_service.h" #include "components/pref_registry/pref_registry_syncable.h" #include "mojo/public/cpp/bindings/binding.h" @@ -63,10 +66,38 @@ private: void InitializePolicyService(); + // Returns the current policies for ARC, in the JSON dump format. + std::string GetCurrentJSONPolicies() const; + + // Called when the compliance report from ARC is parsed. + void OnReportComplianceParseSuccess( + const ArcPolicyBridge::ReportComplianceCallback& callback, + std::unique_ptr<base::Value> parsed_json); + + void UpdateComplianceReportMetrics(const base::DictionaryValue* report); + mojo::Binding<PolicyHost> binding_; policy::PolicyService* policy_service_ = nullptr; bool is_managed_ = false; + // Hash of the policies that were up to date when ARC started. + std::string initial_policies_hash_; + // Whether the UMA metric for the first successfully obtained compliance + // report was already reported. + bool first_compliance_timing_reported_ = false; + // Hash of the policies that were up to date when the most recent policy + // update notification was sent to ARC. + std::string update_notification_policies_hash_; + // The time of the policy update notification sent when the policy with hash + // equal to |update_notification_policy_hash_| was active. + base::Time update_notification_time_; + // Whether the UMA metric for the successfully obtained compliance report + // since the most recent policy update notificaton was already reported. + bool compliance_since_update_timing_reported_ = false; + + // Must be the last member. + base::WeakPtrFactory<ArcPolicyBridge> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(ArcPolicyBridge); };
diff --git a/chrome/browser/chromeos/file_system_provider/service.cc b/chrome/browser/chromeos/file_system_provider/service.cc index 5b81587..0f5a5ba 100644 --- a/chrome/browser/chromeos/file_system_provider/service.cc +++ b/chrome/browser/chromeos/file_system_provider/service.cc
@@ -123,49 +123,12 @@ MountContext context) { DCHECK(thread_checker_.CalledOnValidThread()); - // If already exists a file system provided by the same extension with this - // id, then abort. - if (GetProvidedFileSystem(extension_id, options.file_system_id)) { - for (auto& observer : observers_) { - observer.OnProvidedFileSystemMount(ProvidedFileSystemInfo(), context, - base::File::FILE_ERROR_EXISTS); - } - return base::File::FILE_ERROR_EXISTS; - } - - // Restrict number of file systems to prevent system abusing. - if (file_system_map_.size() + 1 > kMaxFileSystems) { - for (auto& observer : observers_) { - observer.OnProvidedFileSystemMount( - ProvidedFileSystemInfo(), context, - base::File::FILE_ERROR_TOO_MANY_OPENED); - } - return base::File::FILE_ERROR_TOO_MANY_OPENED; - } - - storage::ExternalMountPoints* const mount_points = - storage::ExternalMountPoints::GetSystemInstance(); - DCHECK(mount_points); - // The mount point path and name are unique per system, since they are system // wide. This is necessary for copying between profiles. const base::FilePath& mount_path = util::GetMountPath(profile_, extension_id, options.file_system_id); const std::string mount_point_name = mount_path.BaseName().AsUTF8Unsafe(); - if (!mount_points->RegisterFileSystem( - mount_point_name, storage::kFileSystemTypeProvided, - storage::FileSystemMountOption( - storage::FlushPolicy::FLUSH_ON_COMPLETION), - mount_path)) { - for (auto& observer : observers_) { - observer.OnProvidedFileSystemMount( - ProvidedFileSystemInfo(), context, - base::File::FILE_ERROR_INVALID_OPERATION); - } - return base::File::FILE_ERROR_INVALID_OPERATION; - } - ProvidingExtensionInfo provider_info; // TODO(mtomasz): Set up a testing extension in unit tests. GetProvidingExtensionInfo(extension_id, &provider_info); @@ -186,6 +149,43 @@ provider_info.capabilities.watchable(), provider_info.capabilities.source()); + // If already exists a file system provided by the same extension with this + // id, then abort. + if (GetProvidedFileSystem(extension_id, options.file_system_id)) { + for (auto& observer : observers_) { + observer.OnProvidedFileSystemMount(file_system_info, context, + base::File::FILE_ERROR_EXISTS); + } + return base::File::FILE_ERROR_EXISTS; + } + + // Restrict number of file systems to prevent system abusing. + if (file_system_map_.size() + 1 > kMaxFileSystems) { + for (auto& observer : observers_) { + observer.OnProvidedFileSystemMount( + ProvidedFileSystemInfo(), context, + base::File::FILE_ERROR_TOO_MANY_OPENED); + } + return base::File::FILE_ERROR_TOO_MANY_OPENED; + } + + storage::ExternalMountPoints* const mount_points = + storage::ExternalMountPoints::GetSystemInstance(); + DCHECK(mount_points); + + if (!mount_points->RegisterFileSystem( + mount_point_name, storage::kFileSystemTypeProvided, + storage::FileSystemMountOption( + storage::FlushPolicy::FLUSH_ON_COMPLETION), + mount_path)) { + for (auto& observer : observers_) { + observer.OnProvidedFileSystemMount( + ProvidedFileSystemInfo(), context, + base::File::FILE_ERROR_INVALID_OPERATION); + } + return base::File::FILE_ERROR_INVALID_OPERATION; + } + std::unique_ptr<ProvidedFileSystemInterface> file_system = file_system_factory_.Run(profile_, file_system_info); DCHECK(file_system);
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc index f7cec97..882f8e6 100644 --- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc +++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc
@@ -45,6 +45,10 @@ void DeviceCloudPolicyStoreChromeOS::Store( const em::PolicyFetchResponse& policy) { + // The policy and the public key must have already been loaded by the device + // settings service. + DCHECK(is_initialized()); + // Cancel all pending requests. weak_factory_.InvalidateWeakPtrs();
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h index ec84452..1598291 100644 --- a/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h +++ b/chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h
@@ -43,6 +43,8 @@ ~DeviceCloudPolicyStoreChromeOS() override; // CloudPolicyStore: + // Note that Store() must not be called before the store gets initialized (by + // means of either Load() or InstallInitialPolicy()). void Store(const enterprise_management::PolicyFetchResponse& policy) override; void Load() override;
diff --git a/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc b/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc index 5a989cbd..7b345b23 100644 --- a/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc +++ b/chrome/browser/component_updater/subresource_filter_component_installer_unittest.cc
@@ -170,7 +170,7 @@ base::FieldTrialList field_trial_list(nullptr); subresource_filter::testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle(base::FeatureList::OVERRIDE_DISABLE_FEATURE, - subresource_filter::kActivationStateEnabled, + subresource_filter::kActivationLevelEnabled, subresource_filter::kActivationScopeNoSites); std::unique_ptr<SubresourceFilterMockComponentUpdateService> component_updater(new SubresourceFilterMockComponentUpdateService()); @@ -184,7 +184,7 @@ base::FieldTrialList field_trial_list(nullptr); subresource_filter::testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle(base::FeatureList::OVERRIDE_ENABLE_FEATURE, - subresource_filter::kActivationStateDisabled, + subresource_filter::kActivationLevelDisabled, subresource_filter::kActivationScopeNoSites); std::unique_ptr<SubresourceFilterMockComponentUpdateService> component_updater(new SubresourceFilterMockComponentUpdateService());
diff --git a/chrome/browser/content_settings/OWNERS b/chrome/browser/content_settings/OWNERS index 6cf76130..eac22b71 100644 --- a/chrome/browser/content_settings/OWNERS +++ b/chrome/browser/content_settings/OWNERS
@@ -2,3 +2,5 @@ markusheintz@chromium.org msramek@chromium.org raymes@chromium.org + +# COMPONENT: Internals>Permissions>Model
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index 61540ec..d7fe28e 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc
@@ -138,9 +138,7 @@ #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) should_open_pdf_in_system_reader_ = - prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader) || - prefs->GetBoolean(prefs::kPluginsAlwaysOpenPdfExternally); - disable_adobe_version_check_for_tests_ = false; + prefs->GetBoolean(prefs::kOpenPdfDownloadInSystemReader); #endif // If the download path is dangerous we forcefully reset it. But if we do @@ -342,26 +340,22 @@ #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) void DownloadPrefs::SetShouldOpenPdfInSystemReader(bool should_open) { - should_open_pdf_in_system_reader_ = should_open || - profile_->GetPrefs()->GetBoolean(prefs::kPluginsAlwaysOpenPdfExternally); + if (should_open_pdf_in_system_reader_ == should_open) + return; + should_open_pdf_in_system_reader_ = should_open; profile_->GetPrefs()->SetBoolean(prefs::kOpenPdfDownloadInSystemReader, should_open); } bool DownloadPrefs::ShouldOpenPdfInSystemReader() const { #if defined(OS_WIN) - if (!disable_adobe_version_check_for_tests_ && - IsAdobeReaderDefaultPDFViewer() && + if (IsAdobeReaderDefaultPDFViewer() && !DownloadTargetDeterminer::IsAdobeReaderUpToDate()) { return false; } #endif return should_open_pdf_in_system_reader_; } - -void DownloadPrefs::DisableAdobeVersionCheckForTests() { - disable_adobe_version_check_for_tests_ = true; -} #endif void DownloadPrefs::ResetAutoOpen() {
diff --git a/chrome/browser/download/download_prefs.h b/chrome/browser/download/download_prefs.h index df21f0a..d0c8cfa 100644 --- a/chrome/browser/download/download_prefs.h +++ b/chrome/browser/download/download_prefs.h
@@ -8,7 +8,6 @@ #include <set> #include "base/files/file_path.h" -#include "base/gtest_prod_util.h" #include "base/macros.h" #include "build/build_config.h" #include "components/prefs/pref_member.h" @@ -87,12 +86,8 @@ // Return whether the user prefers to open PDF downloads in the platform's // default reader. bool ShouldOpenPdfInSystemReader() const; - - // Used by tests to disable version checks for Adobe. - void DisableAdobeVersionCheckForTests(); #endif - void ResetAutoOpen(); private: @@ -116,7 +111,6 @@ #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) bool should_open_pdf_in_system_reader_; - bool disable_adobe_version_check_for_tests_; #endif DISALLOW_COPY_AND_ASSIGN(DownloadPrefs);
diff --git a/chrome/browser/download/download_prefs_unittest.cc b/chrome/browser/download/download_prefs_unittest.cc index 1e5dfe34..68406f6 100644 --- a/chrome/browser/download/download_prefs_unittest.cc +++ b/chrome/browser/download/download_prefs_unittest.cc
@@ -117,18 +117,3 @@ EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( base::FilePath(FILE_PATH_LITERAL("x.Bar")))); } - -#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) -TEST(DownloadPrefsTest, AlwaysOpenPdfExternally) { - content::TestBrowserThreadBundle threads_are_required_for_testing_profile; - TestingProfile profile; - profile.GetPrefs()->SetBoolean(prefs::kOpenPdfDownloadInSystemReader, false); - profile.GetPrefs()->SetBoolean(prefs::kPluginsAlwaysOpenPdfExternally, true); - DownloadPrefs prefs(&profile); - prefs.DisableAdobeVersionCheckForTests(); - - EXPECT_TRUE(prefs.ShouldOpenPdfInSystemReader()); - EXPECT_TRUE(prefs.IsAutoOpenEnabledBasedOnExtension( - base::FilePath(FILE_PATH_LITERAL("doc.pdf")))); -} -#endif
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc index c5b2f3d..45b6c3b 100644 --- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc +++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.cc
@@ -132,15 +132,14 @@ evaluator->TrackForWebContents(contents); } -void ChromeContentRulesRegistry::DidNavigateMainFrame( +void ChromeContentRulesRegistry::DidFinishNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { + content::NavigationHandle* navigation_handle) { if (base::ContainsKey(active_rules_, contents)) { EvaluationScope evaluation_scope(this); for (const std::unique_ptr<ContentPredicateEvaluator>& evaluator : evaluators_) - evaluator->OnWebContentsNavigation(contents, details, params); + evaluator->OnWebContentsNavigation(contents, navigation_handle); } }
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h index f8f52063..09ded34 100644 --- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h +++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry.h
@@ -28,8 +28,6 @@ namespace content { class BrowserContext; class WebContents; -struct FrameNavigateParams; -struct LoadCommittedDetails; } namespace extensions { @@ -69,10 +67,9 @@ // ContentRulesRegistry: void MonitorWebContentsForRuleEvaluation( content::WebContents* contents) override; - void DidNavigateMainFrame( + void DidFinishNavigation( content::WebContents* tab, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + content::NavigationHandle* navigation_handle) override; // RulesRegistry: std::string AddRulesImpl(
diff --git a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc index 7dff9dea..ad3be5b 100644 --- a/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/chrome_content_rules_registry_unittest.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h" #include "chrome/browser/extensions/test_extension_environment.h" #include "chrome/test/base/testing_profile.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "content/public/common/frame_navigate_params.h" #include "extensions/common/extension.h" @@ -77,8 +77,7 @@ void OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override { + content::NavigationHandle* navigation_handle) override { RequestEvaluationIfSpecified(); } @@ -151,8 +150,11 @@ std::unique_ptr<content::WebContents> tab = env()->MakeTab(); registry->MonitorWebContentsForRuleEvaluation(tab.get()); - registry->DidNavigateMainFrame(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tab->GetMainFrame(), true); + + registry->DidFinishNavigation(tab.get(), navigation_handle.get()); EXPECT_EQ(0u, registry->GetActiveRulesCountForTesting()); // Add a rule. @@ -179,25 +181,27 @@ "{\"page_action\": {}}")); registry->AddRulesImpl(extension->id(), rules); - registry->DidNavigateMainFrame(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + registry->DidFinishNavigation(tab.get(), navigation_handle.get()); EXPECT_EQ(0u, registry->GetActiveRulesCountForTesting()); evaluator->RequestImmediateEvaluation(tab.get(), true); EXPECT_EQ(1u, registry->GetActiveRulesCountForTesting()); // Closing the tab should erase its entry from active_rules_. + navigation_handle.reset(); tab.reset(); EXPECT_EQ(0u, registry->GetActiveRulesCountForTesting()); tab = env()->MakeTab(); + navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tab->GetMainFrame(), true); registry->MonitorWebContentsForRuleEvaluation(tab.get()); evaluator->RequestImmediateEvaluation(tab.get(), true); EXPECT_EQ(1u, registry->GetActiveRulesCountForTesting()); evaluator->RequestEvaluationOnNextOperation(tab.get(), false); - registry->DidNavigateMainFrame(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + registry->DidFinishNavigation(tab.get(), navigation_handle.get()); EXPECT_EQ(0u, registry->GetActiveRulesCountForTesting()); }
diff --git a/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h b/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h index 283d418..dd1b86b 100644 --- a/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h +++ b/chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h
@@ -13,8 +13,7 @@ namespace content { class BrowserContext; -struct FrameNavigateParams; -struct LoadCommittedDetails; +class NavigationHandle; class WebContents; } // namespace content @@ -92,8 +91,7 @@ // would still be evaluated based on the previous URL. virtual void OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) = 0; + content::NavigationHandle* navigation_handle) = 0; // Returns true if |predicate| evaluates to true on the state associated with // |tab|. It must be the case that predicate->GetEvaluator() == this object,
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.cc index 82c25da..2f52275a 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/extensions/api/declarative_content/content_constants.h" #include "chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h" #include "chrome/browser/profiles/profile.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/render_process_host.h" @@ -98,9 +98,8 @@ } void DeclarativeContentCssConditionTracker::PerWebContentsTracker:: -OnWebContentsNavigation(const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { - if (details.is_in_page) { +OnWebContentsNavigation(content::NavigationHandle* navigation_handle) { + if (navigation_handle->IsSamePage()) { // Within-page navigations don't change the set of elements that // exist, and we only support filtering on the top-level URL, so // this can't change which rules match. @@ -232,10 +231,10 @@ void DeclarativeContentCssConditionTracker::OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { + content::NavigationHandle* navigation_handle) { DCHECK(base::ContainsKey(per_web_contents_tracker_, contents)); - per_web_contents_tracker_[contents]->OnWebContentsNavigation(details, params); + per_web_contents_tracker_[contents]->OnWebContentsNavigation( + navigation_handle); } bool DeclarativeContentCssConditionTracker::EvaluatePredicate(
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.h b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.h index bf0fc7b..e4845c1 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.h +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker.h
@@ -24,13 +24,6 @@ class Value; } -namespace content { -struct FrameNavigateParams; -struct LoadCommittedDetails; -class RenderProcessHost; -class WebContents; -} - namespace extensions { class Extension; @@ -86,8 +79,7 @@ void TrackForWebContents(content::WebContents* contents) override; void OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + content::NavigationHandle* navigation_handle) override; bool EvaluatePredicate(const ContentPredicate* predicate, content::WebContents* tab) const override; @@ -106,8 +98,7 @@ const WebContentsDestroyedCallback& web_contents_destroyed); ~PerWebContentsTracker() override; - void OnWebContentsNavigation(const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params); + void OnWebContentsNavigation(content::NavigationHandle* navigation_handle); const base::hash_set<std::string>& matching_css_selectors() const { return matching_css_selectors_;
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc index d183f57..3f6ee17 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_css_condition_tracker_unittest.cc
@@ -11,7 +11,7 @@ #include "base/test/values_test_util.h" #include "chrome/browser/extensions/api/declarative_content/content_predicate_evaluator.h" #include "chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_test.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "content/public/test/mock_render_process_host.h" #include "extensions/common/extension_messages.h" @@ -301,10 +301,10 @@ // Check that an in-page navigation has no effect on the matching selectors. { - content::LoadCommittedDetails details; - details.is_in_page = true; - content::FrameNavigateParams params; - tracker_.OnWebContentsNavigation(tab.get(), details, params); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tab->GetMainFrame(), true, net::OK, true); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_TRUE(tracker_.EvaluatePredicate(predicate.get(), tab.get())); EXPECT_EQ(expected_evaluation_requests, delegate_.evaluation_requests()); } @@ -312,10 +312,10 @@ // Check that a non in-page navigation clears the matching selectors and // requests condition evaluation. { - content::LoadCommittedDetails details; - details.is_in_page = false; - content::FrameNavigateParams params; - tracker_.OnWebContentsNavigation(tab.get(), details, params); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tab->GetMainFrame(), true); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_FALSE(tracker_.EvaluatePredicate(predicate.get(), tab.get())); EXPECT_EQ(++expected_evaluation_requests, delegate_.evaluation_requests()); }
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc index 884a756..da63f2f 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.cc
@@ -200,8 +200,7 @@ void DeclarativeContentIsBookmarkedConditionTracker::OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { + content::NavigationHandle* navigation_handle) { DCHECK(base::ContainsKey(per_web_contents_tracker_, contents)); per_web_contents_tracker_[contents]->UpdateState(true); }
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.h b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.h index 88cc0806..e8307fc5 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.h +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker.h
@@ -22,13 +22,6 @@ class Value; } -namespace content { -class BrowserContext; -struct FrameNavigateParams; -struct LoadCommittedDetails; -class WebContents; -} - namespace extensions { // Tests the bookmarked state of the page. @@ -89,8 +82,7 @@ void TrackForWebContents(content::WebContents* contents) override; void OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + content::NavigationHandle* navigation_handle) override; bool EvaluatePredicate(const ContentPredicate* predicate, content::WebContents* tab) const override;
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc index 44fcb66..7e2218c 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_is_bookmarked_condition_tracker_unittest.cc
@@ -22,7 +22,7 @@ #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" #include "components/bookmarks/test/bookmark_test_helpers.h" #include "content/public/browser/navigation_controller.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" @@ -238,9 +238,10 @@ // Navigate the first tab to a URL that we will bookmark. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://bookmarked/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tabs[0]->GetMainFrame(), true); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), false)); @@ -283,9 +284,10 @@ // Navigate the first tab to a URL that we will bookmark. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://bookmarked/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tabs[0]->GetMainFrame(), true); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), false)); @@ -386,9 +388,10 @@ // Navigate the first tab to one bookmarked URL. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://bookmarked1/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tabs[0]->GetMainFrame(), true); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), true)); @@ -399,9 +402,7 @@ // bookmarked state hasn't. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://bookmarked2/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), true)); @@ -410,9 +411,7 @@ // Navigate the first tab to a non-bookmarked URL. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://not-bookmarked1/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), false)); @@ -423,9 +422,7 @@ // bookmarked state hasn't. delegate_.evaluation_requests().clear(); LoadURL(tabs[0].get(), GURL("http://not-bookmarked2/")); - tracker_->OnWebContentsNavigation(tabs[0].get(), - content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_->OnWebContentsNavigation(tabs[0].get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tabs[0].get())); EXPECT_TRUE(CheckPredicates(tabs[0].get(), false));
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.cc index e6271fe..ef185b0a 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.cc
@@ -192,8 +192,7 @@ void DeclarativeContentPageUrlConditionTracker::OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { + content::NavigationHandle* navigation_handle) { DCHECK(base::ContainsKey(per_web_contents_tracker_, contents)); per_web_contents_tracker_[contents]->UpdateMatchesForCurrentUrl(true); }
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.h b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.h index e8226bd..82fe962 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.h +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker.h
@@ -20,12 +20,6 @@ class Value; } -namespace content { -struct FrameNavigateParams; -struct LoadCommittedDetails; -class WebContents; -} - namespace extensions { class Extension; @@ -85,8 +79,7 @@ void TrackForWebContents(content::WebContents* contents) override; void OnWebContentsNavigation( content::WebContents* contents, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + content::NavigationHandle* navigation_handle) override; bool EvaluatePredicate(const ContentPredicate* predicate, content::WebContents* tab) const override;
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc index a719121..88bcc92 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_page_url_condition_tracker_unittest.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/extensions/api/declarative_content/declarative_content_condition_tracker_test.h" #include "components/url_matcher/url_matcher.h" #include "content/public/browser/navigation_controller.h" -#include "content/public/browser/navigation_details.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "testing/gmock/include/gmock/gmock.h" @@ -252,8 +252,10 @@ // evaluation request. LoadURL(tab.get(), GURL("http://test1/")); delegate_.evaluation_requests().clear(); - tracker_.OnWebContentsNavigation(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + std::unique_ptr<content::NavigationHandle> navigation_handle = + content::NavigationHandle::CreateNavigationHandleForTesting( + GURL(), tab->GetMainFrame(), true); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tab.get())); @@ -261,8 +263,7 @@ // URL results in an evaluation request. LoadURL(tab.get(), GURL("http://test1/a")); delegate_.evaluation_requests().clear(); - tracker_.OnWebContentsNavigation(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tab.get())); @@ -270,8 +271,7 @@ // URL results in an evaluation request. delegate_.evaluation_requests().clear(); LoadURL(tab.get(), GURL("http://test2/")); - tracker_.OnWebContentsNavigation(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tab.get())); @@ -279,8 +279,7 @@ // non-matching URL results in an evaluation request. delegate_.evaluation_requests().clear(); LoadURL(tab.get(), GURL("http://test2/a")); - tracker_.OnWebContentsNavigation(tab.get(), content::LoadCommittedDetails(), - content::FrameNavigateParams()); + tracker_.OnWebContentsNavigation(tab.get(), navigation_handle.get()); EXPECT_THAT(delegate_.evaluation_requests(), UnorderedElementsAre(tab.get()));
diff --git a/chrome/browser/extensions/bookmark_app_helper.cc b/chrome/browser/extensions/bookmark_app_helper.cc index a70c1b2..48630af 100644 --- a/chrome/browser/extensions/bookmark_app_helper.cc +++ b/chrome/browser/extensions/bookmark_app_helper.cc
@@ -28,8 +28,10 @@ #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/web_applications/web_app.h" +#include "chrome/browser/webshare/share_target_pref_helper.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" +#include "chrome/common/origin_trials/chrome_origin_trial_policy.h" #include "chrome/common/url_constants.h" #include "chrome/grit/platform_locale_settings.h" #include "components/prefs/pref_service.h" @@ -583,6 +585,22 @@ UpdateWebAppInfoFromManifest(manifest, &web_app_info_); + if (!ChromeOriginTrialPolicy().IsFeatureDisabled("WebShare")) { + const std::string& manifest_url_string = manifest_url.spec(); + + base::Optional<std::string> url_template; + if (manifest.share_target.has_value() && + !manifest.share_target.value().url_template.is_null()) { + url_template = base::Optional<std::string>(base::UTF16ToUTF8( + manifest.share_target.value().url_template.string())); + } + + // Add this site as a share target, if it declares a url_template in its + // manifest, or remove if it doesn't. + UpdateShareTargetInPrefs(manifest_url_string, std::move(url_template), + profile_->GetPrefs()); + } + // Add urls from the WebApplicationInfo. std::vector<GURL> web_app_info_icon_urls; for (std::vector<WebApplicationInfo::IconInfo>::const_iterator it =
diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc index ffa77a41..1f884a01 100644 --- a/chrome/browser/extensions/extension_action.cc +++ b/chrome/browser/extensions/extension_action.cc
@@ -15,7 +15,6 @@ #include "extensions/browser/extension_icon_placeholder.h" #include "extensions/common/constants.h" #include "extensions/common/extension_icon_set.h" -#include "extensions/common/feature_switch.h" #include "extensions/common/manifest_handlers/icons_handler.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_utils.h" @@ -237,16 +236,13 @@ return default_icon_image_->image(); if (placeholder_icon_image_.IsEmpty()) { - // If the extension action redesign is enabled, we use a special placeholder - // icon (with the first letter of the extension name) rather than the - // default (puzzle piece). - if (extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()) { - placeholder_icon_image_ = - extensions::ExtensionIconPlaceholder::CreateImage(ActionIconSize(), - extension_name_); - } else { - placeholder_icon_image_ = FallbackIcon(); - } + // For extension actions, we use a special placeholder icon (with the first + // letter of the extension name) rather than the default (puzzle piece). + // Note that this is only if we can't find any better image (e.g. a product + // icon). + placeholder_icon_image_ = + extensions::ExtensionIconPlaceholder::CreateImage(ActionIconSize(), + extension_name_); } return placeholder_icon_image_; @@ -320,6 +316,5 @@ // If no icon has been set and there is no default icon, we need favicon // width. - return ui::ResourceBundle::GetSharedInstance().GetImageNamed( - IDR_EXTENSIONS_FAVICON).Width(); + return FallbackIcon().Width(); }
diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc index 47188646..a6352bd 100644 --- a/chrome/browser/extensions/tab_helper.cc +++ b/chrome/browser/extensions/tab_helper.cc
@@ -40,8 +40,8 @@ #include "chrome/common/url_constants.h" #include "content/public/browser/invalidate_type.h" #include "content/public/browser/navigation_controller.h" -#include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_entry.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" @@ -316,12 +316,14 @@ SetTabId(host); } -void TabHelper::DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { +void TabHelper::DidFinishNavigation( + content::NavigationHandle* navigation_handle) { + if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) + return; + InvokeForContentRulesRegistries( - [this, &details, ¶ms](ContentRulesRegistry* registry) { - registry->DidNavigateMainFrame(web_contents(), details, params); + [this, navigation_handle](ContentRulesRegistry* registry) { + registry->DidFinishNavigation(web_contents(), navigation_handle); }); content::BrowserContext* context = web_contents()->GetBrowserContext(); @@ -338,14 +340,15 @@ SetExtensionApp(extension); } else { UpdateExtensionAppIcon( - enabled_extensions.GetExtensionOrAppByURL(params.url)); + enabled_extensions.GetExtensionOrAppByURL( + navigation_handle->GetURL())); } } else { UpdateExtensionAppIcon( - enabled_extensions.GetExtensionOrAppByURL(params.url)); + enabled_extensions.GetExtensionOrAppByURL(navigation_handle->GetURL())); } - if (!details.is_in_page) + if (!navigation_handle->IsSamePage()) ExtensionActionAPI::Get(context)->ClearAllValuesForTab(web_contents()); }
diff --git a/chrome/browser/extensions/tab_helper.h b/chrome/browser/extensions/tab_helper.h index 3079485..7e35391 100644 --- a/chrome/browser/extensions/tab_helper.h +++ b/chrome/browser/extensions/tab_helper.h
@@ -30,11 +30,6 @@ #include "extensions/common/stack_frame.h" #include "third_party/skia/include/core/SkBitmap.h" -namespace content { -struct LoadCommittedDetails; -class RenderFrameHost; -} - namespace gfx { class Image; } @@ -149,9 +144,8 @@ // content::WebContentsObserver overrides. void RenderFrameCreated(content::RenderFrameHost* host) override; - void DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override; bool OnMessageReceived(const IPC::Message& message) override; bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override;
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index f5b22c7b..e5f48f7 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc
@@ -596,8 +596,8 @@ // Add built-in logs ct_verifier->AddLogs(globals_->ct_logs); - ct_tree_tracker_.reset( - new certificate_transparency::TreeStateTracker(globals_->ct_logs)); + ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( + globals_->ct_logs, net_log_)); // Register the ct_tree_tracker_ as observer for new STHs. RegisterSTHObserver(ct_tree_tracker_.get()); // Register the ct_tree_tracker_ as observer for verified SCTs.
diff --git a/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc b/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc index 6d9a4aa..f7931d25 100644 --- a/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_video_quality_browsertest.cc
@@ -87,7 +87,7 @@ // FileVideoCaptureDevice and its sibling with kYuvFileExtension is used for // comparison. // -// You must also compile the chromium_builder_webrtc target before you run this +// You must also compile the frame_analyzer target before you run this // test to get all the tools built. // // The external compare_videos.py script also depends on two external @@ -198,7 +198,7 @@ if (!base::PathExists(path_to_analyzer)) { LOG(ERROR) << "Missing frame analyzer: should be in " << path_to_analyzer.value() - << ". Try building the chromium_builder_webrtc target."; + << ". Try building the frame_analyzer target."; return false; } if (!base::PathExists(path_to_compare_script)) {
diff --git a/chrome/browser/ntp_snippets/download_suggestions_provider.cc b/chrome/browser/ntp_snippets/download_suggestions_provider.cc index 2b43b4eb..c47a54d 100644 --- a/chrome/browser/ntp_snippets/download_suggestions_provider.cc +++ b/chrome/browser/ntp_snippets/download_suggestions_provider.cc
@@ -319,7 +319,9 @@ void DownloadSuggestionsProvider::OfflinePageModelLoaded( offline_pages::OfflinePageModel* model) { DCHECK_EQ(offline_page_model_, model); - AsynchronouslyFetchOfflinePagesDownloads(/*notify=*/true); + // Ignored. We issue a fetch in the constructor (or when Downloads Manager is + // loaded) and Offline Page model answers asynchronously once it has been + // loaded. } void DownloadSuggestionsProvider::OfflinePageAdded(
diff --git a/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc b/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc index 3afefa7..f63cfce 100644 --- a/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc +++ b/chrome/browser/ntp_snippets/download_suggestions_provider_unittest.cc
@@ -810,8 +810,7 @@ EXPECT_THAT(GetDismissedSuggestions(), SizeIs(1)); } -TEST_F(DownloadSuggestionsProviderTest, - ShouldFetchAssetDownloadsOnStartupButOnlyOnce) { +TEST_F(DownloadSuggestionsProviderTest, ShouldFetchAssetDownloadsOnStartup) { IgnoreOnCategoryStatusChangedToAvailable(); *(downloads_manager()->mutable_items()) = CreateDummyAssetDownloads({1, 2}); @@ -824,6 +823,20 @@ } TEST_F(DownloadSuggestionsProviderTest, + ShouldFetchOfflinePageDownloadsOnStartup) { + IgnoreOnCategoryStatusChangedToAvailable(); + + *(offline_pages_model()->mutable_items()) = CreateDummyOfflinePages({1, 2}); + offline_pages_model()->set_is_loaded(true); + EXPECT_CALL(*observer(), OnNewSuggestions(_, downloads_category(), + UnorderedElementsAre( + HasUrl("http://dummy.com/1"), + HasUrl("http://dummy.com/2")))); + CreateProvider(/*show_assets=*/false, /*show_offline_pages=*/true); + FireOfflinePageModelLoaded(); +} + +TEST_F(DownloadSuggestionsProviderTest, ShouldFetchAssetDownloadsOnHistoryQueryComplete) { IgnoreOnCategoryStatusChangedToAvailable(); @@ -896,38 +909,6 @@ (*downloads_manager()->mutable_items())[0]->NotifyDownloadUpdated(); } -TEST_F(DownloadSuggestionsProviderTest, ShouldLoadOfflinePagesOnModelLoaded) { - IgnoreOnCategoryStatusChangedToAvailable(); - IgnoreOnSuggestionInvalidated(); - - offline_pages_model()->set_is_loaded(false); - EXPECT_CALL(*observer(), - OnNewSuggestions(_, downloads_category(), IsEmpty())); - CreateProvider(/*show_assets=*/false, /*show_offline_pages=*/true); - - *(offline_pages_model()->mutable_items()) = CreateDummyOfflinePages({1, 2}); - offline_pages_model()->set_is_loaded(true); - EXPECT_CALL(*observer(), OnNewSuggestions(_, downloads_category(), - UnorderedElementsAre( - HasUrl("http://dummy.com/1"), - HasUrl("http://dummy.com/2")))); - FireOfflinePageModelLoaded(); -} - -TEST_F(DownloadSuggestionsProviderTest, - ShouldLoadOfflinePagesIfMissesOnModelLoaded) { - IgnoreOnCategoryStatusChangedToAvailable(); - IgnoreOnSuggestionInvalidated(); - - *(offline_pages_model()->mutable_items()) = CreateDummyOfflinePages({1, 2}); - offline_pages_model()->set_is_loaded(true); - EXPECT_CALL(*observer(), OnNewSuggestions(_, downloads_category(), - UnorderedElementsAre( - HasUrl("http://dummy.com/1"), - HasUrl("http://dummy.com/2")))); - CreateProvider(/*show_assets=*/false, /*show_offline_pages=*/true); -} - TEST_F(DownloadSuggestionsProviderTest, ShouldLoadAndSubmitMissedAssetsEvenIfOfflinePagesAreTurnedOff) { IgnoreOnCategoryStatusChangedToAvailable();
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index 2491fef..cb0ffcc 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -17,6 +17,7 @@ #include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/common/profile_management_switches.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" @@ -35,10 +36,14 @@ private: // Overridden from content::WebContentsObserver: - void DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override { - if (cloud_devices::IsCloudPrintURL(params.url)) { + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override { + if (!navigation_handle->IsInMainFrame() || + !navigation_handle->HasCommitted()) { + return; + } + + if (cloud_devices::IsCloudPrintURL(navigation_handle->GetURL())) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&SignInObserver::OnSignIn, weak_ptr_factory_.GetWeakPtr()));
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index c8f14b2..c87f3692 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc
@@ -176,6 +176,8 @@ #if defined(OS_CHROMEOS) registry->RegisterBooleanPref(prefs::kAllowScreenLock, true); #endif + + registry->RegisterDictionaryPref(prefs::kWebShareVisitedTargets); } std::string Profile::GetDebugName() {
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index 40ede50..267745d0 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc
@@ -1121,7 +1121,7 @@ main_request_context_->set_cert_transparency_verifier(ct_verifier.get()); ct_tree_tracker_.reset(new certificate_transparency::TreeStateTracker( - io_thread_globals->ct_logs)); + io_thread_globals->ct_logs, io_thread->net_log())); ct_verifier->SetObserver(ct_tree_tracker_.get()); cert_transparency_verifier_ = std::move(ct_verifier);
diff --git a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js index 8b09ce1..a4b4d24 100644 --- a/chrome/browser/resources/chromeos/login/screen_gaia_signin.js +++ b/chrome/browser/resources/chromeos/login/screen_gaia_signin.js
@@ -1091,8 +1091,7 @@ ADAuthUI.realm = params['realm']; ADAuthUI.userRealm = '@' + params['realm']; } - if ('email' in params) - ADAuthUI.setUser(params['email']); + ADAuthUI.setUser(params['email']); this.onAuthReady_(); },
diff --git a/chrome/browser/resources/md_bookmarks/item.html b/chrome/browser/resources/md_bookmarks/item.html index 56a27dc6..a00cb8f 100644 --- a/chrome/browser/resources/md_bookmarks/item.html +++ b/chrome/browser/resources/md_bookmarks/item.html
@@ -16,10 +16,6 @@ height: 40px; } - :host(:not(:last-of-type)) { - border-bottom: var(--cr-separator-line); - } - #website-title { color: var(--primary-text-color); cursor: pointer;
diff --git a/chrome/browser/resources/md_bookmarks/shared_vars.html b/chrome/browser/resources/md_bookmarks/shared_vars.html index 1889a0e..efae3f43 100644 --- a/chrome/browser/resources/md_bookmarks/shared_vars.html +++ b/chrome/browser/resources/md_bookmarks/shared_vars.html
@@ -1,5 +1,3 @@ -<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> - <style is="custom-style"> :root { --card-max-width: 960px;
diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js index 91caeab..235dc6e3 100644 --- a/chrome/browser/resources/md_history/app.crisper.js +++ b/chrome/browser/resources/md_history/app.crisper.js
@@ -37,7 +37,7 @@ // Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -Polymer({is:"history-toolbar",properties:{count:{type:Number,value:0,observer:"changeToolbarView_"},itemsSelected_:{type:Boolean,value:false,reflectToAttribute:true},searchTerm:{type:String,observer:"searchTermChanged_"},spinnerActive:{type:Boolean,value:false},hasDrawer:{type:Boolean,reflectToAttribute:true},isGroupedMode:{type:Boolean,reflectToAttribute:true},groupedRange:{type:Number,reflectToAttribute:true},groupedOffset:Number,showSyncNotice:{type:Boolean,observer:"showSyncNoticeChanged_"},syncNoticeVisible_:{type:Boolean,value:false},hasMoreResults:Boolean,querying:Boolean,queryInfo:Object,showMenuPromo:Boolean},hasDismissListeners_:false,boundOnDocumentClick_:null,boundOnDocumentKeydown_:null,detached:function(){if(this.hasDismissListeners_){document.removeEventListener("click",this.boundOnDocumentClick_);document.removeEventListener("keydown",this.boundOnDocumentKeydown_)}},get searchField(){return this.$["main-toolbar"].getSearchField()},showSearchField:function(){this.searchField.showAndFocus()},changeToolbarView_:function(){this.itemsSelected_=this.count>0},searchTermChanged_:function(){if(this.searchField.getValue()!=this.searchTerm){this.searchField.showAndFocus();this.searchField.setValue(this.searchTerm)}},showSyncNoticeChanged_:function(){if(!this.showSyncNotice)this.syncNoticeVisible_=false},onSearchChanged_:function(event){this.fire("change-query",{search:event.detail})},onInfoButtonTap_:function(e){this.syncNoticeVisible_=!this.syncNoticeVisible_;e.stopPropagation();if(this.hasDismissListeners_)return;this.boundOnDocumentClick_=this.onDocumentClick_.bind(this);this.boundOnDocumentKeydown_=this.onDocumentKeydown_.bind(this);document.addEventListener("click",this.boundOnDocumentClick_);document.addEventListener("keydown",this.boundOnDocumentKeydown_);this.hasDismissListeners_=true},onDocumentClick_:function(e){if(e.path.indexOf(this.$["sync-notice"])==-1)this.syncNoticeVisible_=false},onDocumentKeydown_:function(e){if(e.key=="Escape")this.syncNoticeVisible_=false},onClearSelectionTap_:function(){this.fire("unselect-all")},onDeleteTap_:function(){this.fire("delete-selected")},deletingAllowed_:function(){return loadTimeData.getBoolean("allowDeletingHistory")},numberOfItemsSelected_:function(count){return count>0?loadTimeData.getStringF("itemsSelected",count):""},getHistoryInterval_:function(){var info=this.queryInfo;if(!info)return;if(this.groupedRange==HistoryRange.WEEK)return info.queryInterval;if(this.groupedRange==HistoryRange.MONTH)return info.queryStartMonth},onTabSelected_:function(e){this.fire("change-query",{range:Number(e.detail.item.getAttribute("value"))})},changeOffset_:function(newOffset){if(!this.querying)this.fire("change-query",{offset:newOffset})},onTodayTap_:function(){this.changeOffset_(0)},onPrevTap_:function(){this.changeOffset_(this.groupedOffset+1)},onNextTap_:function(){this.changeOffset_(this.groupedOffset-1)},isToday_:function(){return this.groupedOffset==0}});(function(){"use strict";Polymer.IronA11yAnnouncer=Polymer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,value:""}},created:function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.instance=this}document.body.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(text){this._text="";this.async(function(){this._text=text},100)},_onIronAnnounce:function(event){if(event.detail&&event.detail.text){this.announce(event.detail.text)}}});Polymer.IronA11yAnnouncer.instance=null;Polymer.IronA11yAnnouncer.requestAvailability=function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer")}document.body.appendChild(Polymer.IronA11yAnnouncer.instance)}})();(function(){var IOS=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/);var IOS_TOUCH_SCROLLING=IOS&&IOS[1]>=8;var DEFAULT_PHYSICAL_COUNT=3;var HIDDEN_Y="-10000px";var ITEM_WIDTH=0;var ITEM_HEIGHT=1;var SECRET_TABINDEX=-100;Polymer({is:"iron-list",properties:{items:{type:Array},maxPhysicalCount:{type:Number,value:500},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},selectedAs:{type:String,value:"selected"},grid:{type:Boolean,value:false,reflectToAttribute:true},selectionEnabled:{type:Boolean,value:false},selectedItem:{type:Object,notify:true},selectedItems:{type:Object,notify:true},multiSelection:{type:Boolean,value:false}},observers:["_itemsChanged(items.*)","_selectionEnabledChanged(selectionEnabled)","_multiSelectionChanged(multiSelection)","_setOverflow(scrollTarget)"],behaviors:[Polymer.Templatizer,Polymer.IronResizableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronScrollTargetBehavior],keyBindings:{up:"_didMoveUp",down:"_didMoveDown",enter:"_didEnter"},_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_physicalIndexForKey:null,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_collection:null,_maxPages:2,_focusedItem:null,_focusedIndex:-1,_offscreenFocusedItem:null,_focusBackfillItem:null,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){var size=this.grid?this._physicalRows*this._rowHeight:this._physicalSize;return size-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollerPaddingTop},_minVirtualStart:0,get _maxVirtualStart(){return Math.max(0,this._virtualCount-this._physicalCount)},_virtualStartVal:0,set _virtualStart(val){this._virtualStartVal=Math.min(this._maxVirtualStart,Math.max(this._minVirtualStart,val))},get _virtualStart(){return this._virtualStartVal||0},_physicalStartVal:0,set _physicalStart(val){this._physicalStartVal=val%this._physicalCount;if(this._physicalStartVal<0){this._physicalStartVal=this._physicalCount+this._physicalStartVal}this._physicalEnd=(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalStart(){return this._physicalStartVal||0},_physicalCountVal:0,set _physicalCount(val){this._physicalCountVal=val;this._physicalEnd=(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal},_physicalEnd:0,get _optPhysicalSize(){if(this.grid){return this._estRowsInView*this._rowHeight*this._maxPages}return this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){if(this._firstVisibleIndexVal===null){var physicalOffset=Math.floor(this._physicalTop+this._scrollerPaddingTop);this._firstVisibleIndexVal=this._iterateItems(function(pidx,vidx){physicalOffset+=this._getPhysicalSizeIncrement(pidx);if(physicalOffset>this._scrollPosition){return this.grid?vidx-vidx%this._itemsPerRow:vidx}if(this.grid&&this._virtualCount-1===vidx){return vidx-vidx%this._itemsPerRow}})||0}return this._firstVisibleIndexVal},get lastVisibleIndex(){if(this._lastVisibleIndexVal===null){if(this.grid){var lastIndex=this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1;this._lastVisibleIndexVal=Math.min(this._virtualCount,lastIndex)}else{var physicalOffset=this._physicalTop;this._iterateItems(function(pidx,vidx){if(physicalOffset<this._scrollBottom){this._lastVisibleIndexVal=vidx}else{return true}physicalOffset+=this._getPhysicalSizeIncrement(pidx)})}}return this._lastVisibleIndexVal},get _defaultScrollTarget(){return this},get _virtualRowCount(){return Math.ceil(this._virtualCount/this._itemsPerRow)},get _estRowsInView(){return Math.ceil(this._viewportHeight/this._rowHeight)},get _physicalRows(){return Math.ceil(this._physicalCount/this._itemsPerRow)},ready:function(){this.addEventListener("focus",this._didFocus.bind(this),true)},attached:function(){if(this._physicalCount===0){this._debounceTemplate(this._render)}this.listen(this,"iron-resize","_resizeHandler")},detached:function(){this.unlisten(this,"iron-resize","_resizeHandler")},_setOverflow:function(scrollTarget){this.style.webkitOverflowScrolling=scrollTarget===this?"touch":"";this.style.overflow=scrollTarget===this?"auto":""},updateViewportBoundaries:function(){this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(window.getComputedStyle(this)["padding-top"],10);this._viewportWidth=this.$.items.offsetWidth;this._viewportHeight=this._scrollTargetHeight;this.grid&&this._updateGridMetrics()},_scrollHandler:function(){var scrollTop=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));var delta=scrollTop-this._scrollPosition;var isScrollingDown=delta>=0;this._scrollPosition=scrollTop;this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null;if(Math.abs(delta)>this._physicalSize){var idxAdjustment=Math.round(delta/this._physicalAverage)*this._itemsPerRow;this._physicalTop=this._physicalTop+delta;this._virtualStart=this._virtualStart+idxAdjustment;this._physicalStart=this._physicalStart+idxAdjustment;this._update()}else{var reusables=this._getReusables(isScrollingDown);if(isScrollingDown){this._physicalTop=reusables.physicalTop;this._virtualStart=this._virtualStart+reusables.indexes.length;this._physicalStart=this._physicalStart+reusables.indexes.length}else{this._virtualStart=this._virtualStart-reusables.indexes.length;this._physicalStart=this._physicalStart-reusables.indexes.length}if(reusables.indexes.length===0){this._increasePoolIfNeeded()}else{this._update(reusables.indexes,isScrollingDown?null:reusables.indexes)}}},_getReusables:function(fromTop){var ith,lastIth,offsetContent,physicalItemHeight;var idxs=[];var protectedOffsetContent=this._hiddenContentSize*this._ratio;var virtualStart=this._virtualStart;var virtualEnd=this._virtualEnd;var physicalCount=this._physicalCount;var physicalTop=this._physicalTop+this._scrollerPaddingTop;var scrollTop=this._scrollTop;var scrollBottom=this._scrollBottom;if(fromTop){ith=this._physicalStart;lastIth=this._physicalEnd;offsetContent=scrollTop-physicalTop}else{ith=this._physicalEnd;lastIth=this._physicalStart;offsetContent=this._physicalBottom-scrollBottom}while(true){physicalItemHeight=this._getPhysicalSizeIncrement(ith);offsetContent=offsetContent-physicalItemHeight;if(idxs.length>=physicalCount||offsetContent<=protectedOffsetContent){break}if(fromTop){if(virtualEnd+idxs.length+1>=this._virtualCount){break}if(physicalTop+physicalItemHeight>=scrollTop){break}idxs.push(ith);physicalTop=physicalTop+physicalItemHeight;ith=(ith+1)%physicalCount}else{if(virtualStart-idxs.length<=0){break}if(physicalTop+this._physicalSize-physicalItemHeight<=scrollBottom){break}idxs.push(ith);physicalTop=physicalTop-physicalItemHeight;ith=ith===0?physicalCount-1:ith-1}}return{indexes:idxs,physicalTop:physicalTop-this._scrollerPaddingTop}},_update:function(itemSet,movingUp){if(itemSet&&itemSet.length===0){return}this._manageFocus();this._assignModels(itemSet);this._updateMetrics(itemSet);if(movingUp){while(movingUp.length){var idx=movingUp.pop();this._physicalTop-=this._getPhysicalSizeIncrement(idx)}}this._positionItems();this._updateScrollerSize();this._increasePoolIfNeeded()},_createPool:function(size){var physicalItems=new Array(size);this._ensureTemplatized();for(var i=0;i<size;i++){var inst=this.stamp(null);physicalItems[i]=inst.root.querySelector("*");Polymer.dom(this).appendChild(inst.root)}return physicalItems},_increasePoolIfNeeded:function(){if(this._viewportHeight===0){return false}var self=this;var isClientFull=this._physicalBottom>=this._scrollBottom&&this._physicalTop<=this._scrollPosition;if(this._physicalSize>=this._optPhysicalSize&&isClientFull){return false}var maxPoolSize=Math.round(this._physicalCount*.5);if(!isClientFull){this._debounceTemplate(this._increasePool.bind(this,maxPoolSize));return true}this._yield(function(){self._increasePool(Math.min(maxPoolSize,Math.max(1,Math.round(50/self._templateCost))))});return true},_yield:function(cb){var g=window;var handle=g.requestIdleCallback?g.requestIdleCallback(cb):g.setTimeout(cb,16);Polymer.dom.addDebouncer({complete:function(){g.cancelIdleCallback?g.cancelIdleCallback(handle):g.clearTimeout(handle);cb()}})},_increasePool:function(missingItems){var nextPhysicalCount=Math.min(this._physicalCount+missingItems,this._virtualCount-this._virtualStart,Math.max(this.maxPhysicalCount,DEFAULT_PHYSICAL_COUNT));var prevPhysicalCount=this._physicalCount;var delta=nextPhysicalCount-prevPhysicalCount;var ts=window.performance.now();if(delta<=0){return}[].push.apply(this._physicalItems,this._createPool(delta));[].push.apply(this._physicalSizes,new Array(delta));this._physicalCount=prevPhysicalCount+delta;if(this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedIndex)&&this._getPhysicalIndex(this._focusedIndex)<this._physicalEnd){this._physicalStart=this._physicalStart+delta}this._update();this._templateCost=(window.performance.now()-ts)/delta},_render:function(){if(this.isAttached&&this._isVisible){if(this._physicalCount===0){this.updateViewportBoundaries();this._increasePool(DEFAULT_PHYSICAL_COUNT)}else{var reusables=this._getReusables(true);this._physicalTop=reusables.physicalTop;this._virtualStart=this._virtualStart+reusables.indexes.length;this._physicalStart=this._physicalStart+reusables.indexes.length;this._update(reusables.indexes);this._update()}}},_ensureTemplatized:function(){if(!this.ctor){var props={};props.__key__=true;props[this.as]=true;props[this.indexAs]=true;props[this.selectedAs]=true;props.tabIndex=true;this._instanceProps=props;this._userTemplate=Polymer.dom(this).querySelector("template");if(this._userTemplate){this.templatize(this._userTemplate)}else{console.warn("iron-list requires a template to be provided in light-dom")}}},_getStampedChildren:function(){return this._physicalItems},_forwardInstancePath:function(inst,path,value){if(path.indexOf(this.as+".")===0){this.notifyPath("items."+inst.__key__+"."+path.slice(this.as.length+1),value)}},_forwardParentProp:function(prop,value){if(this._physicalItems){this._physicalItems.forEach(function(item){item._templateInstance[prop]=value},this)}},_forwardParentPath:function(path,value){if(this._physicalItems){this._physicalItems.forEach(function(item){item._templateInstance.notifyPath(path,value,true)},this)}},_forwardItemPath:function(path,value){if(!this._physicalIndexForKey){return}var dot=path.indexOf(".");var key=path.substring(0,dot<0?path.length:dot);var idx=this._physicalIndexForKey[key];var offscreenItem=this._offscreenFocusedItem;var el=offscreenItem&&offscreenItem._templateInstance.__key__===key?offscreenItem:this._physicalItems[idx];if(!el||el._templateInstance.__key__!==key){return}if(dot>=0){path=this.as+"."+path.substring(dot+1);el._templateInstance.notifyPath(path,value,true)}else{var currentItem=el._templateInstance[this.as];if(Array.isArray(this.selectedItems)){for(var i=0;i<this.selectedItems.length;i++){if(this.selectedItems[i]===currentItem){this.set("selectedItems."+i,value);break}}}else if(this.selectedItem===currentItem){this.set("selectedItem",value)}el._templateInstance[this.as]=value}},_itemsChanged:function(change){if(change.path==="items"){this._virtualStart=0;this._physicalTop=0;this._virtualCount=this.items?this.items.length:0;this._collection=this.items?Polymer.Collection.get(this.items):null;this._physicalIndexForKey={};this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null;this._physicalCount=this._physicalCount||0;this._physicalItems=this._physicalItems||[];this._physicalSizes=this._physicalSizes||[];this._physicalStart=0;this._resetScrollPosition(0);this._removeFocusedItem();this._debounceTemplate(this._render)}else if(change.path==="items.splices"){this._adjustVirtualIndex(change.value.indexSplices);this._virtualCount=this.items?this.items.length:0;this._debounceTemplate(this._render)}else{this._forwardItemPath(change.path.split(".").slice(1).join("."),change.value)}},_adjustVirtualIndex:function(splices){splices.forEach(function(splice){splice.removed.forEach(this._removeItem,this);if(splice.index<this._virtualStart){var delta=Math.max(splice.addedCount-splice.removed.length,splice.index-this._virtualStart);this._virtualStart=this._virtualStart+delta;if(this._focusedIndex>=0){this._focusedIndex=this._focusedIndex+delta}}},this)},_removeItem:function(item){this.$.selector.deselect(item);if(this._focusedItem&&this._focusedItem._templateInstance[this.as]===item){this._removeFocusedItem()}},_iterateItems:function(fn,itemSet){var pidx,vidx,rtn,i;if(arguments.length===2&&itemSet){for(i=0;i<itemSet.length;i++){pidx=itemSet[i];vidx=this._computeVidx(pidx);if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}}else{pidx=this._physicalStart;vidx=this._virtualStart;for(;pidx<this._physicalCount;pidx++,vidx++){if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}for(pidx=0;pidx<this._physicalStart;pidx++,vidx++){if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}}},_computeVidx:function(pidx){if(pidx>=this._physicalStart){return this._virtualStart+(pidx-this._physicalStart)}return this._virtualStart+(this._physicalCount-this._physicalStart)+pidx},_assignModels:function(itemSet){this._iterateItems(function(pidx,vidx){var el=this._physicalItems[pidx];var inst=el._templateInstance;var item=this.items&&this.items[vidx];if(item!=null){inst[this.as]=item;inst.__key__=this._collection.getKey(item);inst[this.selectedAs]=this.$.selector.isSelected(item);inst[this.indexAs]=vidx;inst.tabIndex=this._focusedIndex===vidx?0:-1;this._physicalIndexForKey[inst.__key__]=pidx;el.removeAttribute("hidden")}else{inst.__key__=null;el.setAttribute("hidden","")}},itemSet)},_updateMetrics:function(itemSet){Polymer.dom.flush();var newPhysicalSize=0;var oldPhysicalSize=0;var prevAvgCount=this._physicalAverageCount;var prevPhysicalAvg=this._physicalAverage;this._iterateItems(function(pidx,vidx){oldPhysicalSize+=this._physicalSizes[pidx]||0;this._physicalSizes[pidx]=this._physicalItems[pidx].offsetHeight;newPhysicalSize+=this._physicalSizes[pidx];this._physicalAverageCount+=this._physicalSizes[pidx]?1:0},itemSet);if(this.grid){this._updateGridMetrics();this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight}else{this._physicalSize=this._physicalSize+newPhysicalSize-oldPhysicalSize}if(this._physicalAverageCount!==prevAvgCount){this._physicalAverage=Math.round((prevPhysicalAvg*prevAvgCount+newPhysicalSize)/this._physicalAverageCount)}},_updateGridMetrics:function(){this._itemWidth=this._physicalCount>0?this._physicalItems[0].getBoundingClientRect().width:200;this._rowHeight=this._physicalCount>0?this._physicalItems[0].offsetHeight:200;this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth):this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var y=this._physicalTop;if(this.grid){var totalItemWidth=this._itemsPerRow*this._itemWidth;var rowOffset=(this._viewportWidth-totalItemWidth)/2;this._iterateItems(function(pidx,vidx){var modulus=vidx%this._itemsPerRow;var x=Math.floor(modulus*this._itemWidth+rowOffset);this.translate3d(x+"px",y+"px",0,this._physicalItems[pidx]);if(this._shouldRenderNextRow(vidx)){y+=this._rowHeight}})}else{this._iterateItems(function(pidx,vidx){this.translate3d(0,y+"px",0,this._physicalItems[pidx]);y+=this._physicalSizes[pidx]})}},_getPhysicalSizeIncrement:function(pidx){if(!this.grid){return this._physicalSizes[pidx]}if(this._computeVidx(pidx)%this._itemsPerRow!==this._itemsPerRow-1){return 0}return this._rowHeight},_shouldRenderNextRow:function(vidx){return vidx%this._itemsPerRow===this._itemsPerRow-1},_adjustScrollPosition:function(){var deltaHeight=this._virtualStart===0?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(deltaHeight){this._physicalTop=this._physicalTop-deltaHeight;if(!IOS_TOUCH_SCROLLING&&this._physicalTop!==0){this._resetScrollPosition(this._scrollTop-deltaHeight)}}},_resetScrollPosition:function(pos){if(this.scrollTarget){this._scrollTop=pos;this._scrollPosition=this._scrollTop}},_updateScrollerSize:function(forceUpdate){if(this.grid){this._estScrollHeight=this._virtualRowCount*this._rowHeight}else{this._estScrollHeight=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage}forceUpdate=forceUpdate||this._scrollHeight===0;forceUpdate=forceUpdate||this._scrollPosition>=this._estScrollHeight-this._physicalSize;forceUpdate=forceUpdate||this.grid&&this.$.items.style.height<this._estScrollHeight;if(forceUpdate||Math.abs(this._estScrollHeight-this._scrollHeight)>=this._optPhysicalSize){this.$.items.style.height=this._estScrollHeight+"px";this._scrollHeight=this._estScrollHeight}},scrollToItem:function(item){return this.scrollToIndex(this.items.indexOf(item))},scrollToIndex:function(idx){if(typeof idx!=="number"||idx<0||idx>this.items.length-1){return}Polymer.dom.flush();if(this._physicalCount===0){return}idx=Math.min(Math.max(idx,0),this._virtualCount-1);if(!this._isIndexRendered(idx)||idx>=this._maxVirtualStart){this._virtualStart=this.grid?idx-this._itemsPerRow*2:idx-1}this._manageFocus();this._assignModels();this._updateMetrics();this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;var currentTopItem=this._physicalStart;var currentVirtualItem=this._virtualStart;var targetOffsetTop=0;var hiddenContentSize=this._hiddenContentSize;while(currentVirtualItem<idx&&targetOffsetTop<=hiddenContentSize){targetOffsetTop=targetOffsetTop+this._getPhysicalSizeIncrement(currentTopItem);currentTopItem=(currentTopItem+1)%this._physicalCount;currentVirtualItem++}this._updateScrollerSize(true);this._positionItems();this._resetScrollPosition(this._physicalTop+this._scrollerPaddingTop+targetOffsetTop);this._increasePoolIfNeeded();this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null},_resetAverage:function(){this._physicalAverage=0;this._physicalAverageCount=0},_resizeHandler:function(){var delta=Math.abs(this._viewportHeight-this._scrollTargetHeight);if(IOS&&delta>0&&delta<100){return}Polymer.dom.addDebouncer(this.debounce("_debounceTemplate",function(){this.updateViewportBoundaries();this._render();if(this._isVisible){this.toggleScrollListener(true);if(this._physicalCount>0){this._resetAverage();this.scrollToIndex(this.firstVisibleIndex)}}else{this.toggleScrollListener(false)}}.bind(this),1))},_getModelFromItem:function(item){var key=this._collection.getKey(item);var pidx=this._physicalIndexForKey[key];if(pidx!=null){return this._physicalItems[pidx]._templateInstance}return null},_getNormalizedItem:function(item){if(this._collection.getKey(item)===undefined){if(typeof item==="number"){item=this.items[item];if(!item){throw new RangeError("<item> not found")}return item}throw new TypeError("<item> should be a valid item")}return item},selectItem:function(item){item=this._getNormalizedItem(item);var model=this._getModelFromItem(item);if(!this.multiSelection&&this.selectedItem){this.deselectItem(this.selectedItem)}if(model){model[this.selectedAs]=true}this.$.selector.select(item);this.updateSizeForItem(item)},deselectItem:function(item){item=this._getNormalizedItem(item);var model=this._getModelFromItem(item);if(model){model[this.selectedAs]=false}this.$.selector.deselect(item);this.updateSizeForItem(item)},toggleSelectionForItem:function(item){item=this._getNormalizedItem(item);if(this.$.selector.isSelected(item)){this.deselectItem(item)}else{this.selectItem(item)}},clearSelection:function(){function unselect(item){var model=this._getModelFromItem(item);if(model){model[this.selectedAs]=false}}if(Array.isArray(this.selectedItems)){this.selectedItems.forEach(unselect,this)}else if(this.selectedItem){unselect.call(this,this.selectedItem)}this.$.selector.clearSelection()},_selectionEnabledChanged:function(selectionEnabled){var handler=selectionEnabled?this.listen:this.unlisten;handler.call(this,this,"tap","_selectionHandler")},_selectionHandler:function(e){var model=this.modelForElement(e.target);if(!model){return}var modelTabIndex,activeElTabIndex;var target=Polymer.dom(e).path[0];var activeEl=Polymer.dom(this.domHost?this.domHost.root:document).activeElement;var physicalItem=this._physicalItems[this._getPhysicalIndex(model[this.indexAs])];if(target.localName==="input"||target.localName==="button"||target.localName==="select"){return}modelTabIndex=model.tabIndex;model.tabIndex=SECRET_TABINDEX;activeElTabIndex=activeEl?activeEl.tabIndex:-1;model.tabIndex=modelTabIndex;if(activeEl&&physicalItem!==activeEl&&physicalItem.contains(activeEl)&&activeElTabIndex!==SECRET_TABINDEX){return}this.toggleSelectionForItem(model[this.as])},_multiSelectionChanged:function(multiSelection){this.clearSelection();this.$.selector.multi=multiSelection},updateSizeForItem:function(item){item=this._getNormalizedItem(item);var key=this._collection.getKey(item);var pidx=this._physicalIndexForKey[key];if(pidx!=null){this._updateMetrics([pidx]);this._positionItems()}},_manageFocus:function(){var fidx=this._focusedIndex;if(fidx>=0&&fidx<this._virtualCount){if(this._isIndexRendered(fidx)){this._restoreFocusedItem()}else{this._createFocusBackfillItem()}}else if(this._virtualCount>0&&this._physicalCount>0){this._focusedIndex=this._virtualStart;this._focusedItem=this._physicalItems[this._physicalStart]}},_isIndexRendered:function(idx){return idx>=this._virtualStart&&idx<=this._virtualEnd},_isIndexVisible:function(idx){return idx>=this.firstVisibleIndex&&idx<=this.lastVisibleIndex},_getPhysicalIndex:function(idx){return this._physicalIndexForKey[this._collection.getKey(this._getNormalizedItem(idx))]},_focusPhysicalItem:function(idx){if(idx<0||idx>=this._virtualCount){return}this._restoreFocusedItem();if(!this._isIndexRendered(idx)){this.scrollToIndex(idx)}var physicalItem=this._physicalItems[this._getPhysicalIndex(idx)];var model=physicalItem._templateInstance;var focusable;model.tabIndex=SECRET_TABINDEX;if(physicalItem.tabIndex===SECRET_TABINDEX){focusable=physicalItem}if(!focusable){focusable=Polymer.dom(physicalItem).querySelector('[tabindex="'+SECRET_TABINDEX+'"]')}model.tabIndex=0;this._focusedIndex=idx;focusable&&focusable.focus()},_removeFocusedItem:function(){if(this._offscreenFocusedItem){Polymer.dom(this).removeChild(this._offscreenFocusedItem)}this._offscreenFocusedItem=null;this._focusBackfillItem=null;this._focusedItem=null;this._focusedIndex=-1},_createFocusBackfillItem:function(){var fidx=this._focusedIndex;var pidx=this._getPhysicalIndex(fidx);if(this._offscreenFocusedItem||pidx==null||fidx<0){return}if(!this._focusBackfillItem){var stampedTemplate=this.stamp(null);this._focusBackfillItem=stampedTemplate.root.querySelector("*");Polymer.dom(this).appendChild(stampedTemplate.root)}this._offscreenFocusedItem=this._physicalItems[pidx];this._offscreenFocusedItem._templateInstance.tabIndex=0;this._physicalItems[pidx]=this._focusBackfillItem;this.translate3d(0,HIDDEN_Y,0,this._offscreenFocusedItem)},_restoreFocusedItem:function(){var pidx,fidx=this._focusedIndex;if(!this._offscreenFocusedItem||this._focusedIndex<0){return}this._assignModels();pidx=this._getPhysicalIndex(fidx);if(pidx!=null){this._focusBackfillItem=this._physicalItems[pidx];this._focusBackfillItem._templateInstance.tabIndex=-1;this._physicalItems[pidx]=this._offscreenFocusedItem;this._offscreenFocusedItem=null;this.translate3d(0,HIDDEN_Y,0,this._focusBackfillItem)}},_didFocus:function(e){var targetModel=this.modelForElement(e.target);var focusedModel=this._focusedItem?this._focusedItem._templateInstance:null;var hasOffscreenFocusedItem=this._offscreenFocusedItem!==null;var fidx=this._focusedIndex;if(!targetModel||!focusedModel){return}if(focusedModel===targetModel){if(!this._isIndexVisible(fidx)){this.scrollToIndex(fidx)}}else{this._restoreFocusedItem();focusedModel.tabIndex=-1;targetModel.tabIndex=0;fidx=targetModel[this.indexAs];this._focusedIndex=fidx;this._focusedItem=this._physicalItems[this._getPhysicalIndex(fidx)];if(hasOffscreenFocusedItem&&!this._offscreenFocusedItem){this._update()}}},_didMoveUp:function(){this._focusPhysicalItem(this._focusedIndex-1)},_didMoveDown:function(e){e.detail.keyboardEvent.preventDefault();this._focusPhysicalItem(this._focusedIndex+1)},_didEnter:function(e){this._focusPhysicalItem(this._focusedIndex);this._selectionHandler(e.detail.keyboardEvent)}})})();Polymer({is:"iron-scroll-threshold",properties:{upperThreshold:{type:Number,value:100},lowerThreshold:{type:Number,value:100},upperTriggered:{type:Boolean,value:false,notify:true,readOnly:true},lowerTriggered:{type:Boolean,value:false,notify:true,readOnly:true},horizontal:{type:Boolean,value:false}},behaviors:[Polymer.IronScrollTargetBehavior],observers:["_setOverflow(scrollTarget)","_initCheck(horizontal, isAttached)"],get _defaultScrollTarget(){return this},_setOverflow:function(scrollTarget){this.style.overflow=scrollTarget===this?"auto":""},_scrollHandler:function(){var THROTTLE_THRESHOLD=200;if(!this.isDebouncerActive("_checkTheshold")){this.debounce("_checkTheshold",function(){this.checkScrollThesholds()},THROTTLE_THRESHOLD)}},_initCheck:function(horizontal,isAttached){if(isAttached){this.debounce("_init",function(){this.clearTriggers();this.checkScrollThesholds()})}},checkScrollThesholds:function(){if(!this.scrollTarget||this.lowerTriggered&&this.upperTriggered){return}var upperScrollValue=this.horizontal?this._scrollLeft:this._scrollTop;var lowerScrollValue=this.horizontal?this.scrollTarget.scrollWidth-this._scrollTargetWidth-this._scrollLeft:this.scrollTarget.scrollHeight-this._scrollTargetHeight-this._scrollTop;if(upperScrollValue<=this.upperThreshold&&!this.upperTriggered){this._setUpperTriggered(true);this.fire("upper-threshold")}if(lowerScrollValue<=this.lowerThreshold&&!this.lowerTriggered){this._setLowerTriggered(true);this.fire("lower-threshold")}},clearTriggers:function(){this._setUpperTriggered(false);this._setLowerTriggered(false)}}); +Polymer({is:"history-toolbar",properties:{count:{type:Number,value:0,observer:"changeToolbarView_"},itemsSelected_:{type:Boolean,value:false,reflectToAttribute:true},searchTerm:{type:String,observer:"searchTermChanged_"},spinnerActive:{type:Boolean,value:false},hasDrawer:{type:Boolean,reflectToAttribute:true},groupedRange:{type:Number,reflectToAttribute:true},showGroupedControls:{type:Boolean,reflectToAttribute:true},showSyncNotice:{type:Boolean,observer:"showSyncNoticeChanged_"},syncNoticeVisible_:{type:Boolean,value:false},hasMoreResults:Boolean,groupedOffset:Number,isGroupedMode:Boolean,querying:Boolean,queryInfo:Object,showMenuPromo:Boolean},hasDismissListeners_:false,boundOnDocumentClick_:null,boundOnDocumentKeydown_:null,detached:function(){if(this.hasDismissListeners_){document.removeEventListener("click",this.boundOnDocumentClick_);document.removeEventListener("keydown",this.boundOnDocumentKeydown_)}},get searchField(){return this.$["main-toolbar"].getSearchField()},showSearchField:function(){this.searchField.showAndFocus()},changeToolbarView_:function(){this.itemsSelected_=this.count>0},searchTermChanged_:function(){if(this.searchField.getValue()!=this.searchTerm){this.searchField.showAndFocus();this.searchField.setValue(this.searchTerm)}},showSyncNoticeChanged_:function(){if(!this.showSyncNotice)this.syncNoticeVisible_=false},onSearchChanged_:function(event){this.fire("change-query",{search:event.detail})},onInfoButtonTap_:function(e){this.syncNoticeVisible_=!this.syncNoticeVisible_;e.stopPropagation();if(this.hasDismissListeners_)return;this.boundOnDocumentClick_=this.onDocumentClick_.bind(this);this.boundOnDocumentKeydown_=this.onDocumentKeydown_.bind(this);document.addEventListener("click",this.boundOnDocumentClick_);document.addEventListener("keydown",this.boundOnDocumentKeydown_);this.hasDismissListeners_=true},onDocumentClick_:function(e){if(e.path.indexOf(this.$["sync-notice"])==-1)this.syncNoticeVisible_=false},onDocumentKeydown_:function(e){if(e.key=="Escape")this.syncNoticeVisible_=false},onClearSelectionTap_:function(){this.fire("unselect-all")},onDeleteTap_:function(){this.fire("delete-selected")},deletingAllowed_:function(){return loadTimeData.getBoolean("allowDeletingHistory")},numberOfItemsSelected_:function(count){return count>0?loadTimeData.getStringF("itemsSelected",count):""},getHistoryInterval_:function(){var info=this.queryInfo;if(!info)return;if(this.groupedRange==HistoryRange.WEEK)return info.queryInterval;if(this.groupedRange==HistoryRange.MONTH)return info.queryStartMonth},onTabSelected_:function(e){this.fire("change-query",{range:Number(e.detail.item.getAttribute("value"))})},changeOffset_:function(newOffset){if(!this.querying)this.fire("change-query",{offset:newOffset})},onTodayTap_:function(){this.changeOffset_(0)},onPrevTap_:function(){this.changeOffset_(this.groupedOffset+1)},onNextTap_:function(){this.changeOffset_(this.groupedOffset-1)},isToday_:function(){return this.groupedOffset==0}});(function(){"use strict";Polymer.IronA11yAnnouncer=Polymer({is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},_text:{type:String,value:""}},created:function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.instance=this}document.body.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(text){this._text="";this.async(function(){this._text=text},100)},_onIronAnnounce:function(event){if(event.detail&&event.detail.text){this.announce(event.detail.text)}}});Polymer.IronA11yAnnouncer.instance=null;Polymer.IronA11yAnnouncer.requestAvailability=function(){if(!Polymer.IronA11yAnnouncer.instance){Polymer.IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer")}document.body.appendChild(Polymer.IronA11yAnnouncer.instance)}})();(function(){var IOS=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/);var IOS_TOUCH_SCROLLING=IOS&&IOS[1]>=8;var DEFAULT_PHYSICAL_COUNT=3;var HIDDEN_Y="-10000px";var ITEM_WIDTH=0;var ITEM_HEIGHT=1;var SECRET_TABINDEX=-100;Polymer({is:"iron-list",properties:{items:{type:Array},maxPhysicalCount:{type:Number,value:500},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},selectedAs:{type:String,value:"selected"},grid:{type:Boolean,value:false,reflectToAttribute:true},selectionEnabled:{type:Boolean,value:false},selectedItem:{type:Object,notify:true},selectedItems:{type:Object,notify:true},multiSelection:{type:Boolean,value:false}},observers:["_itemsChanged(items.*)","_selectionEnabledChanged(selectionEnabled)","_multiSelectionChanged(multiSelection)","_setOverflow(scrollTarget)"],behaviors:[Polymer.Templatizer,Polymer.IronResizableBehavior,Polymer.IronA11yKeysBehavior,Polymer.IronScrollTargetBehavior],keyBindings:{up:"_didMoveUp",down:"_didMoveDown",enter:"_didEnter"},_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_physicalIndexForKey:null,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_collection:null,_maxPages:2,_focusedItem:null,_focusedIndex:-1,_offscreenFocusedItem:null,_focusBackfillItem:null,_itemsPerRow:1,_itemWidth:0,_rowHeight:0,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){var size=this.grid?this._physicalRows*this._rowHeight:this._physicalSize;return size-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollerPaddingTop},_minVirtualStart:0,get _maxVirtualStart(){return Math.max(0,this._virtualCount-this._physicalCount)},_virtualStartVal:0,set _virtualStart(val){this._virtualStartVal=Math.min(this._maxVirtualStart,Math.max(this._minVirtualStart,val))},get _virtualStart(){return this._virtualStartVal||0},_physicalStartVal:0,set _physicalStart(val){this._physicalStartVal=val%this._physicalCount;if(this._physicalStartVal<0){this._physicalStartVal=this._physicalCount+this._physicalStartVal}this._physicalEnd=(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalStart(){return this._physicalStartVal||0},_physicalCountVal:0,set _physicalCount(val){this._physicalCountVal=val;this._physicalEnd=(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal},_physicalEnd:0,get _optPhysicalSize(){if(this.grid){return this._estRowsInView*this._rowHeight*this._maxPages}return this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){if(this._firstVisibleIndexVal===null){var physicalOffset=Math.floor(this._physicalTop+this._scrollerPaddingTop);this._firstVisibleIndexVal=this._iterateItems(function(pidx,vidx){physicalOffset+=this._getPhysicalSizeIncrement(pidx);if(physicalOffset>this._scrollPosition){return this.grid?vidx-vidx%this._itemsPerRow:vidx}if(this.grid&&this._virtualCount-1===vidx){return vidx-vidx%this._itemsPerRow}})||0}return this._firstVisibleIndexVal},get lastVisibleIndex(){if(this._lastVisibleIndexVal===null){if(this.grid){var lastIndex=this.firstVisibleIndex+this._estRowsInView*this._itemsPerRow-1;this._lastVisibleIndexVal=Math.min(this._virtualCount,lastIndex)}else{var physicalOffset=this._physicalTop;this._iterateItems(function(pidx,vidx){if(physicalOffset<this._scrollBottom){this._lastVisibleIndexVal=vidx}else{return true}physicalOffset+=this._getPhysicalSizeIncrement(pidx)})}}return this._lastVisibleIndexVal},get _defaultScrollTarget(){return this},get _virtualRowCount(){return Math.ceil(this._virtualCount/this._itemsPerRow)},get _estRowsInView(){return Math.ceil(this._viewportHeight/this._rowHeight)},get _physicalRows(){return Math.ceil(this._physicalCount/this._itemsPerRow)},ready:function(){this.addEventListener("focus",this._didFocus.bind(this),true)},attached:function(){if(this._physicalCount===0){this._debounceTemplate(this._render)}this.listen(this,"iron-resize","_resizeHandler")},detached:function(){this.unlisten(this,"iron-resize","_resizeHandler")},_setOverflow:function(scrollTarget){this.style.webkitOverflowScrolling=scrollTarget===this?"touch":"";this.style.overflow=scrollTarget===this?"auto":""},updateViewportBoundaries:function(){this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(window.getComputedStyle(this)["padding-top"],10);this._viewportWidth=this.$.items.offsetWidth;this._viewportHeight=this._scrollTargetHeight;this.grid&&this._updateGridMetrics()},_scrollHandler:function(){var scrollTop=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));var delta=scrollTop-this._scrollPosition;var isScrollingDown=delta>=0;this._scrollPosition=scrollTop;this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null;if(Math.abs(delta)>this._physicalSize){var idxAdjustment=Math.round(delta/this._physicalAverage)*this._itemsPerRow;this._physicalTop=this._physicalTop+delta;this._virtualStart=this._virtualStart+idxAdjustment;this._physicalStart=this._physicalStart+idxAdjustment;this._update()}else{var reusables=this._getReusables(isScrollingDown);if(isScrollingDown){this._physicalTop=reusables.physicalTop;this._virtualStart=this._virtualStart+reusables.indexes.length;this._physicalStart=this._physicalStart+reusables.indexes.length}else{this._virtualStart=this._virtualStart-reusables.indexes.length;this._physicalStart=this._physicalStart-reusables.indexes.length}if(reusables.indexes.length===0){this._increasePoolIfNeeded()}else{this._update(reusables.indexes,isScrollingDown?null:reusables.indexes)}}},_getReusables:function(fromTop){var ith,lastIth,offsetContent,physicalItemHeight;var idxs=[];var protectedOffsetContent=this._hiddenContentSize*this._ratio;var virtualStart=this._virtualStart;var virtualEnd=this._virtualEnd;var physicalCount=this._physicalCount;var physicalTop=this._physicalTop+this._scrollerPaddingTop;var scrollTop=this._scrollTop;var scrollBottom=this._scrollBottom;if(fromTop){ith=this._physicalStart;lastIth=this._physicalEnd;offsetContent=scrollTop-physicalTop}else{ith=this._physicalEnd;lastIth=this._physicalStart;offsetContent=this._physicalBottom-scrollBottom}while(true){physicalItemHeight=this._getPhysicalSizeIncrement(ith);offsetContent=offsetContent-physicalItemHeight;if(idxs.length>=physicalCount||offsetContent<=protectedOffsetContent){break}if(fromTop){if(virtualEnd+idxs.length+1>=this._virtualCount){break}if(physicalTop+physicalItemHeight>=scrollTop){break}idxs.push(ith);physicalTop=physicalTop+physicalItemHeight;ith=(ith+1)%physicalCount}else{if(virtualStart-idxs.length<=0){break}if(physicalTop+this._physicalSize-physicalItemHeight<=scrollBottom){break}idxs.push(ith);physicalTop=physicalTop-physicalItemHeight;ith=ith===0?physicalCount-1:ith-1}}return{indexes:idxs,physicalTop:physicalTop-this._scrollerPaddingTop}},_update:function(itemSet,movingUp){if(itemSet&&itemSet.length===0){return}this._manageFocus();this._assignModels(itemSet);this._updateMetrics(itemSet);if(movingUp){while(movingUp.length){var idx=movingUp.pop();this._physicalTop-=this._getPhysicalSizeIncrement(idx)}}this._positionItems();this._updateScrollerSize();this._increasePoolIfNeeded()},_createPool:function(size){var physicalItems=new Array(size);this._ensureTemplatized();for(var i=0;i<size;i++){var inst=this.stamp(null);physicalItems[i]=inst.root.querySelector("*");Polymer.dom(this).appendChild(inst.root)}return physicalItems},_increasePoolIfNeeded:function(){if(this._viewportHeight===0){return false}var self=this;var isClientFull=this._physicalBottom>=this._scrollBottom&&this._physicalTop<=this._scrollPosition;if(this._physicalSize>=this._optPhysicalSize&&isClientFull){return false}var maxPoolSize=Math.round(this._physicalCount*.5);if(!isClientFull){this._debounceTemplate(this._increasePool.bind(this,maxPoolSize));return true}this._yield(function(){self._increasePool(Math.min(maxPoolSize,Math.max(1,Math.round(50/self._templateCost))))});return true},_yield:function(cb){var g=window;var handle=g.requestIdleCallback?g.requestIdleCallback(cb):g.setTimeout(cb,16);Polymer.dom.addDebouncer({complete:function(){g.cancelIdleCallback?g.cancelIdleCallback(handle):g.clearTimeout(handle);cb()}})},_increasePool:function(missingItems){var nextPhysicalCount=Math.min(this._physicalCount+missingItems,this._virtualCount-this._virtualStart,Math.max(this.maxPhysicalCount,DEFAULT_PHYSICAL_COUNT));var prevPhysicalCount=this._physicalCount;var delta=nextPhysicalCount-prevPhysicalCount;var ts=window.performance.now();if(delta<=0){return}[].push.apply(this._physicalItems,this._createPool(delta));[].push.apply(this._physicalSizes,new Array(delta));this._physicalCount=prevPhysicalCount+delta;if(this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedIndex)&&this._getPhysicalIndex(this._focusedIndex)<this._physicalEnd){this._physicalStart=this._physicalStart+delta}this._update();this._templateCost=(window.performance.now()-ts)/delta},_render:function(){if(this.isAttached&&this._isVisible){if(this._physicalCount===0){this.updateViewportBoundaries();this._increasePool(DEFAULT_PHYSICAL_COUNT)}else{var reusables=this._getReusables(true);this._physicalTop=reusables.physicalTop;this._virtualStart=this._virtualStart+reusables.indexes.length;this._physicalStart=this._physicalStart+reusables.indexes.length;this._update(reusables.indexes);this._update()}}},_ensureTemplatized:function(){if(!this.ctor){var props={};props.__key__=true;props[this.as]=true;props[this.indexAs]=true;props[this.selectedAs]=true;props.tabIndex=true;this._instanceProps=props;this._userTemplate=Polymer.dom(this).querySelector("template");if(this._userTemplate){this.templatize(this._userTemplate)}else{console.warn("iron-list requires a template to be provided in light-dom")}}},_getStampedChildren:function(){return this._physicalItems},_forwardInstancePath:function(inst,path,value){if(path.indexOf(this.as+".")===0){this.notifyPath("items."+inst.__key__+"."+path.slice(this.as.length+1),value)}},_forwardParentProp:function(prop,value){if(this._physicalItems){this._physicalItems.forEach(function(item){item._templateInstance[prop]=value},this)}},_forwardParentPath:function(path,value){if(this._physicalItems){this._physicalItems.forEach(function(item){item._templateInstance.notifyPath(path,value,true)},this)}},_forwardItemPath:function(path,value){if(!this._physicalIndexForKey){return}var dot=path.indexOf(".");var key=path.substring(0,dot<0?path.length:dot);var idx=this._physicalIndexForKey[key];var offscreenItem=this._offscreenFocusedItem;var el=offscreenItem&&offscreenItem._templateInstance.__key__===key?offscreenItem:this._physicalItems[idx];if(!el||el._templateInstance.__key__!==key){return}if(dot>=0){path=this.as+"."+path.substring(dot+1);el._templateInstance.notifyPath(path,value,true)}else{var currentItem=el._templateInstance[this.as];if(Array.isArray(this.selectedItems)){for(var i=0;i<this.selectedItems.length;i++){if(this.selectedItems[i]===currentItem){this.set("selectedItems."+i,value);break}}}else if(this.selectedItem===currentItem){this.set("selectedItem",value)}el._templateInstance[this.as]=value}},_itemsChanged:function(change){if(change.path==="items"){this._virtualStart=0;this._physicalTop=0;this._virtualCount=this.items?this.items.length:0;this._collection=this.items?Polymer.Collection.get(this.items):null;this._physicalIndexForKey={};this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null;this._physicalCount=this._physicalCount||0;this._physicalItems=this._physicalItems||[];this._physicalSizes=this._physicalSizes||[];this._physicalStart=0;this._resetScrollPosition(0);this._removeFocusedItem();this._debounceTemplate(this._render)}else if(change.path==="items.splices"){this._adjustVirtualIndex(change.value.indexSplices);this._virtualCount=this.items?this.items.length:0;this._debounceTemplate(this._render)}else{this._forwardItemPath(change.path.split(".").slice(1).join("."),change.value)}},_adjustVirtualIndex:function(splices){splices.forEach(function(splice){splice.removed.forEach(this._removeItem,this);if(splice.index<this._virtualStart){var delta=Math.max(splice.addedCount-splice.removed.length,splice.index-this._virtualStart);this._virtualStart=this._virtualStart+delta;if(this._focusedIndex>=0){this._focusedIndex=this._focusedIndex+delta}}},this)},_removeItem:function(item){this.$.selector.deselect(item);if(this._focusedItem&&this._focusedItem._templateInstance[this.as]===item){this._removeFocusedItem()}},_iterateItems:function(fn,itemSet){var pidx,vidx,rtn,i;if(arguments.length===2&&itemSet){for(i=0;i<itemSet.length;i++){pidx=itemSet[i];vidx=this._computeVidx(pidx);if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}}else{pidx=this._physicalStart;vidx=this._virtualStart;for(;pidx<this._physicalCount;pidx++,vidx++){if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}for(pidx=0;pidx<this._physicalStart;pidx++,vidx++){if((rtn=fn.call(this,pidx,vidx))!=null){return rtn}}}},_computeVidx:function(pidx){if(pidx>=this._physicalStart){return this._virtualStart+(pidx-this._physicalStart)}return this._virtualStart+(this._physicalCount-this._physicalStart)+pidx},_assignModels:function(itemSet){this._iterateItems(function(pidx,vidx){var el=this._physicalItems[pidx];var inst=el._templateInstance;var item=this.items&&this.items[vidx];if(item!=null){inst[this.as]=item;inst.__key__=this._collection.getKey(item);inst[this.selectedAs]=this.$.selector.isSelected(item);inst[this.indexAs]=vidx;inst.tabIndex=this._focusedIndex===vidx?0:-1;this._physicalIndexForKey[inst.__key__]=pidx;el.removeAttribute("hidden")}else{inst.__key__=null;el.setAttribute("hidden","")}},itemSet)},_updateMetrics:function(itemSet){Polymer.dom.flush();var newPhysicalSize=0;var oldPhysicalSize=0;var prevAvgCount=this._physicalAverageCount;var prevPhysicalAvg=this._physicalAverage;this._iterateItems(function(pidx,vidx){oldPhysicalSize+=this._physicalSizes[pidx]||0;this._physicalSizes[pidx]=this._physicalItems[pidx].offsetHeight;newPhysicalSize+=this._physicalSizes[pidx];this._physicalAverageCount+=this._physicalSizes[pidx]?1:0},itemSet);if(this.grid){this._updateGridMetrics();this._physicalSize=Math.ceil(this._physicalCount/this._itemsPerRow)*this._rowHeight}else{this._physicalSize=this._physicalSize+newPhysicalSize-oldPhysicalSize}if(this._physicalAverageCount!==prevAvgCount){this._physicalAverage=Math.round((prevPhysicalAvg*prevAvgCount+newPhysicalSize)/this._physicalAverageCount)}},_updateGridMetrics:function(){this._itemWidth=this._physicalCount>0?this._physicalItems[0].getBoundingClientRect().width:200;this._rowHeight=this._physicalCount>0?this._physicalItems[0].offsetHeight:200;this._itemsPerRow=this._itemWidth?Math.floor(this._viewportWidth/this._itemWidth):this._itemsPerRow},_positionItems:function(){this._adjustScrollPosition();var y=this._physicalTop;if(this.grid){var totalItemWidth=this._itemsPerRow*this._itemWidth;var rowOffset=(this._viewportWidth-totalItemWidth)/2;this._iterateItems(function(pidx,vidx){var modulus=vidx%this._itemsPerRow;var x=Math.floor(modulus*this._itemWidth+rowOffset);this.translate3d(x+"px",y+"px",0,this._physicalItems[pidx]);if(this._shouldRenderNextRow(vidx)){y+=this._rowHeight}})}else{this._iterateItems(function(pidx,vidx){this.translate3d(0,y+"px",0,this._physicalItems[pidx]);y+=this._physicalSizes[pidx]})}},_getPhysicalSizeIncrement:function(pidx){if(!this.grid){return this._physicalSizes[pidx]}if(this._computeVidx(pidx)%this._itemsPerRow!==this._itemsPerRow-1){return 0}return this._rowHeight},_shouldRenderNextRow:function(vidx){return vidx%this._itemsPerRow===this._itemsPerRow-1},_adjustScrollPosition:function(){var deltaHeight=this._virtualStart===0?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(deltaHeight){this._physicalTop=this._physicalTop-deltaHeight;if(!IOS_TOUCH_SCROLLING&&this._physicalTop!==0){this._resetScrollPosition(this._scrollTop-deltaHeight)}}},_resetScrollPosition:function(pos){if(this.scrollTarget){this._scrollTop=pos;this._scrollPosition=this._scrollTop}},_updateScrollerSize:function(forceUpdate){if(this.grid){this._estScrollHeight=this._virtualRowCount*this._rowHeight}else{this._estScrollHeight=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage}forceUpdate=forceUpdate||this._scrollHeight===0;forceUpdate=forceUpdate||this._scrollPosition>=this._estScrollHeight-this._physicalSize;forceUpdate=forceUpdate||this.grid&&this.$.items.style.height<this._estScrollHeight;if(forceUpdate||Math.abs(this._estScrollHeight-this._scrollHeight)>=this._optPhysicalSize){this.$.items.style.height=this._estScrollHeight+"px";this._scrollHeight=this._estScrollHeight}},scrollToItem:function(item){return this.scrollToIndex(this.items.indexOf(item))},scrollToIndex:function(idx){if(typeof idx!=="number"||idx<0||idx>this.items.length-1){return}Polymer.dom.flush();if(this._physicalCount===0){return}idx=Math.min(Math.max(idx,0),this._virtualCount-1);if(!this._isIndexRendered(idx)||idx>=this._maxVirtualStart){this._virtualStart=this.grid?idx-this._itemsPerRow*2:idx-1}this._manageFocus();this._assignModels();this._updateMetrics();this._physicalTop=Math.floor(this._virtualStart/this._itemsPerRow)*this._physicalAverage;var currentTopItem=this._physicalStart;var currentVirtualItem=this._virtualStart;var targetOffsetTop=0;var hiddenContentSize=this._hiddenContentSize;while(currentVirtualItem<idx&&targetOffsetTop<=hiddenContentSize){targetOffsetTop=targetOffsetTop+this._getPhysicalSizeIncrement(currentTopItem);currentTopItem=(currentTopItem+1)%this._physicalCount;currentVirtualItem++}this._updateScrollerSize(true);this._positionItems();this._resetScrollPosition(this._physicalTop+this._scrollerPaddingTop+targetOffsetTop);this._increasePoolIfNeeded();this._firstVisibleIndexVal=null;this._lastVisibleIndexVal=null},_resetAverage:function(){this._physicalAverage=0;this._physicalAverageCount=0},_resizeHandler:function(){var delta=Math.abs(this._viewportHeight-this._scrollTargetHeight);if(IOS&&delta>0&&delta<100){return}Polymer.dom.addDebouncer(this.debounce("_debounceTemplate",function(){this.updateViewportBoundaries();this._render();if(this._isVisible){this.toggleScrollListener(true);if(this._physicalCount>0){this._resetAverage();this.scrollToIndex(this.firstVisibleIndex)}}else{this.toggleScrollListener(false)}}.bind(this),1))},_getModelFromItem:function(item){var key=this._collection.getKey(item);var pidx=this._physicalIndexForKey[key];if(pidx!=null){return this._physicalItems[pidx]._templateInstance}return null},_getNormalizedItem:function(item){if(this._collection.getKey(item)===undefined){if(typeof item==="number"){item=this.items[item];if(!item){throw new RangeError("<item> not found")}return item}throw new TypeError("<item> should be a valid item")}return item},selectItem:function(item){item=this._getNormalizedItem(item);var model=this._getModelFromItem(item);if(!this.multiSelection&&this.selectedItem){this.deselectItem(this.selectedItem)}if(model){model[this.selectedAs]=true}this.$.selector.select(item);this.updateSizeForItem(item)},deselectItem:function(item){item=this._getNormalizedItem(item);var model=this._getModelFromItem(item);if(model){model[this.selectedAs]=false}this.$.selector.deselect(item);this.updateSizeForItem(item)},toggleSelectionForItem:function(item){item=this._getNormalizedItem(item);if(this.$.selector.isSelected(item)){this.deselectItem(item)}else{this.selectItem(item)}},clearSelection:function(){function unselect(item){var model=this._getModelFromItem(item);if(model){model[this.selectedAs]=false}}if(Array.isArray(this.selectedItems)){this.selectedItems.forEach(unselect,this)}else if(this.selectedItem){unselect.call(this,this.selectedItem)}this.$.selector.clearSelection()},_selectionEnabledChanged:function(selectionEnabled){var handler=selectionEnabled?this.listen:this.unlisten;handler.call(this,this,"tap","_selectionHandler")},_selectionHandler:function(e){var model=this.modelForElement(e.target);if(!model){return}var modelTabIndex,activeElTabIndex;var target=Polymer.dom(e).path[0];var activeEl=Polymer.dom(this.domHost?this.domHost.root:document).activeElement;var physicalItem=this._physicalItems[this._getPhysicalIndex(model[this.indexAs])];if(target.localName==="input"||target.localName==="button"||target.localName==="select"){return}modelTabIndex=model.tabIndex;model.tabIndex=SECRET_TABINDEX;activeElTabIndex=activeEl?activeEl.tabIndex:-1;model.tabIndex=modelTabIndex;if(activeEl&&physicalItem!==activeEl&&physicalItem.contains(activeEl)&&activeElTabIndex!==SECRET_TABINDEX){return}this.toggleSelectionForItem(model[this.as])},_multiSelectionChanged:function(multiSelection){this.clearSelection();this.$.selector.multi=multiSelection},updateSizeForItem:function(item){item=this._getNormalizedItem(item);var key=this._collection.getKey(item);var pidx=this._physicalIndexForKey[key];if(pidx!=null){this._updateMetrics([pidx]);this._positionItems()}},_manageFocus:function(){var fidx=this._focusedIndex;if(fidx>=0&&fidx<this._virtualCount){if(this._isIndexRendered(fidx)){this._restoreFocusedItem()}else{this._createFocusBackfillItem()}}else if(this._virtualCount>0&&this._physicalCount>0){this._focusedIndex=this._virtualStart;this._focusedItem=this._physicalItems[this._physicalStart]}},_isIndexRendered:function(idx){return idx>=this._virtualStart&&idx<=this._virtualEnd},_isIndexVisible:function(idx){return idx>=this.firstVisibleIndex&&idx<=this.lastVisibleIndex},_getPhysicalIndex:function(idx){return this._physicalIndexForKey[this._collection.getKey(this._getNormalizedItem(idx))]},_focusPhysicalItem:function(idx){if(idx<0||idx>=this._virtualCount){return}this._restoreFocusedItem();if(!this._isIndexRendered(idx)){this.scrollToIndex(idx)}var physicalItem=this._physicalItems[this._getPhysicalIndex(idx)];var model=physicalItem._templateInstance;var focusable;model.tabIndex=SECRET_TABINDEX;if(physicalItem.tabIndex===SECRET_TABINDEX){focusable=physicalItem}if(!focusable){focusable=Polymer.dom(physicalItem).querySelector('[tabindex="'+SECRET_TABINDEX+'"]')}model.tabIndex=0;this._focusedIndex=idx;focusable&&focusable.focus()},_removeFocusedItem:function(){if(this._offscreenFocusedItem){Polymer.dom(this).removeChild(this._offscreenFocusedItem)}this._offscreenFocusedItem=null;this._focusBackfillItem=null;this._focusedItem=null;this._focusedIndex=-1},_createFocusBackfillItem:function(){var fidx=this._focusedIndex;var pidx=this._getPhysicalIndex(fidx);if(this._offscreenFocusedItem||pidx==null||fidx<0){return}if(!this._focusBackfillItem){var stampedTemplate=this.stamp(null);this._focusBackfillItem=stampedTemplate.root.querySelector("*");Polymer.dom(this).appendChild(stampedTemplate.root)}this._offscreenFocusedItem=this._physicalItems[pidx];this._offscreenFocusedItem._templateInstance.tabIndex=0;this._physicalItems[pidx]=this._focusBackfillItem;this.translate3d(0,HIDDEN_Y,0,this._offscreenFocusedItem)},_restoreFocusedItem:function(){var pidx,fidx=this._focusedIndex;if(!this._offscreenFocusedItem||this._focusedIndex<0){return}this._assignModels();pidx=this._getPhysicalIndex(fidx);if(pidx!=null){this._focusBackfillItem=this._physicalItems[pidx];this._focusBackfillItem._templateInstance.tabIndex=-1;this._physicalItems[pidx]=this._offscreenFocusedItem;this._offscreenFocusedItem=null;this.translate3d(0,HIDDEN_Y,0,this._focusBackfillItem)}},_didFocus:function(e){var targetModel=this.modelForElement(e.target);var focusedModel=this._focusedItem?this._focusedItem._templateInstance:null;var hasOffscreenFocusedItem=this._offscreenFocusedItem!==null;var fidx=this._focusedIndex;if(!targetModel||!focusedModel){return}if(focusedModel===targetModel){if(!this._isIndexVisible(fidx)){this.scrollToIndex(fidx)}}else{this._restoreFocusedItem();focusedModel.tabIndex=-1;targetModel.tabIndex=0;fidx=targetModel[this.indexAs];this._focusedIndex=fidx;this._focusedItem=this._physicalItems[this._getPhysicalIndex(fidx)];if(hasOffscreenFocusedItem&&!this._offscreenFocusedItem){this._update()}}},_didMoveUp:function(){this._focusPhysicalItem(this._focusedIndex-1)},_didMoveDown:function(e){e.detail.keyboardEvent.preventDefault();this._focusPhysicalItem(this._focusedIndex+1)},_didEnter:function(e){this._focusPhysicalItem(this._focusedIndex);this._selectionHandler(e.detail.keyboardEvent)}})})();Polymer({is:"iron-scroll-threshold",properties:{upperThreshold:{type:Number,value:100},lowerThreshold:{type:Number,value:100},upperTriggered:{type:Boolean,value:false,notify:true,readOnly:true},lowerTriggered:{type:Boolean,value:false,notify:true,readOnly:true},horizontal:{type:Boolean,value:false}},behaviors:[Polymer.IronScrollTargetBehavior],observers:["_setOverflow(scrollTarget)","_initCheck(horizontal, isAttached)"],get _defaultScrollTarget(){return this},_setOverflow:function(scrollTarget){this.style.overflow=scrollTarget===this?"auto":""},_scrollHandler:function(){var THROTTLE_THRESHOLD=200;if(!this.isDebouncerActive("_checkTheshold")){this.debounce("_checkTheshold",function(){this.checkScrollThesholds()},THROTTLE_THRESHOLD)}},_initCheck:function(horizontal,isAttached){if(isAttached){this.debounce("_init",function(){this.clearTriggers();this.checkScrollThesholds()})}},checkScrollThesholds:function(){if(!this.scrollTarget||this.lowerTriggered&&this.upperTriggered){return}var upperScrollValue=this.horizontal?this._scrollLeft:this._scrollTop;var lowerScrollValue=this.horizontal?this.scrollTarget.scrollWidth-this._scrollTargetWidth-this._scrollLeft:this.scrollTarget.scrollHeight-this._scrollTargetHeight-this._scrollTop;if(upperScrollValue<=this.upperThreshold&&!this.upperTriggered){this._setUpperTriggered(true);this.fire("upper-threshold")}if(lowerScrollValue<=this.lowerThreshold&&!this.lowerTriggered){this._setLowerTriggered(true);this.fire("lower-threshold")}},clearTriggers:function(){this._setUpperTriggered(false);this._setLowerTriggered(false)}}); // Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
diff --git a/chrome/browser/resources/md_history/app.html b/chrome/browser/resources/md_history/app.html index 4bf719c..43865e79 100644 --- a/chrome/browser/resources/md_history/app.html +++ b/chrome/browser/resources/md_history/app.html
@@ -86,6 +86,7 @@ query-info="[[queryResult_.info]]" querying="[[queryState_.querying]]" search-term="[[queryState_.searchTerm]]" + show-grouped-controls="[[!syncedTabsSelected_(selectedPage_)]]" show-menu-promo="[[showMenuPromo_]]" show-sync-notice="[[showSyncNotice_(hasSyncedResults, selectedPage_)]]" spinner-active="[[shouldShowSpinner_(queryState_.querying,
diff --git a/chrome/browser/resources/md_history/app.vulcanized.html b/chrome/browser/resources/md_history/app.vulcanized.html index b636efe..fa4b5f5 100644 --- a/chrome/browser/resources/md_history/app.vulcanized.html +++ b/chrome/browser/resources/md_history/app.vulcanized.html
@@ -2337,7 +2337,6 @@ paper-tabs { --paper-tabs_-_font-size: apply-shim-inherit;; --paper-tabs-selection-bar-color: #fff; - -webkit-margin-start: 32px; height: calc(var(--toolbar-grouped-height) - var(--toolbar-height)); min-width: 300px; } @@ -2348,8 +2347,25 @@ } #grouped-buttons-container { - align-items: center; + margin: var(--card-sizing_-_margin); max-width: var(--card-sizing_-_max-width); min-width: var(--card-sizing_-_min-width); padding: var(--card-sizing_-_padding); width: var(--card-sizing_-_width); + align-items: center; display: flex; + max-height: 0; + opacity: 0; + transition: opacity 300ms, max-height 300ms; +} + +:host([show-grouped-controls]) #grouped-buttons-container { + max-height: calc(var(--toolbar-grouped-height) - var(--toolbar-height)); + opacity: 1; +} + +#grouped-spacer { + -webkit-margin-start: var(--side-bar-width); +} + +:host([has-drawer]) #grouped-spacer { + -webkit-margin-start: 0; } #grouped-nav-container { @@ -2423,25 +2439,27 @@ </template> </div> <template is="dom-if" if="[[isGroupedMode]]"> - <div id="grouped-buttons-container"> - <paper-tabs attr-for-selected="value" selected="[[groupedRange]]" on-iron-select="onTabSelected_"> - <paper-tab value="0">$i18n{rangeAllTime}</paper-tab> - <paper-tab value="1">$i18n{rangeWeek}</paper-tab> - <paper-tab value="2">$i18n{rangeMonth}</paper-tab> - </paper-tabs> - <div id="grouped-nav-container"> - <span id="grouped-date"> - [[getHistoryInterval_(queryInfo)]] - </span> - <button is="paper-icon-button-light" id="today-button" class="icon-button" title="$i18n{rangeToday}" on-click="onTodayTap_" disabled="[[isToday_(groupedOffset)]]"> - <iron-icon icon="history:today"></iron-icon> - </button> - <button is="paper-icon-button-light" id="prev-button" title="$i18n{rangePrevious}" class="icon-button rtl-reversible" on-click="onPrevTap_" disabled="[[!hasMoreResults]]"> - <iron-icon icon="history:chevron-left"></iron-icon> - </button> - <button is="paper-icon-button-light" id="next-button" title="$i18n{rangeNext}" class="icon-button rtl-reversible" on-click="onNextTap_" disabled="[[isToday_(groupedOffset)]]"> - <iron-icon icon="cr:chevron-right"></iron-icon> - </button> + <div id="grouped-spacer"> + <div id="grouped-buttons-container"> + <paper-tabs attr-for-selected="value" selected="[[groupedRange]]" on-iron-select="onTabSelected_"> + <paper-tab value="0">$i18n{rangeAllTime}</paper-tab> + <paper-tab value="1">$i18n{rangeWeek}</paper-tab> + <paper-tab value="2">$i18n{rangeMonth}</paper-tab> + </paper-tabs> + <div id="grouped-nav-container"> + <span id="grouped-date"> + [[getHistoryInterval_(queryInfo)]] + </span> + <button is="paper-icon-button-light" id="today-button" class="icon-button" title="$i18n{rangeToday}" on-click="onTodayTap_" disabled="[[isToday_(groupedOffset)]]"> + <iron-icon icon="history:today"></iron-icon> + </button> + <button is="paper-icon-button-light" id="prev-button" title="$i18n{rangePrevious}" class="icon-button rtl-reversible" on-click="onPrevTap_" disabled="[[!hasMoreResults]]"> + <iron-icon icon="history:chevron-left"></iron-icon> + </button> + <button is="paper-icon-button-light" id="next-button" title="$i18n{rangeNext}" class="icon-button rtl-reversible" on-click="onNextTap_" disabled="[[isToday_(groupedOffset)]]"> + <iron-icon icon="cr:chevron-right"></iron-icon> + </button> + </div> </div> </div> </template> @@ -3723,7 +3741,7 @@ </history-query-manager> <history-router id="router" selected-page="{{selectedPage_}}" grouped="[[grouped_]]" query-state="[[queryState_]]"> </history-router> - <history-toolbar id="toolbar" grouped-offset="[[queryState_.groupedOffset]]" grouped-range="[[queryState_.range]]" has-drawer="[[hasDrawer_]]" has-more-results="[[!queryResult_.info.finished]]" is-grouped-mode="[[grouped_]]" query-info="[[queryResult_.info]]" querying="[[queryState_.querying]]" search-term="[[queryState_.searchTerm]]" show-menu-promo="[[showMenuPromo_]]" show-sync-notice="[[showSyncNotice_(hasSyncedResults, selectedPage_)]]" spinner-active="[[shouldShowSpinner_(queryState_.querying, + <history-toolbar id="toolbar" grouped-offset="[[queryState_.groupedOffset]]" grouped-range="[[queryState_.range]]" has-drawer="[[hasDrawer_]]" has-more-results="[[!queryResult_.info.finished]]" is-grouped-mode="[[grouped_]]" query-info="[[queryResult_.info]]" querying="[[queryState_.querying]]" search-term="[[queryState_.searchTerm]]" show-grouped-controls="[[!syncedTabsSelected_(selectedPage_)]]" show-menu-promo="[[showMenuPromo_]]" show-sync-notice="[[showSyncNotice_(hasSyncedResults, selectedPage_)]]" spinner-active="[[shouldShowSpinner_(queryState_.querying, queryState_.incremental, queryState_.searchTerm)]]"> </history-toolbar>
diff --git a/chrome/browser/resources/md_history/history_toolbar.html b/chrome/browser/resources/md_history/history_toolbar.html index 747d91a..2b5708c1 100644 --- a/chrome/browser/resources/md_history/history_toolbar.html +++ b/chrome/browser/resources/md_history/history_toolbar.html
@@ -112,12 +112,10 @@ /* Grouped toolbar. */ paper-tabs { - /* TODO(tsergeant): Align tabs with cards. */ --paper-tabs: { font-size: inherit; }; --paper-tabs-selection-bar-color: #fff; - -webkit-margin-start: 32px; height: calc(var(--toolbar-grouped-height) - var(--toolbar-height)); min-width: 300px; } @@ -128,8 +126,25 @@ } #grouped-buttons-container { + @apply(--card-sizing); align-items: center; display: flex; + max-height: 0; + opacity: 0; + transition: opacity 300ms, max-height 300ms; + } + + :host([show-grouped-controls]) #grouped-buttons-container { + max-height: calc(var(--toolbar-grouped-height) - var(--toolbar-height)); + opacity: 1; + } + + #grouped-spacer { + -webkit-margin-start: var(--side-bar-width); + } + + :host([has-drawer]) #grouped-spacer { + -webkit-margin-start: 0; } #grouped-nav-container { @@ -219,41 +234,43 @@ </template> </div> <template is="dom-if" if="[[isGroupedMode]]"> - <div id="grouped-buttons-container"> - <paper-tabs attr-for-selected="value" selected="[[groupedRange]]" - on-iron-select="onTabSelected_"> - <paper-tab value="0">$i18n{rangeAllTime}</paper-tab> - <paper-tab value="1">$i18n{rangeWeek}</paper-tab> - <paper-tab value="2">$i18n{rangeMonth}</paper-tab> - </paper-tabs> - <div id="grouped-nav-container"> - <span id="grouped-date"> - [[getHistoryInterval_(queryInfo)]] - </span> - <button is="paper-icon-button-light" - id="today-button" - class="icon-button" - title="$i18n{rangeToday}" - on-click="onTodayTap_" - disabled="[[isToday_(groupedOffset)]]"> - <iron-icon icon="history:today"></iron-icon> - </button> - <button is="paper-icon-button-light" - id="prev-button" - title="$i18n{rangePrevious}" - class="icon-button rtl-reversible" - on-click="onPrevTap_" - disabled="[[!hasMoreResults]]"> - <iron-icon icon="history:chevron-left"></iron-icon> - </button> - <button is="paper-icon-button-light" - id="next-button" - title="$i18n{rangeNext}" - class="icon-button rtl-reversible" - on-click="onNextTap_" - disabled="[[isToday_(groupedOffset)]]"> - <iron-icon icon="cr:chevron-right"></iron-icon> - </button> + <div id="grouped-spacer"> + <div id="grouped-buttons-container"> + <paper-tabs attr-for-selected="value" selected="[[groupedRange]]" + on-iron-select="onTabSelected_"> + <paper-tab value="0">$i18n{rangeAllTime}</paper-tab> + <paper-tab value="1">$i18n{rangeWeek}</paper-tab> + <paper-tab value="2">$i18n{rangeMonth}</paper-tab> + </paper-tabs> + <div id="grouped-nav-container"> + <span id="grouped-date"> + [[getHistoryInterval_(queryInfo)]] + </span> + <button is="paper-icon-button-light" + id="today-button" + class="icon-button" + title="$i18n{rangeToday}" + on-click="onTodayTap_" + disabled="[[isToday_(groupedOffset)]]"> + <iron-icon icon="history:today"></iron-icon> + </button> + <button is="paper-icon-button-light" + id="prev-button" + title="$i18n{rangePrevious}" + class="icon-button rtl-reversible" + on-click="onPrevTap_" + disabled="[[!hasMoreResults]]"> + <iron-icon icon="history:chevron-left"></iron-icon> + </button> + <button is="paper-icon-button-light" + id="next-button" + title="$i18n{rangeNext}" + class="icon-button rtl-reversible" + on-click="onNextTap_" + disabled="[[isToday_(groupedOffset)]]"> + <iron-icon icon="cr:chevron-right"></iron-icon> + </button> + </div> </div> </div> </template>
diff --git a/chrome/browser/resources/md_history/history_toolbar.js b/chrome/browser/resources/md_history/history_toolbar.js index 29d065ed..400ad21 100644 --- a/chrome/browser/resources/md_history/history_toolbar.js +++ b/chrome/browser/resources/md_history/history_toolbar.js
@@ -41,19 +41,16 @@ reflectToAttribute: true, }, - // Whether domain-grouped history is enabled. - isGroupedMode: { - type: Boolean, - reflectToAttribute: true, - }, - // The period to search over. Matches BrowsingHistoryHandler::Range. groupedRange: { type: Number, reflectToAttribute: true, }, - groupedOffset: Number, + showGroupedControls: { + type: Boolean, + reflectToAttribute: true, + }, // Show an (i) button on the right of the toolbar to display a notice about // synced history. @@ -65,11 +62,16 @@ // Sync notice is currently visible. syncNoticeVisible_: { type: Boolean, - value: false + value: false, }, hasMoreResults: Boolean, + groupedOffset: Number, + + // Whether domain-grouped history is enabled. + isGroupedMode: Boolean, + querying: Boolean, queryInfo: Object,
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html index bb110e8..b8d8010 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.html
@@ -84,13 +84,14 @@ <div id="dialogDeviceList" hidden$="[[!isDialogType_(dialogId, 'addDevice')]]" class="layout vertical flex start self-stretch"> - <span class="no-devices" hidden$="[[haveUnpaired_(deviceList.*)]]"> + <span class="no-devices" + hidden$="[[haveUnpaired_(unpairedDeviceList_)]]"> $i18n{bluetoothNoDevices} </span> <div id="container" class="layout vertical flex self-stretch" scrollable> - <iron-list items="[[getUnpaired_(deviceList.*)]]" - selection-enabled selected-item="{{selectedItem}}" + <iron-list id="devices" items="[[unpairedDeviceList_]]" + selection-enabled selected-item="{{selectedItem_}}" scroll-target="container"> <template> <bluetooth-device-list-item device="[[item]]"
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js index 6e50fb4e..267bf91 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_device_dialog.js
@@ -30,19 +30,31 @@ value: /** @return {Array} */ function() { return []; }, - observer: 'deviceListChanged_', + }, + + /** + * The ordered list of unpaired bluetooth devices. + * @type {!Array<!chrome.bluetooth.Device>} + */ + unpairedDeviceList_: { + type: Array, + value: /** @return {Array} */ function() { + return []; + }, }, /** * Reflects the iron-list selecteditem property. * @type {!chrome.bluetooth.Device} */ - selectedItem: { + selectedItem_: { type: Object, observer: 'selectedItemChanged_', }, }, + observers: ['deviceListChanged_(deviceList.*)'], + /** @type {boolean} */ itemWasFocused_: false, @@ -54,8 +66,14 @@ /** @private */ deviceListChanged_: function() { + this.saveScroll(this.$.devices); + this.unpairedDeviceList_ = this.deviceList.filter(function(device) { + return !device.paired; + }); this.updateScrollableContents(); - if (this.itemWasFocused_ || !this.getUnpaired_().length) + this.restoreScroll(this.$.devices); + + if (this.itemWasFocused_ || !this.unpairedDeviceList_.length) return; // If the iron-list is populated with at least one visible item then // focus it. @@ -73,26 +91,17 @@ /** @private */ selectedItemChanged_: function() { - if (this.selectedItem) - this.fire('device-event', {action: 'connect', device: this.selectedItem}); + if (!this.selectedItem_) + return; + this.fire('device-event', {action: 'connect', device: this.selectedItem_}); }, /** - * @return {!Array<!chrome.bluetooth.Device>} + * @return {boolean} * @private */ - getUnpaired_: function() { - return this.deviceList.filter(function(device) { - return !device.paired; - }); - }, - - /** - * @return {boolean} True if deviceList contains any unpaired devices. - * @private - */ - haveUnpaired_: function(deviceList) { - return this.getUnpaired_().length > 0; + haveUnpaired_: function() { + return this.unpairedDeviceList_.length > 0; }, };
diff --git a/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js b/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js index 50ddb239..d5fbf19 100644 --- a/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js +++ b/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
@@ -173,11 +173,12 @@ /** @private */ deviceListChanged_: function() { - var devices = this.$.devices; + this.saveScroll(this.$.devices); this.pairedDeviceList_ = this.deviceList_.filter(function(device) { return !!device.paired || !!device.connecting; }); this.updateScrollableContents(); + this.restoreScroll(this.$.devices); }, /** @private */
diff --git a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html index d861555..8a864884 100644 --- a/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html +++ b/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
@@ -25,7 +25,6 @@ } #dialog .footer { - background-color: #fff; color: var(--paper-grey-600); }
diff --git a/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp b/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp index fc65bec..44831d3 100644 --- a/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp
@@ -35,6 +35,7 @@ { 'target_name': 'internet_known_networks_page', 'dependencies': [ + '<(DEPTH)/ui/webui/resources/cr_elements/cr_action_menu/compiled_resources2.gyp:cr_action_menu', '<(DEPTH)/ui/webui/resources/cr_elements/network/compiled_resources2.gyp:cr_onc_types', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(EXTERNS_GYP):networking_private',
diff --git a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html index 2495f3a..e5482d8 100644 --- a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
@@ -1,3 +1,4 @@ +<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html"> @@ -20,7 +21,8 @@ filter="networkIsPreferred_"> <div class="settings-box self-stretch"> <div class="start">[[item.Name]]</div> - <paper-icon-button icon="cr:clear" on-tap="onRemoveTap_"> + <paper-icon-button preferred icon="cr:more-vert" + tabindex$="[[tabindex]]" on-tap="onMenuButtonTap_"> </paper-icon-button> </div> </template> @@ -32,12 +34,28 @@ filter="networkIsNotPreferred_"> <div class="settings-box self-stretch"> <div class="start">[[item.Name]]</div> - <paper-icon-button icon="cr:add" on-tap="onAddTap_"> + <paper-icon-button icon="cr:more-vert" tabindex$="[[tabindex]]" + on-tap="onMenuButtonTap_"> </paper-icon-button> </div> </template> </div> </div> + + <dialog id="dotsMenu" is="cr-action-menu"> + <button class="dropdown-item" role="option" + hidden="[[selectedIsPreferred_]]" on-tap="onAddPreferredTap_"> + $i18n{knownNetworksMenuAddPreferred} + </button> + <button class="dropdown-item" role="option" + hidden="[[!selectedIsPreferred_]]" on-tap="onRemovePreferredTap_"> + $i18n{knownNetworksMenuRemovePreferred} + </button> + <button class="dropdown-item" role="option" on-tap="onForgetTap_"> + $i18n{knownNetworksMenuForget} + </button> + </dialog> + </template> <script src="internet_known_networks_page.js"></script> </dom-module>
diff --git a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js index bbd19d2d..bf8b2b3f 100644 --- a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.js
@@ -38,6 +38,12 @@ }, }, + /** @private {string} */ + selectedGuid_: '', + + /** @private {boolean} */ + selectedIsPreferred_: false, + /** * Listener function for chrome.networkingPrivate.onNetworksChanged event. * @type {function(!Array<string>)} @@ -130,20 +136,34 @@ }, /** - * @param {!{model: !{item: !CrOnc.NetworkStateProperties}}} e + * @param {!Event} event * @private */ - onRemoveTap_: function(e) { - var state = e.model.item; - this.networkingPrivate.setProperties(state.GUID, {Priority: 0}); + onMenuButtonTap_: function(event) { + var button = /** @type {!HTMLElement} */ (event.target); + this.selectedGuid_ = + /** @type {!{model: !{item: !CrOnc.NetworkStateProperties}}} */ (event) + .model.item.GUID; + this.selectedIsPreferred_ = button.hasAttribute('preferred'); + /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).showAt(button); + event.stopPropagation(); }, - /** - * @param {!{model: !{item: !CrOnc.NetworkStateProperties}}} e - * @private - */ - onAddTap_: function(e) { - var state = e.model.item; - this.networkingPrivate.setProperties(state.GUID, {Priority: 1}); + /** @private */ + onRemovePreferredTap_: function() { + this.networkingPrivate.setProperties(this.selectedGuid_, {Priority: 0}); + /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close(); + }, + + /** @private */ + onAddPreferredTap_: function() { + this.networkingPrivate.setProperties(this.selectedGuid_, {Priority: 1}); + /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close(); + }, + + /** @private */ + onForgetTap_: function() { + this.networkingPrivate.forgetNetwork(this.selectedGuid_); + /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close(); }, });
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.html b/chrome/browser/resources/settings/languages_page/languages_page.html index 9a9d646..76202229 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.html +++ b/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -87,16 +87,16 @@ </cr-expand-button> </div> <iron-collapse id="languagesCollapse" opened="[[languagesOpened_]]"> - <div class="list-frame vertical-list"> - <span class="list-item" - hidden="[[isHelpTextHidden_(languages.enabled.*)]]"> - <span>$i18n{orderLanguagesInstructions}</span> + <span class="settings-box first" + hidden="[[isHelpTextHidden_(languages.enabled.*)]]"> + <span>$i18n{orderLanguagesInstructions}</span> <if expr="chromeos"> - <a href="$i18n{languagesLearnMoreURL}" target="_blank"> - $i18n{learnMore} - </a> + <a href="$i18n{languagesLearnMoreURL}" target="_blank"> + $i18n{learnMore} + </a> </if> - </span> + </span> + <div class="list-frame vertical-list"> <template is="dom-repeat" items="[[languages.enabled]]"> <div class$="list-item [[getLanguageItemClass_( item.language.code, language.prospectiveUILanguage)]]"> @@ -133,6 +133,12 @@ </a> </div> </div> + <div class="settings-box first"> + <settings-toggle-button id="offerTranslateOtherLangs" class="start" + pref="{{prefs.translate.enabled}}" + label="$i18n{offerToEnableTranslate}"> + </settings-toggle-button> + </div> </iron-collapse> <if expr="chromeos"> <div id="manageInputMethodsSubpageTrigger" @@ -239,19 +245,18 @@ <hr> <button class="dropdown-item" role="menuitem" on-tap="onMoveToTopTap_" - hidden="[[isFirstLanguage_( - detailLanguage_, languages.enabled.*)]]"> + hidden="[[isNthLanguage_( + 0, detailLanguage_, languages.enabled.*)]]"> $i18n{moveToTop} </button> <button class="dropdown-item" role="menuitem" on-tap="onMoveUpTap_" - hidden="[[isFirstOrSecondLanguage_( - detailLanguage_, languages.enabled.*)]]"> + hidden="[[!showMoveUp_(detailLanguage_, languages.enabled.*)]]"> $i18n{moveUp} </button> <button class="dropdown-item" role="menuitem" on-tap="onMoveDownTap_" - hidden="[[isLastLanguage_( + hidden="[[!showMoveDown_( detailLanguage_, languages.enabled.*)]]"> $i18n{moveDown} </button>
diff --git a/chrome/browser/resources/settings/languages_page/languages_page.js b/chrome/browser/resources/settings/languages_page/languages_page.js index 1971ab8..76147b0 100644 --- a/chrome/browser/resources/settings/languages_page/languages_page.js +++ b/chrome/browser/resources/settings/languages_page/languages_page.js
@@ -92,33 +92,40 @@ }, /** + * Used to determine which "Move" buttons to show for ordering enabled + * languages. + * @param {number} n * @param {!LanguageState} language - * @return {boolean} True if |language| is first in the list of enabled - * languages. Used to hide the "Move up" option. + * @return {boolean} True if |language| is at the |n|th index in the list of + * enabled languages. * @private */ - isFirstLanguage_: function(language) { - return language == this.languages.enabled[0]; + isNthLanguage_: function(n, language) { + var compareLanguage = assert(this.languages.enabled[n]); + return language.language == compareLanguage.language; }, /** * @param {!LanguageState} language - * @return {boolean} True if |language| is first or second in the list of - * enabled languages. Used to hide the "Move to top" option. + * @return {boolean} True if the "Move to top" option for |language| should be + * visible. * @private */ - isFirstOrSecondLanguage_: function(language) { - return this.languages.enabled.slice(0, 2).includes(language); + showMoveUp_: function(language) { + // "Move up" is a no-op for the top language, and redundant with + // "Move to top" for the 2nd language. + return !this.isNthLanguage_(0, language) && + !this.isNthLanguage_(1, language); }, /** * @param {!LanguageState} language - * @return {boolean} True if |language| is last in the list of enabled - * languages. Used to hide the "Move down" option. + * @return {boolean} True if the "Move down" option for |language| should be + * visible. * @private */ - isLastLanguage_: function(language) { - return language == this.languages.enabled.slice(-1)[0]; + showMoveDown_: function(language) { + return !this.isNthLanguage_(this.languages.enabled.length - 1, language); }, /**
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html index ee85d5c..8fc1f8c 100644 --- a/chrome/browser/resources/settings/people_page/people_page.html +++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -94,7 +94,7 @@ width: var(--iron-icon-width); } - .footer .settings-box { + #disconnectDialog .footer .settings-box { --settings-box-row-padding: 0; } @@ -369,7 +369,7 @@ </div> <if expr="(not chromeos and is_posix) or is_win or is_macosx"> <template is="dom-if" if="[[!syncStatus.domain]]"> - <div class="footer"> + <div class="footer border-top-divider"> <div class="settings-box first"> <paper-checkbox id="deleteProfile" class="start" checked="{{deleteProfile_}}">
diff --git a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html index d408d98..15cf28a 100644 --- a/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html +++ b/chrome/browser/resources/settings/reset_page/reset_profile_dialog.html
@@ -45,7 +45,7 @@ $i18n{resetPageCommit} </paper-button> </div> - <div class="footer"> + <div class="footer border-top-divider"> <paper-checkbox id="sendSettings" checked>$i18n{resetPageFeedback}</paper-checkbox> <a is="action-link"
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui.js b/chrome/browser/resources/vr_shell/vr_shell_ui.js index 86cc664a..cde460d 100644 --- a/chrome/browser/resources/vr_shell/vr_shell_ui.js +++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
@@ -642,6 +642,15 @@ if ('suggestions' in dict) { uiManager.omnibox.setSuggestions(dict['suggestions']); } + if ('setTabs' in dict) { + console.log(dict['setTabs']); + } + if ('updateTab' in dict) { + console.log(dict['updateTab']); + } + if ('removeTab' in dict) { + console.log(dict['removeTab']); + } ui.flush(); }
diff --git a/chrome/browser/safe_browsing/certificate_reporting_service.cc b/chrome/browser/safe_browsing/certificate_reporting_service.cc index ad70493..7c013f5 100644 --- a/chrome/browser/safe_browsing/certificate_reporting_service.cc +++ b/chrome/browser/safe_browsing/certificate_reporting_service.cc
@@ -21,7 +21,8 @@ // a client seeing an invalid cert might not be able to make an HTTPS connection // to report it. const char kExtendedReportingUploadUrl[] = - "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/"; + "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/" + "chrome-certs"; // Compare function that orders Reports in reverse chronological order (i.e. // oldest item is last).
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 1dfefce..40f5ef4 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -113,7 +113,7 @@ ~MockSubresourceFilterDriver() override = default; MOCK_METHOD3(ActivateForProvisionalLoad, - void(subresource_filter::ActivationState, const GURL&, bool)); + void(subresource_filter::ActivationLevel, const GURL&, bool)); private: DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterDriver); @@ -938,7 +938,7 @@ subresource_filter::testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( base::FeatureList::OVERRIDE_ENABLE_FEATURE, - subresource_filter::kActivationStateEnabled, + subresource_filter::kActivationLevelEnabled, subresource_filter::kActivationScopeActivationList, subresource_filter::kActivationListSocialEngineeringAdsInterstitial); // Tests that when Safe Browsing gets hit which is corresponding to the @@ -985,7 +985,7 @@ subresource_filter::testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( base::FeatureList::OVERRIDE_ENABLE_FEATURE, - subresource_filter::kActivationStateEnabled, + subresource_filter::kActivationLevelEnabled, subresource_filter::kActivationScopeNoSites, subresource_filter::kActivationListSocialEngineeringAdsInterstitial);
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config.h b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config.h index 75c1fe5..799fefd 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config.h +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config.h
@@ -47,7 +47,7 @@ SettingsResetPromptConfig(); private: - typedef std::vector<uint8_t> SHA256Hash; + using SHA256Hash = std::vector<uint8_t>; struct SHA256HashHasher { size_t operator()(const SHA256Hash& key) const; };
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc index cc47a0b..3e3832b 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_config.h" @@ -14,12 +15,21 @@ #include "extensions/common/extension.h" #include "extensions/common/extension_id.h" #include "extensions/common/extension_set.h" -#include "url/gurl.h" namespace safe_browsing { namespace { +// Used to keep track of which settings types have been initialized in +// |SettingsResetPromptModel|. +enum SettingsType : uint32_t { + SETTINGS_TYPE_HOMEPAGE = 1 << 0, + SETTINGS_TYPE_DEFAULT_SEARCH = 1 << 1, + SETTINGS_TYPE_STARTUP_URLS = 1 << 2, + SETTINGS_TYPE_ALL = SETTINGS_TYPE_HOMEPAGE | SETTINGS_TYPE_DEFAULT_SEARCH | + SETTINGS_TYPE_STARTUP_URLS, +}; + const extensions::Extension* GetExtension( Profile* profile, const extensions::ExtensionId& extension_id) { @@ -36,16 +46,21 @@ : profile_(profile), prompt_config_(std::move(prompt_config)), settings_snapshot_(std::move(settings_snapshot)), + settings_types_initialized_(0), homepage_reset_domain_id_(-1), - homepage_reset_state_(DISABLED_DUE_TO_DOMAIN_NOT_MATCHED), + homepage_reset_state_(NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED), default_search_reset_domain_id_(-1), - default_search_reset_state_(DISABLED_DUE_TO_DOMAIN_NOT_MATCHED) { + default_search_reset_state_(NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED), + startup_urls_reset_state_(NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED) { DCHECK(profile_); DCHECK(prompt_config_); DCHECK(settings_snapshot_); InitHomepageData(); InitDefaultSearchData(); + InitStartupUrlsData(); + DCHECK_EQ(settings_types_initialized_, SETTINGS_TYPE_ALL); + InitExtensionData(); // TODO(alito): Figure out cases where settings cannot be reset, for example @@ -55,8 +70,9 @@ SettingsResetPromptModel::~SettingsResetPromptModel() {} bool SettingsResetPromptModel::ShouldPromptForReset() { - return homepage_reset_state() == ENABLED || - default_search_reset_state() == ENABLED; + return homepage_reset_state() == RESET_REQUIRED || + default_search_reset_state() == RESET_REQUIRED || + startup_urls_reset_state() == RESET_REQUIRED; } std::string SettingsResetPromptModel::homepage() const { @@ -65,7 +81,8 @@ SettingsResetPromptModel::ResetState SettingsResetPromptModel::homepage_reset_state() const { - DCHECK(homepage_reset_state_ != ENABLED || homepage_reset_domain_id_ >= 0); + DCHECK(homepage_reset_state_ != RESET_REQUIRED || + homepage_reset_domain_id_ >= 0); return homepage_reset_state_; } @@ -75,19 +92,34 @@ SettingsResetPromptModel::ResetState SettingsResetPromptModel::default_search_reset_state() const { - DCHECK(default_search_reset_state_ != ENABLED || + DCHECK(default_search_reset_state_ != RESET_REQUIRED || default_search_reset_domain_id_ >= 0); return default_search_reset_state_; } +const std::vector<GURL>& SettingsResetPromptModel::startup_urls() const { + return startup_urls_; +} + +const std::vector<GURL>& SettingsResetPromptModel::startup_urls_to_reset() + const { + return startup_urls_to_reset_; +} + +SettingsResetPromptModel::ResetState +SettingsResetPromptModel::startup_urls_reset_state() const { + return startup_urls_reset_state_; +} + const SettingsResetPromptModel::ExtensionMap& SettingsResetPromptModel::extensions_to_disable() const { return extensions_to_disable_; } void SettingsResetPromptModel::InitHomepageData() { - DCHECK_LT(homepage_reset_domain_id_, 0); - DCHECK_EQ(homepage_reset_state_, DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + DCHECK(!(settings_types_initialized_ & SETTINGS_TYPE_HOMEPAGE)); + + settings_types_initialized_ |= SETTINGS_TYPE_HOMEPAGE; // If the home button is not visible to the user, then the homepage setting // has no real user-visible effect. @@ -104,19 +136,39 @@ if (homepage_reset_domain_id_ < 0) return; - homepage_reset_state_ = ENABLED; + homepage_reset_state_ = RESET_REQUIRED; } void SettingsResetPromptModel::InitDefaultSearchData() { - DCHECK_LT(default_search_reset_domain_id_, 0); - DCHECK_EQ(default_search_reset_state_, DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + DCHECK(!(settings_types_initialized_ & SETTINGS_TYPE_DEFAULT_SEARCH)); + + settings_types_initialized_ |= SETTINGS_TYPE_DEFAULT_SEARCH; default_search_reset_domain_id_ = prompt_config_->UrlToResetDomainId(GURL(settings_snapshot_->dse_url())); if (default_search_reset_domain_id_ < 0) return; - default_search_reset_state_ = ENABLED; + default_search_reset_state_ = RESET_REQUIRED; +} + +void SettingsResetPromptModel::InitStartupUrlsData() { + DCHECK(!(settings_types_initialized_ & SETTINGS_TYPE_STARTUP_URLS)); + + settings_types_initialized_ |= SETTINGS_TYPE_STARTUP_URLS; + + // Only the URLS startup type is a candidate for resetting. + if (settings_snapshot_->startup_type() == SessionStartupPref::URLS) { + startup_urls_ = settings_snapshot_->startup_urls(); + for (const GURL& startup_url : settings_snapshot_->startup_urls()) { + int reset_domain_id = prompt_config_->UrlToResetDomainId(startup_url); + if (reset_domain_id >= 0) { + startup_urls_reset_state_ = RESET_REQUIRED; + startup_urls_to_reset_.push_back(startup_url); + domain_ids_for_startup_urls_to_reset_.insert(reset_domain_id); + } + } + } } // Populate |extensions_to_disable_| with all enabled extensions that override @@ -127,6 +179,7 @@ // other Init*() functions. void SettingsResetPromptModel::InitExtensionData() { DCHECK(settings_snapshot_); + DCHECK_EQ(settings_types_initialized_, SETTINGS_TYPE_ALL); // |enabled_extensions()| is a container of [id, name] pairs. for (const auto& id_name : settings_snapshot_->enabled_extensions()) { @@ -146,8 +199,11 @@ if (!overrides) continue; - if ((homepage_reset_state_ == ENABLED && overrides->homepage) || - (default_search_reset_state_ == ENABLED && overrides->search_engine)) { + if ((homepage_reset_state_ == RESET_REQUIRED && overrides->homepage) || + (default_search_reset_state_ == RESET_REQUIRED && + overrides->search_engine) || + (startup_urls_reset_state_ == RESET_REQUIRED && + !overrides->startup_pages.empty())) { ExtensionInfo extension_info(extension); extensions_to_disable_.insert( std::make_pair(extension_info.id, extension_info));
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h index 9a58e93e..abbdd27c 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model.h
@@ -5,13 +5,18 @@ #ifndef CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT_MODEL_H_ #define CHROME_BROWSER_SAFE_BROWSING_SETTINGS_RESET_PROMPT_SETTINGS_RESET_PROMPT_MODEL_H_ +#include <stdint.h> + #include <memory> #include <string> #include <unordered_map> +#include <unordered_set> +#include <vector> #include "base/macros.h" #include "chrome/browser/safe_browsing/settings_reset_prompt/extension_info.h" #include "extensions/common/extension_id.h" +#include "url/gurl.h" class Profile; class ResettableSettingsSnapshot; @@ -25,8 +30,8 @@ class SettingsResetPromptModel { public: enum ResetState { - ENABLED = 1, - DISABLED_DUE_TO_DOMAIN_NOT_MATCHED = 2, + RESET_REQUIRED = 1, + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED = 2, }; using ExtensionMap = @@ -47,6 +52,14 @@ std::string default_search() const; ResetState default_search_reset_state() const; + // Returns list of all current startup URLs. Returns empty list if session + // startup is set to show the NTP or restore last session. + const std::vector<GURL>& startup_urls() const; + // Returns the list of all startup URLs that have a match in the prompt + // config. This is a subset of the URLs returned by |startup_urls()|. + const std::vector<GURL>& startup_urls_to_reset() const; + ResetState startup_urls_reset_state() const; + // Returns a map of extension ID -> ExtensionInfo for all extensions that will // be disabled. const ExtensionMap& extensions_to_disable() const; @@ -55,17 +68,27 @@ void InitHomepageData(); void InitDefaultSearchData(); void InitExtensionData(); + void InitStartupUrlsData(); Profile* const profile_; std::unique_ptr<SettingsResetPromptConfig> prompt_config_; std::unique_ptr<ResettableSettingsSnapshot> settings_snapshot_; + // Bits to keep track of which settings types have been initialized. + uint32_t settings_types_initialized_; + int homepage_reset_domain_id_; ResetState homepage_reset_state_; int default_search_reset_domain_id_; ResetState default_search_reset_state_; + std::vector<GURL> startup_urls_; + std::vector<GURL> startup_urls_to_reset_; + // Reset domain IDs for URLs in |startup_urls_to_reset_|; + std::unordered_set<int> domain_ids_for_startup_urls_to_reset_; + ResetState startup_urls_reset_state_; + ExtensionMap extensions_to_disable_; DISALLOW_COPY_AND_ASSIGN(SettingsResetPromptModel);
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest.cc index 26734ac..92ba01a 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest.cc
@@ -12,6 +12,7 @@ #include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/values.h" #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/test_extension_dir.h" #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" @@ -34,22 +35,31 @@ using extensions::Extension; using testing::_; +using testing::Bool; +using testing::Combine; using testing::ElementsAre; using testing::IsEmpty; -using testing::NiceMock; using testing::Pair; -using testing::Return; -using testing::SizeIs; using testing::UnorderedElementsAre; const char kDefaultHomepage[] = "http://myhomepage.com"; const char kDefaultSearchUrl[] = "http://mygoogle.com/s?q={searchTerms}"; +const char kDefaultStartupUrl1[] = "http://mystart1.com"; +const char kDefaultStartupUrl2[] = "http://mystart2.com"; +// Some tests and parts of tests should only be run on platforms where settings +// override for extensions is available. The settings reset prompt is currently +// designed for desktop, and Windows in particular. Getting the tests to run on +// other platforms that do not allow extensions to override settings (e.g., +// Linux) would require more #ifdefs and platform specific considerations than +// it is worth. #if defined(OS_WIN) || defined(OS_MACOSX) const char kHomepage1[] = "http://homepage.com/"; const char kHomepage2[] = "http://otherhomepage.com/"; const char kSearchUrl1[] = "http://mysearch.com/s?q={searchTerms}"; const char kSearchUrl2[] = "http://othersearch.com/s?q={searchTerms}"; +const char kStartupUrl1[] = "http://super-startup.com"; +const char kStartupUrl2[] = "http://awesome-start-page.com"; #endif // defined(OS_WIN) || defined(OS_MACOSX) // Extension manifests to override settings. @@ -84,13 +94,26 @@ " 'encoding': 'UTF-8'," " 'is_default': true" " }" - " }" + " }" + "}"; + +const char kManifestToOverrideStartupUrls[] = + "{" + " 'name': 'Startup URLs Extension'," + " 'version': '1'," + " 'manifest_version': 2," + " 'chrome_settings_overrides' : {" + " 'startup_pages': ['%s']" + " }" "}"; class SettingsResetPromptModelBrowserTest : public ExtensionBrowserTest { protected: using ModelPointer = std::unique_ptr<SettingsResetPromptModel>; + SettingsResetPromptModelBrowserTest() + : startup_pref_(SessionStartupPref::URLS) {} + void SetUpOnMainThread() override { ExtensionBrowserTest::SetUpOnMainThread(); @@ -114,6 +137,14 @@ TemplateURL* template_url = template_url_service->Add(base::MakeUnique<TemplateURL>(data)); template_url_service->SetUserSelectedDefaultSearchProvider(template_url); + + // Set up a couple of startup URLs. + startup_pref_.urls.push_back(GURL(kDefaultStartupUrl1)); + startup_pref_.urls.push_back(GURL(kDefaultStartupUrl2)); + SessionStartupPref::SetStartupPref(profile(), startup_pref_); + ASSERT_EQ(SessionStartupPref::PrefValueToType( + GetPrefs()->GetInteger(prefs::kRestoreOnStartup)), + startup_pref_.type); } PrefService* GetPrefs() { return profile()->GetPrefs(); } @@ -140,6 +171,21 @@ EXPECT_EQ(std::string(search_url), dse->url()); } + void LoadStartupUrlExtension(const char* startup_url, + const Extension** out_extension) { + const std::string manifest = + base::StringPrintf(kManifestToOverrideStartupUrls, startup_url); + LoadManifest(manifest, out_extension); + + // Ensure that the startup url seen in the prefs is same as |startup_url|. + const base::ListValue* url_list = + GetPrefs()->GetList(prefs::kURLsToRestoreOnStartup); + ASSERT_EQ(url_list->GetSize(), 1U); + std::string url_text; + ASSERT_TRUE(url_list->GetString(0, &url_text)); + ASSERT_EQ(GURL(url_text), GURL(startup_url)); + } + void LoadManifest(const std::string& manifest, const Extension** out_extension) { extensions::TestExtensionDir extension_dir; @@ -159,6 +205,8 @@ ModelPointer CreateModel(std::unordered_set<std::string> reset_urls) { return CreateModelForTesting(profile(), reset_urls); } + + SessionStartupPref startup_pref_; }; IN_PROC_BROWSER_TEST_F(SettingsResetPromptModelBrowserTest, @@ -166,15 +214,17 @@ // Homepage does not require reset to start with. { ModelPointer model = CreateModel(); - EXPECT_EQ(model->homepage_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->homepage_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } // Let homepage require reset, no extensions need to be disable. { ModelPointer model = CreateModel({kDefaultHomepage}); - EXPECT_EQ(model->homepage_reset_state(), SettingsResetPromptModel::ENABLED); + EXPECT_EQ(model->homepage_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -184,16 +234,13 @@ LoadManifest(kManifestNoOverride, &safe_extension); { ModelPointer model = CreateModel({kDefaultHomepage}); - EXPECT_EQ(model->homepage_reset_state(), SettingsResetPromptModel::ENABLED); + EXPECT_EQ(model->homepage_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } -// The next part should only be run on platforms where settings override for -// extension is available. The settings reset prompt is currently designed for -// desktop, and Windows in particular. Getting the tests to run on other -// platforms that do not allow extensions to override settings (e.g., Linux) -// would require more #ifdefs and platform specific considerations than it is -// worth. +// Some tests should run only on platforms where settings override for +// extensions is available. See comment at the top for more details. #if defined(OS_WIN) || defined(OS_MACOSX) // Load extension that overrides homepage. Homepage no longer needs to be // reset. @@ -201,8 +248,9 @@ LoadHomepageExtension(kHomepage1, &homepage_extension1); { ModelPointer model = CreateModel({kDefaultHomepage}); - EXPECT_EQ(model->homepage_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->homepage_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -210,7 +258,8 @@ // be reset, one extension needs to be disabled. { ModelPointer model = CreateModel({kDefaultHomepage, kHomepage1}); - EXPECT_EQ(model->homepage_reset_state(), SettingsResetPromptModel::ENABLED); + EXPECT_EQ(model->homepage_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), ElementsAre(Pair(homepage_extension1->id(), _))); } @@ -221,8 +270,9 @@ LoadHomepageExtension(kHomepage2, &homepage_extension2); { ModelPointer model = CreateModel({kDefaultHomepage, kHomepage1}); - EXPECT_EQ(model->homepage_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->homepage_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -231,7 +281,8 @@ { ModelPointer model = CreateModel({kDefaultHomepage, kHomepage1, kHomepage2}); - EXPECT_EQ(model->homepage_reset_state(), SettingsResetPromptModel::ENABLED); + EXPECT_EQ(model->homepage_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), UnorderedElementsAre(Pair(homepage_extension1->id(), _), Pair(homepage_extension2->id(), _))); @@ -241,7 +292,8 @@ // needs to be reset, and both extensions need to be disabled. { ModelPointer model = CreateModel({kHomepage2}); - EXPECT_EQ(model->homepage_reset_state(), SettingsResetPromptModel::ENABLED); + EXPECT_EQ(model->homepage_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), UnorderedElementsAre(Pair(homepage_extension1->id(), _), Pair(homepage_extension2->id(), _))); @@ -254,8 +306,9 @@ // Search does not need to be reset to start with. { ModelPointer model = CreateModel(); - EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->default_search_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -264,35 +317,32 @@ { ModelPointer model = CreateModel({kDefaultSearchUrl}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } // Load an extension that does not override settings. Search still needs to be - // reset, no extensions need to ge disabled. + // reset, no extensions need to be disabled. const Extension* safe_extension = nullptr; LoadManifest(kManifestNoOverride, &safe_extension); { ModelPointer model = CreateModel({kDefaultSearchUrl}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } -// The next part should only be run on platforms where settings override for -// extension is available. The settings reset prompt is currently designed for -// desktop, and Windows in particular. Getting the tests to run on other -// platforms that do not allow extensions to override settings (e.g., Linux) -// would require more #ifdefs and platform specific considerations than it is -// worth. +// Some tests should run only on platforms where settings override for +// extensions is available. See comment at the top for more details. #if defined(OS_WIN) || defined(OS_MACOSX) // Load extension that overrides search. Search no longer needs to be reset. const Extension* search_extension1 = nullptr; LoadSearchExtension(kSearchUrl1, &search_extension1); { ModelPointer model = CreateModel({kDefaultSearchUrl}); - EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->default_search_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -301,7 +351,7 @@ { ModelPointer model = CreateModel({kDefaultSearchUrl, kSearchUrl1}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), ElementsAre(Pair(search_extension1->id(), _))); } @@ -312,8 +362,9 @@ LoadSearchExtension(kSearchUrl2, &search_extension2); { ModelPointer model = CreateModel({kDefaultSearchUrl, kSearchUrl1}); - EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->default_search_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); } @@ -323,7 +374,7 @@ ModelPointer model = CreateModel({kDefaultSearchUrl, kSearchUrl1, kSearchUrl2}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), UnorderedElementsAre(Pair(search_extension1->id(), _), Pair(search_extension2->id(), _))); @@ -334,7 +385,7 @@ { ModelPointer model = CreateModel({kSearchUrl2}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); EXPECT_THAT(model->extensions_to_disable(), UnorderedElementsAre(Pair(search_extension1->id(), _), Pair(search_extension2->id(), _))); @@ -342,5 +393,248 @@ #endif // defined(OS_WIN) || defined(OS_MACOSX) } +IN_PROC_BROWSER_TEST_F(SettingsResetPromptModelBrowserTest, + ExtensionsToDisable_StartupUrls) { + // Startup urls do not require reset to begin with. + { + ModelPointer model = CreateModel(); + EXPECT_EQ( + model->startup_urls_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_THAT(model->startup_urls(), + UnorderedElementsAre(GURL(kDefaultStartupUrl1), + GURL(kDefaultStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); + } + + // Let a default startup URL require reset, no extensions need to be disabled. + { + ModelPointer model = CreateModel({kDefaultStartupUrl1}); + EXPECT_EQ(model->startup_urls_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); + EXPECT_THAT(model->startup_urls(), + UnorderedElementsAre(GURL(kDefaultStartupUrl1), + GURL(kDefaultStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kDefaultStartupUrl1))); + EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); + } + + // Load an extension that does not override settings. Startup URLs still needs + // to be reset, no extensions need to be disabled. + const Extension* safe_extension = nullptr; + LoadManifest(kManifestNoOverride, &safe_extension); + { + ModelPointer model = CreateModel({kDefaultStartupUrl1}); + EXPECT_EQ(model->startup_urls_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); + EXPECT_THAT(model->startup_urls(), + UnorderedElementsAre(GURL(kDefaultStartupUrl1), + GURL(kDefaultStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kDefaultStartupUrl1))); + EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); + } + +// Some tests should run only on platforms where settings override for +// extensions is available. See comment at the top for more details. +#if defined(OS_WIN) || defined(OS_MACOSX) + // Load two other extensions that each override startup urls. + const Extension* startup_url_extension1 = nullptr; + LoadStartupUrlExtension(kStartupUrl1, &startup_url_extension1); + const Extension* startup_url_extension2 = nullptr; + LoadStartupUrlExtension(kStartupUrl2, &startup_url_extension2); + + // Startup URLs should not require reset when a default startup URL that is + // not active (since it is now overridden by an extension) requires reset. + { + ModelPointer model = CreateModel({kDefaultStartupUrl1}); + EXPECT_EQ( + model->startup_urls_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); + } + + // Let the first extension's URL require reset. Startup URLs do not need to be + // reset because the second extension's URL is the active one and does not + // require reset. + { + ModelPointer model = CreateModel({kStartupUrl1}); + EXPECT_EQ( + model->startup_urls_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + EXPECT_THAT(model->extensions_to_disable(), IsEmpty()); + } + + // Let the second extension's URL also require reset. Startup URLs now need to + // be reset and both extensions need to be disabled. + { + ModelPointer model = CreateModel({kStartupUrl1, kStartupUrl2}); + EXPECT_EQ(model->startup_urls_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->extensions_to_disable(), + UnorderedElementsAre(Pair(startup_url_extension1->id(), _), + Pair(startup_url_extension2->id(), _))); + } + + // Both extensions need to be disabled even when only the second extension's + // URL requires reset. + { + ModelPointer model = CreateModel({kStartupUrl2}); + EXPECT_EQ(model->startup_urls_reset_state(), + SettingsResetPromptModel::RESET_REQUIRED); + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kStartupUrl2))); + EXPECT_THAT(model->extensions_to_disable(), + UnorderedElementsAre(Pair(startup_url_extension1->id(), _), + Pair(startup_url_extension2->id(), _))); + } +#endif // defined(OS_WIN) || defined(OS_MACOSX) +} + +// Some tests should run only on platforms where settings override for +// extensions is available. See comment at the top for more details. +#if defined(OS_WIN) || defined(OS_MACOSX) +const char kManifestToOverrideAll[] = + "{" + " 'name': 'Override All Extension'," + " 'version': '0.1'," + " 'manifest_version': 2," + " 'chrome_settings_overrides': {" + " 'homepage': '%s'," + " 'search_provider': {" + " 'name': 'name'," + " 'keyword': 'keyword'," + " 'search_url': '%s'," + " 'favicon_url': 'http://someplace.com/favicon.ico'," + " 'encoding': 'UTF-8'," + " 'is_default': true" + " }," + " 'startup_pages': ['%s']" + " }" + "}"; + +class ExtensionSettingsOverrideTest + : public SettingsResetPromptModelBrowserTest, + public testing::WithParamInterface<testing::tuple<bool, bool, bool>> { + protected: + void SetUpOnMainThread() override { + SettingsResetPromptModelBrowserTest::SetUpOnMainThread(); + homepage_requires_reset_ = testing::get<0>(GetParam()); + default_search_requires_reset_ = testing::get<1>(GetParam()); + startup_urls_requires_reset_ = testing::get<2>(GetParam()); + + // Always set up these extensions, but only require reset for their URLs + // based on the parameters of the test: + // + // - 1 extension that overrides all three settings. + // - 2 Homepage-overriding extensions; + // - 2 Search-overriding extensions; and + // - 2 Startup URLs-overriding extensions. + // + // For each setting, the value set by the last installed extension that + // overrides that setting will be the value set in preferences. + std::string override_all_manifest = + base::StringPrintf(kManifestToOverrideAll, "http://all-homepage.com", + "http://all-search.com", "http://all-startup.com"); + LoadManifest(override_all_manifest, &overrides_all_); + LoadHomepageExtension(kHomepage1, &homepage1_); + LoadHomepageExtension(kHomepage2, &homepage2_); + LoadSearchExtension(kSearchUrl1, &default_search1_); + LoadSearchExtension(kSearchUrl2, &default_search2_); + LoadStartupUrlExtension(kStartupUrl1, &startup_urls1_); + LoadStartupUrlExtension(kStartupUrl2, &startup_urls2_); + } + + bool homepage_requires_reset_; + bool default_search_requires_reset_; + bool startup_urls_requires_reset_; + const Extension* overrides_all_; + const Extension* homepage1_; + const Extension* homepage2_; + const Extension* default_search1_; + const Extension* default_search2_; + const Extension* startup_urls1_; + const Extension* startup_urls2_; +}; + +IN_PROC_BROWSER_TEST_P(ExtensionSettingsOverrideTest, ExtensionsToDisable) { + // Prepare the reset URLs based on the test parameters. + std::unordered_set<std::string> reset_urls; + if (homepage_requires_reset_) + reset_urls.insert(kHomepage2); + if (default_search_requires_reset_) + reset_urls.insert(kSearchUrl2); + if (startup_urls_requires_reset_) + reset_urls.insert(kStartupUrl2); + + { + ModelPointer model = CreateModel(reset_urls); + EXPECT_EQ(model->homepage(), kHomepage2); + EXPECT_EQ(model->homepage_reset_state(), + homepage_requires_reset_ + ? SettingsResetPromptModel::RESET_REQUIRED + : SettingsResetPromptModel:: + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + + EXPECT_EQ(model->default_search(), kSearchUrl2); + EXPECT_EQ(model->default_search_reset_state(), + default_search_requires_reset_ + ? SettingsResetPromptModel::RESET_REQUIRED + : SettingsResetPromptModel:: + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl2))); + if (startup_urls_requires_reset_) { + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kStartupUrl2))); + } else { + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + } + EXPECT_EQ(model->startup_urls_reset_state(), + startup_urls_requires_reset_ + ? SettingsResetPromptModel::RESET_REQUIRED + : SettingsResetPromptModel:: + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); + + std::unordered_set<extensions::ExtensionId> expected_extension_ids; + if (homepage_requires_reset_) { + expected_extension_ids.insert(homepage1_->id()); + expected_extension_ids.insert(homepage2_->id()); + expected_extension_ids.insert(overrides_all_->id()); + } + if (default_search_requires_reset_) { + expected_extension_ids.insert(default_search1_->id()); + expected_extension_ids.insert(default_search2_->id()); + expected_extension_ids.insert(overrides_all_->id()); + } + if (startup_urls_requires_reset_) { + expected_extension_ids.insert(startup_urls1_->id()); + expected_extension_ids.insert(startup_urls2_->id()); + expected_extension_ids.insert(overrides_all_->id()); + } + + std::unordered_set<extensions::ExtensionId> actual_extension_ids; + for (const auto& pair : model->extensions_to_disable()) + actual_extension_ids.insert(pair.first); + + EXPECT_EQ(actual_extension_ids, expected_extension_ids); + } +} + +INSTANTIATE_TEST_CASE_P(SettingsResetPromptModel, + ExtensionSettingsOverrideTest, + Combine(Bool(), Bool(), Bool())); +#endif // defined(OS_WIN) || defined(OS_MACOSX) + } // namespace } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc index 8357f362..b880638 100644 --- a/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc +++ b/chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_unittest.cc
@@ -12,7 +12,9 @@ #include "base/callback_forward.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/values.h" #include "chrome/browser/extensions/extension_service_test_base.h" +#include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_test_utils.h" @@ -39,12 +41,18 @@ using testing::_; using testing::Bool; using testing::Combine; +using testing::ElementsAre; +using testing::IsEmpty; using testing::NiceMock; using testing::Return; using testing::StrictMock; +using testing::UnorderedElementsAre; const char kHomepage[] = "http://myhomepage.com"; const char kDefaultSearch[] = "http://testsearch.com/?q={searchTerms}"; +const char kStartupUrl1[] = "http://start1.com"; +const char kStartupUrl2[] = "http://start2.com"; +const char kStartupUrl3[] = "http://start3.com"; // |ResettableSettingsSnapshot| needs to get a |TemplateURLService| for the // profile it takes a snapshot for. This will create one for the testing profile @@ -64,11 +72,25 @@ base::Closure()); } +bool ListValueContainsUrl(const base::ListValue* list, const GURL& url) { + if (!list) + return false; + + for (size_t i = 0; i < list->GetSize(); ++i) { + std::string url_text; + if (list->GetString(i, &url_text) && url == url_text) + return true; + } + return false; +} + class SettingsResetPromptModelTest : public extensions::ExtensionServiceTestBase { protected: using ModelPointer = std::unique_ptr<SettingsResetPromptModel>; + SettingsResetPromptModelTest() : startup_pref_(SessionStartupPref::DEFAULT) {} + void SetUp() override { extensions::ExtensionServiceTestBase::SetUp(); InitializeEmptyExtensionService(); @@ -77,6 +99,8 @@ TemplateURLServiceFactory::GetInstance()->SetTestingFactory( profile(), CreateTemplateURLService); + SessionStartupPref::SetStartupPref(profile(), startup_pref_); + prefs_ = profile()->GetPrefs(); ASSERT_TRUE(prefs_); } @@ -89,11 +113,11 @@ prefs_->SetBoolean(prefs::kHomePageIsNewTabPage, homepage_is_ntp); } - void SetHomepage(const std::string homepage) { + void SetHomepage(const std::string& homepage) { prefs_->SetString(prefs::kHomePage, homepage); } - void SetDefaultSearch(const std::string default_search) { + void SetDefaultSearch(const std::string& default_search) { TemplateURLService* template_url_service = TemplateURLServiceFactory::GetForProfile(profile()); ASSERT_TRUE(template_url_service); @@ -107,6 +131,30 @@ template_url_service->SetUserSelectedDefaultSearchProvider(template_url); } + void SetStartupType(SessionStartupPref::Type startup_type) { + startup_pref_.type = startup_type; + SessionStartupPref::SetStartupPref(profile(), startup_pref_); + ASSERT_EQ(SessionStartupPref::PrefValueToType( + prefs_->GetInteger(prefs::kRestoreOnStartup)), + startup_pref_.type); + } + + void AddStartupUrl(const std::string& startup_url) { + GURL startup_gurl(startup_url); + ASSERT_TRUE(startup_gurl.is_valid()); + + startup_pref_.urls.push_back(startup_gurl); + SessionStartupPref::SetStartupPref(profile(), startup_pref_); + ASSERT_EQ(SessionStartupPref::PrefValueToType( + prefs_->GetInteger(prefs::kRestoreOnStartup)), + startup_pref_.type); + + // Also make sure that the |startup_url| is now in the list of URLs in the + // preferences. + ASSERT_TRUE(ListValueContainsUrl( + prefs_->GetList(prefs::kURLsToRestoreOnStartup), startup_gurl)); + } + // Returns a model with a mock config that will return negative IDs for every // URL. positive IDs for each URL in |reset_urls_|. ModelPointer CreateModel() { @@ -120,17 +168,20 @@ } PrefService* prefs_; + SessionStartupPref startup_pref_; }; class ResetStatesTest : public SettingsResetPromptModelTest, - public testing::WithParamInterface<testing::tuple<bool, bool>> { + public testing::WithParamInterface<testing::tuple<bool, bool, bool>> { protected: void SetUp() override { SettingsResetPromptModelTest::SetUp(); homepage_reset_enabled_ = testing::get<0>(GetParam()); default_search_reset_enabled_ = testing::get<1>(GetParam()); - should_prompt_ = homepage_reset_enabled_ || default_search_reset_enabled_; + startup_urls_reset_enabled_ = testing::get<2>(GetParam()); + should_prompt_ = homepage_reset_enabled_ || default_search_reset_enabled_ || + startup_urls_reset_enabled_; if (homepage_reset_enabled_) { SetShowHomeButton(true); @@ -140,10 +191,18 @@ if (default_search_reset_enabled_) SetDefaultSearch(kDefaultSearch); + + if (startup_urls_reset_enabled_) { + SetStartupType(SessionStartupPref::URLS); + AddStartupUrl(kStartupUrl1); + AddStartupUrl(kStartupUrl2); + AddStartupUrl(kStartupUrl3); + } } bool homepage_reset_enabled_; bool default_search_reset_enabled_; + bool startup_urls_reset_enabled_; bool should_prompt_; }; @@ -160,24 +219,26 @@ for (bool show_home_button : {false, true}) { SetShowHomeButton(show_home_button); SetHomepageIsNTP(homepage_is_ntp); - // Should return |DISABLED_DUE_TO_DOMAIN_NOT_MATCHED| when + // Should return |NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED| when // |UrlToResetDomainId()| returns a negative integer. { ModelPointer model = CreateModel(); EXPECT_EQ(model->homepage_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + SettingsResetPromptModel:: + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); } - // Should return |ENABLED| when |UrlToResetDomainId()| returns a positive - // integer and the home button is visible and homepage is not set to the - // New Tab page, and |DISABLED_DUE_TO_DOMAIN_NOT_MATCHED| otherwise. + // Should return |RESET_REQUIRED| when |UrlToResetDomainId()| returns a + // positive integer and the home button is visible and homepage is not set + // to the New Tab page, and |NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED| + // otherwise. { ModelPointer model = CreateModel({kHomepage}); - EXPECT_EQ( - model->homepage_reset_state(), - show_home_button && !homepage_is_ntp - ? SettingsResetPromptModel::ENABLED - : SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ(model->homepage_reset_state(), + show_home_button && !homepage_is_ntp + ? SettingsResetPromptModel::RESET_REQUIRED + : SettingsResetPromptModel:: + NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); } } } @@ -192,19 +253,92 @@ TEST_F(SettingsResetPromptModelTest, DefaultSearchResetState) { SetDefaultSearch(kDefaultSearch); - // Should return |DISABLED_DUE_TO_DOMAIN_NOT_MATCHED| when + // Should return |NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED| when // |UrlToResetDomainId()| is negative. { ModelPointer model = CreateModel(); - EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::DISABLED_DUE_TO_DOMAIN_NOT_MATCHED); + EXPECT_EQ( + model->default_search_reset_state(), + SettingsResetPromptModel::NO_RESET_REQUIRED_DUE_TO_DOMAIN_NOT_MATCHED); } - // Should return |ENABLED| when |UrlToResetDomainId()| is non-negative. + // Should return |RESET_REQUIRED| when |UrlToResetDomainId()| is non-negative. { ModelPointer model = CreateModel({kDefaultSearch}); EXPECT_EQ(model->default_search_reset_state(), - SettingsResetPromptModel::ENABLED); + SettingsResetPromptModel::RESET_REQUIRED); + } +} + +TEST_F(SettingsResetPromptModelTest, StartupUrls) { + // Should return empty list of startup URLs if startup type is not set to + // |SessionStartupPref::URLS|. + SetStartupType(SessionStartupPref::DEFAULT); + { + ModelPointer model = CreateModel(); + EXPECT_THAT(model->startup_urls(), IsEmpty()); + } + + AddStartupUrl(kStartupUrl1); + { + ModelPointer model = CreateModel(); + EXPECT_THAT(model->startup_urls(), IsEmpty()); + } + + SetStartupType(SessionStartupPref::LAST); + { + ModelPointer model = CreateModel(); + EXPECT_THAT(model->startup_urls(), IsEmpty()); + } + + // Should return the list of startup URLs if startup type is set to + // |SessionStartupPref::URLS|. + SetStartupType(SessionStartupPref::URLS); + { + ModelPointer model = CreateModel(); + EXPECT_THAT(model->startup_urls(), ElementsAre(GURL(kStartupUrl1))); + } + + AddStartupUrl(kStartupUrl2); + { + ModelPointer model = CreateModel(); + EXPECT_THAT(model->startup_urls(), + UnorderedElementsAre(GURL(kStartupUrl1), GURL(kStartupUrl2))); + } +} + +TEST_F(SettingsResetPromptModelTest, StartupUrlsToReset) { + AddStartupUrl(kStartupUrl1); + AddStartupUrl(kStartupUrl2); + AddStartupUrl(kStartupUrl3); + + // Should return no URLs as long as startup type is not set to + // |SessionStartupPref::URLS|. + SetStartupType(SessionStartupPref::DEFAULT); + { + ModelPointer model = CreateModel({kStartupUrl2}); + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + } + + SetStartupType(SessionStartupPref::LAST); + { + ModelPointer model = CreateModel({kStartupUrl2}); + EXPECT_THAT(model->startup_urls_to_reset(), IsEmpty()); + } + + // Should return the URLs that need to be reset when startup type is set to + // |SessionStartupPref::URLS|. + SetStartupType(SessionStartupPref::URLS); + { + ModelPointer model = CreateModel({kStartupUrl2}); + EXPECT_THAT(model->startup_urls_to_reset(), + ElementsAre(GURL(kStartupUrl2))); + } + + { + ModelPointer model = CreateModel({kStartupUrl1, kStartupUrl2}); + EXPECT_THAT(model->startup_urls_to_reset(), + UnorderedElementsAre(GURL(kStartupUrl1), GURL(kStartupUrl2))); } } @@ -214,19 +348,25 @@ reset_urls.insert(kHomepage); if (default_search_reset_enabled_) reset_urls.insert(kDefaultSearch); + if (startup_urls_reset_enabled_) + reset_urls.insert(kStartupUrl2); ModelPointer model = CreateModel(reset_urls); - ASSERT_EQ(model->homepage_reset_state() == SettingsResetPromptModel::ENABLED, - homepage_reset_enabled_); ASSERT_EQ( - model->default_search_reset_state() == SettingsResetPromptModel::ENABLED, - default_search_reset_enabled_); + model->homepage_reset_state() == SettingsResetPromptModel::RESET_REQUIRED, + homepage_reset_enabled_); + ASSERT_EQ(model->default_search_reset_state() == + SettingsResetPromptModel::RESET_REQUIRED, + default_search_reset_enabled_); + ASSERT_EQ(model->startup_urls_reset_state() == + SettingsResetPromptModel::RESET_REQUIRED, + startup_urls_reset_enabled_); EXPECT_EQ(model->ShouldPromptForReset(), should_prompt_); } INSTANTIATE_TEST_CASE_P(SettingsResetPromptModel, ResetStatesTest, - Combine(Bool(), Bool())); + Combine(Bool(), Bool(), Bool())); } // namespace } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/ui_manager_unittest.cc b/chrome/browser/safe_browsing/ui_manager_unittest.cc index 30b7cf8..b652b91 100644 --- a/chrome/browser/safe_browsing/ui_manager_unittest.cc +++ b/chrome/browser/safe_browsing/ui_manager_unittest.cc
@@ -12,6 +12,7 @@ #include "chrome/test/base/testing_profile.h" #include "components/safe_browsing_db/safe_browsing_prefs.h" #include "components/safe_browsing_db/util.h" +#include "components/security_interstitials/core/safe_browsing_error_ui.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" @@ -343,7 +344,13 @@ web_contents, main_frame_url, unsafe_resources, - BaseBlockingPage::CreateDefaultDisplayOptions(unsafe_resources)) { + SafeBrowsingErrorUI::SBErrorDisplayOptions( + BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources), + false, + false, + false, + false, + false)) { // Don't delay details at all for the unittest. threat_details_proceed_delay_ms_ = 0; DontCreateViewForTesting();
diff --git a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc index 44d5dd8..5eb1a17 100644 --- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc +++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -29,7 +29,7 @@ #include "components/security_interstitials/content/unsafe_resource.h" #include "components/subresource_filter/core/browser/subresource_filter_features.h" #include "components/subresource_filter/core/browser/subresource_filter_features_test_support.h" -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" #include "components/subresource_filter/core/common/scoped_timers.h" #include "components/subresource_filter/core/common/test_ruleset_utils.h" #include "content/public/browser/browser_thread.h" @@ -52,8 +52,8 @@ "subresource_filter/frame_set.html"; // Names of DocumentLoad histograms. -constexpr const char kDocumentLoadActivationState[] = - "SubresourceFilter.DocumentLoad.ActivationState"; +constexpr const char kDocumentLoadActivationLevel[] = + "SubresourceFilter.DocumentLoad.ActivationLevel"; constexpr const char kSubresourceLoadsTotal[] = "SubresourceFilter.DocumentLoad.NumSubresourceLoads.Total"; constexpr const char kSubresourceLoadsEvaluated[] = @@ -232,7 +232,7 @@ void SetUpOnMainThread() override { scoped_feature_toggle_.reset(new ScopedSubresourceFilterFeatureToggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, kActivationListPhishingInterstitial, measure_performance_ ? "1" : "0")); @@ -545,8 +545,8 @@ // The only frames where filtering was (even considered to be) activated // should be the main frame, and the child that was navigated to an HTTP URL. histogram_tester.ExpectUniqueSample( - "SubresourceFilter.DocumentLoad.ActivationState", - static_cast<base::Histogram::Sample>(ActivationState::ENABLED), 2); + "SubresourceFilter.DocumentLoad.ActivationLevel", + static_cast<base::Histogram::Sample>(ActivationLevel::ENABLED), 2); } IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest, @@ -640,8 +640,8 @@ tester.ExpectTotalCount(kActivationCPUDuration, 6); tester.ExpectUniqueSample( - kDocumentLoadActivationState, - static_cast<base::Histogram::Sample>(ActivationState::ENABLED), 6); + kDocumentLoadActivationLevel, + static_cast<base::Histogram::Sample>(ActivationLevel::ENABLED), 6); EXPECT_THAT(tester.GetAllSamples(kSubresourceLoadsTotal), ::testing::ElementsAre(base::Bucket(0, 3), base::Bucket(2, 3))); @@ -722,8 +722,8 @@ // Although SubresourceFilterAgents still record the activation decision. tester.ExpectUniqueSample( - kDocumentLoadActivationState, - static_cast<base::Histogram::Sample>(ActivationState::DISABLED), 6); + kDocumentLoadActivationLevel, + static_cast<base::Histogram::Sample>(ActivationLevel::DISABLED), 6); } } // namespace subresource_filter
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index 1c7d649..c8db967b 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -48,7 +48,7 @@ // theme packs that aren't int-equal to this. Increment this number if you // change default theme assets or if you need themes to recreate their generated // images (which are cached). -const int kThemePackVersion = 45; +const int kThemePackVersion = 46; // IDs that are in the DataPack won't clash with the positive integer // uint16_t. kHeaderID should always have the maximum value because we want the @@ -235,13 +235,7 @@ { "ntp_background", ThemeProperties::COLOR_NTP_BACKGROUND }, { "ntp_text", ThemeProperties::COLOR_NTP_TEXT }, { "ntp_link", ThemeProperties::COLOR_NTP_LINK }, - { "ntp_link_underline", ThemeProperties::COLOR_NTP_LINK_UNDERLINE }, { "ntp_header", ThemeProperties::COLOR_NTP_HEADER }, - { "ntp_section", ThemeProperties::COLOR_NTP_SECTION }, - { "ntp_section_text", ThemeProperties::COLOR_NTP_SECTION_TEXT }, - { "ntp_section_link", ThemeProperties::COLOR_NTP_SECTION_LINK }, - { "ntp_section_link_underline", - ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE }, { "button_background", ThemeProperties::COLOR_BUTTON_BACKGROUND }, }; const size_t kColorTableLength = arraysize(kColorTable); @@ -969,9 +963,16 @@ color = SkColorSetRGB(r, g, b); } - int id = GetIntForString(iter.key(), kColorTable, kColorTableLength); - if (id != -1) { - (*temp_colors)[id] = color; + if (iter.key() == "ntp_section") { + // We no longer use ntp_section, but to support legacy + // themes we still need to use it as a fallback for + // ntp_header. + if (!temp_colors->count(ThemeProperties::COLOR_NTP_HEADER)) + (*temp_colors)[ThemeProperties::COLOR_NTP_HEADER] = color; + } else { + int id = GetIntForString(iter.key(), kColorTable, kColorTableLength); + if (id != -1) + (*temp_colors)[id] = color; } } } @@ -980,28 +981,6 @@ void BrowserThemePack::GenerateMissingColors( std::map<int, SkColor>* colors) { - // Generate link colors, if missing. (See GetColor()). - if (!colors->count(ThemeProperties::COLOR_NTP_HEADER) && - colors->count(ThemeProperties::COLOR_NTP_SECTION)) { - (*colors)[ThemeProperties::COLOR_NTP_HEADER] = - (*colors)[ThemeProperties::COLOR_NTP_SECTION]; - } - - if (!colors->count(ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE) && - colors->count(ThemeProperties::COLOR_NTP_SECTION_LINK)) { - SkColor color_section_link = - (*colors)[ThemeProperties::COLOR_NTP_SECTION_LINK]; - (*colors)[ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE] = - SkColorSetA(color_section_link, SkColorGetA(color_section_link) / 3); - } - - if (!colors->count(ThemeProperties::COLOR_NTP_LINK_UNDERLINE) && - colors->count(ThemeProperties::COLOR_NTP_LINK)) { - SkColor color_link = (*colors)[ThemeProperties::COLOR_NTP_LINK]; - (*colors)[ThemeProperties::COLOR_NTP_LINK_UNDERLINE] = - SkColorSetA(color_link, SkColorGetA(color_link) / 3); - } - // Generate frame colors, if missing. (See GenerateFrameColors()). SkColor frame; std::map<int, SkColor>::const_iterator it =
diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc index f31dc4e..a2dd82f 100644 --- a/chrome/browser/themes/browser_theme_pack_unittest.cc +++ b/chrome/browser/themes/browser_theme_pack_unittest.cc
@@ -370,47 +370,11 @@ scoped_refptr<BrowserThemePack> theme_pack_; }; - -TEST_F(BrowserThemePackTest, DeriveUnderlineLinkColor) { - // If we specify a link color, but don't specify the underline color, the - // theme provider should create one. - std::string color_json = "{ \"ntp_link\": [128, 128, 128]," - " \"ntp_section_link\": [128, 128, 128] }"; - LoadColorJSON(color_json); - - std::map<int, SkColor> colors = GetDefaultColorMap(); - SkColor link_color = SkColorSetRGB(128, 128, 128); - colors[ThemeProperties::COLOR_NTP_LINK] = link_color; - colors[ThemeProperties::COLOR_NTP_LINK_UNDERLINE] = - BuildThirdOpacity(link_color); - colors[ThemeProperties::COLOR_NTP_SECTION_LINK] = link_color; - colors[ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE] = - BuildThirdOpacity(link_color); - - VerifyColorMap(colors); -} - -TEST_F(BrowserThemePackTest, ProvideUnderlineLinkColor) { - // If we specify the underline color, it shouldn't try to generate one. - std::string color_json = "{ \"ntp_link\": [128, 128, 128]," - " \"ntp_link_underline\": [255, 255, 255]," - " \"ntp_section_link\": [128, 128, 128]," - " \"ntp_section_link_underline\": [255, 255, 255]" - "}"; - LoadColorJSON(color_json); - - std::map<int, SkColor> colors = GetDefaultColorMap(); - SkColor link_color = SkColorSetRGB(128, 128, 128); - SkColor underline_color = SkColorSetRGB(255, 255, 255); - colors[ThemeProperties::COLOR_NTP_LINK] = link_color; - colors[ThemeProperties::COLOR_NTP_LINK_UNDERLINE] = underline_color; - colors[ThemeProperties::COLOR_NTP_SECTION_LINK] = link_color; - colors[ThemeProperties::COLOR_NTP_SECTION_LINK_UNDERLINE] = - underline_color; - - VerifyColorMap(colors); -} - +// 'ntp_section' used to correspond to ThemeProperties::COLOR_NTP_SECTION, +// but COLOR_NTP_SECTION was since removed because it was never used. +// While it was in use, COLOR_NTP_HEADER used 'ntp_section' as a fallback when +// 'ntp_header' was absent. We still preserve this fallback for themes that +// relied on this. TEST_F(BrowserThemePackTest, UseSectionColorAsNTPHeader) { std::string color_json = "{ \"ntp_section\": [190, 190, 190] }"; LoadColorJSON(color_json); @@ -418,7 +382,6 @@ std::map<int, SkColor> colors = GetDefaultColorMap(); SkColor ntp_color = SkColorSetRGB(190, 190, 190); colors[ThemeProperties::COLOR_NTP_HEADER] = ntp_color; - colors[ThemeProperties::COLOR_NTP_SECTION] = ntp_color; VerifyColorMap(colors); } @@ -429,7 +392,6 @@ std::map<int, SkColor> colors = GetDefaultColorMap(); colors[ThemeProperties::COLOR_NTP_HEADER] = SkColorSetRGB(120, 120, 120); - colors[ThemeProperties::COLOR_NTP_SECTION] = SkColorSetRGB(190, 190, 190); VerifyColorMap(colors); }
diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc index 3d09033..dd1d9f4e 100644 --- a/chrome/browser/themes/theme_properties.cc +++ b/chrome/browser/themes/theme_properties.cc
@@ -66,9 +66,6 @@ #endif // OS_WIN const SkColor kDefaultColorNTPHeader = SkColorSetRGB(0x96, 0x96, 0x96); -const SkColor kDefaultColorNTPSection = SkColorSetRGB(0xE5, 0xE5, 0xE5); -constexpr SkColor kDefaultColorNTPSectionText = SK_ColorBLACK; -const SkColor kDefaultColorNTPSectionLink = SkColorSetRGB(0x06, 0x37, 0x74); constexpr SkColor kDefaultColorButtonBackground = SK_ColorTRANSPARENT; // Default tints. @@ -132,10 +129,6 @@ constexpr char kTilingRepeatY[] = "repeat-y"; constexpr char kTilingRepeat[] = "repeat"; -SkColor TintForUnderline(SkColor input) { - return SkColorSetA(input, SkColorGetA(input) / 3); -} - } // namespace // static @@ -249,18 +242,8 @@ return kDefaultColorNTPText; case COLOR_NTP_LINK: return kDefaultColorNTPLink; - case COLOR_NTP_LINK_UNDERLINE: - return TintForUnderline(kDefaultColorNTPLink); case COLOR_NTP_HEADER: return kDefaultColorNTPHeader; - case COLOR_NTP_SECTION: - return kDefaultColorNTPSection; - case COLOR_NTP_SECTION_TEXT: - return kDefaultColorNTPSectionText; - case COLOR_NTP_SECTION_LINK: - return kDefaultColorNTPSectionLink; - case COLOR_NTP_SECTION_LINK_UNDERLINE: - return TintForUnderline(kDefaultColorNTPSectionLink); case COLOR_BUTTON_BACKGROUND: return kDefaultColorButtonBackground;
diff --git a/chrome/browser/themes/theme_properties.h b/chrome/browser/themes/theme_properties.h index 573d8590..3e328d7 100644 --- a/chrome/browser/themes/theme_properties.h +++ b/chrome/browser/themes/theme_properties.h
@@ -40,12 +40,7 @@ COLOR_NTP_BACKGROUND, COLOR_NTP_TEXT, COLOR_NTP_LINK, - COLOR_NTP_LINK_UNDERLINE, COLOR_NTP_HEADER, - COLOR_NTP_SECTION, - COLOR_NTP_SECTION_TEXT, - COLOR_NTP_SECTION_LINK, - COLOR_NTP_SECTION_LINK_UNDERLINE, COLOR_BUTTON_BACKGROUND, TINT_BUTTONS, @@ -124,10 +119,6 @@ // These colors don't have constant default values. They are derived from // the runtime value of other colors. - COLOR_NTP_SECTION_HEADER_TEXT, - COLOR_NTP_SECTION_HEADER_TEXT_HOVER, - COLOR_NTP_SECTION_HEADER_RULE, - COLOR_NTP_SECTION_HEADER_RULE_LIGHT, COLOR_NTP_TEXT_LIGHT, #if BUILDFLAG(ENABLE_SUPERVISED_USERS) COLOR_SUPERVISED_USER_LABEL,
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 9f5b82a..8c8103e 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc
@@ -487,14 +487,6 @@ // Use 50% of bookmark text color as separator color. return SkColorSetA( GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128); - case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT: - return IncreaseLightness(GetColor(kNtpText, incognito), 0.30); - case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER: - return GetColor(kNtpText, incognito); - case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE: - return IncreaseLightness(GetColor(kNtpText, incognito), 0.70); - case ThemeProperties::COLOR_NTP_SECTION_HEADER_RULE_LIGHT: - return IncreaseLightness(GetColor(kNtpText, incognito), 0.86); case ThemeProperties::COLOR_NTP_TEXT_LIGHT: return IncreaseLightness(GetColor(kNtpText, incognito), 0.40); case ThemeProperties::COLOR_TAB_THROBBER_SPINNING:
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 35f819a6..eb276ad3 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -396,6 +396,14 @@ "webui/predictors/predictors_ui.h", "webui/profiler_ui.cc", "webui/profiler_ui.h", + "webui/quota_internals/quota_internals_handler.cc", + "webui/quota_internals/quota_internals_handler.h", + "webui/quota_internals/quota_internals_proxy.cc", + "webui/quota_internals/quota_internals_proxy.h", + "webui/quota_internals/quota_internals_types.cc", + "webui/quota_internals/quota_internals_types.h", + "webui/quota_internals/quota_internals_ui.cc", + "webui/quota_internals/quota_internals_ui.h", "webui/signin_internals_ui.cc", "webui/signin_internals_ui.h", "webui/supervised_user_internals_message_handler.cc", @@ -1065,14 +1073,6 @@ "webui/profile_helper.h", "webui/profile_info_watcher.cc", "webui/profile_info_watcher.h", - "webui/quota_internals/quota_internals_handler.cc", - "webui/quota_internals/quota_internals_handler.h", - "webui/quota_internals/quota_internals_proxy.cc", - "webui/quota_internals/quota_internals_proxy.h", - "webui/quota_internals/quota_internals_types.cc", - "webui/quota_internals/quota_internals_types.h", - "webui/quota_internals/quota_internals_ui.cc", - "webui/quota_internals/quota_internals_ui.h", "webui/set_as_default_browser_ui_win.cc", "webui/set_as_default_browser_ui_win.h", "webui/settings/about_handler.cc", @@ -1417,7 +1417,7 @@ "//ash", "//ash:ash_with_content", "//ash/common/strings", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/public/interfaces", "//ash/resources/vector_icons", "//components/session_manager/core", @@ -1761,8 +1761,6 @@ "views/location_bar/location_bar_view.h", "views/location_bar/location_icon_view.cc", "views/location_bar/location_icon_view.h", - "views/location_bar/open_pdf_in_reader_view.cc", - "views/location_bar/open_pdf_in_reader_view.h", "views/location_bar/page_action_image_view.cc", "views/location_bar/page_action_image_view.h", "views/location_bar/page_action_with_badge_view.cc", @@ -1781,8 +1779,6 @@ "views/omnibox/omnibox_result_view.h", "views/omnibox/omnibox_view_views.cc", "views/omnibox/omnibox_view_views.h", - "views/open_pdf_in_reader_bubble_view.cc", - "views/open_pdf_in_reader_bubble_view.h", "views/outdated_upgrade_bubble_view.cc", "views/outdated_upgrade_bubble_view.h", "views/passwords/account_chooser_dialog_view.cc",
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index 27f1ecb4..e85a82e0 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -33,6 +33,7 @@ #include "extensions/common/constants.h" #include "services/service_manager/public/cpp/connector.h" #include "ui/base/window_open_disposition.h" +#include "ui/wm/public/activation_client.h" namespace { @@ -44,6 +45,19 @@ } // namespace +// static +Browser* ChromeNewWindowClient::GetActiveBrowser() { + Browser* browser = BrowserList::GetInstance()->GetLastActive(); + if (browser) { + aura::Window* window = browser->window()->GetNativeWindow(); + aura::client::ActivationClient* client = + aura::client::GetActivationClient(window->GetRootWindow()); + if (client->GetActiveWindow() == window) + return browser; + } + return nullptr; +} + ChromeNewWindowClient::ChromeNewWindowClient() : binding_(this) { service_manager::Connector* connector = content::ServiceManagerConnection::GetForProcess()->GetConnector(); @@ -102,7 +116,7 @@ }; void ChromeNewWindowClient::NewTab() { - Browser* browser = BrowserList::GetInstance()->GetLastActive(); + Browser* browser = GetActiveBrowser(); if (browser && browser->is_type_tabbed()) { chrome::NewTab(browser); return; @@ -120,7 +134,7 @@ } void ChromeNewWindowClient::NewWindow(bool is_incognito) { - Browser* browser = BrowserList::GetInstance()->GetLastActive(); + Browser* browser = GetActiveBrowser(); Profile* profile = (browser && browser->profile()) ? browser->profile()->GetOriginalProfile() : ProfileManager::GetActiveUserProfile(); @@ -173,8 +187,8 @@ return; } - Browser* browser = BrowserList::GetInstance()->GetLastActive(); - Profile* profile = browser ? browser->profile() : NULL; + Browser* browser = GetActiveBrowser(); + Profile* profile = browser ? browser->profile() : nullptr; if (!profile) profile = ProfileManager::GetActiveUserProfile(); if (profile->IsOffTheRecord()) @@ -201,9 +215,9 @@ } void ChromeNewWindowClient::ShowTaskManager() { - chrome::OpenTaskManager(NULL); + chrome::OpenTaskManager(nullptr); } void ChromeNewWindowClient::OpenFeedbackPage() { - chrome::OpenFeedbackDialog(BrowserList::GetInstance()->GetLastActive()); + chrome::OpenFeedbackDialog(GetActiveBrowser()); }
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.h b/chrome/browser/ui/ash/chrome_new_window_client.h index f8bcb0f..0004039f 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.h +++ b/chrome/browser/ui/ash/chrome_new_window_client.h
@@ -11,11 +11,16 @@ #include "base/macros.h" #include "mojo/public/cpp/bindings/associated_binding.h" +class Browser; + class ChromeNewWindowClient : public ash::mojom::NewWindowClient { public: ChromeNewWindowClient(); ~ChromeNewWindowClient() override; + // Returns the active browser that has active browser window, if any. + static Browser* GetActiveBrowser(); + // Overridden from ash::mojom::NewWindowClient: void NewTab() override; void NewWindow(bool incognito) override;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc index 2b83559..e808a96 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_browsertest.cc
@@ -17,9 +17,9 @@ #include "ash/common/wm_shell.h" #include "ash/common/wm_window.h" #include "ash/common/wm_window_property.h" +#include "ash/public/cpp/window_properties.h" #include "ash/shell.h" #include "ash/test/shelf_view_test_api.h" -#include "ash/wm/window_properties.h" #include "ash/wm/window_state_aura.h" #include "ash/wm/window_util.h" #include "base/macros.h"
diff --git a/chrome/browser/ui/ash/launcher/settings_window_observer.cc b/chrome/browser/ui/ash/launcher/settings_window_observer.cc index 1912e85c..af2e9ee 100644 --- a/chrome/browser/ui/ash/launcher/settings_window_observer.cc +++ b/chrome/browser/ui/ash/launcher/settings_window_observer.cc
@@ -5,8 +5,8 @@ #include "chrome/browser/ui/ash/launcher/settings_window_observer.h" #include "ash/common/shelf/shelf_item_types.h" +#include "ash/public/cpp/window_properties.h" #include "ash/resources/grit/ash_resources.h" -#include "ash/wm/window_properties.h" #include "base/feature_list.h" #include "base/memory/ptr_util.h" #include "chrome/browser/ui/ash/ash_util.h"
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc index aa7d11f..2114633 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos_unittest.cc
@@ -34,11 +34,15 @@ #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/ui/ash/chrome_new_window_client.h" #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" #include "chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.h" #include "chrome/browser/ui/ash/session_util.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_list.h" +#include "chrome/test/base/test_browser_window_aura.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" @@ -123,6 +127,17 @@ DISALLOW_COPY_AND_ASSIGN(TestShellDelegateChromeOS); }; +std::unique_ptr<Browser> CreateTestBrowser(aura::Window* window, + const gfx::Rect& bounds, + Browser::CreateParams* params) { + if (!bounds.IsEmpty()) + window->SetBounds(bounds); + std::unique_ptr<Browser> browser = + chrome::CreateBrowserWithAuraTestWindowForParams(base::WrapUnique(window), + params); + return browser; +} + } // namespace namespace ash { @@ -1528,5 +1543,42 @@ EXPECT_EQ(mru_list[2], window(2)); } +// Tests that ChromeNewWindowClient::GetActiveBrowser works properly in +// multi-user scenario, that is it should return the browser with active window +// associated with it (crbug.com/675265). +TEST_F(MultiUserWindowManagerChromeOSTest, GetActiveBrowserTest) { + SetUpForThisManyWindows(1); + + const AccountId account_id_A(AccountId::FromUserEmail("A")); + const AccountId account_id_B(AccountId::FromUserEmail("B")); + AddTestUser(account_id_A); + AddTestUser(account_id_B); + session_state_delegate()->set_logged_in_users(2); + user_manager()->SwitchActiveUser(account_id_A); + multi_user_window_manager()->ActiveUserChanged(account_id_A); + + aura::client::ActivationClient* activation_client = + aura::client::GetActivationClient(window(0)->GetRootWindow()); + multi_user_window_manager()->SetWindowOwner(window(0), account_id_A); + Profile* profile = multi_user_util::GetProfileFromAccountId(account_id_A); + Browser::CreateParams params(profile); + std::unique_ptr<Browser> browser(CreateTestBrowser( + CreateTestWindowInShellWithId(0), gfx::Rect(16, 32, 640, 320), ¶ms)); + aura::Window* browser_native_window = browser->window()->GetNativeWindow(); + activation_client->ActivateWindow(browser_native_window); + // Manually set last active browser in BrowserList for testing. + BrowserList::GetInstance()->SetLastActive(browser.get()); + EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive()); + EXPECT_EQ(browser_native_window, wm::GetActiveWindow()); + EXPECT_EQ(browser.get(), ChromeNewWindowClient::GetActiveBrowser()); + + // Switch to another user's desktop with no active window. + user_manager()->SwitchActiveUser(account_id_B); + multi_user_window_manager()->ActiveUserChanged(account_id_B); + EXPECT_EQ(browser.get(), BrowserList::GetInstance()->GetLastActive()); + EXPECT_EQ(nullptr, wm::GetActiveWindow()); + EXPECT_EQ(nullptr, ChromeNewWindowClient::GetActiveBrowser()); +} + } // namespace test } // namespace ash
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index e6461dd..0eb187b7 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1418,6 +1418,10 @@ return !manager || !manager->IsDialogActive(); } +- (CGFloat)menubarOffset { + return [[self fullscreenToolbarController] computeLayout].menubarOffset; +} + // TabStripControllerDelegate protocol. - (void)onActivateTabWithContents:(WebContents*)contents { // Update various elements that are interested in knowing the current
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm index ab3fa19d..f084fb03 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -53,6 +53,7 @@ #include "components/prefs/scoped_user_pref_update.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" +#include "ui/base/cocoa/appkit_utils.h" #import "ui/base/cocoa/focus_tracker.h" #import "ui/base/cocoa/nsview_additions.h" #include "ui/base/ui_base_types.h" @@ -966,12 +967,20 @@ - (void)updateSubviewZOrderFullscreen { base::scoped_nsobject<NSMutableArray> subviews([[NSMutableArray alloc] init]); + + // The infobar should overlay the toolbar if the toolbar is fully shown. + FullscreenToolbarLayout layout = [fullscreenToolbarController_ computeLayout]; + BOOL shouldInfoBarOverlayToolbar = + ui::IsCGFloatEqual(layout.toolbarFraction, 1.0); + if ([downloadShelfController_ view]) [subviews addObject:[downloadShelfController_ view]]; if ([self tabContentArea]) [subviews addObject:[self tabContentArea]]; - if ([infoBarContainerController_ view]) + + if (!shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) [subviews addObject:[infoBarContainerController_ view]]; + if ([self placeBookmarkBarBelowInfoBar]) { if ([bookmarkBarController_ view]) [subviews addObject:[bookmarkBarController_ view]]; @@ -983,8 +992,13 @@ if ([bookmarkBarController_ view]) [subviews addObject:[bookmarkBarController_ view]]; } + if ([toolbarController_ view]) [subviews addObject:[toolbarController_ view]]; + + if (shouldInfoBarOverlayToolbar && [infoBarContainerController_ view]) + [subviews addObject:[infoBarContainerController_ view]]; + if ([findBarCocoaController_ view]) [subviews addObject:[findBarCocoaController_ view]];
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h index fabf4ad9..b3759a85 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h +++ b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.h
@@ -9,10 +9,14 @@ #import "chrome/browser/ui/cocoa/animatable_view.h" +@class HoverCloseButton; + // A view that handles any special rendering for the download shelf, painting // a gradient and managing a set of DownloadItemViews. @interface DownloadShelfView : AnimatableView { + @private + IBOutlet HoverCloseButton* closeButton_; } @end
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm index c74832b7..5e7c977 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm
@@ -6,6 +6,7 @@ #include "chrome/browser/themes/theme_properties.h" #include "chrome/browser/themes/theme_service.h" +#include "chrome/browser/ui/cocoa/hover_close_button.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/view_id_util.h" #import "ui/base/cocoa/nsview_additions.h" @@ -61,6 +62,14 @@ } } +- (void)viewWillDraw { + if (const ui::ThemeProvider* themeProvider = [[self window] themeProvider]) { + [closeButton_ + setIconColor:themeProvider->GetColor(ThemeProperties::COLOR_TAB_TEXT)]; + } + [super viewWillDraw]; +} + // Mouse down events on the download shelf should not allow dragging the parent // window around. - (BOOL)mouseDownCanMoveWindow {
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h index 19a8c71..a38b91ce 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h
@@ -146,9 +146,6 @@ // Sets the value of |inFullscreenMode_|. - (void)setTestFullscreenMode:(BOOL)isInFullscreen; -// Returns |kToolbarVerticalOffset|. -- (CGFloat)toolbarVerticalOffset; - @end #endif // CHROME_BROWSER_UI_COCOA_FULLSCREEN_FULLSCREEN_TOOLBAR_CONTROLLER_H_
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm index 1373245..f80e083f 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.mm
@@ -21,11 +21,6 @@ const CGFloat kHideFraction = 0.0; const CGFloat kShowFraction = 1.0; -// The amount by which the toolbar is offset downwards (to avoid the menu) -// when the toolbar style is TOOLBAR_HIDDEN. (We can't use -// |-[NSMenu menuBarHeight]| since it returns 0 when the menu bar is hidden.) -const CGFloat kToolbarVerticalOffset = -22; - } // end namespace @implementation FullscreenToolbarController @@ -121,13 +116,14 @@ layout.toolbarStyle = toolbarStyle_; layout.toolbarFraction = [self toolbarFraction]; + // Calculate how much the toolbar is offset downwards to avoid the menu. if ([browserController_ isInAppKitFullscreen]) { layout.menubarOffset = [menubarTracker_ menubarFraction]; } else { layout.menubarOffset = [immersiveFullscreenController_ shouldShowMenubar] ? 1 : 0; } - layout.menubarOffset *= kToolbarVerticalOffset; + layout.menubarOffset *= -[browserController_ menubarHeight]; return layout; } @@ -212,8 +208,4 @@ inFullscreenMode_ = isInFullscreen; } -- (CGFloat)toolbarVerticalOffset { - return kToolbarVerticalOffset; -} - @end
diff --git a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller_unittest.mm b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller_unittest.mm index b731b8b6..152b6185 100644 --- a/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller_unittest.mm
@@ -93,12 +93,14 @@ void SetUp() override { BOOL yes = YES; BOOL no = NO; + CGFloat menubarHeight = 22; bwc_ = [OCMockObject mockForClass:[BrowserWindowController class]]; [[[bwc_ stub] andReturnValue:OCMOCK_VALUE(yes)] isKindOfClass:[BrowserWindowController class]]; [[[bwc_ stub] andReturnValue:OCMOCK_VALUE(yes)] isInAppKitFullscreen]; [[[bwc_ stub] andReturnValue:OCMOCK_VALUE(no)] isInImmersiveFullscreen]; + [[[bwc_ stub] andReturnValue:OCMOCK_VALUE(menubarHeight)] menubarHeight]; [[bwc_ stub] layoutSubviews]; controller_.reset( @@ -127,8 +129,7 @@ void CheckLayout(CGFloat toolbarFraction, CGFloat menubarFraction) { FullscreenToolbarLayout layout = [controller_ computeLayout]; EXPECT_EQ(toolbarFraction, layout.toolbarFraction); - EXPECT_EQ(menubarFraction * [controller_ toolbarVerticalOffset], - layout.menubarOffset); + EXPECT_EQ(menubarFraction * -[bwc_ menubarHeight], layout.menubarOffset); } // A mock BrowserWindowController object.
diff --git a/chrome/browser/ui/cocoa/hover_close_button.h b/chrome/browser/ui/cocoa/hover_close_button.h index 5d809b1..231a83f56 100644 --- a/chrome/browser/ui/cocoa/hover_close_button.h +++ b/chrome/browser/ui/cocoa/hover_close_button.h
@@ -20,6 +20,9 @@ HoverState previousState_; } +// The color of the icon in its idle (not-hovering) state. +@property(nonatomic) SkColor iconColor; + @end // A version of HoverCloseButton with the "x" icon changed to match the WebUI
diff --git a/chrome/browser/ui/cocoa/hover_close_button.mm b/chrome/browser/ui/cocoa/hover_close_button.mm index a5e59d5..f025a58 100644 --- a/chrome/browser/ui/cocoa/hover_close_button.mm +++ b/chrome/browser/ui/cocoa/hover_close_button.mm
@@ -4,21 +4,12 @@ #import "chrome/browser/ui/cocoa/hover_close_button.h" -#include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/themes/theme_properties.h" -#include "chrome/browser/themes/theme_service.h" -#import "chrome/browser/ui/cocoa/browser_window_controller.h" -#import "chrome/browser/ui/cocoa/tabs/tab_controller.h" -#import "chrome/browser/ui/cocoa/tabs/tab_view.h" #include "chrome/grit/generated_resources.h" -#include "chrome/grit/theme_resources.h" #include "components/strings/grit/components_strings.h" #import "third_party/google_toolbox_for_mac/src/AppKit/GTMKeyValueAnimation.h" -#include "ui/base/cocoa/animation_utils.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia_util_mac.h" @@ -37,6 +28,8 @@ // If this string is changed, the setter (currently setFadeOutValue:) must // be changed as well to match. NSString* const kFadeOutValueKeyPath = @"fadeOutValue"; + +const SkColor kDefaultIconColor = SkColorSetARGB(0xA0, 0x00, 0x00, 0x00); } // namespace @interface HoverCloseButton () @@ -54,6 +47,8 @@ @implementation HoverCloseButton +@synthesize iconColor = iconColor_; + + (void)initialize { // Grab some strings that are used by all close buttons. if (!gBasicAccessibilityTitle) { @@ -155,20 +150,14 @@ [self setNeedsDisplay]; } -- (TabView *)tabView { - return base::mac::ObjCCast<TabView>([self superview]); -} - - (NSImage*)imageForHoverState:(HoverState)hoverState { const gfx::VectorIcon* vectorIcon = nullptr; SkColor vectorIconColor = gfx::kPlaceholderColor; - TabView* tabView = [self tabView]; switch (hoverState) { case kHoverStateNone: vectorIcon = &kTabCloseNormalIcon; - vectorIconColor = - tabView ? [tabView iconColor] : tabs::kDefaultTabTextColor; + vectorIconColor = iconColor_; break; case kHoverStateMouseOver: // For mouse over, the icon color is the fill color of the circle. @@ -217,8 +206,8 @@ // tooltip contents immediately before showing it. [self addToolTipRect:[self bounds] owner:self userData:NULL]; - // Initialize previousState. previousState_ = kHoverStateNone; + iconColor_ = kDefaultIconColor; } // Called each time a tooltip is about to be shown. @@ -251,6 +240,13 @@ [super setAccessibilityTitle:extendedTitle]; } +- (void)setIconColor:(SkColor)iconColor { + if (iconColor != iconColor_) { + iconColor_ = iconColor; + [self setNeedsDisplay:YES]; + } +} + @end @implementation WebUIHoverCloseButton
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h index abb965ba..58d8413 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h
@@ -70,7 +70,6 @@ void UpdateLocationBarVisibility(bool visible, bool animate) override; bool ShowPageActionPopup(const extensions::Extension* extension, bool grant_active_tab) override; - void UpdateOpenPDFInReaderPrompt() override; void SaveStateToContents(content::WebContents* contents) override; void Revert() override; const OmniboxView* GetOmniboxView() const override;
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm index 429101a6..5c4a91e 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -256,10 +256,6 @@ return false; } -void LocationBarViewMac::UpdateOpenPDFInReaderPrompt() { - // Not implemented on Mac. -} - void LocationBarViewMac::SaveStateToContents(WebContents* contents) { // TODO(shess): Why SaveStateToContents vs SaveStateToTab? omnibox_view_->SaveStateToTab(contents);
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm index f06e1d1a..2e6e3378 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
@@ -348,9 +348,13 @@ tearProgress = sqrtf(MAX(MIN(tearProgress, 1.0), 0.0)); // Move the dragged window to the right place on the screen. + // TODO(spqchan): Write a test to check if the window is at the right place. + // See http://crbug.com/687647. NSPoint origin = sourceWindowFrame_.origin; origin.x += (thisPoint.x - dragOrigin_.x); - origin.y += (thisPoint.y - dragOrigin_.y); + origin.y += + (thisPoint.y - dragOrigin_.y) + + ([sourceController_ menubarOffset] + [sourceController_ menubarHeight]); if (tearProgress < 1) { // If the tear animation is not complete, call back to ourself with the
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.h b/chrome/browser/ui/cocoa/tabs/tab_view.h index ad16403f..5ab4c5e46 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.h +++ b/chrome/browser/ui/cocoa/tabs/tab_view.h
@@ -128,10 +128,6 @@ // the "x", and the default favicon. - (SkColor)iconColor; -// Updates the label font after changes to either state or the system "Increase -// Contrast" setting. -- (void)updateLabelFont; - // Called when systemwide accessibility options change. - (void)accessibilityOptionsDidChange:(id)ignored;
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm index f454cfb6..39df6448 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -613,6 +613,7 @@ return; [titleView_ setTextColor:titleColor]; [self setNeedsDisplayInRect:[titleView_ frame]]; + [self updateAppearance]; } - (BOOL)titleHidden { @@ -646,11 +647,11 @@ } - (void)accessibilityOptionsDidChange:(id)ignored { - [self updateLabelFont]; + [self updateAppearance]; [self setNeedsDisplay:YES]; } -- (void)updateLabelFont { +- (void)updateAppearance { CGFloat fontSize = [titleViewCell_ font].pointSize; const ui::ThemeProvider* provider = [[self window] themeProvider]; if (provider && provider->ShouldIncreaseContrast() && state_ == NSOnState) { @@ -658,15 +659,16 @@ } else { [titleViewCell_ setFont:[NSFont systemFontOfSize:fontSize]]; } + + [closeButton_ setIconColor:[self iconColor]]; } - (void)setState:(NSCellStateValue)state { if (state_ == state) return; state_ = state; - [self updateLabelFont]; + [self updateAppearance]; [self setNeedsDisplay:YES]; - [closeButton_ setNeedsDisplay:YES]; } - (void)setClosing:(BOOL)closing {
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h index e9904d9..23f0fcc 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.h +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.h
@@ -163,6 +163,9 @@ // the screen (tab strip, omnibox, bookmark bar, etc). Ranges from 0 to -22. - (CGFloat)menubarOffset; +// The height of the menubar. +- (CGFloat)menubarHeight; + // Returns the view of the avatar button. - (NSView*)avatarView;
diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm index 73d0f3e..cd5a115 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm
@@ -353,6 +353,13 @@ return 0; } +- (CGFloat)menubarHeight { + // The height of the menubar. We can't use |-[NSMenu menuBarHeight]| since it + // returns 0 when the menu bar is hidden. + const CGFloat kMenubarHeight = 22; + return kMenubarHeight; +} + - (NSView*)avatarView { return nil; }
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.cc b/chrome/browser/ui/extensions/extension_action_view_controller.cc index ccefa92d..7ce2454 100644 --- a/chrome/browser/ui/extensions/extension_action_view_controller.cc +++ b/chrome/browser/ui/extensions/extension_action_view_controller.cc
@@ -155,7 +155,7 @@ } ui::MenuModel* ExtensionActionViewController::GetContextMenu() { - if (!ExtensionIsValid() || !extension()->ShowConfigureContextMenus()) + if (!ExtensionIsValid()) return nullptr; extensions::ExtensionContextMenuModel::ButtonVisibility visibility =
diff --git a/chrome/browser/ui/location_bar/location_bar.h b/chrome/browser/ui/location_bar/location_bar.h index ad2b220..f566d39 100644 --- a/chrome/browser/ui/location_bar/location_bar.h +++ b/chrome/browser/ui/location_bar/location_bar.h
@@ -76,9 +76,6 @@ virtual bool ShowPageActionPopup(const extensions::Extension* extension, bool grant_active_tab) = 0; - // Updates the state of the button to open a PDF in Adobe Reader. - virtual void UpdateOpenPDFInReaderPrompt() = 0; - // Saves the state of the location bar to the specified WebContents, so that // it can be restored later. (Done when switching tabs). virtual void SaveStateToContents(content::WebContents* contents) = 0;
diff --git a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc index 2fedeac..a478c9b 100644 --- a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc +++ b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.cc
@@ -7,8 +7,6 @@ #include "chrome/browser/download/download_stats.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" -#include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" @@ -33,23 +31,6 @@ ChromePDFWebContentsHelperClient::~ChromePDFWebContentsHelperClient() { } -void ChromePDFWebContentsHelperClient::UpdateLocationBar( - content::WebContents* contents) { - Browser* browser = chrome::FindBrowserWithWebContents(contents); - if (!browser) - return; - - BrowserWindow* window = browser->window(); - if (!window) - return; - - LocationBar* location_bar = window->GetLocationBar(); - if (!location_bar) - return; - - location_bar->UpdateOpenPDFInReaderPrompt(); -} - void ChromePDFWebContentsHelperClient::UpdateContentRestrictions( content::WebContents* contents, int content_restrictions) {
diff --git a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h index 9d1df6d..96192cf 100644 --- a/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h +++ b/chrome/browser/ui/pdf/chrome_pdf_web_contents_helper_client.h
@@ -16,8 +16,6 @@ private: // pdf::PDFWebContentsHelperClient: - void UpdateLocationBar(content::WebContents* contents) override; - void UpdateContentRestrictions(content::WebContents* contents, int content_restrictions) override;
diff --git a/chrome/browser/ui/search/instant_test_utils.cc b/chrome/browser/ui/search/instant_test_utils.cc index 3dfe0ee..7f04880 100644 --- a/chrome/browser/ui/search/instant_test_utils.cc +++ b/chrome/browser/ui/search/instant_test_utils.cc
@@ -6,7 +6,6 @@ #include <stddef.h> -#include "base/command_line.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chrome_notification_types.h" @@ -14,17 +13,13 @@ #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/ui/search/search_tab_helper.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/common/chrome_switches.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/search_test_utils.h" #include "components/omnibox/browser/omnibox_edit_model.h" -#include "components/prefs/pref_service.h" +#include "components/omnibox/browser/omnibox_view.h" #include "components/search_engines/template_url_service.h" -#include "components/variations/entropy_provider.h" #include "content/public/browser/notification_service.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -#include "content/public/common/result_codes.h" #include "content/public/test/browser_test_utils.h" namespace { @@ -68,20 +63,6 @@ service->SetUserSelectedDefaultSearchProvider(template_url); } -void InstantTestBase::SetInstantURL(const std::string& url) { - TemplateURLService* service = - TemplateURLServiceFactory::GetForProfile(browser_->profile()); - search_test_utils::WaitForTemplateURLServiceToLoad(service); - - TemplateURLData data; - data.SetShortName(base::ASCIIToUTF16("name")); - data.SetURL(url); - data.instant_url = url; - - TemplateURL* template_url = service->Add(base::MakeUnique<TemplateURL>(data)); - service->SetUserSelectedDefaultSearchProvider(template_url); -} - void InstantTestBase::Init(const GURL& instant_url, const GURL& ntp_url, bool init_suggestions_url) { @@ -144,15 +125,6 @@ contents, WrapScript(script), result); } -bool InstantTestBase::CheckVisibilityIs(content::WebContents* contents, - bool expected) { - bool actual = !expected; // Purposely start with a mis-match. - // We can only use ASSERT_*() in a method that returns void, hence this - // convoluted check. - return GetBoolFromJS(contents, "!document.hidden", &actual) && - actual == expected; -} - std::string InstantTestBase::GetOmniboxText() { return base::UTF16ToUTF8(omnibox()->GetText()); } @@ -167,11 +139,3 @@ "img.src = '" + image + "';"; return content::ExecuteScriptAndExtractBool(rvh, js_chrome, loaded); } - -base::string16 InstantTestBase::GetBlueText() { - size_t start = 0, end = 0; - omnibox()->GetSelectionBounds(&start, &end); - if (start > end) - std::swap(start, end); - return omnibox()->GetText().substr(start, end - start); -}
diff --git a/chrome/browser/ui/search/instant_test_utils.h b/chrome/browser/ui/search/instant_test_utils.h index f18e29a..4c83d37 100644 --- a/chrome/browser/ui/search/instant_test_utils.h +++ b/chrome/browser/ui/search/instant_test_utils.h
@@ -7,22 +7,15 @@ #include <string> -#include "base/compiler_specific.h" #include "base/macros.h" -#include "base/metrics/field_trial.h" -#include "base/run_loop.h" -#include "base/strings/string16.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_instant_controller.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/location_bar/location_bar.h" #include "chrome/browser/ui/search/instant_controller.h" -#include "chrome/common/search/search_types.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "url/gurl.h" -class BrowserInstantController; -class InstantController; class OmniboxView; namespace content { @@ -41,20 +34,10 @@ void Init(const GURL& instant_url, const GURL& ntp_url, bool init_suggestions_url); - void SetInstantURL(const std::string& url); - void set_browser(Browser* browser) { browser_ = browser; } - BrowserInstantController* browser_instant() { - return browser_->instant_controller(); - } - - InstantController* instant() { - return browser_->instant_controller()->instant(); - } - OmniboxView* omnibox() { return browser_->window()->GetLocationBar()->GetOmniboxView(); } @@ -65,8 +48,6 @@ net::EmbeddedTestServer& https_test_server() { return https_test_server_; } - void KillInstantRenderView(); - void FocusOmnibox(); void SetOmniboxText(const std::string& text); @@ -83,8 +64,6 @@ bool GetStringFromJS(content::WebContents* contents, const std::string& script, std::string* result) WARN_UNUSED_RESULT; - bool CheckVisibilityIs(content::WebContents* contents, - bool expected) WARN_UNUSED_RESULT; std::string GetOmniboxText(); @@ -95,9 +74,6 @@ const std::string& image, bool* loaded); - // Returns the omnibox's inline autocompletion (shown in blue highlight). - base::string16 GetBlueText(); - private: GURL instant_url_; GURL ntp_url_;
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc index 0f74b5f..65e254eb 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc
@@ -15,6 +15,7 @@ #include "ash/common/wm/window_state_observer.h" #include "ash/common/wm_window.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/public/cpp/window_properties.h" #include "ash/screen_util.h" #include "ash/shared/app_types.h" #include "ash/shared/immersive_fullscreen_controller.h"
diff --git a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc index 72124314..c09617c 100644 --- a/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc +++ b/chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc
@@ -4,9 +4,10 @@ #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" +#include "ash/public/cpp/mus_property_mirror_ash.h" +#include "ash/public/cpp/window_properties.h" #include "ash/root_window_controller.h" #include "ash/shell.h" -#include "ash/wm/window_properties.h" #include "base/memory/ptr_util.h" #include "chrome/browser/chrome_browser_main.h" #include "chrome/browser/ui/ash/ash_init.h" @@ -25,65 +26,11 @@ #include "chrome/browser/ui/views/frame/immersive_handler_factory_mus.h" #include "chrome/browser/ui/views/select_file_dialog_extension.h" #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" -#include "ui/aura/client/aura_constants.h" #include "ui/aura/mus/property_converter.h" #include "ui/base/class_property.h" #include "ui/keyboard/content/keyboard.h" #include "ui/keyboard/keyboard_controller.h" #include "ui/views/mus/mus_client.h" -#include "ui/views/mus/mus_property_mirror.h" - -namespace { - -void MirrorIcon(aura::Window* window, - aura::Window* root_window, - const aura::WindowProperty<gfx::ImageSkia*>* key) { - gfx::ImageSkia* value = window->GetProperty(key); - if (!value || value->isNull()) - root_window->ClearProperty(key); - else - root_window->SetProperty(key, new gfx::ImageSkia(*value)); -} - -} // namespace - -// Relays aura content window properties to its root window (the mash frame). -// Ash relies on various window properties for frame titles, shelf items, etc. -// These properties are read from the client's root, not child content windows. -class MusPropertyMirrorAsh : public views::MusPropertyMirror { - public: - MusPropertyMirrorAsh() {} - ~MusPropertyMirrorAsh() override {} - - // MusPropertyMirror: - void MirrorPropertyFromWidgetWindowToRootWindow(aura::Window* window, - aura::Window* root_window, - const void* key) override { - if (key == ash::kShelfIDKey) { - int32_t value = window->GetProperty(ash::kShelfIDKey); - root_window->SetProperty(ash::kShelfIDKey, value); - } else if (key == ash::kShelfItemTypeKey) { - int32_t value = window->GetProperty(ash::kShelfItemTypeKey); - root_window->SetProperty(ash::kShelfItemTypeKey, value); - } else if (key == aura::client::kAppIconKey) { - MirrorIcon(window, root_window, aura::client::kAppIconKey); - } else if (key == aura::client::kAppIdKey) { - std::string* value = window->GetProperty(aura::client::kAppIdKey); - root_window->SetProperty(aura::client::kAppIdKey, value); - } else if (key == aura::client::kDrawAttentionKey) { - bool value = window->GetProperty(aura::client::kDrawAttentionKey); - root_window->SetProperty(aura::client::kDrawAttentionKey, value); - } else if (key == aura::client::kTitleKey) { - base::string16* value = window->GetProperty(aura::client::kTitleKey); - root_window->SetProperty(aura::client::kTitleKey, value); - } else if (key == aura::client::kWindowIconKey) { - MirrorIcon(window, root_window, aura::client::kWindowIconKey); - } - } - - private: - DISALLOW_COPY_AND_ASSIGN(MusPropertyMirrorAsh); -}; ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() {} @@ -105,7 +52,8 @@ ash::kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property); - mus_client->SetMusPropertyMirror(base::MakeUnique<MusPropertyMirrorAsh>()); + mus_client->SetMusPropertyMirror( + base::MakeUnique<ash::MusPropertyMirrorAsh>()); } }
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index 1a36534..4735f87 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -11,6 +11,7 @@ #include "ash/common/frame/default_header_painter.h" #include "ash/common/frame/frame_border_hit_test.h" #include "ash/common/frame/header_painter_util.h" +#include "ash/common/material_design/material_design_controller.h" #include "ash/common/wm_lookup.h" #include "ash/common/wm_shell.h" #include "ash/common/wm_window.h" @@ -262,8 +263,15 @@ header_painter_->LayoutHeader(); int painted_height = GetTopInset(false); - if (browser_view()->IsTabStripVisible()) - painted_height += browser_view()->tabstrip()->GetPreferredSize().height(); + if (browser_view()->IsTabStripVisible()) { + const ImmersiveModeController* const immersive_controller = + browser_view()->immersive_mode_controller(); + if (!immersive_controller->IsEnabled() || + immersive_controller->IsRevealed() || + !ash::MaterialDesignController::IsImmersiveModeMaterial()) { + painted_height += browser_view()->tabstrip()->GetPreferredSize().height(); + } + } header_painter_->SetHeaderHeightForPainting(painted_height); @@ -384,6 +392,9 @@ } bool BrowserNonClientFrameViewAsh::UseImmersiveLightbarHeaderStyle() const { + if (ash::MaterialDesignController::IsImmersiveModeMaterial()) + return false; + const ImmersiveModeController* const immersive_controller = browser_view()->immersive_mode_controller(); return immersive_controller->IsEnabled() &&
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 3b3b4dd..9bca895b 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -147,13 +147,13 @@ #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" +#if defined(OS_CHROMEOS) +#include "chrome/browser/ui/ash/ash_util.h" +#endif // defined(OS_CHROMEOS) + #if !defined(OS_CHROMEOS) #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" -#endif - -#if defined(USE_ASH) -#include "chrome/browser/ui/ash/ash_util.h" -#endif +#endif // !defined(OS_CHROMEOS) #if defined(USE_AURA) #include "ui/aura/client/window_parenting_client.h" @@ -526,11 +526,6 @@ } bool BrowserView::IsTabStripVisible() const { - if (immersive_mode_controller_->ShouldHideTopViews() && - immersive_mode_controller_->ShouldHideTabIndicators()) { - return false; - } - // Return false if this window does not normally display a tabstrip. if (!browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP)) return false; @@ -593,10 +588,10 @@ // BrowserView, BrowserWindow implementation: void BrowserView::Show() { -#if !defined(OS_WIN) && !defined(USE_ASH) +#if !defined(OS_WIN) && !defined(OS_CHROMEOS) // The Browser associated with this browser window must become the active // browser at the time |Show()| is called. This is the natural behavior under - // Windows and Ash, but other platforms will not trigger + // Windows and Chrome OS, but other platforms will not trigger // OnWidgetActivationChanged() until we return to the runloop. Therefore any // calls to Browser::GetLastActive() will return the wrong result if we do not // explicitly set it here. @@ -992,12 +987,11 @@ } void BrowserView::SetFocusToLocationBar(bool select_all) { - // On Windows, changing focus to the location bar causes the browser - // window to become active. This can steal focus if the user has - // another window open already. On ChromeOS, changing focus makes a - // view believe it has a focus even if the widget doens't have a - // focus. Either cases, we need to ignore this when the browser - // window isn't active. + // On Windows, changing focus to the location bar causes the browser window to + // become active. This can steal focus if the user has another window open + // already. On Chrome OS, changing focus makes a view believe it has a focus + // even if the widget doens't have a focus. Either cases, we need to ignore + // this when the browser window isn't active. #if defined(OS_WIN) || defined(OS_CHROMEOS) if (!force_location_bar_focus_ && !IsActive()) return; @@ -1658,12 +1652,12 @@ } bool BrowserView::ShouldShowWindowTitle() const { -#if defined(USE_ASH) - // For Ash only, trusted windows (apps and settings) do not show a title, - // crbug.com/119411. Child windows (i.e. popups) do show a title. +#if defined(OS_CHROMEOS) + // For Chrome OS only, trusted windows (apps and settings) do not show a + // title, crbug.com/119411. Child windows (i.e. popups) do show a title. if (browser_->is_trusted_source()) return false; -#endif // USE_ASH +#endif // OS_CHROMEOS return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); } @@ -1692,12 +1686,12 @@ } bool BrowserView::ShouldShowWindowIcon() const { -#if defined(USE_ASH) - // For Ash only, trusted windows (apps and settings) do not show an icon, - // crbug.com/119411. Child windows (i.e. popups) do show an icon. +#if defined(OS_CHROMEOS) + // For Chrome OS only, trusted windows (apps and settings) do not show an + // icon, crbug.com/119411. Child windows (i.e. popups) do show an icon. if (browser_->is_trusted_source()) return false; -#endif // USE_ASH +#endif // OS_CHROMEOS return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); } @@ -2352,16 +2346,16 @@ } bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { -#if defined(USE_ASH) +#if defined(OS_CHROMEOS) // Kiosk mode needs the whole screen. if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) return false; return url.is_empty(); #else - // No immersive except in Ash. + // No immersive except in Chrome OS. return false; -#endif // !USE_ASH +#endif } void BrowserView::LoadAccelerators() {
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc index 5e986a69..9fb9c7a 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash_unittest.cc
@@ -131,16 +131,13 @@ EXPECT_TRUE(controller()->IsEnabled()); EXPECT_FALSE(controller()->IsRevealed()); EXPECT_FALSE(toolbar->visible()); - // For MD, the browser's top chrome is completely hidden in immersive - // fullscreen mode. + // For MD, the browser's top chrome is completely offscreen with tapstrip + // visible. + EXPECT_TRUE(tabstrip->visible()); bool is_using_material_design = ash::MaterialDesignController::IsImmersiveModeMaterial(); - if (is_using_material_design) { - EXPECT_FALSE(tabstrip->visible()); - } else { - EXPECT_TRUE(tabstrip->visible()); + if (!is_using_material_design) EXPECT_TRUE(tabstrip->IsImmersiveStyle()); - } // The tab indicators should be flush with the top of the widget. EXPECT_EQ(0, GetBoundsInWidget(tabstrip).y()); @@ -195,12 +192,11 @@ // both immersive and tab fullscreen. EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y()); - // Hide the top-of-window views. Both the tab strip and the toolbar should - // hide when in both immersive and tab fullscreen. + // Hide the top-of-window views. Tabstrip is still considered as visible. AttemptUnreveal(); EXPECT_FALSE(controller()->IsRevealed()); - EXPECT_FALSE(tabstrip->visible()); EXPECT_FALSE(toolbar->visible()); + EXPECT_TRUE(tabstrip->visible()); // The web contents should still be flush with the edge of the widget. EXPECT_EQ(0, GetBoundsInWidget(contents_web_view).y()); @@ -351,7 +347,8 @@ EXPECT_FALSE(controller()->IsRevealed()); // Entering immersive fullscreen should make the web contents flush with the - // top of the widget. + // top of the widget. The popup browser type doesn't support tabstrip and + // toolbar feature, thus invisible. EXPECT_FALSE(tabstrip->visible()); EXPECT_FALSE(toolbar->visible()); EXPECT_TRUE(top_container->GetVisibleBounds().IsEmpty());
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 6fa564c..0fcbb434a 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -40,7 +40,6 @@ #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_layout.h" #include "chrome/browser/ui/views/location_bar/location_icon_view.h" -#include "chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h" #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" @@ -131,7 +130,6 @@ selected_keyword_view_(nullptr), keyword_hint_view_(nullptr), zoom_view_(nullptr), - open_pdf_in_reader_view_(nullptr), manage_passwords_icon_view_(nullptr), save_credit_card_icon_view_(nullptr), translate_icon_view_(nullptr), @@ -251,9 +249,6 @@ zoom_view_->Init(); AddChildView(zoom_view_); - open_pdf_in_reader_view_ = new OpenPDFInReaderView(); - AddChildView(open_pdf_in_reader_view_); - manage_passwords_icon_view_ = new ManagePasswordsIconViews(command_updater()); manage_passwords_icon_view_->Init(); AddChildView(manage_passwords_icon_view_); @@ -475,7 +470,6 @@ int trailing_width = edge_thickness; trailing_width += IncrementalMinimumWidth(star_view_) + IncrementalMinimumWidth(translate_icon_view_) + - IncrementalMinimumWidth(open_pdf_in_reader_view_) + IncrementalMinimumWidth(save_credit_card_icon_view_) + IncrementalMinimumWidth(manage_passwords_icon_view_) + IncrementalMinimumWidth(zoom_view_); @@ -555,10 +549,6 @@ trailing_decorations.AddDecoration(vertical_padding, location_height, translate_icon_view_); } - if (open_pdf_in_reader_view_->visible()) { - trailing_decorations.AddDecoration(vertical_padding, location_height, - open_pdf_in_reader_view_); - } if (save_credit_card_icon_view_->visible()) { trailing_decorations.AddDecoration(vertical_padding, location_height, save_credit_card_icon_view_); @@ -654,9 +644,6 @@ RefreshTranslateIcon(); RefreshSaveCreditCardIconView(); RefreshManagePasswordsIconView(); - WebContents* web_contents_for_sub_views = - GetToolbarModel()->input_in_progress() ? nullptr : GetWebContents(); - open_pdf_in_reader_view_->Update(web_contents_for_sub_views); if (star_view_) UpdateBookmarkStarVisibility(); @@ -780,9 +767,7 @@ page_action_views_.push_back(std::move(page_action_view)); } - View* right_anchor = open_pdf_in_reader_view_; - if (!right_anchor) - right_anchor = star_view_; + View* right_anchor = star_view_; DCHECK(right_anchor); // |page_action_views_| are ordered right-to-left. Add them as children in @@ -1038,13 +1023,6 @@ return extension_action_view_controller->ExecuteAction(grant_tab_permissions); } -void LocationBarView::UpdateOpenPDFInReaderPrompt() { - open_pdf_in_reader_view_->Update( - GetToolbarModel()->input_in_progress() ? nullptr : GetWebContents()); - Layout(); - SchedulePaint(); -} - void LocationBarView::SaveStateToContents(WebContents* contents) { omnibox_view_->SaveStateToTab(contents); }
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index 1d9b7a4..310a3c3 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -36,7 +36,6 @@ class GURL; class KeywordHintView; class LocationIconView; -class OpenPDFInReaderView; class ManagePasswordsIconViews; class PageActionWithBadgeView; class PageActionImageView; @@ -351,7 +350,6 @@ void UpdateLocationBarVisibility(bool visible, bool animation) override; bool ShowPageActionPopup(const extensions::Extension* extension, bool grant_active_tab) override; - void UpdateOpenPDFInReaderPrompt() override; void SaveStateToContents(content::WebContents* contents) override; const OmniboxView* GetOmniboxView() const override; LocationBarTesting* GetLocationBarForTesting() override; @@ -431,9 +429,6 @@ // The zoom icon. ZoomView* zoom_view_; - // The icon to open a PDF in Reader. - OpenPDFInReaderView* open_pdf_in_reader_view_; - // The manage passwords icon. ManagePasswordsIconViews* manage_passwords_icon_view_;
diff --git a/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.cc b/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.cc deleted file mode 100644 index 58f9375c..0000000 --- a/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.cc +++ /dev/null
@@ -1,95 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h" - -#include "chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h" -#include "chrome/grit/generated_resources.h" -#include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" -#include "components/pdf/browser/pdf_web_contents_helper.h" -#include "ui/accessibility/ax_node_data.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/color_utils.h" -#include "ui/gfx/paint_vector_icon.h" -#include "ui/gfx/vector_icons_public.h" -#include "ui/native_theme/native_theme.h" -#include "ui/views/widget/widget.h" - -OpenPDFInReaderView::OpenPDFInReaderView() : bubble_(nullptr), model_(nullptr) { - SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); - SetTooltipText(l10n_util::GetStringUTF16(IDS_PDF_BUBBLE_OPEN_IN_READER_LINK)); -} - -OpenPDFInReaderView::~OpenPDFInReaderView() { - if (bubble_) - bubble_->GetWidget()->RemoveObserver(this); -} - -void OpenPDFInReaderView::Update(content::WebContents* web_contents) { - model_ = nullptr; - if (web_contents) { - pdf::PDFWebContentsHelper* pdf_tab_helper = - pdf::PDFWebContentsHelper::FromWebContents(web_contents); - model_ = pdf_tab_helper->open_in_reader_prompt(); - } - - SetVisible(!!model_); - - // Hide the bubble if it is currently shown and the icon is hidden. - if (!model_ && bubble_) - bubble_->GetWidget()->Hide(); -} - -void OpenPDFInReaderView::ShowBubble() { - if (bubble_) - return; - - DCHECK(model_); - bubble_ = new OpenPDFInReaderBubbleView(this, model_); - views::BubbleDialogDelegateView::CreateBubble(bubble_); - bubble_->GetWidget()->AddObserver(this); - bubble_->GetWidget()->Show(); -} - -void OpenPDFInReaderView::GetAccessibleNodeData(ui::AXNodeData* node_data) { - ImageView::GetAccessibleNodeData(node_data); - node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_OPEN_PDF_IN_READER)); - node_data->role = ui::AX_ROLE_BUTTON; -} - -bool OpenPDFInReaderView::OnMousePressed(const ui::MouseEvent& event) { - // Show the bubble on mouse release; that is standard button behavior. - return true; -} - -void OpenPDFInReaderView::OnMouseReleased(const ui::MouseEvent& event) { - if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location())) - ShowBubble(); -} - -bool OpenPDFInReaderView::OnKeyPressed(const ui::KeyEvent& event) { - if (event.key_code() != ui::VKEY_SPACE && - event.key_code() != ui::VKEY_RETURN) { - return false; - } - - ShowBubble(); - return true; -} - -void OpenPDFInReaderView::OnNativeThemeChanged( - const ui::NativeTheme* native_theme) { - SetImage(gfx::CreateVectorIcon( - gfx::VectorIconId::PDF, - color_utils::DeriveDefaultIconColor(native_theme->GetSystemColor( - ui::NativeTheme::kColorId_TextfieldDefaultColor)))); -} - -void OpenPDFInReaderView::OnWidgetDestroying(views::Widget* widget) { - if (!bubble_) - return; - - bubble_->GetWidget()->RemoveObserver(this); - bubble_ = nullptr; -}
diff --git a/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h b/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h deleted file mode 100644 index 19f53c72..0000000 --- a/chrome/browser/ui/views/location_bar/open_pdf_in_reader_view.h +++ /dev/null
@@ -1,53 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ -#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ - -#include "base/macros.h" -#include "ui/views/controls/image_view.h" -#include "ui/views/widget/widget_observer.h" - -class OpenPDFInReaderBubbleView; - -namespace content { -class WebContents; -} - -namespace pdf { -class OpenPDFInReaderPromptClient; -} - -// A Page Action image view for the "Open PDF in Reader" bubble. -class OpenPDFInReaderView : public views::ImageView, - public views::WidgetObserver { - public: - OpenPDFInReaderView(); - ~OpenPDFInReaderView() override; - - void Update(content::WebContents* web_contents); - - private: - void ShowBubble(); - - // views::ImageView: - void GetAccessibleNodeData(ui::AXNodeData* node_data) override; - bool OnMousePressed(const ui::MouseEvent& event) override; - void OnMouseReleased(const ui::MouseEvent& event) override; - bool OnKeyPressed(const ui::KeyEvent& event) override; - void OnNativeThemeChanged(const ui::NativeTheme* theme) override; - - // views::WidgetObserver: - void OnWidgetDestroying(views::Widget* widget) override; - - OpenPDFInReaderBubbleView* bubble_; - - // Weak pointer; owned by the PDFWebContentsHelper of the currently active - // tab. - pdf::OpenPDFInReaderPromptClient* model_; - - DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderView); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index 0446be9..8a8ae03 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -87,6 +87,19 @@ gfx::BaselineStyle baseline; }; +// Returns the styles that should be applied to the specified answer text type. +// +// Note that the font value is only consulted for the first text type that +// appears on an answer line, because RenderText does not yet support multiple +// font sizes. Subsequent text types on the same line will share the text size +// of the first type, while the color and baseline styles specified here will +// always apply. The gfx::INFERIOR baseline style is used as a workaround to +// produce smaller text on the same line. The way this is used in the current +// set of answers is that the small types (TOP_ALIGNED, DESCRIPTION_NEGATIVE, +// DESCRIPTION_POSITIVE and SUGGESTION_SECONDARY_TEXT_SMALL) only ever appear +// following LargeFont text, so for consistency they specify LargeFont for the +// first value even though this is not actually used (since they're not the +// first value). TextStyle GetTextStyle(int type) { switch (type) { case SuggestionAnswer::TOP_ALIGNED: @@ -125,7 +138,12 @@ NativeTheme::kColorId_ResultsTableHoveredText, NativeTheme::kColorId_ResultsTableSelectedText}, gfx::NORMAL_BASELINE}; - case SuggestionAnswer::SUGGESTION_SECONDARY_TEXT_SMALL: // Fall through. + case SuggestionAnswer::SUGGESTION_SECONDARY_TEXT_SMALL: + return {ui::ResourceBundle::LargeFont, + {NativeTheme::kColorId_ResultsTableNormalDimmedText, + NativeTheme::kColorId_ResultsTableHoveredDimmedText, + NativeTheme::kColorId_ResultsTableSelectedDimmedText}, + gfx::INFERIOR}; case SuggestionAnswer::SUGGESTION_SECONDARY_TEXT_MEDIUM: return {ui::ResourceBundle::BaseFont, {NativeTheme::kColorId_ResultsTableNormalDimmedText, @@ -278,12 +296,11 @@ gfx::Size OmniboxResultView::GetPreferredSize() const { if (!match_.answer) return gfx::Size(0, GetContentLineHeight()); - // An answer implies a match and a description in a large font. if (match_.answer->second_line().num_text_lines() == 1) return gfx::Size(0, GetContentLineHeight() + GetAnswerLineHeight()); if (!description_rendertext_) { description_rendertext_ = - CreateAnswerLine(match_.answer->second_line(), font_list_); + CreateAnswerLine(match_.answer->second_line(), GetAnswerLineFont()); } description_rendertext_->SetDisplayRect( gfx::Rect(text_bounds_.width(), 0)); @@ -648,7 +665,7 @@ if (!description_rendertext_) { if (match_.answer) { description_rendertext_ = - CreateAnswerLine(match_.answer->second_line(), font_list_); + CreateAnswerLine(match_.answer->second_line(), GetAnswerLineFont()); } else if (!match_.description.empty()) { description_rendertext_ = CreateClassifiedRenderText( match_.description, match_.description_class, true); @@ -681,12 +698,21 @@ SchedulePaint(); } +const gfx::FontList& OmniboxResultView::GetAnswerLineFont() const { + // This assumes that the first text type in the second answer line can be used + // to specify the font for all the text fields in the line. For now this works + // but eventually it will be necessary to get RenderText to support multiple + // font sizes or use multiple RenderTexts. + int text_type = + match_.answer && !match_.answer->second_line().text_fields().empty() + ? match_.answer->second_line().text_fields()[0].type() + : SuggestionAnswer::SUGGESTION; + return ui::ResourceBundle::GetSharedInstance().GetFontList( + GetTextStyle(text_type).font); +} + int OmniboxResultView::GetAnswerLineHeight() const { - // ANSWER_TEXT_LARGE is the largest font used and so defines the boundary that - // all the other answer styles fit within. - return ui::ResourceBundle::GetSharedInstance() - .GetFontList(GetTextStyle(SuggestionAnswer::ANSWER_TEXT_LARGE).font) - .GetHeight(); + return GetAnswerLineFont().GetHeight(); } int OmniboxResultView::GetContentLineHeight() const { @@ -700,7 +726,7 @@ std::unique_ptr<gfx::RenderText> OmniboxResultView::CreateAnswerLine( const SuggestionAnswer::ImageLine& line, - gfx::FontList font_list) const { + const gfx::FontList& font_list) const { std::unique_ptr<gfx::RenderText> destination = CreateRenderText(base::string16()); destination->SetFontList(font_list);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h index 7597002c..56c47b3f 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
@@ -158,13 +158,19 @@ bool is_ui_rtl, bool is_match_contents_rtl) const; + // Returns the font to use for the description line of answer suggestions. + const gfx::FontList& GetAnswerLineFont() const; + + // Returns the height of the the description line of answer suggestions. int GetAnswerLineHeight() const; + + // Returns the height of the content line. int GetContentLineHeight() const; // Creates a RenderText with text and styling from the image line. std::unique_ptr<gfx::RenderText> CreateAnswerLine( const SuggestionAnswer::ImageLine& line, - gfx::FontList font_list) const; + const gfx::FontList& font_list) const; // Adds |text| to |destination|. |text_type| is an index into the // kTextStyles constant defined in the .cc file and is used to style the text,
diff --git a/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.cc b/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.cc deleted file mode 100644 index d1e78d5..0000000 --- a/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.cc +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h" - -#include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" -#include "ui/views/controls/button/label_button.h" -#include "ui/views/controls/label.h" -#include "ui/views/controls/link.h" -#include "ui/views/controls/separator.h" -#include "ui/views/layout/grid_layout.h" -#include "ui/views/layout/layout_constants.h" - -OpenPDFInReaderBubbleView::~OpenPDFInReaderBubbleView() {} - -OpenPDFInReaderBubbleView::OpenPDFInReaderBubbleView( - views::View* anchor_view, - pdf::OpenPDFInReaderPromptClient* model) - : views::BubbleDialogDelegateView(anchor_view, - views::BubbleBorder::TOP_RIGHT), - model_(model), - open_in_reader_link_(nullptr) { - DCHECK(model); -} - -void OpenPDFInReaderBubbleView::Init() { - using views::GridLayout; - - GridLayout* layout = new views::GridLayout(this); - SetLayoutManager(layout); - - const int single_column_set_id = 0; - views::ColumnSet* column_set = layout->AddColumnSet(single_column_set_id); - column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, - GridLayout::USE_PREF, 0, 0); - - base::string16 title = model_->GetMessageText(); - views::Label* title_label = new views::Label(title); - layout->StartRow(0, single_column_set_id); - layout->AddView(title_label); - - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); - - base::string16 accept_text = model_->GetAcceptButtonText(); - open_in_reader_link_ = new views::Link(accept_text); - open_in_reader_link_->set_listener(this); - layout->StartRow(0, single_column_set_id); - layout->AddView(open_in_reader_link_); -} - -int OpenPDFInReaderBubbleView::GetDialogButtons() const { - return ui::DIALOG_BUTTON_CANCEL; -} - -base::string16 OpenPDFInReaderBubbleView::GetDialogButtonLabel( - ui::DialogButton button) const { - return model_->GetCancelButtonText(); -} - -bool OpenPDFInReaderBubbleView::Cancel() { - model_->Cancel(); - return true; -} - -void OpenPDFInReaderBubbleView::LinkClicked(views::Link* source, - int event_flags) { - DCHECK_EQ(open_in_reader_link_, source); - - model_->Accept(); - GetWidget()->Close(); -} -
diff --git a/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h b/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h deleted file mode 100644 index 9ea2f75d..0000000 --- a/chrome/browser/ui/views/open_pdf_in_reader_bubble_view.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_OPEN_PDF_IN_READER_BUBBLE_VIEW_H_ -#define CHROME_BROWSER_UI_VIEWS_OPEN_PDF_IN_READER_BUBBLE_VIEW_H_ - -#include "base/macros.h" -#include "ui/views/bubble/bubble_dialog_delegate.h" -#include "ui/views/controls/link_listener.h" - -namespace pdf { -class OpenPDFInReaderPromptClient; -} - -class OpenPDFInReaderBubbleView : public views::BubbleDialogDelegateView, - public views::LinkListener { - public: - OpenPDFInReaderBubbleView(views::View* anchor_view, - pdf::OpenPDFInReaderPromptClient* model); - ~OpenPDFInReaderBubbleView() override; - - protected: - // views::BubbleDialogDelegateView: - void Init() override; - bool Cancel() override; - int GetDialogButtons() const override; - base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; - - // views::LinkListener: - void LinkClicked(views::Link* source, int event_flags) override; - - private: - // Weak pointer; owned by the PDFWebContentsHelper of the currently active - // tab. - pdf::OpenPDFInReaderPromptClient* model_; - - views::Link* open_in_reader_link_; - - DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderBubbleView); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_OPEN_PDF_IN_READER_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index 860d0e3..3f0edc3d 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -63,6 +63,7 @@ #if defined(USE_ASH) #include "ash/common/ash_switches.h" +#include "ash/common/material_design/material_design_controller.h" #include "ash/common/wm/root_window_finder.h" #include "ash/common/wm/window_state.h" #include "ash/common/wm_window.h" @@ -2098,9 +2099,15 @@ ->controller()) .SetupForTest(); chrome::ToggleFullscreenMode(browser2); + // For MD, the browser's top chrome is completely offscreen, with tabstrip + // visible. ASSERT_TRUE(immersive_controller2->IsEnabled()); ASSERT_FALSE(immersive_controller2->IsRevealed()); - ASSERT_TRUE(tab_strip2->IsImmersiveStyle()); + ASSERT_TRUE(tab_strip2->visible()); + bool is_using_material_design = + ash::MaterialDesignController::IsImmersiveModeMaterial(); + if (!is_using_material_design) + ASSERT_TRUE(tab_strip2->IsImmersiveStyle()); // Move to the first tab and drag it enough so that it detaches, but not // enough that it attaches to browser2. @@ -2121,6 +2128,7 @@ // at normal height while user is tragging tabs_strip2's tabs. ASSERT_TRUE(immersive_controller2->IsRevealed()); ASSERT_FALSE(tab_strip2->IsImmersiveStyle()); + ASSERT_TRUE(tab_strip2->visible()); // Release the mouse, stopping the drag session. ASSERT_TRUE(ReleaseInput()); @@ -2143,7 +2151,9 @@ EXPECT_TRUE(immersive_controller2->IsEnabled()); EXPECT_FALSE(immersive_controller2->IsRevealed()); - EXPECT_TRUE(tab_strip2->IsImmersiveStyle()); + EXPECT_TRUE(tab_strip2->visible()); + if (!is_using_material_design) + EXPECT_TRUE(tab_strip2->IsImmersiveStyle()); } // Subclass of DetachToBrowserTabDragControllerTest that
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 60717d7..3e73cc2 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -36,8 +36,8 @@ #if defined(USE_ASH) // Note: gn check complains here, despite the correct conditional //ash dep. #include "ash/common/shelf/shelf_item_types.h" // nogncheck +#include "ash/public/cpp/window_properties.h" // nogncheck #include "ash/resources/grit/ash_resources.h" // nogncheck -#include "ash/wm/window_properties.h" // nogncheck #include "ash/wm/window_util.h" // nogncheck #include "chrome/browser/ui/ash/ash_util.h" // nogncheck #include "ui/aura/client/aura_constants.h"
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 9793463..a0c0c2580 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -50,6 +50,7 @@ #include "chrome/browser/ui/webui/policy_ui.h" #include "chrome/browser/ui/webui/predictors/predictors_ui.h" #include "chrome/browser/ui/webui/profiler_ui.h" +#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" #include "chrome/browser/ui/webui/settings/md_settings_ui.h" #include "chrome/browser/ui/webui/settings_utils.h" #include "chrome/browser/ui/webui/signin_internals_ui.h" @@ -127,7 +128,6 @@ #include "chrome/browser/ui/webui/md_feedback/md_feedback_ui.h" #include "chrome/browser/ui/webui/md_history_ui.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" -#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" #include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_internals_ui.h" #include "chrome/browser/ui/webui/system_info_ui.h" #include "chrome/browser/ui/webui/uber/uber_ui.h" @@ -366,7 +366,9 @@ return &NewWebUI<PredictorsUI>; if (url.host_piece() == chrome::kChromeUIProfilerHost) return &NewWebUI<ProfilerUI>; - if (url.host_piece() == chrome::kChromeUISignInInternalsHost) + if (url.host() == chrome::kChromeUIQuotaInternalsHost) + return &NewWebUI<QuotaInternalsUI>; + if (url.host() == chrome::kChromeUISignInInternalsHost) return &NewWebUI<SignInInternalsUI>; if (url.host_piece() == chrome::kChromeUISuggestionsHost) return &NewWebUI<suggestions::SuggestionsUI>; @@ -441,8 +443,6 @@ url.host_piece() == chrome::kChromeUISettingsHost) { return &NewWebUI<settings::MdSettingsUI>; } - if (url.host_piece() == chrome::kChromeUIQuotaInternalsHost) - return &NewWebUI<QuotaInternalsUI>; // Settings are implemented with native UI elements on Android. // Handle chrome://settings if settings in a window is enabled. if (url.host_piece() == chrome::kChromeUISettingsFrameHost ||
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index 8351265a..3fd073c 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -823,6 +823,12 @@ IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_NO_PREFERRED}, {"knownNetworksPreferred", IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_PREFFERED}, + {"knownNetworksMenuAddPreferred", + IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_ADD_PREFERRED}, + {"knownNetworksMenuRemovePreferred", + IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_REMOVE_PREFERRED}, + {"knownNetworksMenuForget", + IDS_SETTINGS_INTERNET_KNOWN_NETWORKS_MENU_FORGET}, {"networkAutoConnect", IDS_SETTINGS_INTERNET_NETWORK_AUTO_CONNECT}, {"networkButtonActivate", IDS_SETTINGS_INTERNET_BUTTON_ACTIVATE}, {"networkButtonConfigure", IDS_SETTINGS_INTERNET_BUTTON_CONFIGURE}, @@ -940,6 +946,8 @@ IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE}, {"offerToTranslateInThisLanguage", IDS_SETTINGS_LANGUAGES_OFFER_TO_TRANSLATE_IN_THIS_LANGUAGE}, + {"offerToEnableTranslate", + IDS_SETTINGS_LANGUAGES_OFFER_TO_ENABLE_TRANSLATE}, #if !defined(OS_MACOSX) {"spellCheckListTitle", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_LIST_TITLE}, {"spellCheckExpandA11yLabel",
diff --git a/chrome/browser/ui/webui/snippets_internals_message_handler.cc b/chrome/browser/ui/webui/snippets_internals_message_handler.cc index b40f49d..8df8495 100644 --- a/chrome/browser/ui/webui/snippets_internals_message_handler.cc +++ b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
@@ -141,23 +141,26 @@ } void SnippetsInternalsMessageHandler::OnNewSuggestions(Category category) { - if (!dom_loaded_) + if (!dom_loaded_) { return; + } SendContentSuggestions(); } void SnippetsInternalsMessageHandler::OnCategoryStatusChanged( Category category, CategoryStatus new_status) { - if (!dom_loaded_) + if (!dom_loaded_) { return; + } SendContentSuggestions(); } void SnippetsInternalsMessageHandler::OnSuggestionInvalidated( const ntp_snippets::ContentSuggestion::ID& suggestion_id) { - if (!dom_loaded_) + if (!dom_loaded_) { return; + } SendContentSuggestions(); } @@ -197,8 +200,9 @@ SendString("remote-status", std::string()); - if (!remote_suggestions_provider_) + if (!remote_suggestions_provider_) { return; + } remote_suggestions_provider_->ReloadSuggestions(); } @@ -208,8 +212,9 @@ DCHECK_EQ(1u, args->GetSize()); int category_id; - if (!args->GetInteger(0, &category_id)) + if (!args->GetInteger(0, &category_id)) { return; + } content_suggestions_service_->ClearCachedSuggestions( Category::FromIDValue(category_id)); @@ -221,8 +226,9 @@ DCHECK_EQ(1u, args->GetSize()); int category_id; - if (!args->GetInteger(0, &category_id)) + if (!args->GetInteger(0, &category_id)) { return; + } Category category = Category::FromIDValue(category_id); content_suggestions_service_->ClearDismissedSuggestionsForDebugging(category); @@ -239,11 +245,13 @@ DCHECK_EQ(2u, args->GetSize()); int category_id; - if (!args->GetInteger(0, &category_id)) + if (!args->GetInteger(0, &category_id)) { return; + } bool dismissed_visible; - if (!args->GetBoolean(1, &dismissed_visible)) + if (!args->GetBoolean(1, &dismissed_visible)) { return; + } Category category = Category::FromIDValue(category_id); if (dismissed_visible) { @@ -385,8 +393,9 @@ const std::string& status = remote_suggestions_provider_->suggestions_fetcher_for_debugging() ->last_status(); - if (!status.empty()) + if (!status.empty()) { SendString("remote-status", "Finished: " + status); + } } base::DictionaryValue result; @@ -412,8 +421,9 @@ void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( Category category, std::vector<ContentSuggestion> dismissed_suggestions) { - if (dismissed_state_[category] == DismissedState::HIDDEN) + if (dismissed_state_[category] == DismissedState::HIDDEN) { return; + } dismissed_suggestions_[category] = std::move(dismissed_suggestions); dismissed_state_[category] = DismissedState::VISIBLE; SendContentSuggestions();
diff --git a/chrome/browser/webshare/share_target_pref_helper.cc b/chrome/browser/webshare/share_target_pref_helper.cc new file mode 100644 index 0000000..f09fc14 --- /dev/null +++ b/chrome/browser/webshare/share_target_pref_helper.cc
@@ -0,0 +1,32 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/webshare/share_target_pref_helper.h" + +#include "base/values.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/scoped_user_pref_update.h" + +void UpdateShareTargetInPrefs(base::StringPiece manifest_url, + base::Optional<std::string> url_template, + PrefService* pref_service) { + DictionaryPrefUpdate update(pref_service, prefs::kWebShareVisitedTargets); + base::DictionaryValue* share_target_dict = update.Get(); + + if (!url_template.has_value()) { + share_target_dict->RemoveWithoutPathExpansion(manifest_url, NULL); + return; + } + + constexpr char kUrlTemplateKey[] = "url_template"; + + std::unique_ptr<base::DictionaryValue> origin_dict(new base::DictionaryValue); + + origin_dict->SetStringWithoutPathExpansion(kUrlTemplateKey, + url_template.value()); + + share_target_dict->SetWithoutPathExpansion(manifest_url, + std::move(origin_dict)); +}
diff --git a/chrome/browser/webshare/share_target_pref_helper.h b/chrome/browser/webshare/share_target_pref_helper.h new file mode 100644 index 0000000..511564a --- /dev/null +++ b/chrome/browser/webshare/share_target_pref_helper.h
@@ -0,0 +1,21 @@ +// 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_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ +#define CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ + +#include "base/optional.h" +#include "base/strings/string_piece.h" + +class PrefService; + +// Adds the Web Share target |share_target_origin| with template |url_template| +// to |pref_service| under kWebShareVisitedTargets. If |url_template| is null, +// this function will remove |share_target_origin| from kWebShareVisitedTargets, +// if it is there. +void UpdateShareTargetInPrefs(base::StringPiece manifest_url, + base::Optional<std::string> url_template, + PrefService* pref_service); + +#endif // CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
diff --git a/chrome/browser/webshare/share_target_pref_helper_unittest.cc b/chrome/browser/webshare/share_target_pref_helper_unittest.cc new file mode 100644 index 0000000..38fe35ed --- /dev/null +++ b/chrome/browser/webshare/share_target_pref_helper_unittest.cc
@@ -0,0 +1,195 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/strings/string16.h" +#include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/webshare/share_target_pref_helper.h" +#include "chrome/common/pref_names.h" +#include "chrome/test/base/testing_profile.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/testing_pref_service.h" +#include "testing/gtest/include/gtest/gtest.h" + +class PrefRegistrySimple; + +namespace { + +class ShareTargetPrefHelperUnittest : public testing::Test { + protected: + ShareTargetPrefHelperUnittest() {} + ~ShareTargetPrefHelperUnittest() override {} + + void SetUp() override { + pref_service_.reset(new TestingPrefServiceSimple()); + pref_service_->registry()->RegisterDictionaryPref( + prefs::kWebShareVisitedTargets); + } + + PrefService* pref_service() { return pref_service_.get(); } + + private: + std::unique_ptr<TestingPrefServiceSimple> pref_service_; +}; + +constexpr char kUrlTemplateKey[] = "url_template"; + +TEST_F(ShareTargetPrefHelperUnittest, AddMultipleShareTargets) { + // Add a share target to prefs that wasn't previously stored. + std::string manifest_url = "https://www.sharetarget.com/manifest.json"; + base::Optional<std::string> url_template = + base::Optional<std::string>("share/?title={title}"); + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + const base::DictionaryValue* share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + const base::DictionaryValue* share_target_info_dict = nullptr; + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + manifest_url, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + std::string url_template_in_dict; + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, url_template); + + // Add second share target to prefs that wasn't previously stored. + manifest_url = "https://www.sharetarget2.com/manifest.json"; + url_template = base::Optional<std::string>("share/?title={title}"); + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(2UL, share_target_dict->size()); + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + manifest_url, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, url_template); +} + +TEST_F(ShareTargetPrefHelperUnittest, AddShareTargetTwice) { + const char kManifestUrl[] = "https://www.sharetarget.com/manifest.json"; + const base::Optional<std::string> kUrlTemplate = + base::Optional<std::string>("share/?title={title}"); + + // Add a share target to prefs that wasn't previously stored. + UpdateShareTargetInPrefs(kManifestUrl, kUrlTemplate, pref_service()); + + const base::DictionaryValue* share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + const base::DictionaryValue* share_target_info_dict = nullptr; + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + kManifestUrl, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + std::string url_template_in_dict; + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, kUrlTemplate); + + // Add same share target to prefs that was previously stored; shouldn't + // duplicate it. + UpdateShareTargetInPrefs(kManifestUrl, kUrlTemplate, pref_service()); + + share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + kManifestUrl, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, kUrlTemplate); +} + +TEST_F(ShareTargetPrefHelperUnittest, UpdateShareTarget) { + // Add a share target to prefs that wasn't previously stored. + std::string manifest_url = "https://www.sharetarget.com/manifest.json"; + base::Optional<std::string> url_template = + base::Optional<std::string>("share/?title={title}"); + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + const base::DictionaryValue* share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + const base::DictionaryValue* share_target_info_dict = nullptr; + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + manifest_url, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + std::string url_template_in_dict; + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, url_template); + + // Add same share target to prefs that was previously stored, with new + // url_template_in_dict; should update the value. + manifest_url = "https://www.sharetarget.com/manifest.json"; + url_template = + base::Optional<std::string>("share/?title={title}&text={text}"); + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + manifest_url, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, url_template); +} + +TEST_F(ShareTargetPrefHelperUnittest, DontAddNonShareTarget) { + const char kManifestUrl[] = "https://www.dudsharetarget.com/manifest.json"; + const base::Optional<std::string> kUrlTemplate; + + // Don't add a site that has a null template. + UpdateShareTargetInPrefs(kManifestUrl, kUrlTemplate, pref_service()); + + const base::DictionaryValue* share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(0UL, share_target_dict->size()); + const base::DictionaryValue* share_target_info_dict = nullptr; + ASSERT_FALSE(share_target_dict->GetDictionaryWithoutPathExpansion( + kManifestUrl, &share_target_info_dict)); +} + +TEST_F(ShareTargetPrefHelperUnittest, RemoveShareTarget) { + // Add a share target to prefs that wasn't previously stored. + std::string manifest_url = "https://www.sharetarget.com/manifest.json"; + base::Optional<std::string> url_template = + base::Optional<std::string>("share/?title={title}"); + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + const base::DictionaryValue* share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(1UL, share_target_dict->size()); + const base::DictionaryValue* share_target_info_dict = nullptr; + ASSERT_TRUE(share_target_dict->GetDictionaryWithoutPathExpansion( + manifest_url, &share_target_info_dict)); + EXPECT_EQ(1UL, share_target_info_dict->size()); + std::string url_template_in_dict; + EXPECT_TRUE(share_target_info_dict->GetString(kUrlTemplateKey, + &url_template_in_dict)); + EXPECT_EQ(url_template_in_dict, url_template); + + // Share target already added now has null template. Remove from prefs. + manifest_url = "https://www.sharetarget.com/manifest.json"; + url_template = base::nullopt; + + UpdateShareTargetInPrefs(manifest_url, url_template, pref_service()); + + share_target_dict = + pref_service()->GetDictionary(prefs::kWebShareVisitedTargets); + EXPECT_EQ(0UL, share_target_dict->size()); +} + +} // namespace
diff --git a/chrome/chrome.isolate b/chrome/chrome.isolate index 52704555..5ac069c 100644 --- a/chrome/chrome.isolate +++ b/chrome/chrome.isolate
@@ -115,13 +115,6 @@ ], }, }], - ['OS=="win" and kasko==1', { - 'variables': { - 'files': [ - '<(PRODUCT_DIR)/kasko.dll', - ], - }, - }], ['OS=="win" and component=="shared_library" and (fastbuild==0 or fastbuild==1)', { 'variables': { 'files': [
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 27c483c..1ecd49b 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -96,6 +96,7 @@ "$root_gen_dir/chrome/net_internals_resources.pak", "$root_gen_dir/chrome/password_manager_internals_resources.pak", "$root_gen_dir/chrome/policy_resources.pak", + "$root_gen_dir/chrome/quota_internals_resources.pak", "$root_gen_dir/chrome/task_scheduler_internals_resources.pak", "$root_gen_dir/chrome/translate_internals_resources.pak", "$root_gen_dir/components/components_resources.pak", @@ -111,6 +112,7 @@ "//chrome/browser/resources:net_internals_resources", "//chrome/browser/resources:password_manager_internals_resources", "//chrome/browser/resources:policy_resources", + "//chrome/browser/resources:quota_internals_resources", "//chrome/browser/resources:task_scheduler_internals_resources", "//chrome/browser/resources:translate_internals_resources", "//chrome/common:resources", @@ -134,14 +136,12 @@ "$root_gen_dir/blink/devtools_resources.pak", "$root_gen_dir/chrome/component_extension_resources.pak", "$root_gen_dir/chrome/options_resources.pak", - "$root_gen_dir/chrome/quota_internals_resources.pak", "$root_gen_dir/chrome/settings_resources.pak", "$root_gen_dir/chrome/sync_file_system_internals_resources.pak", ] deps += [ "//chrome/browser/resources:component_extension_resources", "//chrome/browser/resources:options_resources", - "//chrome/browser/resources:quota_internals_resources", "//chrome/browser/resources:settings_resources", "//chrome/browser/resources:sync_file_system_internals_resources", "//content/browser/devtools:devtools_resources",
diff --git a/chrome/chrome_watcher/BUILD.gn b/chrome/chrome_watcher/BUILD.gn index 4a5d77e..0668586 100644 --- a/chrome/chrome_watcher/BUILD.gn +++ b/chrome/chrome_watcher/BUILD.gn
@@ -41,12 +41,6 @@ ] } -group("kasko_util") { - public_deps = [ - "//third_party/kasko:kasko_features", - ] -} - process_version_rc_template("chrome_watcher_resources") { sources = [ "chrome_watcher.ver", @@ -64,7 +58,6 @@ deps = [ ":chrome_watcher_resources", ":client", - ":kasko_util", "//base", "//base:base_static", "//build/config/sanitizers:deps",
diff --git a/chrome/chrome_watcher/DEPS b/chrome/chrome_watcher/DEPS index 70d347f..cded49b 100644 --- a/chrome/chrome_watcher/DEPS +++ b/chrome/chrome_watcher/DEPS
@@ -4,7 +4,5 @@ "+components/browser_watcher", "+components/crash", "+components/memory_pressure", - "+syzygy/kasko/api", "+testing/gtest", - "+third_party/kasko", ]
diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc index 180ec3c..e0b2343 100644 --- a/chrome/chrome_watcher/chrome_watcher_main.cc +++ b/chrome/chrome_watcher/chrome_watcher_main.cc
@@ -142,8 +142,8 @@ // This needs to run on an IO thread. DCHECK_NE(main_thread_, base::ThreadTaskRunnerHandle::Get()); - // Signal our client now that the Kasko reporter is initialized and we have - // cleared all of the obstacles that might lead to an early exit. + // Signal our client that we have cleared all of the obstacles that might lead + // to an early exit. ::SetEvent(on_initialized_event.Get()); on_initialized_event.Close();
diff --git a/chrome/chrome_watcher/chrome_watcher_main_api.cc b/chrome/chrome_watcher/chrome_watcher_main_api.cc index e8b29e16..513aa73 100644 --- a/chrome/chrome_watcher/chrome_watcher_main_api.cc +++ b/chrome/chrome_watcher/chrome_watcher_main_api.cc
@@ -10,7 +10,3 @@ const char kChromeWatcherDLLEntrypoint[] = "WatcherMain"; const base::FilePath::CharType kPermanentlyFailedReportsSubdir[] = L"Crash Reports Fallback"; - -base::string16 GetKaskoEndpoint(base::ProcessId client_process_id) { - return L"chrome_kasko_" + base::UintToString16(client_process_id); -}
diff --git a/chrome/chrome_watcher/chrome_watcher_main_api.h b/chrome/chrome_watcher/chrome_watcher_main_api.h index a8999556..8491d98 100644 --- a/chrome/chrome_watcher/chrome_watcher_main_api.h +++ b/chrome/chrome_watcher/chrome_watcher_main_api.h
@@ -21,11 +21,9 @@ // The type of the watcher DLL's main entry point. // Watches |parent_process|, whose main thread ID is |main_thread_id|, and // records its exit code under |registry_path| in HKCU. The Chrome message -// window, owned by |parent_process|, will be monitored for responsiveness. If -// enabled, a Kasko reporter process is also instantiated, using -// |browser_data_directory| to store crash reports. |on_initialized_event| will -// be signaled once the watcher process is fully initialized. Takes ownership of -// |parent_process| and |on_initialized_event|. +// window, owned by |parent_process|, will be monitored for responsiveness. +// |on_initialized_event| will be signaled once the watcher process is fully +// initialized. Takes ownership of |parent_process| and |on_initialized_event|. typedef int (*ChromeWatcherMainFunction)( const base::char16* registry_path, HANDLE parent_process, @@ -33,10 +31,4 @@ HANDLE on_initialized_event, const base::char16* browser_data_directory); -// Returns an RPC endpoint name for the identified client process. This method -// may be invoked in both the client and the watcher process with the PID of the -// client process to establish communication between the two using a common -// endpoint name. -base::string16 GetKaskoEndpoint(base::ProcessId client_process_id); - #endif // CHROME_CHROME_WATCHER_CHROME_WATCHER_MAIN_API_H_
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index fb23d30..dfd8f17 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -222,7 +222,6 @@ "//printing/features", "//skia", "//third_party/icu", - "//third_party/kasko:kasko_features", "//third_party/re2", "//third_party/widevine/cdm:headers", "//third_party/zlib:zip",
diff --git a/chrome/common/DEPS b/chrome/common/DEPS index a55a1ce..10fabe5 100644 --- a/chrome/common/DEPS +++ b/chrome/common/DEPS
@@ -37,7 +37,6 @@ "+ppapi/thunk", "+sandbox/linux/services/credentials.h", "+third_party/boringssl/src/include", - "+third_party/kasko", # FIXME - refactor code and remove these dependencies "+chrome/installer",
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc index c099a26..b1589f16 100644 --- a/chrome/common/crash_keys.cc +++ b/chrome/common/crash_keys.cc
@@ -92,11 +92,6 @@ } // namespace mac #endif -#if BUILDFLAG(ENABLE_KASKO) -const char kKaskoGuid[] = "kasko-guid"; -const char kKaskoEquivalentGuid[] = "kasko-equivalent-guid"; -#endif - const char kViewCount[] = "view-count"; const char kZeroEncodeDetails[] = "zero-encode-details"; @@ -175,10 +170,6 @@ { "rwhvm_window", kMediumSize }, // media/: #endif -#if BUILDFLAG(ENABLE_KASKO) - { kKaskoGuid, kSmallSize }, - { kKaskoEquivalentGuid, kSmallSize }, -#endif { kBug464926CrashKey, kSmallSize }, { kViewCount, kSmallSize },
diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h index 2b6106c..bf6bbdc 100644 --- a/chrome/common/crash_keys.h +++ b/chrome/common/crash_keys.h
@@ -15,7 +15,6 @@ #include "base/macros.h" #include "build/build_config.h" #include "components/crash/core/common/crash_keys.h" -#include "third_party/kasko/kasko_features.h" namespace base { class CommandLine; @@ -148,12 +147,6 @@ } // namespace mac #endif -#if BUILDFLAG(ENABLE_KASKO) -// Used to correlate a report sent via Kasko with one sent via Breakpad. -extern const char kKaskoGuid[]; -extern const char kKaskoEquivalentGuid[]; -#endif - // Numbers of active views. extern const char kViewCount[];
diff --git a/chrome/common/extensions/docs/templates/json/chrome_sidenav.json b/chrome/common/extensions/docs/templates/json/chrome_sidenav.json index fb54e07..8147c10 100644 --- a/chrome/common/extensions/docs/templates/json/chrome_sidenav.json +++ b/chrome/common/extensions/docs/templates/json/chrome_sidenav.json
@@ -165,20 +165,12 @@ "href": "/devtools/docs/debugging-clients" }, { - "title": "Version 1.1 (Stable)", - "href": "/devtools/docs/protocol/1.1/index" + "title": "Version 1.2 (Stable)", + "href": "https://chromedevtools.github.io/debugger-protocol-viewer/1-2/" }, { "title": "Tip-of-tree (Unstable)", - "href": "https://chromedevtools.github.io/debugger-protocol-viewer/" - }, - { - "title": "Version 1.0", - "href": "/devtools/docs/protocol/1.0/index" - }, - { - "title": "Version .1", - "href": "/devtools/docs/protocol/0.1/index" + "href": "https://chromedevtools.github.io/debugger-protocol-viewer/tot/" } ] }
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index d670a3e..7b14c9a 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -2382,4 +2382,10 @@ // default search engine, if it is the Google search engine. const char kGoogleDSEGeolocationSetting[] = "google_dse_geolocation_setting"; +// A dictionary of manifest URLs of Web Share Targets to a dictionary containing +// attributes of its share_target field found in its manifest. Each key in the +// dictionary is the name of the attribute, and the value is the corresponding +// value. +const char kWebShareVisitedTargets[] = "profile.web_share.visited_targets"; + } // namespace prefs
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 3cc7fde..1dbaadaf 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -876,6 +876,8 @@ extern const char kGoogleDSEGeolocationSetting[]; +extern const char kWebShareVisitedTargets[]; + } // namespace prefs #endif // CHROME_COMMON_PREF_NAMES_H_
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index e0aa711..50bc9637 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc
@@ -644,6 +644,7 @@ kChromeUIPolicyHost, kChromeUIPredictorsHost, kChromeUIProfilerHost, + kChromeUIQuotaInternalsHost, kChromeUISignInInternalsHost, kChromeUISiteEngagementHost, kChromeUINTPTilesInternalsHost, @@ -680,7 +681,6 @@ kChromeUIFlashHost, kChromeUIHelpHost, kChromeUIInspectHost, - kChromeUIQuotaInternalsHost, kChromeUISettingsHost, kChromeUISystemInfoHost, kChromeUIUberHost,
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release index d67113e..6176a03 100644 --- a/chrome/installer/mini_installer/chrome.release +++ b/chrome/installer/mini_installer/chrome.release
@@ -27,7 +27,6 @@ ffmpeg.dll: %(VersionDir)s\ icudt.dll: %(VersionDir)s\ icudtl.dat: %(VersionDir)s\ -kasko.dll: %(VersionDir)s\ libEGL.dll: %(VersionDir)s\ libGLESv2.dll: %(VersionDir)s\ nacl64.exe: %(VersionDir)s\
diff --git a/chrome/renderer/safe_browsing/threat_dom_details.cc b/chrome/renderer/safe_browsing/threat_dom_details.cc index b2a8ed6..45e3145 100644 --- a/chrome/renderer/safe_browsing/threat_dom_details.cc +++ b/chrome/renderer/safe_browsing/threat_dom_details.cc
@@ -4,7 +4,10 @@ #include "chrome/renderer/safe_browsing/threat_dom_details.h" +#include <map> + #include "base/compiler_specific.h" +#include "base/strings/stringprintf.h" #include "components/safe_browsing/common/safebrowsing_messages.h" #include "content/public/renderer/render_frame.h" #include "third_party/WebKit/public/platform/WebString.h" @@ -16,13 +19,25 @@ namespace safe_browsing { +// A map for keeping track of the identity of DOM Elements, used to generate +// unique IDs for each element and lookup elements IDs by parent Element, to +// maintain proper parent/child relationships. +// They key is a WebNode from the DOM, which is basically a pointer so can be +// copied into the map when inserting new elements. +// The values are pointers to IPC messages generated by ThreatDOMDetails. They +// are not owned by the map - ownership remains with the vector of resources +// collected by this class. +typedef std::map<blink::WebNode, SafeBrowsingHostMsg_ThreatDOMDetails_Node*> + ElementToNodeMap; + namespace { // Handler for the various HTML elements that we extract URLs from. void HandleElement( const blink::WebElement& element, SafeBrowsingHostMsg_ThreatDOMDetails_Node* parent_node, - std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node>* resources) { + std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node>* resources, + safe_browsing::ElementToNodeMap* element_to_node_map) { if (!element.hasAttribute("src")) return; @@ -36,11 +51,25 @@ parent_node->children.push_back(child_url); // Create the child node. - SafeBrowsingHostMsg_ThreatDOMDetails_Node child_node; - child_node.url = child_url; - child_node.tag_name = element.tagName().utf8(); - child_node.parent = parent_node->url; - resources->push_back(child_node); + resources->push_back(SafeBrowsingHostMsg_ThreatDOMDetails_Node()); + SafeBrowsingHostMsg_ThreatDOMDetails_Node* child_node = &resources->back(); + child_node->url = child_url; + child_node->tag_name = element.tagName().utf8(); + child_node->parent = parent_node->url; + + // Update the ID mapping. First generate the ID for the current node. + // Then, if its parent is available, set the current node's parent ID, and + // also update the parent's children with the current node's ID. + const int child_id = element_to_node_map->size() + 1; + child_node->node_id = child_id; + if (!element.parentNode().isNull()) { + auto parent_node_iter = element_to_node_map->find(element.parentNode()); + if (parent_node_iter != element_to_node_map->end()) { + child_node->parent_node_id = parent_node->node_id; + parent_node->child_node_ids.push_back(child_id); + } + } + (*element_to_node_map)[element] = child_node; } } // namespace @@ -90,12 +119,14 @@ resources->push_back(details_node); return; } + + ElementToNodeMap element_to_node_map; blink::WebElementCollection elements = document.all(); blink::WebElement element = elements.firstItem(); for (; !element.isNull(); element = elements.nextItem()) { if (element.hasHTMLTagName("iframe") || element.hasHTMLTagName("frame") || element.hasHTMLTagName("embed") || element.hasHTMLTagName("script")) { - HandleElement(element, &details_node, resources); + HandleElement(element, &details_node, resources, &element_to_node_map); if (resources->size() >= kMaxNodes) { // We have reached kMaxNodes, exit early. resources->push_back(details_node);
diff --git a/chrome/renderer/safe_browsing/threat_dom_details_browsertest.cc b/chrome/renderer/safe_browsing/threat_dom_details_browsertest.cc index 157cefc..6df0012 100644 --- a/chrome/renderer/safe_browsing/threat_dom_details_browsertest.cc +++ b/chrome/renderer/safe_browsing/threat_dom_details_browsertest.cc
@@ -34,7 +34,11 @@ std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; details->ExtractResources(¶ms); ASSERT_EQ(1u, params.size()); - EXPECT_EQ(GURL(urlprefix + html), params[0].url); + auto& param = params[0]; + EXPECT_EQ(GURL(urlprefix + html), param.url); + EXPECT_EQ(0, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); } { @@ -52,11 +56,25 @@ std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; details->ExtractResources(¶ms); ASSERT_EQ(3u, params.size()); - EXPECT_EQ(script1_url, params[0].url); - EXPECT_EQ("SCRIPT", params[0].tag_name); - EXPECT_EQ(script2_url, params[1].url); - EXPECT_EQ("SCRIPT", params[0].tag_name); - EXPECT_EQ(url, params[2].url); + auto& param = params[0]; + EXPECT_EQ(script1_url, param.url); + EXPECT_EQ("SCRIPT", param.tag_name); + EXPECT_EQ(1, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); + + param = params[1]; + EXPECT_EQ(script2_url, param.url); + EXPECT_EQ("SCRIPT", param.tag_name); + EXPECT_EQ(2, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); + + param = params[2]; + EXPECT_EQ(url, param.url); + EXPECT_EQ(0, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); } { @@ -86,19 +104,23 @@ std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; details->ExtractResources(¶ms); ASSERT_EQ(2u, params.size()); - std::sort(params.begin(), params.end(), - [](const SafeBrowsingHostMsg_ThreatDOMDetails_Node& a, - const SafeBrowsingHostMsg_ThreatDOMDetails_Node& b) -> bool { - return a.parent < b.parent; - }); - EXPECT_EQ(url, params[0].url); - EXPECT_EQ(GURL(), params[0].parent); - EXPECT_EQ(1u, params[0].children.size()); - EXPECT_EQ(iframe1_url, params[0].children[0]); - EXPECT_EQ(iframe1_url, params[1].url); - EXPECT_EQ(url, params[1].parent); - EXPECT_EQ(0u, params[1].children.size()); + auto& param = params[0]; + EXPECT_EQ(iframe1_url, param.url); + EXPECT_EQ(url, param.parent); + EXPECT_EQ("IFRAME", param.tag_name); + EXPECT_EQ(0u, param.children.size()); + EXPECT_EQ(1, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); + + param = params[1]; + EXPECT_EQ(url, param.url); + EXPECT_EQ(GURL(), param.parent); + EXPECT_EQ(1u, param.children.size()); + EXPECT_EQ(0, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); } { @@ -116,6 +138,15 @@ std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; details->ExtractResources(¶ms); ASSERT_EQ(51u, params.size()); + + // The element nodes should all have node IDs. + for (size_t i = 0; i < params.size() - 1; ++i) { + auto& param = params[i]; + const int expected_id = i + 1; + EXPECT_EQ(expected_id, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); + } } { @@ -133,5 +164,14 @@ std::vector<SafeBrowsingHostMsg_ThreatDOMDetails_Node> params; details->ExtractResources(¶ms); ASSERT_EQ(51u, params.size()); + + // The element nodes should all have node IDs. + for (size_t i = 0; i < params.size() - 1; ++i) { + auto& param = params[i]; + const int expected_id = i + 1; + EXPECT_EQ(expected_id, param.node_id); + EXPECT_EQ(0, param.parent_node_id); + EXPECT_TRUE(param.child_node_ids.empty()); + } } }
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 8c91b053..32e9a70 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -3372,6 +3372,7 @@ "../browser/ui/webui/log_web_ui_url_unittest.cc", "../browser/update_client/chrome_update_query_params_delegate_unittest.cc", "../browser/webshare/share_service_impl_unittest.cc", + "../browser/webshare/share_target_pref_helper_unittest.cc", "../browser/win/chrome_elf_init_unittest.cc", "../browser/win/enumerate_modules_model_unittest.cc", "../common/chrome_content_client_unittest.cc", @@ -4988,7 +4989,6 @@ "//chrome/child", "//components/crash/core/common", "//components/flags_ui:switches", - "//third_party/kasko:kasko_features", ] } }
diff --git a/chrome/test/android/OWNERS b/chrome/test/android/OWNERS index 96fd7abc..05f86d3 100644 --- a/chrome/test/android/OWNERS +++ b/chrome/test/android/OWNERS
@@ -8,3 +8,5 @@ skyostil@chromium.org tedchoc@chromium.org yfriedman@chromium.org + +# COMPONENT: Test>Android
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h index 6411db51..d75242d 100644 --- a/chrome/test/base/test_browser_window.h +++ b/chrome/test/base/test_browser_window.h
@@ -169,7 +169,6 @@ void UpdateLocationBarVisibility(bool visible, bool animate) override {} bool ShowPageActionPopup(const extensions::Extension* extension, bool grant_active_tab) override; - void UpdateOpenPDFInReaderPrompt() override {} void SaveStateToContents(content::WebContents* contents) override {} void Revert() override {} const OmniboxView* GetOmniboxView() const override;
diff --git a/chrome/test/data/profiles/profile_with_complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/manifest.json b/chrome/test/data/profiles/profile_with_complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/manifest.json index 07a9755..2e42e61 100644 --- a/chrome/test/data/profiles/profile_with_complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/manifest.json +++ b/chrome/test/data/profiles/profile_with_complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/manifest.json
@@ -8,8 +8,6 @@ "ntp_background": [ 57, 137, 194 ], "ntp_link": [ 0, 0, 0 ], "ntp_section": [ 131, 138, 146, 0.8 ], - "ntp_section_link": [ 255, 255, 255 ], - "ntp_section_text": [ 255, 255, 255 ], "ntp_text": [ 0, 0, 0 ], "tab_background_text": [ 0, 0, 0 ], "tab_text": [ 0, 0, 0 ],
diff --git a/chrome/test/data/profiles/profile_with_complex_theme/Default/PreferencesTemplate b/chrome/test/data/profiles/profile_with_complex_theme/Default/PreferencesTemplate index 79128ef..2fdf1f98 100644 --- a/chrome/test/data/profiles/profile_with_complex_theme/Default/PreferencesTemplate +++ b/chrome/test/data/profiles/profile_with_complex_theme/Default/PreferencesTemplate
@@ -20,8 +20,6 @@ "ntp_background": [ 57, 137, 194 ], "ntp_link": [ 0, 0, 0 ], "ntp_section": [ 131, 138, 146, 0.8 ], - "ntp_section_link": [ 255, 255, 255 ], - "ntp_section_text": [ 255, 255, 255 ], "ntp_text": [ 0, 0, 0 ], "tab_background_text": [ 0, 0, 0 ], "tab_text": [ 0, 0, 0 ],
diff --git a/chrome/test/data/webrtc/peerconnection_getstats.js b/chrome/test/data/webrtc/peerconnection_getstats.js index 7fa3333..b1cc9246 100644 --- a/chrome/test/data/webrtc/peerconnection_getstats.js +++ b/chrome/test/data/webrtc/peerconnection_getstats.js
@@ -17,14 +17,13 @@ * @private */ var kRTCRTPStreamStats = new RTCStats_(null, { - ssrc: 'string', + // TODO(hbos): As soon as |ssrc| has changed into a number, change to + // 'number'. https://bugs.chromium.org/p/webrtc/issues/detail?id=7065, 7066 + ssrc: 'any', associateStatsId: 'string', isRemote: 'boolean', mediaType: 'string', trackId: 'string', - // TODO(hbos): As soon as |mediaTrackId| has been renamed to |trackId|, remove - // this line. crbug.com/657854 - mediaTrackId: 'string', transportId: 'string', codecId: 'string', firCount: 'number', @@ -123,9 +122,6 @@ ended: 'boolean', detached: 'boolean', kind: 'string', - // TODO(hbos): As soon as |ssrcIds| has been removed, remove this line. - // crbug.com/659137 - ssrcIds: 'sequence_string', frameWidth: 'number', frameHeight: 'number', framesPerSecond: 'number', @@ -169,9 +165,6 @@ bytesReceived: 'number', rtcpTransportStatsId: 'string', dtlsState: 'string', - // TODO(hbos): As soon as |activeConnection| has been replaced by |dtlsState|, - // remove this line. crbug.com/653873 - activeConnection: 'boolean', selectedCandidatePairId: 'string', localCertificateId: 'string', remoteCertificateId: 'string', @@ -380,6 +373,8 @@ throw failTest('stats.' + propertyName + ' is not a whitelisted ' + 'member: ' + stats[propertyName]); } + if (whitelistedStats[propertyName] === 'any') + continue; if (!whitelistedStats[propertyName].startsWith('sequence_')) { if (typeof(stats[propertyName]) !== whitelistedStats[propertyName]) { throw failTest('stats.' + propertyName + ' should have a different ' +
diff --git a/chrome/test/data/webrtc/resources/tools/linux/zxing.sha1 b/chrome/test/data/webrtc/resources/tools/linux/zxing.sha1 index eb7c721..5707f534 100644 --- a/chrome/test/data/webrtc/resources/tools/linux/zxing.sha1 +++ b/chrome/test/data/webrtc/resources/tools/linux/zxing.sha1
@@ -1 +1 @@ -2754e6066c9d4c9672b77d725d8390c70bea4efb \ No newline at end of file +3e2a25eaa2e207a1e569c6585e50addb20bca89a
diff --git a/chrome/test/data/webui/settings/category_default_setting_tests.js b/chrome/test/data/webui/settings/category_default_setting_tests.js index ecd69ce..12085f7 100644 --- a/chrome/test/data/webui/settings/category_default_setting_tests.js +++ b/chrome/test/data/webui/settings/category_default_setting_tests.js
@@ -77,12 +77,6 @@ }, }; - // Import necessary html before running suite. - suiteSetup(function() { - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/category_default_setting.html'); - }); - // Initialize a site-settings-category before each test. setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy();
diff --git a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js index 800e65d5..97ddefbf 100644 --- a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js +++ b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js
@@ -12,13 +12,6 @@ */ var testElement; - // Import necessary html before running suite. - suiteSetup(function() { - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/category_setting_exceptions.html' - ); - }); - // Initialize a category-setting-exceptions before each test. setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy();
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index b53e3053..2f4d918a 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -650,7 +650,7 @@ __proto__: CrSettingsBrowserTest.prototype, /** @override */ - browsePreload: 'chrome://md-settings/prefs/prefs.html', + browsePreload: 'chrome://md-settings/privacy_page/privacy_page.html', /** @override */ extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
diff --git a/chrome/test/data/webui/settings/languages_page_browsertest.js b/chrome/test/data/webui/settings/languages_page_browsertest.js index a7e1dd967..abed7bc9 100644 --- a/chrome/test/data/webui/settings/languages_page_browsertest.js +++ b/chrome/test/data/webui/settings/languages_page_browsertest.js
@@ -73,9 +73,9 @@ }); } - // Returns a supported language that is not enabled, for testing. - function getAvailableLanguage() { - return languagesPage.languages.supported.find(function(language) { + // Returns supported languages that are not enabled. + function getAvailableLanguages() { + return languagesPage.languages.supported.filter(function(language) { return !languageHelper.isLanguageEnabled(language.code); }); } @@ -202,6 +202,33 @@ suite('language menu', function() { var origTranslateEnabled; + /** + * Finds, asserts and returns the menu item for the given i18n key. + * @param {string} i18nKey Name of the i18n string for the item's text. + * @return {!HTMLElement} Menu item. + */ + function getMenuItem(i18nKey) { + var i18nString = assert(loadTimeData.getString(i18nKey)); + var menuItems = actionMenu.querySelectorAll('.dropdown-item'); + var menuItem = Array.from(menuItems).find( + item => item.textContent.trim() == i18nString); + return assert(menuItem, 'Menu item "' + i18nKey + '" not found'); + } + + /** + * Checks the visibility of each expected menu item button. + * param {!Object<boolean>} Dictionary from i18n keys to expected + * visibility of those menu items. + */ + function assertMenuItemButtonsVisible(buttonVisibility) { + assertTrue(actionMenu.open); + for (var buttonKey of Object.keys(buttonVisibility)) { + var buttonItem = getMenuItem(buttonKey); + assertEquals(!buttonVisibility[buttonKey], buttonItem.hidden, + 'Menu item "' + buttonKey + '" hidden'); + } + } + suiteSetup(function() { // Cache the value of Translate to avoid side effects. origTranslateEnabled = languageHelper.prefs.translate.enabled.value; @@ -235,7 +262,24 @@ cr.isChromeOS || cr.isWindows ? 1 : 0, separator.offsetHeight); }); - test('toggle translate', function(done) { + test('test translate.enable toggle', function() { + languageHelper.setPrefValue('translate.enabled', true); + var toggle = languagesPage.$.offerTranslateOtherLangs.root + .querySelectorAll('paper-toggle-button')[0]; + assertTrue(!!toggle); + + // Clicking on toggle switch it to false. + MockInteractions.tap(toggle); + var newToggleValue = languageHelper.prefs.translate.enabled.value; + assertFalse(newToggleValue); + + // Clicking on toggle switch it to true again. + MockInteractions.tap(toggle); + newToggleValue = languageHelper.prefs.translate.enabled.value; + assertTrue(newToggleValue); + }); + + test('toggle translate for a specific language', function(done) { // Enable Translate so the menu always shows the Translate checkbox. languageHelper.setPrefValue('translate.enabled', true); languagesPage.set('languages.translateTarget', 'foo'); @@ -248,8 +292,7 @@ assertTrue(actionMenu.open); // Toggle the translate option. - var translateOption = actionMenu.querySelector('#offerTranslations'); - assertTrue(!!translateOption); + var translateOption = getMenuItem('offerToTranslateInThisLanguage'); assertFalse(translateOption.disabled); MockInteractions.tap(translateOption); @@ -262,11 +305,30 @@ }, settings.kMenuCloseDelay + 1); }); + test('disable translate hides language-specific option', function() { + // Disables translate. + languageHelper.setPrefValue('translate.enabled', false); + languagesPage.set('languages.translateTarget', 'foo'); + languagesPage.set('languages.enabled.1.supportsTranslate', true); + + // Makes sure language-specific menu exists. + var languageOptionsDropdownTrigger = + languagesCollapse.querySelectorAll('paper-icon-button')[1]; + assertTrue(!!languageOptionsDropdownTrigger); + MockInteractions.tap(languageOptionsDropdownTrigger); + assertTrue(actionMenu.open); + + // The language-specific translation option should be hidden. + var translateOption = actionMenu.querySelector('#offerTranslations'); + assertTrue(!!translateOption); + assertTrue(translateOption.hidden); + }); + test('remove language', function() { var numEnabled = languagesPage.languages.enabled.length; // Enabled a language which we can then disable. - var newLanguage = getAvailableLanguage(); + var newLanguage = assert(getAvailableLanguages()[0]); languageHelper.enableLanguage(newLanguage.code); // Wait for the language to be enabled. @@ -287,8 +349,7 @@ MockInteractions.tap(item.querySelector('paper-icon-button')); assertTrue(actionMenu.open); - var removeMenuItem = assert(actionMenu.querySelector( - '.dropdown-item:last-child')); + var removeMenuItem = getMenuItem('removeLanguage'); assertFalse(removeMenuItem.disabled); MockInteractions.tap(removeMenuItem); assertFalse(actionMenu.open); @@ -299,6 +360,50 @@ assertFalse(languageHelper.isLanguageEnabled(newLanguage.code)); }); }); + + test('move up/down buttons', function() { + // Add several languages. + var numEnabled = languagesPage.languages.enabled.length; + var available = getAvailableLanguages(); + for (var i = 0; i < 4; i++) + languageHelper.enableLanguage(assert(available[i]).code); + + return whenNumEnabledLanguagesBecomes(numEnabled + 4).then(function() { + Polymer.dom.flush(); + + var menuButtons = + languagesCollapse.querySelectorAll( + '.list-item paper-icon-button[icon="cr:more-vert"]'); + + // First language should not have "Move up" or "Move to top". + MockInteractions.tap(menuButtons[0]); + assertMenuItemButtonsVisible({ + moveToTop: false, moveUp: false, moveDown: true, + }); + actionMenu.close(); + + // Second language should not have "Move up". + MockInteractions.tap(menuButtons[1]); + assertMenuItemButtonsVisible({ + moveToTop: true, moveUp: false, moveDown: true, + }); + actionMenu.close(); + + // Middle languages should have all buttons. + MockInteractions.tap(menuButtons[2]); + assertMenuItemButtonsVisible({ + moveToTop: true, moveUp: true, moveDown: true, + }); + actionMenu.close(); + + // Last language should not have "Move down". + MockInteractions.tap(menuButtons[menuButtons.length - 1]); + assertMenuItemButtonsVisible({ + moveToTop: true, moveUp: true, moveDown: false, + }); + actionMenu.close(); + }); + }); }); test('manage input methods', function() {
diff --git a/chrome/test/data/webui/settings/protocol_handlers_tests.js b/chrome/test/data/webui/settings/protocol_handlers_tests.js index 8ec96f8..54817298 100644 --- a/chrome/test/data/webui/settings/protocol_handlers_tests.js +++ b/chrome/test/data/webui/settings/protocol_handlers_tests.js
@@ -54,12 +54,6 @@ */ var browserProxy = null; - // Import necessary html before running suite. - suiteSetup(function() { - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/protocol_handlers.html'); - }); - setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js index 95bb6b6..7b13e5c46 100644 --- a/chrome/test/data/webui/settings/site_list_tests.js +++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -325,11 +325,8 @@ } }; - // Import necessary html before running suite. suiteSetup(function() { CrSettingsPrefs.setInitialized(); - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/site_list.html'); }); suiteTeardown(function() {
diff --git a/chrome/test/data/webui/settings/usb_devices_tests.js b/chrome/test/data/webui/settings/usb_devices_tests.js index eb5ebdc5..9acf929 100644 --- a/chrome/test/data/webui/settings/usb_devices_tests.js +++ b/chrome/test/data/webui/settings/usb_devices_tests.js
@@ -50,12 +50,6 @@ } ]; - // Import necessary html before running suite. - suiteSetup(function() { - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/usb_devices.html'); - }); - setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
diff --git a/chrome/test/data/webui/settings/zoom_levels_tests.js b/chrome/test/data/webui/settings/zoom_levels_tests.js index a688b66..82d79ff 100644 --- a/chrome/test/data/webui/settings/zoom_levels_tests.js +++ b/chrome/test/data/webui/settings/zoom_levels_tests.js
@@ -41,12 +41,6 @@ }, ]; - // Import necessary html before running suite. - suiteSetup(function() { - return PolymerTest.importHtml( - 'chrome://md-settings/site_settings/zoom_levels.html'); - }); - setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
diff --git a/chrome/test/kasko/OWNERS b/chrome/test/kasko/OWNERS deleted file mode 100644 index 2b8fbc2..0000000 --- a/chrome/test/kasko/OWNERS +++ /dev/null
@@ -1,2 +0,0 @@ -chrisha@chromium.org -sebmarchand@chromium.org \ No newline at end of file
diff --git a/chrome/test/kasko/hang_watcher_integration_test.py b/chrome/test/kasko/hang_watcher_integration_test.py deleted file mode 100755 index 24ff958..0000000 --- a/chrome/test/kasko/hang_watcher_integration_test.py +++ /dev/null
@@ -1,64 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""A Windows-only end-to-end integration test for the Chrome hang watcher. - -This test ensures that the hang watcher is able to detect when Chrome hangs and -to generate a Kasko report. The report is then delivered to a locally hosted -test crash server. If a crash report is received then all is well. - -Note that this test only works against non-component Release and Official builds -of Chrome with Chrome branding, and attempting to use it with anything else will -most likely lead to constant failures. - -Typical usage (assuming in root 'src' directory): -- generate project files with the following build variables: - GYP variables: - branding=Chrome kasko_hang_reports=1 - GN variables: - target_cpu = "x86" - is_debug = false - is_chrome_branded = true - enable_kasko_hang_reports = true -- build the release Chrome binaries: - ninja -C {build_dir} chrome.exe chromedriver.exe -- run the test: - python chrome/test/kasko/hang_watcher_integration_test.py - --chrome={build_dir}\chrome.exe -""" - -import logging -import os -import sys - -# Bring in the Kasko module. -KASKO_DIR = os.path.join(os.path.dirname(__file__), 'py') -sys.path.append(KASKO_DIR) -import kasko - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def Main(): - options = kasko.config.ParseCommandLine() - - kasko.integration_test.RunTest( - options, - 'chrome://delayeduithreadhang', - 120, - { - 'hung-process': 'DumpHungBrowserProcess()', - 'hung-process-is-deadlock': 'GetThreadWaitChain()', - 'hung-process-wait-chain-00': 'GetThreadWaitChain()', - }) - - _LOGGER.info('Test passed successfully!') - - return 0 - - -if __name__ == '__main__': - sys.exit(Main())
diff --git a/chrome/test/kasko/kasko_integration_test.py b/chrome/test/kasko/kasko_integration_test.py deleted file mode 100755 index 97f2e17..0000000 --- a/chrome/test/kasko/kasko_integration_test.py +++ /dev/null
@@ -1,57 +0,0 @@ -#!/usr/bin/env python -# Copyright 2015 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""A Windows-only end-to-end integration test for Kasko, Chrome and Crashpad. - -This test ensures that the interface between Kasko and Chrome and Crashpad works -as expected. The test causes Kasko to set certain crash keys and invoke a crash -report, which is in turn delivered to a locally hosted test crash server. If the -crash report is received intact with the expected crash keys then all is well. - -Note that this test only works against non-component Release and Official builds -of Chrome with Chrome branding, and attempting to use it with anything else will -most likely lead to constant failures. - -Typical usage (assuming in root 'src' directory): - -- generate project files with the following GYP variables: - branding=Chrome syzyasan=1 win_z7=0 chromium_win_pch=0 -- build the release Chrome binaries: - ninja -C out\Release chrome.exe chromedriver.exe -- run the test: - python chrome/test/kasko/kasko_integration_test.py -""" - -import logging -import os -import sys - -# Bring in the Kasko module. -KASKO_DIR = os.path.join(os.path.dirname(__file__), 'py') -sys.path.append(KASKO_DIR) -import kasko - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def Main(): - try: - options = kasko.config.ParseCommandLine() - - kasko.integration_test.RunTest( - options, - 'chrome://kasko/send-report', - 10, - {'kasko-set-crash-key-value-impl': 'SetCrashKeyValueImpl'}) - - _LOGGER.info('Test passed successfully!') - except Exception as e: - _LOGGER.error(e) - return 1 - - -if __name__ == '__main__': - sys.exit(Main())
diff --git a/chrome/test/kasko/py/kasko/__init__.py b/chrome/test/kasko/py/kasko/__init__.py deleted file mode 100755 index 82c0441b..0000000 --- a/chrome/test/kasko/py/kasko/__init__.py +++ /dev/null
@@ -1,12 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import config -import crash_server -import exceptions -import integration_test -import process -import report -import util
diff --git a/chrome/test/kasko/py/kasko/config.py b/chrome/test/kasko/py/kasko/config.py deleted file mode 100755 index 61440b09..0000000 --- a/chrome/test/kasko/py/kasko/config.py +++ /dev/null
@@ -1,112 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Command-line configuration utilities.""" - -import logging -import os -import optparse -import sys - -from kasko.process import ImportSelenium -from kasko.json_logging_handler import JSONLoggingHandler - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def GenerateOptionParser(): - """Generates a default OptionParser.""" - - """Parses the command-line and returns an options structure.""" - self_dir = os.path.dirname(__file__) - src_dir = os.path.abspath(os.path.join(self_dir, '..', '..', '..', '..', - '..')) - - option_parser = optparse.OptionParser() - option_parser.add_option('--chrome', dest='chrome', type='string', - default=os.path.join(src_dir, 'out', 'Release', 'chrome.exe'), - help='Path to chrome.exe. Defaults to $SRC/out/Release/chrome.exe') - option_parser.add_option('--chromedriver', dest='chromedriver', - type='string', help='Path to the chromedriver.exe. By default will look ' - 'alongside chrome.exe.') - option_parser.add_option('--keep-temp-dirs', action='store_true', - default=False, help='Prevents temporary directories from being deleted.') - option_parser.add_option('--quiet', dest='log_level', action='store_const', - default=logging.INFO, const=logging.ERROR, - help='Disables all output except for errors.') - option_parser.add_option('--user-data-dir', dest='user_data_dir', - type='string', help='User data directory to use. Defaults to using a ' - 'temporary one.') - option_parser.add_option('--verbose', dest='log_level', action='store_const', - default=logging.INFO, const=logging.DEBUG, - help='Enables verbose logging.') - option_parser.add_option('--webdriver', type='string', - default=os.path.join(src_dir, 'third_party', 'webdriver', 'pylib'), - help='Specifies the directory where the python installation of webdriver ' - '(selenium) can be found. Specify an empty string to use the system ' - 'installation. Defaults to $SRC/third_party/webdriver/pylib') - option_parser.add_option('--log-to-json', type='string', - help='The path to the JSON file that should be used for the logging. ' - 'Defaults to logging directly to the console.') - - return option_parser - - -def LogParserError(message, parser, log_to_json): - """Log a parsing error on the command-line. - - This logs the error via the logger if the '--log-to-json' flag has been - passed to the logger. - """ - if log_to_json: - _LOGGER.error(message) - sys.exit(1) - else: - parser.error(message) - - -def ParseCommandLine(option_parser=None): - if not option_parser: - option_parser = GenerateOptionParser() - - options, args = option_parser.parse_args() - - # Configure logging. - logging.basicConfig(level=options.log_level) - - if options.log_to_json: - logging.getLogger().addHandler(JSONLoggingHandler(options.log_to_json)) - - if args: - return LogParserError('Unexpected arguments: %s' % args, - option_parser, options.log_to_json) - - # Validate chrome.exe exists. - if not os.path.isfile(options.chrome): - return LogParserError('chrome.exe not found', - option_parser, options.log_to_json) - - # Use default chromedriver.exe if necessary, and validate it exists. - if not options.chromedriver: - options.chromedriver = os.path.join(os.path.dirname(options.chrome), - 'chromedriver.exe') - if not os.path.isfile(options.chromedriver): - return LogParserError('chromedriver.exe not found', - option_parser, options.log_to_json) - - # If specified, ensure the webdriver parameters is a directory. - if options.webdriver and not os.path.isdir(options.webdriver): - return LogParserError('Invalid webdriver directory.', - option_parser, options.log_to_json) - - _LOGGER.debug('Using chrome path: %s', options.chrome) - _LOGGER.debug('Using chromedriver path: %s', options.chromedriver) - _LOGGER.debug('Using webdriver path: %s', options.webdriver) - - # Import webdriver and selenium. - ImportSelenium(options.webdriver) - - return options
diff --git a/chrome/test/kasko/py/kasko/crash_server.py b/chrome/test/kasko/py/kasko/crash_server.py deleted file mode 100755 index 625531b..0000000 --- a/chrome/test/kasko/py/kasko/crash_server.py +++ /dev/null
@@ -1,148 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Exceptions used by the Kasko integration test module.""" - -import BaseHTTPServer -import cgi -import logging -import os -import socket -import threading -import time -import uuid - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -class _StoppableHTTPServer(BaseHTTPServer.HTTPServer): - """An extension of BaseHTTPServer that uses timeouts and is interruptable.""" - - def server_bind(self): - BaseHTTPServer.HTTPServer.server_bind(self) - self.socket.settimeout(1) - self.run_ = True - - def get_request(self): - while self.run_: - try: - sock, addr = self.socket.accept() - sock.settimeout(None) - return (sock, addr) - except socket.timeout: - pass - - def stop(self): - self.run_ = False - - def serve(self): - while self.run_: - self.handle_request() - - -class CrashServer(object): - """A simple crash server for testing.""" - - def __init__(self): - self.server_ = None - self.lock_ = threading.Lock() - self.crashes_ = [] # Under lock_. - - def crash(self, index): - """Accessor for the list of crashes.""" - with self.lock_: - if index >= len(self.crashes_): - return None - return self.crashes_[index] - - @property - def port(self): - """Returns the port associated with the server.""" - if not self.server_: - return 0 - return self.server_.server_port - - def start(self): - """Starts the server on another thread. Call from main thread only.""" - page_handler = self.multipart_form_handler() - self.server_ = _StoppableHTTPServer(('127.0.0.1', 0), page_handler) - self.thread_ = self.server_thread() - self.thread_.start() - - def stop(self): - """Stops the running server. Call from main thread only.""" - self.server_.stop() - self.thread_.join() - self.server_ = None - self.thread_ = None - - def wait_for_report(self, timeout): - """Waits until the server has received a crash report. - - Returns True if the a report has been received in the given time, or False - if a timeout occurred. Since Python condition variables have no notion of - timeout this is, sadly, a busy loop on the calling thread. - """ - started = time.time() - elapsed = 0 - while elapsed < timeout: - with self.lock_: - if len(self.crashes_): - return True - time.sleep(0.1) - elapsed = time.time() - started - - return False - - - def multipart_form_handler(crash_server): - """Returns a multi-part form handler class for use with a BaseHTTPServer.""" - - class MultipartFormHandler(BaseHTTPServer.BaseHTTPRequestHandler): - """A multi-part form handler that processes crash reports. - - This class only handles multipart form POST messages, with all other - requests by default returning a '501 not implemented' error. - """ - - def __init__(self, request, client_address, socket_server): - BaseHTTPServer.BaseHTTPRequestHandler.__init__( - self, request, client_address, socket_server) - - def log_message(self, format, *args): - _LOGGER.debug(format, *args) - - def do_POST(self): - """Handles POST messages contained multipart form data.""" - content_type, parameters = cgi.parse_header( - self.headers.getheader('content-type')) - if content_type != 'multipart/form-data': - raise Exception('Unsupported Content-Type: ' + content_type) - post_multipart = cgi.parse_multipart(self.rfile, parameters) - - # Save the crash report. - report = dict(post_multipart.items()) - report_id = str(uuid.uuid4()) - report['report-id'] = [report_id] - with crash_server.lock_: - crash_server.crashes_.append(report) - - # Send the response. - self.send_response(200) - self.send_header("Content-Type", "text/plain") - self.end_headers() - self.wfile.write(report_id) - - return MultipartFormHandler - - def server_thread(crash_server): - """Returns a thread that hosts the webserver.""" - - class ServerThread(threading.Thread): - def run(self): - crash_server.server_.serve() - - return ServerThread() \ No newline at end of file
diff --git a/chrome/test/kasko/py/kasko/exceptions.py b/chrome/test/kasko/py/kasko/exceptions.py deleted file mode 100755 index d7ba4227..0000000 --- a/chrome/test/kasko/py/kasko/exceptions.py +++ /dev/null
@@ -1,10 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Exceptions used by the Kasko integration test module.""" - -class TimeoutException(Exception): - """Exception used to indicate a timeout has occurred.""" - pass
diff --git a/chrome/test/kasko/py/kasko/integration_test.py b/chrome/test/kasko/py/kasko/integration_test.py deleted file mode 100755 index f2531c362..0000000 --- a/chrome/test/kasko/py/kasko/integration_test.py +++ /dev/null
@@ -1,81 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Integration test for Kasko.""" - -import logging -import os -import optparse - -import kasko - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def RunTest(options, url, timeout, expected_keys): - """Runs an integration test for Kasko crash reports. - - Launches both test server and a Chrome instance and then navigates - to the test |url|. The visited |url| is expected to generate a - Kasko report within the |timeout| allowed. The report is finally - verified against expected crash keys. - - This test raises an exception on error. - - Args: - options The options used to modify the test behavior. Call - kasko.config.ParseCommandLine() to generate them. - url The URL that the browser will be navigated to in order to - cause a crash. - timeout The time, in seconds, in which the crash is expected to - be processed. - expected_keys A dictionary containing the keys that are expected - to be present in the crash keys of the report. The value is an - optional string to give an indication of what is the probable - cause of the missing key. - """ - - # Generate a temporary directory for use in the tests. - with kasko.util.ScopedTempDir() as temp_dir: - # Prevent the temporary directory from self cleaning if requested. - if options.keep_temp_dirs: - temp_dir_path = temp_dir.release() - else: - temp_dir_path = temp_dir.path - - # Use the specified user data directory if requested. - if options.user_data_dir: - user_data_dir = options.user_data_dir - else: - user_data_dir = os.path.join(temp_dir_path, 'user-data-dir') - - kasko_dir = os.path.join(temp_dir_path, 'kasko') - os.makedirs(kasko_dir) - - # Launch the test server. - server = kasko.crash_server.CrashServer() - with kasko.util.ScopedStartStop(server): - _LOGGER.info('Started server on port %d', server.port) - - # Configure the environment so Chrome can find the test crash server. - os.environ['KASKO_CRASH_SERVER_URL'] = ( - 'http://127.0.0.1:%d/crash' % server.port) - - # Launch Chrome and navigate it to the test URL. - chrome = kasko.process.ChromeInstance(options.chromedriver, - options.chrome, user_data_dir) - with kasko.util.ScopedStartStop(chrome): - _LOGGER.info('Navigating to Kasko debug URL') - chrome.navigate_to(url) - - _LOGGER.info('Waiting for Kasko report') - if not server.wait_for_report(timeout): - raise Exception('No Kasko report received.') - - # Verify a few crash keys. - report = server.crash(0) - kasko.report.LogCrashKeys(report) - kasko.report.ValidateCrashReport(report, expected_keys)
diff --git a/chrome/test/kasko/py/kasko/json_logging_handler.py b/chrome/test/kasko/py/kasko/json_logging_handler.py deleted file mode 100755 index 8a26c38..0000000 --- a/chrome/test/kasko/py/kasko/json_logging_handler.py +++ /dev/null
@@ -1,30 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Logging handler used to log into a JSON file.""" - -import json -import logging - - -class JSONLoggingHandler(logging.Handler): - """A logging handler that forwards log messages into a JSON file.""" - - def __init__(self, json_file): - logging.Handler.__init__(self) - formatter = logging.Formatter('%(name)s:%(message)s') - self.setFormatter(formatter) - self.json_file_ = json_file - self.log_messages_ = [] - - def close(self): - """Dump the list of log messages into the JSON file.""" - with open(self.json_file_, 'w') as f: - f.write(json.dumps(self.log_messages_)) - logging.Handler.close(self) - - def emit(self, record): - """Append the record to list of messages.""" - self.log_messages_.append({record.levelname: self.format(record)})
diff --git a/chrome/test/kasko/py/kasko/process.py b/chrome/test/kasko/py/kasko/process.py deleted file mode 100755 index 89edaf25..0000000 --- a/chrome/test/kasko/py/kasko/process.py +++ /dev/null
@@ -1,222 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utilities for interacting with processes on a win32 system.""" - -import logging -import os -import pywintypes -import re -import subprocess -import sys -import time -import win32api -import win32com.client -import win32con -import win32event -import win32gui -import win32process - -from kasko.util import ScopedStartStop - - -_DEFAULT_TIMEOUT = 10 # Seconds. -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def ImportSelenium(webdriver_dir=None): - """Imports Selenium from the given path.""" - global webdriver - global service - if webdriver_dir: - sys.path.append(webdriver_dir) - from selenium import webdriver - import selenium.webdriver.chrome.service as service - - -def FindChromeProcessId(user_data_dir, timeout=_DEFAULT_TIMEOUT): - """Finds the process ID of a given Chrome instance.""" - udd = os.path.abspath(user_data_dir) - - # Find the message window. - started = time.time() - elapsed = 0 - msg_win = None - while msg_win is None: - try: - win = win32gui.FindWindowEx(None, None, 'Chrome_MessageWindow', udd) - if win != 0: - msg_win = win - break - except pywintypes.error: - continue - - time.sleep(0.1) - elapsed = time.time() - started - if elapsed >= timeout: - raise TimeoutException() - - # Get the process ID associated with the message window. - tid, pid = win32process.GetWindowThreadProcessId(msg_win) - - return pid - - -def ShutdownProcess(process_id, timeout, force=False): - """Attempts to nicely close the specified process. - - Returns the exit code on success. Raises an error on failure. - """ - - # Open the process in question, so we can wait for it to exit. - permissions = win32con.SYNCHRONIZE | win32con.PROCESS_QUERY_INFORMATION - process_handle = win32api.OpenProcess(permissions, False, process_id) - - # Loop around to periodically retry to close Chrome. - started = time.time() - elapsed = 0 - while True: - _LOGGER.debug('Shutting down process with PID=%d.', process_id) - - with open(os.devnull, 'w') as f: - cmd = ['taskkill.exe', '/PID', str(process_id)] - if force: - cmd.append('/F') - subprocess.call(cmd, shell=True, stdout=f, stderr=f) - - # Wait at most 2 seconds after each call to taskkill. - curr_timeout_ms = int(max(2, timeout - elapsed) * 1000) - - _LOGGER.debug('Waiting for process with PID=%d to exit.', process_id) - result = win32event.WaitForSingleObject(process_handle, curr_timeout_ms) - # Exit the loop on successful wait. - if result == win32event.WAIT_OBJECT_0: - break - - elapsed = time.time() - started - if elapsed > timeout: - _LOGGER.debug('Timeout waiting for process to exit.') - raise TimeoutException() - - exit_status = win32process.GetExitCodeProcess(process_handle) - process_handle.Close() - _LOGGER.debug('Process exited with status %d.', exit_status) - - return exit_status - - -def _WmiTimeToLocalEpoch(wmitime): - """Converts a WMI time string to a Unix epoch time.""" - # The format of WMI times is: yyyymmddHHMMSS.xxxxxx[+-]UUU, where - # UUU is the number of minutes between local time and UTC. - m = re.match('^(?P<year>\d{4})(?P<month>\d{2})(?P<day>\d{2})' - '(?P<hour>\d{2})(?P<minutes>\d{2})(?P<seconds>\d{2}\.\d+)' - '(?P<offset>[+-]\d{3})$', wmitime) - if not m: - raise Exception('Invalid WMI time string.') - - # This parses the time as a local time. - t = time.mktime(time.strptime(wmitime[0:14], '%Y%m%d%H%M%S')) - - # Add the fractional part of the seconds that wasn't parsed by strptime. - s = float(m.group('seconds')) - t += s - int(s) - - return t - - -def GetProcessCreationDate(pid): - """Returns the process creation date as local unix epoch time.""" - wmi = win32com.client.GetObject('winmgmts:') - procs = wmi.ExecQuery( - 'select CreationDate from Win32_Process where ProcessId = %s' % pid) - for proc in procs: - return _WmiTimeToLocalEpoch(proc.Properties_('CreationDate').Value) - raise Exception('Unable to find process with PID %d.' % pid) - - -def ShutdownChildren(parent_pid, child_exe, started_after, started_before, - timeout=_DEFAULT_TIMEOUT, force=False): - """Shuts down any lingering child processes of a given parent. - - This is an inherently racy thing to do as process IDs are aggressively reused - on Windows. Filtering by a valid known |started_after| and |started_before| - timestamp, as well as by the executable of the child process resolves this - issue. Ugh. - """ - started = time.time() - wmi = win32com.client.GetObject('winmgmts:') - _LOGGER.debug('Shutting down lingering children processes.') - for proc in wmi.InstancesOf('Win32_Process'): - if proc.Properties_('ParentProcessId').Value != parent_pid: - continue - if proc.Properties_('ExecutablePath').Value != child_exe: - continue - t = _WmiTimeToLocalEpoch(proc.Properties_('CreationDate').Value) - if t <= started_after or t >= started_before: - continue - pid = proc.Properties_('ProcessId').Value - remaining = max(0, started + timeout - time.time()) - ShutdownProcess(pid, remaining, force=force) - - -class ChromeInstance(object): - """A class encapsulating a running instance of Chrome for testing. - - The Chrome instance is controlled via chromedriver and Selenium.""" - - def __init__(self, chromedriver, chrome, user_data_dir): - self.chromedriver_ = os.path.abspath(chromedriver) - self.chrome_ = os.path.abspath(chrome) - self.user_data_dir_ = user_data_dir - - def start(self, timeout=_DEFAULT_TIMEOUT): - capabilities = { - 'chromeOptions': { - 'args': [ - # This allows automated navigation to chrome:// URLs. - '--enable-gpu-benchmarking', - '--user-data-dir=%s' % self.user_data_dir_, - ], - 'binary': self.chrome_, - } - } - - # Use a _ScopedStartStop helper so the service and driver clean themselves - # up in case of any exceptions. - _LOGGER.info('Starting chromedriver') - with ScopedStartStop(service.Service(self.chromedriver_)) as \ - scoped_service: - _LOGGER.info('Starting chrome') - with ScopedStartStop(webdriver.Remote(scoped_service.service.service_url, - capabilities), - start=lambda x: None, stop=lambda x: x.quit()) as \ - scoped_driver: - self.pid_ = FindChromeProcessId(self.user_data_dir_, timeout) - self.started_at_ = GetProcessCreationDate(self.pid_) - _LOGGER.debug('Chrome launched.') - self.driver_ = scoped_driver.release() - self.service_ = scoped_service.release() - - - def stop(self, timeout=_DEFAULT_TIMEOUT): - started = time.time() - self.driver_.quit() - self.stopped_at_ = time.time() - self.service_.stop() - self.driver_ = None - self.service = None - - # Ensure that any lingering children processes are torn down as well. This - # is generally racy on Windows, but is gated based on parent process ID, - # child executable, and start time of the child process. These criteria - # ensure we don't go indiscriminately killing processes. - remaining = max(0, started + timeout - time.time()) - ShutdownChildren(self.pid_, self.chrome_, self.started_at_, - self.stopped_at_, remaining, force=True) - - def navigate_to(self, url): - """Navigates the running Chrome instance to the provided URL.""" - self.driver_.get(url)
diff --git a/chrome/test/kasko/py/kasko/report.py b/chrome/test/kasko/py/kasko/report.py deleted file mode 100755 index 401d71c2..0000000 --- a/chrome/test/kasko/py/kasko/report.py +++ /dev/null
@@ -1,51 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Utility functions for dealing with crash reports.""" - -import logging -import os -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -def LogCrashKeys(report): - for key in sorted(report.keys()): - val = report[key][0] - if (len(val) < 64): - _LOGGER.debug('Got crashkey "%s": "%s"', key, val) - else: - _LOGGER.debug('Got crashkey "%s": ...%d bytes...', key, len(val)) - - -def ValidateCrashReport(report, expectations=None): - expected_keys = {} - - # The following keys are all expected to be set in all crashes, and should - # be set by GetCrashKeysForKasko. The 'channel' crash-key doesn't need to be - # set as it is omitted when empty (developer builds). - get_crash_keys = 'GetCrashKeysForKasko' - for k in ['guid', 'prod', 'plat', 'ver', 'ptype']: - expected_keys[k] = get_crash_keys - - # The following crash keys are expected to be set by the Kasko code itself. - kasko = 'Kasko' - for k in ['kasko-generated-by-version', 'kasko-uploaded-by-version']: - expected_keys[k] = kasko - - # Merge in additional expectations. - if expectations: - for key, value in expectations.iteritems(): - expected_keys[key] = value - - # Validate the expectations. - missing_keys = False - for expected_key, error in expected_keys.iteritems(): - if expected_key not in report: - _LOGGER.error('Missing expected "%s" crash key.', expected_key) - _LOGGER.error('"%s" integration appears broken.', error) - missing_keys = True - - if missing_keys: - raise Exception('Missing expected crash keys.')
diff --git a/chrome/test/kasko/py/kasko/util.py b/chrome/test/kasko/py/kasko/util.py deleted file mode 100755 index 4189157..0000000 --- a/chrome/test/kasko/py/kasko/util.py +++ /dev/null
@@ -1,77 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Various utilities useful for performing Kasko integration tests.""" - -import logging -import os -import shutil -import tempfile - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) - - -class ScopedTempDir(object): - """A class that creates a scoped temporary directory.""" - - def __init__(self): - self.path_ = None - - def __enter__(self): - """Creates the temporary directory and initializes |path|.""" - self.path_ = tempfile.mkdtemp(prefix='kasko_integration_') - return self - - def __exit__(self, *args, **kwargs): - """Destroys the temporary directory.""" - if self.path_ is None: - return - shutil.rmtree(self.path_) - - @property - def path(self): - return self.path_ - - def release(self): - path = self.path_ - self.path_ = None - return path - - -class ScopedStartStop(object): - """Utility class for calling 'start' and 'stop' within a scope.""" - - def __init__(self, service, start=None, stop=None): - self.service_ = service - - if start is None: - self.start_ = lambda x: x.start() - else: - self.start_ = start - - if stop is None: - self.stop_ = lambda x: x.stop() - else: - self.stop_ = stop - - def __enter__(self): - self.start_(self.service_) - return self - - def __exit__(self, *args, **kwargs): - if self.service_: - self.stop_(self.service_) - - @property - def service(self): - """Returns the encapsulated service, retaining ownership.""" - return self.service_ - - def release(self): - """Relinquishes ownership of the encapsulated service and returns it.""" - service = self.service_ - self.service_ = None - return service
diff --git a/chrome/test/kasko/syzyasan_integration_test.py b/chrome/test/kasko/syzyasan_integration_test.py deleted file mode 100755 index b423cdf..0000000 --- a/chrome/test/kasko/syzyasan_integration_test.py +++ /dev/null
@@ -1,282 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""A Windows-only end-to-end integration test for Kasko and SyzyAsan. - -This test ensures that the interface between SyzyAsan, Kasko and Chrome works -as expected. The test causes a crash that should be detected by SyzyAsan and -delivered via Kasko to a locally hosted test crash server. - -Note that this test only works against non-component Release and Official builds -of Chrome with Chrome branding, and attempting to use it with anything else will -most likely lead to constant failures. - -Typical usage (assuming in root 'src' directory): - -- generate project files with the following GYP variables: - syzyasan=1 win_z7=0 chromium_win_pch=0 -- build the release Chrome binaries: - ninja -C out\Release chrome.exe chromedriver.exe -- run the test: - python chrome/test/kasko/syzyasan_integration_test.py -""" - -import logging -import os -import optparse -import re -import shutil -import subprocess -import sys - -# Bring in the Kasko module. -KASKO_DIR = os.path.join(os.path.dirname(__file__), 'py') -sys.path.append(KASKO_DIR) -import kasko - - -_LOGGER = logging.getLogger(os.path.basename(__file__)) -_CHROME_DLL = 'chrome.dll' -_INSTRUMENT = 'instrument.exe' -_SYZYASAN_RTL = 'syzyasan_rtl.dll' - - -def _ParseCommandLine(): - self_dir = os.path.dirname(__file__) - src_dir = os.path.abspath(os.path.join(self_dir, '..', '..', '..')) - - option_parser = kasko.config.GenerateOptionParser() - option_parser.add_option('--instrumented-dir', dest='instrumented_dir', - type='string', - help='Path where instrumented binaries will be placed. If instrumented ' - 'binaries already exist here they will be reused.') - option_parser.add_option('--skip-instrumentation', - dest='skip_instrumentation', action='store_true', default=False, - help='Skips instrumentation if specified. To be used when testing ' - 'against an already instrumented build of Chrome.') - option_parser.add_option('--syzygy-dir', dest='syzygy_dir', type='string', - default=os.path.join(src_dir, 'third_party', 'syzygy', 'binaries', 'exe'), - help='Path to Syzygy binaries. By default will look in third_party.') - options = kasko.config.ParseCommandLine(option_parser) - - if not os.path.isdir(options.syzygy_dir): - option_parser.error('Invalid syzygy directory.') - for basename in [_INSTRUMENT, _SYZYASAN_RTL]: - path = os.path.join(options.syzygy_dir, basename) - if not os.path.isfile(path): - option_parser.error('Missing syzygy binary: %s' % path) - - _LOGGER.debug('Using syzygy path: %s', options.syzygy_dir) - - return options - - -def _DecorateFilename(name, deco): - """Decorates a filename, transforming 'foo.baz.bar' to 'foo.dec.baz.bar'.""" - d = os.path.dirname(name) - b = os.path.basename(name) - b = b.split('.', 1) - b.insert(1, deco) - return os.path.join(d, '.'.join(b)) - - -def _BackupFile(path, dst_dir): - """Creates a backup of a file in the specified directory.""" - bak = os.path.abspath(os.path.join(dst_dir, os.path.basename(path))) - if os.path.exists(bak): - os.remove(bak) - # Copy the file, with its permissions and timestamps, etc. - _LOGGER.debug('Copying "%s" to "%s".' % (path, bak)) - shutil.copyfile(path, bak) - shutil.copystat(path, bak) - return bak - - -def _RestoreFile(path, backup): - """Restores a file from its backup. Leaves the backup file.""" - if not os.path.exists(backup): - raise Exception('Backup does not exist: %s' % backup) - if os.path.exists(path): - os.remove(path) - _LOGGER.debug('Restoring "%s" from "%s".' % (path, backup)) - shutil.copyfile(backup, path) - shutil.copystat(backup, path) - - -class _ScopedInstrumentedChrome(object): - """SyzyAsan Instruments a Chrome installation in-place.""" - - def __init__(self, chrome_dir, syzygy_dir, temp_dir, instrumented_dir=None, - verbose=False, skip_instrumentation=False): - self.chrome_dir_ = chrome_dir - self.syzygy_dir_ = syzygy_dir - self.temp_dir_ = temp_dir - self.instrumented_dir_ = instrumented_dir - self.verbose_ = verbose - self.skip_instrumentation_ = skip_instrumentation - - def _ProduceInstrumentedBinaries(self): - # Generate the instrumentation command-line. This will place the - # instrumented binaries in the temp directory. - instrument = os.path.abspath(os.path.join(self.syzygy_dir_, _INSTRUMENT)) - cmd = [instrument, - '--mode=asan', - '--input-image=%s' % self.chrome_dll_bak_, - '--input-pdb=%s' % self.chrome_dll_pdb_bak_, - '--output-image=%s' % self.chrome_dll_inst_, - '--output-pdb=%s' % self.chrome_dll_pdb_inst_, - '--no-augment-pdb'] - - _LOGGER.debug('Instrumenting Chrome binaries.') - - # If in verbose mode then let the instrumentation produce output directly. - if self.verbose_: - result = subprocess.call(cmd) - else: - # Otherwise run the command with all output suppressed. - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - stdout, stderr = proc.communicate() - result = proc.returncode - if result != 0: - sys.stdout.write(stdout) - sys.stderr.write(stderr) - - if result != 0: - raise Exception('Failed to instrument: %s' % self.chrome_dll_) - - return - - def __enter__(self): - """In-place instruments a Chrome installation with SyzyAsan.""" - # Do nothing if instrumentation is to be skipped entirely. - if self.skip_instrumentation_: - _LOGGER.debug('Assuming binaries already instrumented.') - return self - - # Build paths to the original Chrome binaries. - self.chrome_dll_ = os.path.abspath(os.path.join( - self.chrome_dir_, _CHROME_DLL)) - self.chrome_dll_pdb_ = self.chrome_dll_ + '.pdb' - - # Backup the original Chrome binaries to the temp directory. - orig_dir = os.path.join(self.temp_dir_, 'orig') - os.makedirs(orig_dir) - self.chrome_dll_bak_ = _BackupFile(self.chrome_dll_, orig_dir) - self.chrome_dll_pdb_bak_ = _BackupFile(self.chrome_dll_pdb_, orig_dir) - - # Generate the path to the instrumented binaries. - inst_dir = os.path.join(self.temp_dir_, 'inst') - if self.instrumented_dir_: - inst_dir = self.instrumented_dir_ - if not os.path.isdir(inst_dir): - os.makedirs(inst_dir) - self.chrome_dll_inst_ = os.path.abspath(os.path.join( - inst_dir, _DecorateFilename(_CHROME_DLL, 'inst'))) - self.chrome_dll_pdb_inst_ = os.path.abspath(os.path.join( - inst_dir, _DecorateFilename(_CHROME_DLL + '.pdb', 'inst'))) - - # Only generate the instrumented binaries if they don't exist. - if (os.path.isfile(self.chrome_dll_inst_) and - os.path.isfile(self.chrome_dll_pdb_inst_)): - _LOGGER.debug('Using existing instrumented binaries.') - else: - self._ProduceInstrumentedBinaries() - - # Replace the original chrome binaries with the instrumented versions. - _RestoreFile(self.chrome_dll_, self.chrome_dll_inst_) - _RestoreFile(self.chrome_dll_pdb_, self.chrome_dll_pdb_inst_) - - # Copy the runtime library into the Chrome directory. - syzyasan_rtl = os.path.abspath(os.path.join(self.syzygy_dir_, - _SYZYASAN_RTL)) - self.syzyasan_rtl_ = os.path.abspath(os.path.join(self.chrome_dir_, - _SYZYASAN_RTL)) - _RestoreFile(self.syzyasan_rtl_, syzyasan_rtl) - - return self - - def __exit__(self, *args, **kwargs): - # Do nothing if instrumentation is to be skipped entirely. - if self.skip_instrumentation_: - return - - # Remove the RTL and restore the original Chrome binaries. - os.remove(self.syzyasan_rtl_) - _RestoreFile(self.chrome_dll_, self.chrome_dll_bak_) - _RestoreFile(self.chrome_dll_pdb_, self.chrome_dll_pdb_bak_) - - -def Main(): - options = _ParseCommandLine() - - # Generate a temporary directory for use in the tests. - with kasko.util.ScopedTempDir() as temp_dir: - try: - # Prevent the temporary directory from self cleaning if requested. - if options.keep_temp_dirs: - temp_dir_path = temp_dir.release() - else: - temp_dir_path = temp_dir.path - - # Use the specified user data directory if requested. - if options.user_data_dir: - user_data_dir = options.user_data_dir - else: - user_data_dir = os.path.join(temp_dir_path, 'user-data-dir') - - kasko_dir = os.path.join(temp_dir_path, 'kasko') - os.makedirs(kasko_dir) - - # Launch the test server. - server = kasko.crash_server.CrashServer() - with kasko.util.ScopedStartStop(server): - _LOGGER.info('Started server on port %d', server.port) - - # Configure the environment so Chrome can find the test crash server. - os.environ['KASKO_CRASH_SERVER_URL'] = ( - 'http://127.0.0.1:%d/crash' % server.port) - - # Configure the environment to disable feature randomization, which can - # result in Kasko being randomly disabled. Append to any existing - # options. - k = 'SYZYGY_ASAN_OPTIONS' - v = '--disable_feature_randomization' - if k in os.environ: - os.environ[k] += ' ' + v - else: - os.environ[k] = v - - # SyzyAsan instrument the Chrome installation. - chrome_dir = os.path.dirname(options.chrome) - with _ScopedInstrumentedChrome(chrome_dir, options.syzygy_dir, - temp_dir_path, instrumented_dir=options.instrumented_dir, - verbose=(options.log_level == logging.DEBUG), - skip_instrumentation=options.skip_instrumentation) as asan_chrome: - # Launch Chrome and navigate it to the test URL. - chrome = kasko.process.ChromeInstance(options.chromedriver, - options.chrome, user_data_dir) - with kasko.util.ScopedStartStop(chrome): - _LOGGER.info('Navigating to SyzyAsan debug URL') - chrome.navigate_to('chrome://crash/browser-use-after-free') - - _LOGGER.info('Waiting for Kasko report') - if not server.wait_for_report(10): - raise Exception('No Kasko report received.') - - report = server.crash(0) - kasko.report.LogCrashKeys(report) - kasko.report.ValidateCrashReport(report, {'asan-error-type': 'SyzyAsan'}) - - _LOGGER.info('Test passed successfully!') - except Exception as e: - _LOGGER.error(e) - return 1 - - return 0 - - -if __name__ == '__main__': - sys.exit(Main())
diff --git a/chrome/test/media_router/BUILD.gn b/chrome/test/media_router/BUILD.gn index ca68b77e..73d4675eb 100644 --- a/chrome/test/media_router/BUILD.gn +++ b/chrome/test/media_router/BUILD.gn
@@ -4,23 +4,15 @@ group("media_router_perf_tests") { testonly = true - data_deps = [ - "//chrome:chrome", - ] data = [ - "$root_out_dir/chrome_200_percent.pak", "$root_out_dir/media_router/test_extension/", "$root_out_dir/mr_extension/release/", "internal/", "telemetry/", - "../../../third_party/catapult/", - "../../../tools/json_comment_eater/", - "../../../tools/json_to_struct/", - "../../../tools/perf/", - "../../../tools/variations/", ] deps = [ ":test_extension_resource_files", + "//tools/perf:perf", ] }
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg index d00459a..f7d03ee 100644 --- a/chrome/tools/build/win/FILES.cfg +++ b/chrome/tools/build/win/FILES.cfg
@@ -521,12 +521,6 @@ 'buildtype': ['dev', 'official'], 'optional': ['dev', 'official'], }, - { - 'filename': 'kasko.dll', - 'arch': ['32bit'], - 'buildtype': ['dev', 'official'], - 'optional': ['dev', 'official'], - }, # Test binaries for external QA: { 'filename': 'interactive_ui_tests.exe', @@ -672,13 +666,6 @@ 'optional': ['dev', 'official'], }, { - 'filename': 'kasko.dll.pdb', - 'arch': ['32bit'], - 'buildtype': ['dev', 'official'], - 'archive': 'chrome-win32-syms.zip', - 'optional': ['dev', 'official'], - }, - { 'filename': 'nacl_irt_x86_32.nexe.debug', 'arch': ['32bit'], 'buildtype': ['official'],
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index d00db735..d24f0b11 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h
@@ -49,12 +49,6 @@ const base::FileDescriptor& dest_fd); #endif // defined(OS_CHROMEOS) - void OnPatchFileBsdiff(const IPC::PlatformFileForTransit& input_file, - const IPC::PlatformFileForTransit& patch_file, - const IPC::PlatformFileForTransit& output_file); - void OnPatchFileCourgette(const IPC::PlatformFileForTransit& input_file, - const IPC::PlatformFileForTransit& patch_file, - const IPC::PlatformFileForTransit& output_file); void OnStartupPing(); #if defined(FULL_SAFE_BROWSING) void OnAnalyzeZipFileForDownloadProtection(
diff --git a/chrome/utility/extensions/extensions_handler.cc b/chrome/utility/extensions/extensions_handler.cc index f6f37b1f..c6e2a74b 100644 --- a/chrome/utility/extensions/extensions_handler.cc +++ b/chrome/utility/extensions/extensions_handler.cc
@@ -96,7 +96,6 @@ #else callback.Run(false); #endif - ReleaseProcessIfNeeded(); } ChromeContentUtilityClient* const utility_client_;
diff --git a/chromecast/browser/cast_media_blocker_unittest.cc b/chromecast/browser/cast_media_blocker_unittest.cc index dddb008..c0eb415 100644 --- a/chromecast/browser/cast_media_blocker_unittest.cc +++ b/chromecast/browser/cast_media_blocker_unittest.cc
@@ -8,12 +8,11 @@ #include "base/memory/ptr_util.h" #include "content/public/browser/media_session.h" -#include "content/public/browser/web_contents.h" #include "content/public/test/test_content_client_initializer.h" #include "content/public/test/test_renderer_host.h" -#include "content/public/test/web_contents_tester.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/gl/test/gl_surface_test_support.h" namespace chromecast { namespace shell { @@ -21,19 +20,12 @@ using ::testing::_; using ::testing::Invoke; +namespace { + class MockMediaSession : public content::MediaSession { public: - explicit MockMediaSession(content::MediaSession* session) { - // Delegate the calls to the real MediaSession. - ON_CALL(*this, Resume(_)) - .WillByDefault(Invoke(session, &MediaSession::Resume)); - ON_CALL(*this, Suspend(_)) - .WillByDefault(Invoke(session, &MediaSession::Suspend)); - ON_CALL(*this, Stop(_)).WillByDefault(Invoke(session, &MediaSession::Stop)); - ON_CALL(*this, DidReceiveAction(_)) - .WillByDefault(Invoke(session, &MediaSession::DidReceiveAction)); - } - ~MockMediaSession() {} + MockMediaSession() {} + ~MockMediaSession() override {} MOCK_METHOD1(Resume, void(content::MediaSession::SuspendType)); MOCK_METHOD1(Suspend, void(content::MediaSession::SuspendType)); @@ -41,25 +33,26 @@ MOCK_METHOD0(StartDucking, void()); MOCK_METHOD0(StopDucking, void()); MOCK_METHOD1(DidReceiveAction, void(blink::mojom::MediaSessionAction)); + MOCK_METHOD1(AddObserver, void(content::MediaSessionObserver*)); + MOCK_METHOD1(RemoveObserver, void(content::MediaSessionObserver*)); private: DISALLOW_COPY_AND_ASSIGN(MockMediaSession); }; +} // namespace + class CastMediaBlockerTest : public content::RenderViewHostTestHarness { public: CastMediaBlockerTest() {} ~CastMediaBlockerTest() override {} void SetUp() override { + gl::GLSurfaceTestSupport::InitializeOneOff(); initializer_ = base::MakeUnique<content::TestContentClientInitializer>(); content::RenderViewHostTestHarness::SetUp(); - media_session_ = base::MakeUnique<MockMediaSession>( - content::MediaSession::Get(web_contents())); + media_session_ = base::MakeUnique<MockMediaSession>(); media_blocker_ = base::MakeUnique<CastMediaBlocker>(media_session_.get()); - - content::WebContentsTester::For(web_contents()) - ->NavigateAndCommit(GURL("https://www.youtube.com")); } void TearDown() override { content::RenderViewHostTestHarness::TearDown(); } @@ -77,10 +70,8 @@ DISALLOW_COPY_AND_ASSIGN(CastMediaBlockerTest); }; -// TODO(derekjchow): Make the tests pass on cast testbots. -// crbug.com/665118 -TEST_F(CastMediaBlockerTest, DISABLED_Block_Unblock_Suspended) { +TEST_F(CastMediaBlockerTest, Block_Unblock_Suspended) { // Testing block/unblock operations do nothing if media never plays. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -96,7 +87,7 @@ media_blocker_->BlockMediaLoading(false); } -TEST_F(CastMediaBlockerTest, DISABLED_No_Block) { +TEST_F(CastMediaBlockerTest, No_Block) { // Tests CastMediaBlocker does nothing if block/unblock is not called. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -121,7 +112,7 @@ MediaSessionChanged(true, true); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_Before_Controllable) { +TEST_F(CastMediaBlockerTest, Block_Before_Controllable) { // Tests CastMediaBlocker only suspends when controllable. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -134,7 +125,7 @@ MediaSessionChanged(true, false); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_After_Controllable) { +TEST_F(CastMediaBlockerTest, Block_After_Controllable) { // Tests CastMediaBlocker suspends immediately on block if controllable. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -154,7 +145,7 @@ media_blocker_->BlockMediaLoading(false); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_Multiple) { +TEST_F(CastMediaBlockerTest, Block_Multiple) { // Tests CastMediaBlocker repeatively suspends when blocked. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -182,7 +173,7 @@ testing::Mock::VerifyAndClearExpectations(media_session_.get()); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_Unblock_Uncontrollable) { +TEST_F(CastMediaBlockerTest, Block_Unblock_Uncontrollable) { // Tests CastMediaBlocker does not suspend or resume when uncontrollable. EXPECT_CALL(*media_session_, Suspend(_)).Times(0); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -196,7 +187,7 @@ testing::Mock::VerifyAndClearExpectations(media_session_.get()); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_Unblock_Uncontrollable2) { +TEST_F(CastMediaBlockerTest, Block_Unblock_Uncontrollable2) { EXPECT_CALL(*media_session_, Suspend(_)).Times(1); EXPECT_CALL(*media_session_, Resume(_)).Times(0); MediaSessionChanged(true, true); @@ -219,7 +210,7 @@ media_blocker_->BlockMediaLoading(false); } -TEST_F(CastMediaBlockerTest, DISABLED_Resume_When_Controllable) { +TEST_F(CastMediaBlockerTest, Resume_When_Controllable) { // Tests CastMediaBlocker will only resume after unblock when controllable. EXPECT_CALL(*media_session_, Suspend(_)).Times(1); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -235,7 +226,7 @@ MediaSessionChanged(true, true); } -TEST_F(CastMediaBlockerTest, DISABLED_No_Resume) { +TEST_F(CastMediaBlockerTest, No_Resume) { // Tests CastMediaBlocker will not resume if media starts playing by itself // after unblock. EXPECT_CALL(*media_session_, Suspend(_)).Times(1); @@ -252,7 +243,7 @@ MediaSessionChanged(false, false); } -TEST_F(CastMediaBlockerTest, DISABLED_Block_Before_Resume) { +TEST_F(CastMediaBlockerTest, Block_Before_Resume) { // Tests CastMediaBlocker does not resume if blocked again after an unblock. EXPECT_CALL(*media_session_, Suspend(_)).Times(1); EXPECT_CALL(*media_session_, Resume(_)).Times(0); @@ -269,7 +260,7 @@ MediaSessionChanged(true, true); } -TEST_F(CastMediaBlockerTest, DISABLED_Unblocked_Already_Playing) { +TEST_F(CastMediaBlockerTest, Unblocked_Already_Playing) { // Tests CastMediaBlocker does not resume if unblocked and media is playing. EXPECT_CALL(*media_session_, Suspend(_)).Times(1); EXPECT_CALL(*media_session_, Resume(_)).Times(0);
diff --git a/chromecast/media/service/cast_renderer.cc b/chromecast/media/service/cast_renderer.cc index aa3ae06..42964ba 100644 --- a/chromecast/media/service/cast_renderer.cc +++ b/chromecast/media/service/cast_renderer.cc
@@ -18,8 +18,8 @@ #include "chromecast/public/media/media_pipeline_device_params.h" #include "media/base/audio_decoder_config.h" #include "media/base/demuxer_stream.h" -#include "media/base/demuxer_stream_provider.h" #include "media/base/media_log.h" +#include "media/base/media_resource.h" #include "media/base/renderer_client.h" namespace chromecast { @@ -61,10 +61,9 @@ video_resolution_policy_->RemoveObserver(this); } -void CastRenderer::Initialize( - ::media::DemuxerStreamProvider* demuxer_stream_provider, - ::media::RendererClient* client, - const ::media::PipelineStatusCB& init_cb) { +void CastRenderer::Initialize(::media::MediaResource* media_resource, + ::media::RendererClient* client, + const ::media::PipelineStatusCB& init_cb) { CMALOG(kLogControl) << __FUNCTION__ << ": " << this; DCHECK(task_runner_->BelongsToCurrentThread()); @@ -94,7 +93,7 @@ // Initialize audio. ::media::DemuxerStream* audio_stream = - demuxer_stream_provider->GetStream(::media::DemuxerStream::AUDIO); + media_resource->GetStream(::media::DemuxerStream::AUDIO); if (audio_stream) { AvPipelineClient audio_client; audio_client.wait_for_key_cb = base::Bind( @@ -120,7 +119,7 @@ // Initialize video. ::media::DemuxerStream* video_stream = - demuxer_stream_provider->GetStream(::media::DemuxerStream::VIDEO); + media_resource->GetStream(::media::DemuxerStream::VIDEO); if (video_stream) { VideoPipelineClient video_client; video_client.av_pipeline_client.wait_for_key_cb = base::Bind(
diff --git a/chromecast/media/service/cast_renderer.h b/chromecast/media/service/cast_renderer.h index 3273e26..61b722d0 100644 --- a/chromecast/media/service/cast_renderer.h +++ b/chromecast/media/service/cast_renderer.h
@@ -35,7 +35,7 @@ ~CastRenderer() final; // ::media::Renderer implementation. - void Initialize(::media::DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(::media::MediaResource* media_resource, ::media::RendererClient* client, const ::media::PipelineStatusCB& init_cb) final; void SetCdm(::media::CdmContext* cdm_context,
diff --git a/chromeos/network/auto_connect_handler_unittest.cc b/chromeos/network/auto_connect_handler_unittest.cc index acbcbcd..a2f370be 100644 --- a/chromeos/network/auto_connect_handler_unittest.cc +++ b/chromeos/network/auto_connect_handler_unittest.cc
@@ -15,6 +15,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" +#include "base/test/scoped_task_scheduler.h" #include "chromeos/cert_loader.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill_device_client.h" @@ -77,7 +78,9 @@ class AutoConnectHandlerTest : public testing::Test { public: AutoConnectHandlerTest() - : test_manager_client_(nullptr), test_service_client_(nullptr) {} + : test_manager_client_(nullptr), + test_service_client_(nullptr), + scoped_task_scheduler_(&message_loop_) {} void SetUp() override { ASSERT_TRUE(test_nssdb_.is_open()); @@ -127,8 +130,6 @@ client_cert_resolver_.reset(new ClientCertResolver()); client_cert_resolver_->Init(network_state_handler_.get(), managed_config_handler_.get()); - client_cert_resolver_->SetSlowTaskRunnerForTest( - message_loop_.task_runner()); auto_connect_handler_.reset(new AutoConnectHandler()); auto_connect_handler_->Init(client_cert_resolver_.get(), @@ -253,6 +254,8 @@ base::MessageLoopForUI message_loop_; private: + base::test::ScopedTaskScheduler scoped_task_scheduler_; + DISALLOW_COPY_AND_ASSIGN(AutoConnectHandlerTest); };
diff --git a/chromeos/network/client_cert_resolver.cc b/chromeos/network/client_cert_resolver.cc index 706a6d1..788e5ee9 100644 --- a/chromeos/network/client_cert_resolver.cc +++ b/chromeos/network/client_cert_resolver.cc
@@ -15,8 +15,7 @@ #include "base/logging.h" #include "base/stl_util.h" #include "base/strings/string_util.h" -#include "base/task_runner.h" -#include "base/threading/worker_pool.h" +#include "base/task_scheduler/post_task.h" #include "base/time/clock.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/shill_service_client.h" @@ -311,11 +310,6 @@ CertLoader::Get()->AddObserver(this); } -void ClientCertResolver::SetSlowTaskRunnerForTest( - const scoped_refptr<base::TaskRunner>& task_runner) { - slow_task_runner_for_test_ = task_runner; -} - void ClientCertResolver::AddObserver(Observer* observer) { observers_.AddObserver(observer); } @@ -498,15 +492,13 @@ } VLOG(2) << "Start task for resolving client cert patterns."; - base::TaskRunner* task_runner = slow_task_runner_for_test_.get(); - if (!task_runner) - task_runner = - base::WorkerPool::GetTaskRunner(true /* task is slow */).get(); - resolve_task_running_ = true; NetworkCertMatches* matches = new NetworkCertMatches; - task_runner->PostTaskAndReply( - FROM_HERE, + base::PostTaskWithTraitsAndReply( + FROM_HERE, base::TaskTraits() + .WithShutdownBehavior( + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN) + .MayBlock(), base::Bind(&FindCertificateMatches, CertLoader::Get()->cert_list(), base::Owned(networks_to_resolve.release()), Now(), matches), base::Bind(&ClientCertResolver::ConfigureCertificates,
diff --git a/chromeos/network/client_cert_resolver.h b/chromeos/network/client_cert_resolver.h index bc2af20..63d6d89 100644 --- a/chromeos/network/client_cert_resolver.h +++ b/chromeos/network/client_cert_resolver.h
@@ -10,7 +10,6 @@ #include <vector> #include "base/macros.h" -#include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/time/time.h" @@ -23,7 +22,6 @@ namespace base { class Clock; -class TaskRunner; } namespace chromeos { @@ -61,11 +59,6 @@ void Init(NetworkStateHandler* network_state_handler, ManagedNetworkConfigurationHandler* managed_network_config_handler); - // Sets the task runner that any slow calls will be made from, e.g. calls - // to the NSS database. If not set, uses base::WorkerPool. - void SetSlowTaskRunnerForTest( - const scoped_refptr<base::TaskRunner>& task_runner); - void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -144,9 +137,6 @@ // Unowned associated (global or test) instance. ManagedNetworkConfigurationHandler* managed_network_config_handler_; - // TaskRunner for slow tasks. - scoped_refptr<base::TaskRunner> slow_task_runner_for_test_; - // Can be set for testing. base::Clock* testing_clock_;
diff --git a/chromeos/network/client_cert_resolver_unittest.cc b/chromeos/network/client_cert_resolver_unittest.cc index f64629d..ea417747 100644 --- a/chromeos/network/client_cert_resolver_unittest.cc +++ b/chromeos/network/client_cert_resolver_unittest.cc
@@ -16,6 +16,7 @@ #include "base/macros.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" +#include "base/test/scoped_task_scheduler.h" #include "base/test/simple_test_clock.h" #include "base/values.h" #include "chromeos/cert_loader.h" @@ -56,7 +57,8 @@ : network_properties_changed_count_(0), service_test_(nullptr), profile_test_(nullptr), - cert_loader_(nullptr) {} + cert_loader_(nullptr), + scoped_task_scheduler_(&message_loop_) {} ~ClientCertResolverTest() override {} void SetUp() override { @@ -158,8 +160,6 @@ client_cert_resolver_->Init(network_state_handler_.get(), managed_config_handler_.get()); client_cert_resolver_->AddObserver(this); - client_cert_resolver_->SetSlowTaskRunnerForTest( - message_loop_.task_runner()); } void SetupWifi() { @@ -293,6 +293,7 @@ std::unique_ptr<ManagedNetworkConfigurationHandlerImpl> managed_config_handler_; base::MessageLoop message_loop_; + base::test::ScopedTaskScheduler scoped_task_scheduler_; scoped_refptr<net::X509Certificate> test_client_cert_; std::string test_ca_cert_pem_; crypto::ScopedTestNSSDB test_nssdb_;
diff --git a/chromeos/network/network_state_unittest.cc b/chromeos/network/network_state_unittest.cc index 5fdb1d6..2daeef12 100644 --- a/chromeos/network/network_state_unittest.cc +++ b/chromeos/network/network_state_unittest.cc
@@ -21,40 +21,6 @@ namespace { -// StringValue that skips the DCHECK in the constructor for valid UTF8. -class TestStringValue : public base::Value { - public: - explicit TestStringValue(const std::string& in_value) - : base::Value(Type::STRING), value_(in_value) {} - - ~TestStringValue() override { - // Ugly hack that prevents ~Value() from trying to destroy string_value_. - // TODO(crbug.com/646113): Clean this up when StringValue will be removed. - type_ = Type::NONE; - } - - // Overridden from Value: - bool GetAsString(std::string* out_value) const override { - if (out_value) - *out_value = value_; - return true; - } - - TestStringValue* DeepCopy() const override { - return new TestStringValue(value_); - } - - bool Equals(const base::Value* other) const override { - if (other->GetType() != GetType()) - return false; - std::string lhs, rhs; - return GetAsString(&lhs) && other->GetAsString(&rhs) && lhs == rhs; - } - - private: - std::string value_; -}; - class NetworkStateTest : public testing::Test { public: NetworkStateTest() : network_state_("test_path") { @@ -68,7 +34,7 @@ } bool SetStringProperty(const std::string& key, const std::string& value) { - return SetProperty(key, base::MakeUnique<TestStringValue>(value)); + return SetProperty(key, base::MakeUnique<base::Value>(value)); } bool SignalInitialPropertiesReceived() { @@ -106,7 +72,9 @@ EXPECT_EQ(network_state_.name(), network_setname_result); } -// Truncates invalid UTF-8 +// Truncates invalid UTF-8. base::Value has a DCHECK against invalid UTF-8 +// strings, which is why this is a release mode only test. +#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) TEST_F(NetworkStateTest, NameTruncateInvalid) { EXPECT_TRUE(SetStringProperty(shill::kTypeProperty, shill::kTypeVPN)); @@ -116,6 +84,7 @@ EXPECT_TRUE(SignalInitialPropertiesReceived()); EXPECT_EQ(network_state_.name(), network_setname_result); } +#endif // If HexSSID doesn't exist, fallback to NameProperty. TEST_F(NetworkStateTest, SsidFromName) {
diff --git a/components/BUILD.gn b/components/BUILD.gn index 08ee226..a197558e 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn
@@ -162,6 +162,7 @@ if (is_ios) { deps += [ + "//components/image_fetcher/ios:unit_tests", "//components/reading_list/ios:unit_tests", "//components/signin/ios/browser:unit_tests", "//components/translate/ios/browser:unit_tests",
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc index 272dcce..f3f78d10 100644 --- a/components/autofill/core/browser/personal_data_manager_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -4254,14 +4254,7 @@ // Tests the SaveImportedProfile method with different profiles to make sure the // merge logic works correctly. -// Flaky on TSan, see crbug.com/686226. -#if defined(THREAD_SANITIZER) -#define MAYBE_SaveImportedProfile DISABLED_SaveImportedProfile -#else -#define MAYBE_SaveImportedProfile SaveImportedProfile -#endif - -TEST_F(PersonalDataManagerTest, MAYBE_SaveImportedProfile) { +TEST_F(PersonalDataManagerTest, SaveImportedProfile) { typedef struct { autofill::ServerFieldType field_type; std::string field_value; @@ -4523,7 +4516,13 @@ {{COMPANY_NAME, "Stark Inc."}}}, }; + // Create the test clock. + TestAutofillClock test_clock; + for (TestCase test_case : test_cases) { + // Set the time to a specific value. + test_clock.SetNow(kArbitraryTime); + SetupReferenceProfile(); const std::vector<AutofillProfile*>& initial_profiles = personal_data_->GetProfiles(); @@ -4534,6 +4533,9 @@ change.field_type, base::UTF8ToUTF16(change.field_value)); } + // Set the time to a bigger value. + test_clock.SetNow(kSomeLaterTime); + AutofillProfile profile2(base::GenerateGUID(), "https://www.example.com"); test::SetProfileInfo(&profile2, "Marion", "Mitchell", "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St", "unit 5", @@ -4565,11 +4567,8 @@ // Verify that the merged profile's use count, use date and modification // date were properly updated. EXPECT_EQ(1U, saved_profiles.front()->use_count()); - EXPECT_GT(base::TimeDelta::FromMilliseconds(500), - AutofillClock::Now() - saved_profiles.front()->use_date()); - EXPECT_GT( - base::TimeDelta::FromMilliseconds(500), - AutofillClock::Now() - saved_profiles.front()->modification_date()); + EXPECT_EQ(kSomeLaterTime, saved_profiles.front()->use_date()); + EXPECT_EQ(kSomeLaterTime, saved_profiles.front()->modification_date()); } // Erase the profiles for the next test.
diff --git a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc index c5ce09b..c18292a2 100644 --- a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc +++ b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
@@ -57,15 +57,21 @@ return reinterpret_cast<void*>(&user_data_key); } +std::string EscapeIdentifiers(const AutofillSpecifics& specifics) { + return net::EscapePath(specifics.name()) + + std::string(kAutocompleteTagDelimiter) + + net::EscapePath(specifics.value()); +} + std::unique_ptr<EntityData> CreateEntityData(const AutofillEntry& entry) { auto entity_data = base::MakeUnique<EntityData>(); - entity_data->non_unique_name = base::UTF16ToUTF8(entry.key().name()); AutofillSpecifics* autofill = entity_data->specifics.mutable_autofill(); autofill->set_name(base::UTF16ToUTF8(entry.key().name())); autofill->set_value(base::UTF16ToUTF8(entry.key().value())); autofill->add_usage_timestamp(entry.date_created().ToInternalValue()); if (entry.date_created() != entry.date_last_used()) autofill->add_usage_timestamp(entry.date_last_used().ToInternalValue()); + entity_data->non_unique_name = EscapeIdentifiers(*autofill); return entity_data; } @@ -450,11 +456,8 @@ std::string AutocompleteSyncBridge::GetClientTag( const EntityData& entity_data) { DCHECK(entity_data.specifics.has_autofill()); - const AutofillSpecifics specifics = entity_data.specifics.autofill(); return std::string(kAutocompleteEntryNamespaceTag) + - net::EscapePath(specifics.name()) + - std::string(kAutocompleteTagDelimiter) + - net::EscapePath(specifics.value()); + EscapeIdentifiers(entity_data.specifics.autofill()); } std::string AutocompleteSyncBridge::GetStorageKey(
diff --git a/components/browsing_data/core/pref_names.cc b/components/browsing_data/core/pref_names.cc index 4ff2416..87a39cb 100644 --- a/components/browsing_data/core/pref_names.cc +++ b/components/browsing_data/core/pref_names.cc
@@ -28,6 +28,7 @@ "browser.last_clear_browsing_data_time"; const char kClearBrowsingDataHistoryNoticeShownTimes[] = "browser.clear_data.history_notice_shown_times"; +const char kLastClearBrowsingDataTab[] = "browser.last_clear_browsing_data_tab"; void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { registry->RegisterIntegerPref( @@ -63,6 +64,12 @@ user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, 0); #endif // !defined(OS_IOS) + +#if defined(OS_ANDROID) + registry->RegisterIntegerPref( + kLastClearBrowsingDataTab, 0, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); +#endif } } // namespace prefs
diff --git a/components/browsing_data/core/pref_names.h b/components/browsing_data/core/pref_names.h index 8325ab4..560948e 100644 --- a/components/browsing_data/core/pref_names.h +++ b/components/browsing_data/core/pref_names.h
@@ -27,6 +27,8 @@ extern const char kLastClearBrowsingDataTime[]; extern const char kClearBrowsingDataHistoryNoticeShownTimes[]; +extern const char kLastClearBrowsingDataTab[]; + // Registers the Clear Browsing Data UI prefs. void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry);
diff --git a/components/certificate_transparency/BUILD.gn b/components/certificate_transparency/BUILD.gn index 8209a04..bf687c9c7 100644 --- a/components/certificate_transparency/BUILD.gn +++ b/components/certificate_transparency/BUILD.gn
@@ -39,6 +39,7 @@ "mock_log_dns_traffic.cc", "mock_log_dns_traffic.h", "single_tree_tracker_unittest.cc", + "tree_state_tracker_unittest.cc", ] deps = [ ":certificate_transparency",
diff --git a/components/certificate_transparency/single_tree_tracker.cc b/components/certificate_transparency/single_tree_tracker.cc index 28123169..547ac58 100644 --- a/components/certificate_transparency/single_tree_tracker.cc +++ b/components/certificate_transparency/single_tree_tracker.cc
@@ -11,6 +11,8 @@ #include "base/bind.h" #include "base/metrics/histogram_macros.h" +#include "base/strings/string_number_conversions.h" +#include "base/values.h" #include "components/certificate_transparency/log_dns_client.h" #include "crypto/sha2.h" #include "net/base/hash_value.h" @@ -20,6 +22,7 @@ #include "net/cert/merkle_tree_leaf.h" #include "net/cert/signed_certificate_timestamp.h" #include "net/cert/x509_certificate.h" +#include "net/log/net_log.h" using net::SHA256HashValue; using net::ct::LogEntry; @@ -166,6 +169,21 @@ return sct_timestamp + kMaximumMergeDelay < sth_timestamp; } +std::unique_ptr<base::Value> NetLogEntryAuditingEventCallback( + const SHA256HashValue* log_entry, + base::StringPiece log_id, + bool success, + net::NetLogCaptureMode capture_mode) { + std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); + + dict->SetString("log_entry", + base::HexEncode(log_entry->data, crypto::kSHA256Length)); + dict->SetString("log_id", base::HexEncode(log_id.data(), log_id.size())); + dict->SetBoolean("success", success); + + return std::move(dict); +} + } // namespace // The entry that is being audited. @@ -214,10 +232,14 @@ SingleTreeTracker::SingleTreeTracker( scoped_refptr<const net::CTLogVerifier> ct_log, - LogDnsClient* dns_client) + LogDnsClient* dns_client, + net::NetLog* net_log) : ct_log_(std::move(ct_log)), checked_entries_(kCheckedEntriesCacheSize), dns_client_(dns_client), + net_log_(net::NetLogWithSource::Make( + net_log, + net::NetLogSourceType::CT_TREE_STATE_TRACKER)), weak_factory_(this) { memory_pressure_listener_.reset(new base::MemoryPressureListener(base::Bind( &SingleTreeTracker::OnMemoryPressure, base::Unretained(this)))); @@ -368,6 +390,7 @@ break; } else if (result == net::ERR_NAME_RESOLUTION_FAILED) { LogInclusionCheckResult(DNS_QUERY_NOT_POSSIBLE); + LogAuditResultToNetLog(it->first, false); // Lookup failed due to bad DNS configuration, erase the entry and // continue to the next one. it = pending_entries_.erase(it); @@ -419,8 +442,9 @@ DCHECK_EQ(it->second.state, INCLUSION_PROOF_REQUESTED); if (net_error != net::OK) { - // XXX(eranm): Should failures be cached? For now, they are not. + // TODO(eranm): Should failures be cached? For now, they are not. LogInclusionCheckResult(FAILED_GETTING_INCLUSION_PROOF); + LogAuditResultToNetLog(entry, false); pending_entries_.erase(it); return; } @@ -430,6 +454,7 @@ bool verified = ct_log_->VerifyAuditProof(it->second.proof, it->second.root_hash, leaf_hash); + LogAuditResultToNetLog(entry, verified); if (!verified) { LogInclusionCheckResult(GOT_INVALID_INCLUSION_PROOF); @@ -455,4 +480,14 @@ } } +void SingleTreeTracker::LogAuditResultToNetLog(const EntryToAudit& entry, + bool success) { + net::NetLogParametersCallback net_log_callback = + base::Bind(&NetLogEntryAuditingEventCallback, &entry.leaf_hash, + ct_log_->key_id(), success); + + net_log_.AddEvent(net::NetLogEventType::CT_LOG_ENTRY_AUDITED, + net_log_callback); +} + } // namespace certificate_transparency
diff --git a/components/certificate_transparency/single_tree_tracker.h b/components/certificate_transparency/single_tree_tracker.h index eb9cd7f8..16342e1b 100644 --- a/components/certificate_transparency/single_tree_tracker.h +++ b/components/certificate_transparency/single_tree_tracker.h
@@ -17,6 +17,7 @@ #include "net/cert/ct_verifier.h" #include "net/cert/signed_tree_head.h" #include "net/cert/sth_observer.h" +#include "net/log/net_log_with_source.h" namespace net { @@ -78,7 +79,8 @@ }; SingleTreeTracker(scoped_refptr<const net::CTLogVerifier> ct_log, - LogDnsClient* dns_client); + LogDnsClient* dns_client, + net::NetLog* net_log); ~SingleTreeTracker() override; // net::ct::CTVerifier::Observer implementation. @@ -142,6 +144,8 @@ void OnMemoryPressure( base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); + void LogAuditResultToNetLog(const EntryToAudit& entry, bool success); + // Holds the latest STH fetched and verified for this log. net::ct::SignedTreeHead verified_sth_; @@ -167,6 +171,8 @@ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; + net::NetLogWithSource net_log_; + base::WeakPtrFactory<SingleTreeTracker> weak_factory_; DISALLOW_COPY_AND_ASSIGN(SingleTreeTracker);
diff --git a/components/certificate_transparency/single_tree_tracker_unittest.cc b/components/certificate_transparency/single_tree_tracker_unittest.cc index adeb3780..b5e0edf9 100644 --- a/components/certificate_transparency/single_tree_tracker_unittest.cc +++ b/components/certificate_transparency/single_tree_tracker_unittest.cc
@@ -10,6 +10,7 @@ #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/test/histogram_tester.h" #include "components/base32/base32.h" @@ -25,6 +26,8 @@ #include "net/cert/x509_certificate.h" #include "net/dns/dns_client.h" #include "net/log/net_log.h" +#include "net/log/test_net_log.h" +#include "net/log/test_net_log_util.h" #include "net/test/ct_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -85,8 +88,8 @@ return sct; } -std::string Base32LeafHash(const net::X509Certificate* cert, - const SignedCertificateTimestamp* sct) { +std::string LeafHash(const net::X509Certificate* cert, + const SignedCertificateTimestamp* sct) { net::ct::MerkleTreeLeaf leaf; if (!GetMerkleTreeLeaf(cert, sct, &leaf)) return std::string(); @@ -95,6 +98,15 @@ if (!HashMerkleTreeLeaf(leaf, &leaf_hash)) return std::string(); + return leaf_hash; +} + +std::string Base32LeafHash(const net::X509Certificate* cert, + const SignedCertificateTimestamp* sct) { + std::string leaf_hash = LeafHash(cert, sct); + if (leaf_hash.empty()) + return std::string(); + return base32::Base32Encode(leaf_hash, base32::Base32EncodePolicy::OMIT_PADDING); } @@ -174,10 +186,10 @@ protected: void CreateTreeTracker() { log_dns_client_ = base::MakeUnique<LogDnsClient>( - mock_dns_.CreateDnsClient(), net_log_, 1); + mock_dns_.CreateDnsClient(), net_log_with_source_, 1); - tree_tracker_ = - base::MakeUnique<SingleTreeTracker>(log_, log_dns_client_.get()); + tree_tracker_ = base::MakeUnique<SingleTreeTracker>( + log_, log_dns_client_.get(), &net_log_); } void CreateTreeTrackerWithDefaultDnsExpectation() { @@ -198,6 +210,41 @@ net::Error::ERR_TEMPORARILY_THROTTLED); } + bool MatchAuditingResultInNetLog(net::TestNetLog& net_log, + std::string expected_leaf_hash, + bool expected_success) { + net::TestNetLogEntry::List entries; + + net_log.GetEntries(&entries); + if (entries.size() == 0) + return false; + + size_t pos = net::ExpectLogContainsSomewhere( + entries, 0, net::NetLogEventType::CT_LOG_ENTRY_AUDITED, + net::NetLogEventPhase::NONE); + + const net::TestNetLogEntry& logged_entry = entries[pos]; + + std::string logged_log_id, logged_leaf_hash; + if (!logged_entry.GetStringValue("log_id", &logged_log_id) || + !logged_entry.GetStringValue("log_entry", &logged_leaf_hash)) + return false; + + if (base::HexEncode(GetTestPublicKeyId().data(), + GetTestPublicKeyId().size()) != logged_log_id) + return false; + + if (base::HexEncode(expected_leaf_hash.data(), expected_leaf_hash.size()) != + logged_leaf_hash) + return false; + + bool logged_success; + if (!logged_entry.GetBooleanValue("success", &logged_success)) + return false; + + return logged_success == expected_success; + } + base::MessageLoopForIO message_loop_; MockLogDnsTraffic mock_dns_; scoped_refptr<const net::CTLogVerifier> log_; @@ -206,7 +253,8 @@ std::unique_ptr<SingleTreeTracker> tree_tracker_; scoped_refptr<net::X509Certificate> chain_; scoped_refptr<SignedCertificateTimestamp> cert_sct_; - net::NetLogWithSource net_log_; + net::TestNetLog net_log_; + net::NetLogWithSource net_log_with_source_; }; // Test that an SCT is classified as pending for a newer STH if the @@ -231,6 +279,7 @@ // Expect logging of a value indicating a valid STH is required. histograms.ExpectTotalCount(kCanCheckForInclusionHistogramName, 1); histograms.ExpectBucketCount(kCanCheckForInclusionHistogramName, 0, 1); + EXPECT_EQ(0u, net_log_.GetSize()); } // Test that an SCT is classified as pending an inclusion check if the @@ -266,6 +315,7 @@ // Nothing should be logged in the result histogram since inclusion check // didn't finish. histograms.ExpectTotalCount(kInclusionCheckResultHistogramName, 0); + EXPECT_EQ(0u, net_log_.GetSize()); } // Test that the SingleTreeTracker correctly queues verified SCTs for inclusion @@ -296,6 +346,7 @@ // only supposed to measure the state of newly-observed SCTs, not pending // ones. histograms.ExpectTotalCount(kCanCheckForInclusionHistogramName, 1); + EXPECT_EQ(0u, net_log_.GetSize()); } // Test that the SingleTreeTracker does not change an SCT's status if an STH @@ -319,6 +370,7 @@ EXPECT_EQ( SingleTreeTracker::SCT_PENDING_NEWER_STH, tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get())); + EXPECT_EQ(0u, net_log_.GetSize()); } // Test that the SingleTreeTracker correctly logs that an SCT is pending a new @@ -342,6 +394,7 @@ // for inclusion as the STH is too old. histograms.ExpectTotalCount(kCanCheckForInclusionHistogramName, 1); histograms.ExpectBucketCount(kCanCheckForInclusionHistogramName, 1, 1); + EXPECT_EQ(0u, net_log_.GetSize()); } // Test that an entry transitions to the "not found" state if the LogDnsClient @@ -368,6 +421,9 @@ EXPECT_EQ( SingleTreeTracker::SCT_NOT_OBSERVED, tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get())); + // There should have been one NetLog event, logged with failure. + EXPECT_TRUE(MatchAuditingResultInNetLog( + net_log_, LeafHash(chain_.get(), cert_sct_.get()), false)); } // Test that an entry transitions to the "not found" state if the LogDnsClient @@ -401,6 +457,9 @@ EXPECT_EQ( SingleTreeTracker::SCT_NOT_OBSERVED, tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get())); + // There should have been one NetLog event, logged with failure. + EXPECT_TRUE(MatchAuditingResultInNetLog( + net_log_, LeafHash(chain_.get(), cert_sct_.get()), false)); } // Test that an entry transitions to the "included" state if the LogDnsClient @@ -440,6 +499,9 @@ EXPECT_EQ( SingleTreeTracker::SCT_INCLUDED_IN_LOG, tree_tracker_->GetLogEntryInclusionStatus(chain_.get(), cert_sct_.get())); + // There should have been one NetLog event, with success logged. + EXPECT_TRUE(MatchAuditingResultInNetLog( + net_log_, LeafHash(chain_.get(), cert_sct_.get()), true)); } // Test that pending entries transition states correctly according to the
diff --git a/components/certificate_transparency/tree_state_tracker.cc b/components/certificate_transparency/tree_state_tracker.cc index 06a7498..8167e69 100644 --- a/components/certificate_transparency/tree_state_tracker.cc +++ b/components/certificate_transparency/tree_state_tracker.cc
@@ -33,20 +33,22 @@ base::FEATURE_DISABLED_BY_DEFAULT}; TreeStateTracker::TreeStateTracker( - std::vector<scoped_refptr<const CTLogVerifier>> ct_logs) { + std::vector<scoped_refptr<const CTLogVerifier>> ct_logs, + net::NetLog* net_log) { if (!base::FeatureList::IsEnabled(kCTLogAuditing)) return; - // TODO(eranm): Hook up a real NetLog. - net::NetLogWithSource net_log; std::unique_ptr<net::DnsClient> dns_client = - net::DnsClient::CreateClient(net_log.net_log()); - dns_client_ = base::MakeUnique<LogDnsClient>(std::move(dns_client), net_log, - kMaxConcurrentDnsQueries); + net::DnsClient::CreateClient(net_log); + dns_client_ = base::MakeUnique<LogDnsClient>( + std::move(dns_client), + net::NetLogWithSource::Make(net_log, + net::NetLogSourceType::CT_TREE_STATE_TRACKER), + kMaxConcurrentDnsQueries); for (const auto& log : ct_logs) { tree_trackers_[log->key_id()].reset( - new SingleTreeTracker(log, dns_client_.get())); + new SingleTreeTracker(log, dns_client_.get(), net_log)); } }
diff --git a/components/certificate_transparency/tree_state_tracker.h b/components/certificate_transparency/tree_state_tracker.h index 7523978..83d82c0a 100644 --- a/components/certificate_transparency/tree_state_tracker.h +++ b/components/certificate_transparency/tree_state_tracker.h
@@ -15,6 +15,7 @@ #include "net/cert/sth_observer.h" namespace net { +class NetLog; class CTLogVerifier; class X509Certificate; @@ -43,8 +44,8 @@ // is based on the assumption that the list of recognized logs does not change // during the object's life time. // Observed STHs from logs not in this list will be simply ignored. - explicit TreeStateTracker( - std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs); + TreeStateTracker(std::vector<scoped_refptr<const net::CTLogVerifier>> ct_logs, + net::NetLog* net_log); ~TreeStateTracker() override; // net::ct::CTVerifier::Observer implementation.
diff --git a/components/certificate_transparency/tree_state_tracker_unittest.cc b/components/certificate_transparency/tree_state_tracker_unittest.cc new file mode 100644 index 0000000..e97ce3da --- /dev/null +++ b/components/certificate_transparency/tree_state_tracker_unittest.cc
@@ -0,0 +1,97 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/certificate_transparency/tree_state_tracker.h" + +#include <string> +#include <utility> + +#include "base/feature_list.h" +#include "base/memory/ptr_util.h" +#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#include "base/strings/string_number_conversions.h" +#include "base/test/scoped_feature_list.h" +#include "net/cert/ct_log_verifier.h" +#include "net/cert/ct_serialization.h" +#include "net/cert/merkle_tree_leaf.h" +#include "net/cert/signed_certificate_timestamp.h" +#include "net/cert/signed_tree_head.h" +#include "net/cert/x509_certificate.h" +#include "net/log/net_log.h" +#include "net/log/test_net_log.h" +#include "net/test/ct_test_util.h" +#include "testing/gtest/include/gtest/gtest.h" + +using net::ct::SignedCertificateTimestamp; +using net::ct::SignedTreeHead; +using net::ct::GetSampleSignedTreeHead; +using net::ct::GetTestPublicKeyId; +using net::ct::GetTestPublicKey; +using net::ct::kSthRootHashLength; +using net::ct::GetX509CertSCT; + +const base::Feature kCTLogAuditing = {"CertificateTransparencyLogAuditing", + base::FEATURE_DISABLED_BY_DEFAULT}; + +namespace certificate_transparency { + +class TreeStateTrackerTest : public ::testing::Test { + void SetUp() override { + log_ = net::CTLogVerifier::Create(GetTestPublicKey(), "testlog", + "https://ct.example.com", + "unresolvable.invalid"); + + ASSERT_TRUE(log_); + ASSERT_EQ(log_->key_id(), GetTestPublicKeyId()); + + const std::string der_test_cert(net::ct::GetDerEncodedX509Cert()); + chain_ = net::X509Certificate::CreateFromBytes(der_test_cert.data(), + der_test_cert.length()); + ASSERT_TRUE(chain_.get()); + GetX509CertSCT(&cert_sct_); + cert_sct_->origin = SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE; + } + + protected: + base::MessageLoopForIO message_loop_; + scoped_refptr<const net::CTLogVerifier> log_; + std::unique_ptr<TreeStateTracker> tree_tracker_; + scoped_refptr<net::X509Certificate> chain_; + scoped_refptr<SignedCertificateTimestamp> cert_sct_; + net::TestNetLog net_log_; +}; + +// Test that a new STH & SCT are delegated correctly to a +// SingleTreeTracker instance created by the TreeStateTracker. +// This is verified by looking for a single event on the net_log_ +// passed into the TreeStateTracker c'tor. +TEST_F(TreeStateTrackerTest, TestDelegatesCorrectly) { + std::vector<scoped_refptr<const net::CTLogVerifier>> verifiers; + verifiers.push_back(log_); + + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(kCTLogAuditing); + + tree_tracker_ = base::MakeUnique<TreeStateTracker>(verifiers, &net_log_); + + SignedTreeHead sth; + GetSampleSignedTreeHead(&sth); + ASSERT_EQ(log_->key_id(), sth.log_id); + tree_tracker_->NewSTHObserved(sth); + + ASSERT_EQ(log_->key_id(), cert_sct_->log_id); + tree_tracker_->OnSCTVerified(chain_.get(), cert_sct_.get()); + base::RunLoop().RunUntilIdle(); + + net::ct::MerkleTreeLeaf leaf; + ASSERT_TRUE(GetMerkleTreeLeaf(chain_.get(), cert_sct_.get(), &leaf)); + + std::string leaf_hash; + ASSERT_TRUE(HashMerkleTreeLeaf(leaf, &leaf_hash)); + // There should be one NetLog event. + EXPECT_EQ(1u, net_log_.GetSize()); +} + +} // namespace certificate_transparency
diff --git a/components/content_settings/OWNERS b/components/content_settings/OWNERS index e6ff207..7690635 100644 --- a/components/content_settings/OWNERS +++ b/components/content_settings/OWNERS
@@ -3,3 +3,5 @@ markusheintz@chromium.org msramek@chromium.org raymes@chromium.org + +# COMPONENT: Internals>Permissions>Model
diff --git a/components/crash/DEPS b/components/crash/DEPS deleted file mode 100644 index 246d797..0000000 --- a/components/crash/DEPS +++ /dev/null
@@ -1,4 +0,0 @@ -include_rules = [ - # Header struct only, and only used when #define KASKO. - "+syzygy/kasko/api/crash_key.h", -]
diff --git a/components/crash/content/app/BUILD.gn b/components/crash/content/app/BUILD.gn index 0cf0c6ca..e035ac3 100644 --- a/components/crash/content/app/BUILD.gn +++ b/components/crash/content/app/BUILD.gn
@@ -44,7 +44,6 @@ public_deps = [ ":app_non_mac_win", ":lib", - "//third_party/kasko", ] deps = [ "//base",
diff --git a/components/crash/content/app/DEPS b/components/crash/content/app/DEPS index 80bc21a3..dc5e9320 100644 --- a/components/crash/content/app/DEPS +++ b/components/crash/content/app/DEPS
@@ -4,6 +4,5 @@ "+content/public/common/content_descriptors.h", "+content/public/common/result_codes.h", "+third_party/crashpad", - "+third_party/kasko", "+third_party/lss/linux_syscall_support.h", ]
diff --git a/components/cronet/ios/Cronet.h b/components/cronet/ios/Cronet.h index 5c867a6..52f81d9f 100644 --- a/components/cronet/ios/Cronet.h +++ b/components/cronet/ios/Cronet.h
@@ -12,13 +12,13 @@ // Type of HTTP cache; public interface to private implementation defined in // URLRequestContextConfig class. -enum HttpCacheType { +typedef NS_ENUM(NSInteger, CRNHttpCacheType) { // Disabled HTTP cache. Some data may still be temporarily stored in memory. - DISABLED, + CRNHttpCacheTypeDisabled, // Enable on-disk HTTP cache, including HTTP data. - DISK, + CRNHttpCacheTypeDisk, // Enable in-memory cache, including HTTP data. - MEMORY, + CRNHttpCacheTypeMemory, }; // A block, that takes a request, and returns YES if the request should @@ -42,7 +42,7 @@ // Set HTTP Cache type to be used by CronetEngine. This method only has any // effect before |start| is called. See HttpCacheType enum for available // options. -+ (void)setHttpCacheType:(HttpCacheType)httpCacheType; ++ (void)setHttpCacheType:(CRNHttpCacheType)httpCacheType; // Adds hint that host supports QUIC on altPort. This method only has any effect // before |start| is called.
diff --git a/components/cronet/ios/Cronet.mm b/components/cronet/ios/Cronet.mm index efbe206..65d5e87c 100644 --- a/components/cronet/ios/Cronet.mm +++ b/components/cronet/ios/Cronet.mm
@@ -161,16 +161,16 @@ gSslKeyLogFileName = sslKeyLogFileName; } -+ (void)setHttpCacheType:(HttpCacheType)httpCacheType { ++ (void)setHttpCacheType:(CRNHttpCacheType)httpCacheType { [self checkNotStarted]; switch (httpCacheType) { - case DISABLED: + case CRNHttpCacheTypeDisabled: gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISABLED; break; - case DISK: + case CRNHttpCacheTypeDisk: gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::DISK; break; - case MEMORY: + case CRNHttpCacheTypeMemory: gHttpCache = cronet::URLRequestContextConfig::HttpCacheType::MEMORY; break; default:
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm index 68d09a3..f9b90cec 100644 --- a/components/cronet/ios/cronet_environment.mm +++ b/components/cronet/ios/cronet_environment.mm
@@ -312,7 +312,7 @@ context_builder.set_host_resolver(std::move(mapped_host_resolver)); std::unique_ptr<net::CookieStore> cookie_store = - base::MakeUnique<CookieStoreIOS>( + base::MakeUnique<net::CookieStoreIOS>( [NSHTTPCookieStorage sharedHTTPCookieStorage]); context_builder.SetCookieAndChannelIdStores(std::move(cookie_store), nullptr);
diff --git a/components/exo/BUILD.gn b/components/exo/BUILD.gn index 446d86a..0fc3abc 100644 --- a/components/exo/BUILD.gn +++ b/components/exo/BUILD.gn
@@ -50,7 +50,7 @@ deps = [ "//ash", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//base", "//cc", "//cc/ipc:interfaces", @@ -92,7 +92,7 @@ deps = [ ":exo", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//ash/test:ash_with_aura_test_support", "//ash/test:test_support_without_content", "//base", @@ -127,7 +127,7 @@ ":exo", ":test_support", "//ash", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//base", "//base/test:test_support", "//cc",
diff --git a/components/exo/pointer.cc b/components/exo/pointer.cc index 3cf4b73..f0e76858e 100644 --- a/components/exo/pointer.cc +++ b/components/exo/pointer.cc
@@ -50,7 +50,9 @@ // Pointer, public: Pointer::Pointer(PointerDelegate* delegate) - : delegate_(delegate), cursor_(ui::kCursorNull) { + : delegate_(delegate), + cursor_(ui::kCursorNull), + cursor_capture_weak_ptr_factory_(this) { auto* helper = WMHelper::GetInstance(); helper->AddPreTargetHandler(this); helper->AddCursorObserver(this); @@ -121,7 +123,7 @@ if (surface_) { CaptureCursor(); } else { - cursor_captured_callback_.Cancel(); + cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs(); cursor_ = ui::kCursorNone; UpdateCursor(); } @@ -152,6 +154,7 @@ focus_->UnregisterCursorProvider(this); focus_ = nullptr; cursor_ = ui::kCursorNull; + cursor_capture_weak_ptr_factory_.InvalidateWeakPtrs(); } // Second generate an enter event if focus moved to a new target. if (target) { @@ -328,17 +331,16 @@ float primary_device_scale_factor = display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor(); - // Cancel pending capture and create a new request. - cursor_captured_callback_.Reset( - base::Bind(&Pointer::OnCursorCaptured, base::Unretained(this), - gfx::ScaleToFlooredPoint( - hotspot_, - // |hotspot_| is in surface coordinate space so apply both - // device scale and UI scale. - cursor_scale_ * primary_device_scale_factor))); - surface_->window()->layer()->RequestCopyOfOutput( + std::unique_ptr<cc::CopyOutputRequest> request = cc::CopyOutputRequest::CreateBitmapRequest( - cursor_captured_callback_.callback())); + base::Bind(&Pointer::OnCursorCaptured, + cursor_capture_weak_ptr_factory_.GetWeakPtr(), + gfx::ScaleToFlooredPoint( + hotspot_, + // |hotspot_| is in surface coordinate space so apply + // both device scale and UI scale. + cursor_scale_ * primary_device_scale_factor))); + surface_->window()->layer()->RequestCopyOfOutput(std::move(request)); } void Pointer::OnCursorCaptured(const gfx::Point& hotspot,
diff --git a/components/exo/pointer.h b/components/exo/pointer.h index 262b95b..24feb2d3 100644 --- a/components/exo/pointer.h +++ b/components/exo/pointer.h
@@ -7,8 +7,8 @@ #include <memory> -#include "base/cancelable_callback.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "components/exo/surface_delegate.h" #include "components/exo/surface_observer.h" #include "components/exo/wm_helper.h" @@ -103,9 +103,8 @@ // The current cursor. ui::Cursor cursor_; - // Cancelable callback for pending cursor capture. - base::CancelableCallback<void(std::unique_ptr<cc::CopyOutputResult>)> - cursor_captured_callback_; + // Weak pointer factory used for cursor capture callbacks. + base::WeakPtrFactory<Pointer> cursor_capture_weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(Pointer); };
diff --git a/components/exo/wayland/BUILD.gn b/components/exo/wayland/BUILD.gn index 231b7bc..389b367 100644 --- a/components/exo/wayland/BUILD.gn +++ b/components/exo/wayland/BUILD.gn
@@ -31,7 +31,7 @@ deps = [ "//ash", - "//ash/public/cpp", + "//ash/public/cpp:ash_public_cpp", "//base", "//components/exo", "//device/gamepad",
diff --git a/components/history/ios/browser/BUILD.gn b/components/history/ios/browser/BUILD.gn index 05fc199..611399e 100644 --- a/components/history/ios/browser/BUILD.gn +++ b/components/history/ios/browser/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("browser") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "history_database_helper.cc", "history_database_helper.h",
diff --git a/components/history/ios/browser/web_state_top_sites_observer.mm b/components/history/ios/browser/web_state_top_sites_observer.mm index ac95a55..cdddbd9 100644 --- a/components/history/ios/browser/web_state_top_sites_observer.mm +++ b/components/history/ios/browser/web_state_top_sites_observer.mm
@@ -9,6 +9,10 @@ #include "ios/web/public/load_committed_details.h" #include "ios/web/public/navigation_item.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + DEFINE_WEB_STATE_USER_DATA_KEY(history::WebStateTopSitesObserver); namespace history {
diff --git a/components/image_fetcher/ios/BUILD.gn b/components/image_fetcher/ios/BUILD.gn new file mode 100644 index 0000000..c5c1705 --- /dev/null +++ b/components/image_fetcher/ios/BUILD.gn
@@ -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. + +source_set("ios") { + sources = [ + "ios_image_data_fetcher_wrapper.h", + "ios_image_data_fetcher_wrapper.mm", + ] + deps = [ + "//base", + "//components/image_fetcher", + "//ios/web/public/image_fetcher", + "//net", + ] + configs += [ "//build/config/compiler:enable_arc" ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "ios_image_data_fetcher_wrapper_unittest.mm", + ] + deps = [ + ":ios", + "//base", + "//ios/web/public/image_fetcher", + "//net", + "//net:test_support", + "//testing/gmock", + "//testing/gtest", + ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/components/image_fetcher/ios/DEPS b/components/image_fetcher/ios/DEPS new file mode 100644 index 0000000..0fc0ddd --- /dev/null +++ b/components/image_fetcher/ios/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+ios/web/public", +]
diff --git a/components/image_fetcher/ios/OWNERS b/components/image_fetcher/ios/OWNERS new file mode 100644 index 0000000..2d35f0a --- /dev/null +++ b/components/image_fetcher/ios/OWNERS
@@ -0,0 +1 @@ +gambard@chromium.org
diff --git a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h new file mode 100644 index 0000000..ad1e9e9 --- /dev/null +++ b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h
@@ -0,0 +1,60 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ +#define COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ + +#import <Foundation/Foundation.h> + +#include "base/memory/ref_counted.h" +#include "components/data_use_measurement/core/data_use_user_data.h" +#include "components/image_fetcher/image_data_fetcher.h" + +namespace base { +class TaskRunner; +} + +namespace net { +class URLRequestContextGetter; +} + +class GURL; + +namespace image_fetcher { + +// Callback that informs of the download of an image encoded in |data|. +using IOSImageDataFetcherCallback = void (^)(NSData* data); + +class IOSImageDataFetcherWrapper { + public: + using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; + + // The TaskRunner is used to decode the image if it is WebP-encoded. + IOSImageDataFetcherWrapper( + net::URLRequestContextGetter* url_request_context_getter, + const scoped_refptr<base::TaskRunner>& task_runner); + virtual ~IOSImageDataFetcherWrapper(); + + // Start downloading the image at the given |image_url|. The |callback| will + // be called with the downloaded image, or nil if any error happened or the + // http response header is not HTTP_OK (200). If the url is a data URL, the + // http response header is considered to be HTTP_OK. + // |callback| cannot be nil. + virtual void FetchImageDataWebpDecoded(const GURL& image_url, + IOSImageDataFetcherCallback callback); + + // Sets a service name against which to track data usage. + void SetDataUseServiceName(DataUseServiceName data_use_service_name); + + private: + // The task runner used to decode images if necessary. + const scoped_refptr<base::TaskRunner> task_runner_; + ImageDataFetcher image_data_fetcher_; + + DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); +}; + +} // namespace image_fetcher + +#endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_
diff --git a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm new file mode 100644 index 0000000..6bf24c69 --- /dev/null +++ b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm
@@ -0,0 +1,118 @@ +// 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 "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h" + +#import "base/mac/bind_objc_block.h" +#import "base/mac/scoped_nsobject.h" +#include "base/memory/ptr_util.h" +#include "base/task_runner.h" +#include "base/task_runner_util.h" +#import "ios/web/public/image_fetcher/webp_decoder.h" +#include "net/http/http_response_headers.h" +#include "net/http/http_status_code.h" +#include "net/url_request/url_fetcher.h" +#include "url/url_constants.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +#pragma mark - WebpDecoderDelegate + +namespace { + +// TODO(crbug.com/687921): Refactor this. +class WebpDecoderDelegate : public webp_transcode::WebpDecoder::Delegate { + public: + WebpDecoderDelegate() = default; + + NSData* data() const { return decoded_image_; } + + // WebpDecoder::Delegate methods + void OnFinishedDecoding(bool success) override { + if (!success) + decoded_image_ = nil; + } + void SetImageFeatures( + size_t total_size, + webp_transcode::WebpDecoder::DecodedImageFormat format) override { + decoded_image_ = [[NSMutableData alloc] initWithCapacity:total_size]; + } + void OnDataDecoded(NSData* data) override { + DCHECK(decoded_image_); + [decoded_image_ appendData:data]; + } + + private: + ~WebpDecoderDelegate() override = default; + NSMutableData* decoded_image_; + + DISALLOW_COPY_AND_ASSIGN(WebpDecoderDelegate); +}; + +// Content-type header for WebP images. +const char kWEBPFirstMagicPattern[] = "RIFF"; +const char kWEBPSecondMagicPattern[] = "WEBP"; + +// Returns a NSData object containing the decoded image. +// Returns nil in case of failure. +NSData* DecodeWebpImage(NSData* webp_image) { + scoped_refptr<WebpDecoderDelegate> delegate(new WebpDecoderDelegate); + scoped_refptr<webp_transcode::WebpDecoder> decoder( + new webp_transcode::WebpDecoder(delegate.get())); + decoder->OnDataReceived(webp_image); + DLOG_IF(ERROR, !delegate->data()) << "WebP image decoding failed."; + return delegate->data(); +} + +} // namespace + +#pragma mark - IOSImageDataFetcherWrapper + +namespace image_fetcher { + +IOSImageDataFetcherWrapper::IOSImageDataFetcherWrapper( + net::URLRequestContextGetter* url_request_context_getter, + const scoped_refptr<base::TaskRunner>& task_runner) + : task_runner_(task_runner), + image_data_fetcher_(url_request_context_getter) { + DCHECK(task_runner_.get()); +} + +IOSImageDataFetcherWrapper::~IOSImageDataFetcherWrapper() {} + +void IOSImageDataFetcherWrapper::FetchImageDataWebpDecoded( + const GURL& image_url, + IOSImageDataFetcherCallback callback) { + DCHECK(callback); + + scoped_refptr<base::TaskRunner> task_runner = task_runner_; + ImageDataFetcher::ImageDataFetcherCallback local_callback = + base::BindBlockArc(^(const std::string& image_data) { + // Create a NSData from the returned data and notify the callback. + NSData* data = + [NSData dataWithBytes:image_data.data() length:image_data.size()]; + + if (data.length < 12 || + image_data.compare(0, 4, kWEBPFirstMagicPattern) != 0 || + image_data.compare(8, 4, kWEBPSecondMagicPattern) != 0) { + callback(data); + return; + } + + // The image is a webp image. + base::PostTaskAndReplyWithResult(task_runner.get(), FROM_HERE, + base::Bind(&DecodeWebpImage, data), + base::BindBlockArc(callback)); + }); + image_data_fetcher_.FetchImageData(image_url, local_callback); +} + +void IOSImageDataFetcherWrapper::SetDataUseServiceName( + DataUseServiceName data_use_service_name) { + image_data_fetcher_.SetDataUseServiceName(data_use_service_name); +} + +} // namespace image_fetcher
diff --git a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper_unittest.mm b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper_unittest.mm new file mode 100644 index 0000000..61bf1632 --- /dev/null +++ b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper_unittest.mm
@@ -0,0 +1,255 @@ +// Copyright 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h" + +#import <UIKit/UIKit.h> + +#include "base/ios/ios_util.h" +#include "base/mac/scoped_block.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "base/memory/ref_counted.h" +#include "base/run_loop.h" +#include "base/threading/thread.h" +#include "base/threading/thread_task_runner_handle.h" +#include "build/build_config.h" +#import "ios/web/public/image_fetcher/webp_decoder.h" +#include "net/http/http_response_headers.h" +#include "net/url_request/test_url_fetcher_factory.h" +#include "net/url_request/url_fetcher_delegate.h" +#include "net/url_request/url_request_test_util.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +const unsigned char kJPGImage[] = { + 255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, + 72, 0, 72, 0, 0, 255, 254, 0, 19, 67, 114, 101, 97, 116, 101, + 100, 32, 119, 105, 116, 104, 32, 71, 73, 77, 80, 255, 219, 0, 67, + 0, 5, 3, 4, 4, 4, 3, 5, 4, 4, 4, 5, 5, 5, 6, + 7, 12, 8, 7, 7, 7, 7, 15, 11, 11, 9, 12, 17, 15, 18, + 18, 17, 15, 17, 17, 19, 22, 28, 23, 19, 20, 26, 21, 17, 17, + 24, 33, 24, 26, 29, 29, 31, 31, 31, 19, 23, 34, 36, 34, 30, + 36, 28, 30, 31, 30, 255, 219, 0, 67, 1, 5, 5, 5, 7, 6, + 7, 14, 8, 8, 14, 30, 20, 17, 20, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 255, + 192, 0, 17, 8, 0, 1, 0, 1, 3, 1, 34, 0, 2, 17, 1, + 3, 17, 1, 255, 196, 0, 21, 0, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 255, 196, 0, 20, + 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 255, 196, 0, 20, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 196, 0, 20, 17, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, + 0, 178, 192, 7, 255, 217, +}; + +const unsigned char kPNGImage[] = { + 137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, + 82, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 55, + 110, 249, 36, 0, 0, 0, 2, 98, 75, 71, 68, 0, 1, 221, 138, + 19, 164, 0, 0, 0, 9, 112, 72, 89, 115, 0, 0, 11, 18, 0, + 0, 11, 18, 1, 210, 221, 126, 252, 0, 0, 0, 9, 118, 112, 65, + 103, 0, 0, 0, 1, 0, 0, 0, 1, 0, 199, 149, 95, 237, 0, + 0, 0, 10, 73, 68, 65, 84, 8, 215, 99, 104, 0, 0, 0, 130, + 0, 129, 221, 67, 106, 244, 0, 0, 0, 25, 116, 69, 88, 116, 99, + 111, 109, 109, 101, 110, 116, 0, 67, 114, 101, 97, 116, 101, 100, 32, + 119, 105, 116, 104, 32, 71, 73, 77, 80, 231, 175, 64, 203, 0, 0, + 0, 37, 116, 69, 88, 116, 100, 97, 116, 101, 58, 99, 114, 101, 97, + 116, 101, 0, 50, 48, 49, 49, 45, 48, 54, 45, 50, 50, 84, 49, + 54, 58, 49, 54, 58, 52, 54, 43, 48, 50, 58, 48, 48, 31, 248, + 231, 223, 0, 0, 0, 37, 116, 69, 88, 116, 100, 97, 116, 101, 58, + 109, 111, 100, 105, 102, 121, 0, 50, 48, 49, 49, 45, 48, 54, 45, + 50, 50, 84, 49, 54, 58, 49, 54, 58, 52, 54, 43, 48, 50, 58, + 48, 48, 110, 165, 95, 99, 0, 0, 0, 17, 116, 69, 88, 116, 106, + 112, 101, 103, 58, 99, 111, 108, 111, 114, 115, 112, 97, 99, 101, 0, + 50, 44, 117, 85, 159, 0, 0, 0, 32, 116, 69, 88, 116, 106, 112, + 101, 103, 58, 115, 97, 109, 112, 108, 105, 110, 103, 45, 102, 97, 99, + 116, 111, 114, 0, 50, 120, 50, 44, 49, 120, 49, 44, 49, 120, 49, + 73, 250, 166, 180, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, + 130, +}; + +const unsigned char kWEBPImage[] = { + 82, 73, 70, 70, 74, 0, 0, 0, 87, 69, 66, 80, 86, 80, 56, 88, 10, + 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 76, 80, 72, + 12, 0, 0, 0, 1, 7, 16, 17, 253, 15, 68, 68, 255, 3, 0, 0, 86, + 80, 56, 32, 24, 0, 0, 0, 48, 1, 0, 157, 1, 42, 1, 0, 1, 0, + 3, 0, 52, 37, 164, 0, 3, 112, 0, 254, 251, 253, 80, 0, +}; + +const char kTestUrl[] = "http://www.img.com"; + +const char kWEBPHeaderResponse[] = + "HTTP/1.1 200 OK\0Content-type: image/webp\0\0"; + +// TODO(crbug.com/687921): Refactor this. +class WebpDecoderDelegate : public webp_transcode::WebpDecoder::Delegate { + public: + WebpDecoderDelegate() = default; + NSData* data() const { return decoded_image_; } + + void OnFinishedDecoding(bool success) override {} + void SetImageFeatures( + size_t total_size, + webp_transcode::WebpDecoder::DecodedImageFormat format) override { + decoded_image_ = [[NSMutableData alloc] initWithCapacity:total_size]; + } + void OnDataDecoded(NSData* data) override { + [decoded_image_ appendData:data]; + } + + private: + ~WebpDecoderDelegate() override {} + NSMutableData* decoded_image_; + + DISALLOW_COPY_AND_ASSIGN(WebpDecoderDelegate); +}; + +// Returns a NSData object containing the decoded image. +NSData* DecodedWebpImage() { + scoped_refptr<WebpDecoderDelegate> delegate(new WebpDecoderDelegate); + scoped_refptr<webp_transcode::WebpDecoder> decoder( + new webp_transcode::WebpDecoder(delegate.get())); + decoder->OnDataReceived([NSData + dataWithBytes:reinterpret_cast<const char*>(kWEBPImage) + length:sizeof(kWEBPImage)]); + return delegate->data(); +} + +} // namespace + +namespace image_fetcher { + +class IOSImageDataFetcherWrapperTest : public PlatformTest { + protected: + IOSImageDataFetcherWrapperTest() + : callback_([^(NSData* data) { + result_data_ = data; + result_ = [UIImage imageWithData:data]; + called_ = true; + } copy]) { + image_fetcher_ = base::MakeUnique<IOSImageDataFetcherWrapper>( + new net::TestURLRequestContextGetter(message_loop_.task_runner()), + message_loop_.task_runner()); + } + + net::TestURLFetcher* SetupFetcher() { + image_fetcher_->FetchImageDataWebpDecoded(GURL(kTestUrl), callback_); + EXPECT_EQ(nil, result_); + EXPECT_EQ(false, called_); + net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); + DCHECK(fetcher); + DCHECK(fetcher->delegate()); + return fetcher; + } + + // Message loop for the main test thread. + base::MessageLoop message_loop_; + + base::mac::ScopedBlock<IOSImageDataFetcherCallback> callback_; + net::TestURLFetcherFactory factory_; + std::unique_ptr<IOSImageDataFetcherWrapper> image_fetcher_; + NSData* result_data_ = nil; + UIImage* result_ = nil; + bool called_ = false; + + private: + DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapperTest); +}; + +TEST_F(IOSImageDataFetcherWrapperTest, TestError) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(404); + fetcher->delegate()->OnURLFetchComplete(fetcher); + EXPECT_EQ(nil, result_); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestJpg) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString( + std::string(reinterpret_cast<const char*>(kJPGImage), sizeof(kJPGImage))); + fetcher->delegate()->OnURLFetchComplete(fetcher); + EXPECT_NE(nil, result_); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestPng) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString( + std::string(reinterpret_cast<const char*>(kPNGImage), sizeof(kPNGImage))); + fetcher->delegate()->OnURLFetchComplete(fetcher); + EXPECT_NE(nil, result_); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestGoodWebP) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString(std::string( + reinterpret_cast<const char*>(kWEBPImage), sizeof(kWEBPImage))); + scoped_refptr<net::HttpResponseHeaders> headers(new net::HttpResponseHeaders( + std::string(kWEBPHeaderResponse, arraysize(kWEBPHeaderResponse)))); + fetcher->set_response_headers(headers); + fetcher->delegate()->OnURLFetchComplete(fetcher); + base::RunLoop().RunUntilIdle(); + EXPECT_NE(nil, result_); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestGoodWebPNoHeader) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString(std::string( + reinterpret_cast<const char*>(kWEBPImage), sizeof(kWEBPImage))); + fetcher->delegate()->OnURLFetchComplete(fetcher); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE([DecodedWebpImage() isEqualToData:result_data_]); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestBadWebP) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString("This is not a valid WebP image"); + scoped_refptr<net::HttpResponseHeaders> headers(new net::HttpResponseHeaders( + std::string(kWEBPHeaderResponse, arraysize(kWEBPHeaderResponse)))); + fetcher->set_response_headers(headers); + fetcher->delegate()->OnURLFetchComplete(fetcher); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(nil, result_); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, DeleteDuringWebPDecoding) { + net::TestURLFetcher* fetcher = SetupFetcher(); + fetcher->set_response_code(200); + fetcher->SetResponseString(std::string( + reinterpret_cast<const char*>(kWEBPImage), sizeof(kWEBPImage))); + fetcher->delegate()->OnURLFetchComplete(fetcher); + // Delete the image fetcher, and check that the callback is called. + image_fetcher_.reset(); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE([DecodedWebpImage() isEqualToData:result_data_]); + EXPECT_TRUE(called_); +} + +TEST_F(IOSImageDataFetcherWrapperTest, TestCallbacksNotCalledDuringDeletion) { + image_fetcher_->FetchImageDataWebpDecoded(GURL(kTestUrl), callback_); + image_fetcher_.reset(); + EXPECT_FALSE(called_); +} + +} // namespace image_fetcher
diff --git a/components/nacl/broker/BUILD.gn b/components/nacl/broker/BUILD.gn index aaf1de8..252ab4da 100644 --- a/components/nacl/broker/BUILD.gn +++ b/components/nacl/broker/BUILD.gn
@@ -167,7 +167,6 @@ "//components/policy:generated", "//content/public/common:static_switches", "//ipc", - "//third_party/kasko", ] } }
diff --git a/components/password_manager/core/browser/credential_manager_pending_request_task.cc b/components/password_manager/core/browser/credential_manager_pending_request_task.cc index a3a3747..63c79bb0 100644 --- a/components/password_manager/core/browser/credential_manager_pending_request_task.cc +++ b/components/password_manager/core/browser/credential_manager_pending_request_task.cc
@@ -26,8 +26,10 @@ // Send a UMA histogram about if |local_results| has empty or duplicate // usernames. -void ReportAccountChooserUsabilityMetrics(bool had_duplicates, - bool had_empty_username) { +void ReportAccountChooserUsabilityMetrics( + const std::vector<std::unique_ptr<autofill::PasswordForm>>& forms, + bool had_duplicates, + bool had_empty_username) { metrics_util::AccountChooserUsabilityMetric metric; if (had_empty_username && had_duplicates) metric = metrics_util::ACCOUNT_CHOOSER_EMPTY_USERNAME_AND_DUPLICATES; @@ -37,7 +39,14 @@ metric = metrics_util::ACCOUNT_CHOOSER_DUPLICATES; else metric = metrics_util::ACCOUNT_CHOOSER_LOOKS_OK; - metrics_util::LogAccountChooserUsability(metric); + + int count_empty_icons = + std::count_if(forms.begin(), forms.end(), + [](const std::unique_ptr<autofill::PasswordForm>& form) { + return !form->icon_url.is_valid(); + }); + metrics_util::LogAccountChooserUsability(metric, count_empty_icons, + forms.size()); } // Returns true iff |form1| is better suitable for showing in the account @@ -125,7 +134,8 @@ if (results.empty()) { // Try to migrate the HTTP passwords and process them later. http_migrator_ = base::MakeUnique<HttpPasswordMigrator>( - origin_, delegate_->client()->GetPasswordStore(), this); + origin_, HttpPasswordMigrator::MigrationMode::COPY, + delegate_->client()->GetPasswordStore(), this); return; } ProcessForms(std::move(results)); @@ -242,7 +252,8 @@ return; } - ReportAccountChooserUsabilityMetrics(has_duplicates, has_empty_username); + ReportAccountChooserUsabilityMetrics(local_results, has_duplicates, + has_empty_username); if (!delegate_->client()->PromptUserToChooseCredentials( std::move(local_results), origin_, base::Bind(
diff --git a/components/password_manager/core/browser/form_fetcher_impl.cc b/components/password_manager/core/browser/form_fetcher_impl.cc index e4f8ed6..6bff00d 100644 --- a/components/password_manager/core/browser/form_fetcher_impl.cc +++ b/components/password_manager/core/browser/form_fetcher_impl.cc
@@ -111,7 +111,8 @@ if (should_migrate_http_passwords_ && results.empty() && form_digest_.origin.SchemeIs(url::kHttpsScheme)) { http_migrator_ = base::MakeUnique<HttpPasswordMigrator>( - form_digest_.origin, client_->GetPasswordStore(), this); + form_digest_.origin, HttpPasswordMigrator::MigrationMode::COPY, + client_->GetPasswordStore(), this); return; }
diff --git a/components/password_manager/core/browser/http_password_migrator.cc b/components/password_manager/core/browser/http_password_migrator.cc index da6eb67c..700327ca 100644 --- a/components/password_manager/core/browser/http_password_migrator.cc +++ b/components/password_manager/core/browser/http_password_migrator.cc
@@ -12,9 +12,10 @@ namespace password_manager { HttpPasswordMigrator::HttpPasswordMigrator(const GURL& https_origin, + MigrationMode mode, PasswordStore* password_store, Consumer* consumer) - : consumer_(consumer), password_store_(password_store) { + : mode_(mode), consumer_(consumer), password_store_(password_store) { DCHECK(password_store_); DCHECK(https_origin.is_valid()); DCHECK(https_origin.SchemeIs(url::kHttpsScheme)) << https_origin; @@ -40,21 +41,27 @@ }), results.end()); - // Add the new credentials to the password store. The HTTP forms aren't - // removed for now. + // Add the new credentials to the password store. The HTTP forms are + // removed iff |mode_| == MigrationMode::MOVE. for (const auto& form : results) { + autofill::PasswordForm new_form = *form; + GURL::Replacements rep; rep.SetSchemeStr(url::kHttpsScheme); - form->origin = form->origin.ReplaceComponents(rep); - form->signon_realm = form->origin.spec(); + new_form.origin = form->origin.ReplaceComponents(rep); + new_form.signon_realm = new_form.origin.spec(); // If |action| is not HTTPS then it's most likely obsolete. Otherwise, it // may still be valid. if (!form->action.SchemeIs(url::kHttpsScheme)) - form->action = form->origin; - form->form_data = autofill::FormData(); - form->generation_upload_status = autofill::PasswordForm::NO_SIGNAL_SENT; - form->skip_zero_click = false; - password_store_->AddLogin(*form); + new_form.action = new_form.origin; + new_form.form_data = autofill::FormData(); + new_form.generation_upload_status = autofill::PasswordForm::NO_SIGNAL_SENT; + new_form.skip_zero_click = false; + password_store_->AddLogin(new_form); + + if (mode_ == MigrationMode::MOVE) + password_store_->RemoveLogin(*form); + *form = std::move(new_form); } metrics_util::LogCountHttpMigratedPasswords(results.size());
diff --git a/components/password_manager/core/browser/http_password_migrator.h b/components/password_manager/core/browser/http_password_migrator.h index cf054487..7d9d096 100644 --- a/components/password_manager/core/browser/http_password_migrator.h +++ b/components/password_manager/core/browser/http_password_migrator.h
@@ -25,6 +25,11 @@ // origin. class HttpPasswordMigrator : public PasswordStoreConsumer { public: + enum class MigrationMode { + MOVE, // HTTP credentials are deleted after migration to HTTPS. + COPY, // HTTP credentials are kept after migration to HTTPS. + }; + // API to be implemented by an embedder of HttpPasswordMigrator. class Consumer { public: @@ -38,6 +43,7 @@ // |https_origin| should specify a valid HTTPS URL. HttpPasswordMigrator(const GURL& https_origin, + MigrationMode mode, PasswordStore* password_store, Consumer* consumer); ~HttpPasswordMigrator() override; @@ -47,6 +53,7 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; private: + const MigrationMode mode_; Consumer* consumer_; PasswordStore* password_store_;
diff --git a/components/password_manager/core/browser/http_password_migrator_unittest.cc b/components/password_manager/core/browser/http_password_migrator_unittest.cc index e536f10..76cc593 100644 --- a/components/password_manager/core/browser/http_password_migrator_unittest.cc +++ b/components/password_manager/core/browser/http_password_migrator_unittest.cc
@@ -85,6 +85,10 @@ MockConsumer& consumer() { return consumer_; } MockPasswordStore& store() { return *mock_store_; } + protected: + void TestEmptyStore(HttpPasswordMigrator::MigrationMode mode); + void TestFullStore(HttpPasswordMigrator::MigrationMode mode); + private: base::MessageLoop message_loop_; // Used by mock_store_. MockConsumer consumer_; @@ -93,22 +97,26 @@ DISALLOW_COPY_AND_ASSIGN(HttpPasswordMigratorTest); }; -TEST_F(HttpPasswordMigratorTest, EmptyStore) { +void HttpPasswordMigratorTest::TestEmptyStore( + HttpPasswordMigrator::MigrationMode mode) { PasswordStore::FormDigest form(autofill::PasswordForm::SCHEME_HTML, kTestHttpURL, GURL(kTestHttpURL)); EXPECT_CALL(store(), GetLogins(form, _)); - HttpPasswordMigrator migrator(GURL(kTestHttpsURL), &store(), &consumer()); + HttpPasswordMigrator migrator(GURL(kTestHttpsURL), mode, &store(), + &consumer()); EXPECT_CALL(consumer(), ProcessForms(std::vector<autofill::PasswordForm*>())); migrator.OnGetPasswordStoreResults( std::vector<std::unique_ptr<autofill::PasswordForm>>()); } -TEST_F(HttpPasswordMigratorTest, FullStore) { +void HttpPasswordMigratorTest::TestFullStore( + HttpPasswordMigrator::MigrationMode mode) { PasswordStore::FormDigest form_digest(autofill::PasswordForm::SCHEME_HTML, kTestHttpURL, GURL(kTestHttpURL)); EXPECT_CALL(store(), GetLogins(form_digest, _)); - HttpPasswordMigrator migrator(GURL(kTestHttpsURL), &store(), &consumer()); + HttpPasswordMigrator migrator(GURL(kTestHttpsURL), mode, &store(), + &consumer()); PasswordForm form = CreateTestForm(); PasswordForm psl_form = CreateTestPSLForm(); @@ -118,6 +126,8 @@ expected_form.signon_realm = expected_form.origin.spec(); EXPECT_CALL(store(), AddLogin(expected_form)); + EXPECT_CALL(store(), RemoveLogin(form)) + .Times(mode == HttpPasswordMigrator::MigrationMode::MOVE); EXPECT_CALL(consumer(), ProcessForms(ElementsAre(Pointee(expected_form)))); std::vector<std::unique_ptr<autofill::PasswordForm>> results; results.push_back(base::MakeUnique<PasswordForm>(psl_form)); @@ -126,5 +136,21 @@ migrator.OnGetPasswordStoreResults(std::move(results)); } +TEST_F(HttpPasswordMigratorTest, EmptyStoreWithMove) { + TestEmptyStore(HttpPasswordMigrator::MigrationMode::MOVE); +} + +TEST_F(HttpPasswordMigratorTest, EmptyStoreWithCopy) { + TestEmptyStore(HttpPasswordMigrator::MigrationMode::COPY); +} + +TEST_F(HttpPasswordMigratorTest, FullStoreWithMove) { + TestFullStore(HttpPasswordMigrator::MigrationMode::MOVE); +} + +TEST_F(HttpPasswordMigratorTest, FullStoreWithCopy) { + TestFullStore(HttpPasswordMigrator::MigrationMode::COPY); +} + } // namespace } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc index 6151969..6ddc53f1 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.cc +++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -114,9 +114,15 @@ UMA_HISTOGRAM_COUNTS_100("PasswordManager.HttpPasswordMigrationCount", count); } -void LogAccountChooserUsability(AccountChooserUsabilityMetric usability) { +void LogAccountChooserUsability(AccountChooserUsabilityMetric usability, + int count_empty_icons, + int count_accounts) { UMA_HISTOGRAM_ENUMERATION("PasswordManager.AccountChooserDialogUsability", usability, ACCOUNT_CHOOSER_USABILITY_COUNT); + UMA_HISTOGRAM_COUNTS_100("PasswordManager.AccountChooserDialogEmptyAvatars", + count_empty_icons); + UMA_HISTOGRAM_COUNTS_100("PasswordManager.AccountChooserDialogAccounts", + count_accounts); } void LogCredentialManagerGetResult(CredentialManagerGetResult result,
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h index 2df5d745..29cb551c 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.h +++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -228,8 +228,11 @@ // Logs number of passwords migrated from HTTP to HTTPS. void LogCountHttpMigratedPasswords(int count); -// Log if the account chooser has empty username or duplicate usernames. -void LogAccountChooserUsability(AccountChooserUsabilityMetric usability); +// Log if the account chooser has empty username or duplicate usernames. In +// addition record number of the placeholder avatars and total number of rows. +void LogAccountChooserUsability(AccountChooserUsabilityMetric usability, + int count_empty_icons, + int count_accounts); // Log the result of navigator.credentials.get. |status| specifies the // "unmediated" parameter of the API method.
diff --git a/components/pdf/browser/BUILD.gn b/components/pdf/browser/BUILD.gn index 8ec86e9..99f85ad 100644 --- a/components/pdf/browser/BUILD.gn +++ b/components/pdf/browser/BUILD.gn
@@ -6,7 +6,6 @@ static_library("browser") { sources = [ - "open_pdf_in_reader_prompt_client.h", "pdf_web_contents_helper.cc", "pdf_web_contents_helper.h", "pdf_web_contents_helper_client.h",
diff --git a/components/pdf/browser/open_pdf_in_reader_prompt_client.h b/components/pdf/browser/open_pdf_in_reader_prompt_client.h deleted file mode 100644 index 854e6f4..0000000 --- a/components/pdf/browser/open_pdf_in_reader_prompt_client.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_PDF_BROWSER_OPEN_PDF_IN_READER_PROMPT_CLIENT_H_ -#define COMPONENTS_PDF_BROWSER_OPEN_PDF_IN_READER_PROMPT_CLIENT_H_ - -#include "base/strings/string16.h" - -namespace content { -struct LoadCommittedDetails; -} - -namespace pdf { - -class OpenPDFInReaderPromptClient { - public: - virtual ~OpenPDFInReaderPromptClient() {} - - virtual base::string16 GetMessageText() const = 0; - - virtual base::string16 GetAcceptButtonText() const = 0; - - virtual base::string16 GetCancelButtonText() const = 0; - - virtual bool ShouldExpire( - const content::LoadCommittedDetails& details) const = 0; - - virtual void Accept() = 0; - - virtual void Cancel() = 0; -}; - -} // namespace pdf - -#endif // COMPONENTS_PDF_BROWSER_OPEN_PDF_IN_READER_PROMPT_CLIENT_H_
diff --git a/components/pdf/browser/pdf_web_contents_helper.cc b/components/pdf/browser/pdf_web_contents_helper.cc index ae931d4e..e425338 100644 --- a/components/pdf/browser/pdf_web_contents_helper.cc +++ b/components/pdf/browser/pdf_web_contents_helper.cc
@@ -8,10 +8,8 @@ #include "base/bind.h" #include "base/strings/utf_string_conversions.h" -#include "components/pdf/browser/open_pdf_in_reader_prompt_client.h" #include "components/pdf/browser/pdf_web_contents_helper_client.h" #include "components/pdf/common/pdf_messages.h" -#include "content/public/browser/navigation_details.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(pdf::PDFWebContentsHelper); @@ -35,12 +33,6 @@ PDFWebContentsHelper::~PDFWebContentsHelper() { } -void PDFWebContentsHelper::ShowOpenInReaderPrompt( - std::unique_ptr<OpenPDFInReaderPromptClient> prompt) { - open_in_reader_prompt_ = std::move(prompt); - UpdateLocationBar(); -} - bool PDFWebContentsHelper::OnMessageReceived( const IPC::Message& message, content::RenderFrameHost* render_frame_host) { @@ -56,20 +48,6 @@ return handled; } -void PDFWebContentsHelper::DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) { - if (open_in_reader_prompt_.get() && - open_in_reader_prompt_->ShouldExpire(details)) { - open_in_reader_prompt_.reset(); - UpdateLocationBar(); - } -} - -void PDFWebContentsHelper::UpdateLocationBar() { - client_->UpdateLocationBar(web_contents()); -} - void PDFWebContentsHelper::OnHasUnsupportedFeature() { client_->OnPDFHasUnsupportedFeature(web_contents()); }
diff --git a/components/pdf/browser/pdf_web_contents_helper.h b/components/pdf/browser/pdf_web_contents_helper.h index 85d7d02a..c9a2e58 100644 --- a/components/pdf/browser/pdf_web_contents_helper.h +++ b/components/pdf/browser/pdf_web_contents_helper.h
@@ -20,7 +20,6 @@ namespace pdf { -class OpenPDFInReaderPromptClient; class PDFWebContentsHelperClient; // Per-WebContents class to handle PDF messages. @@ -32,13 +31,6 @@ content::WebContents* contents, std::unique_ptr<PDFWebContentsHelperClient> client); - OpenPDFInReaderPromptClient* open_in_reader_prompt() const { - return open_in_reader_prompt_.get(); - } - - void ShowOpenInReaderPrompt( - std::unique_ptr<OpenPDFInReaderPromptClient> prompt); - private: PDFWebContentsHelper(content::WebContents* web_contents, std::unique_ptr<PDFWebContentsHelperClient> client); @@ -47,21 +39,12 @@ // content::WebContentsObserver overrides: bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override; - void DidNavigateMainFrame( - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) override; - - // Internal helpers ---------------------------------------------------------- - - void UpdateLocationBar(); // Message handlers. void OnHasUnsupportedFeature(); void OnSaveURLAs(const GURL& url, const content::Referrer& referrer); void OnUpdateContentRestrictions(int content_restrictions); - // The model for the confirmation prompt to open a PDF in Adobe Reader. - std::unique_ptr<OpenPDFInReaderPromptClient> open_in_reader_prompt_; std::unique_ptr<PDFWebContentsHelperClient> client_; DISALLOW_COPY_AND_ASSIGN(PDFWebContentsHelper);
diff --git a/components/pdf/browser/pdf_web_contents_helper_client.h b/components/pdf/browser/pdf_web_contents_helper_client.h index eb983bf4..9a6ae89 100644 --- a/components/pdf/browser/pdf_web_contents_helper_client.h +++ b/components/pdf/browser/pdf_web_contents_helper_client.h
@@ -19,8 +19,6 @@ public: virtual ~PDFWebContentsHelperClient() {} - virtual void UpdateLocationBar(content::WebContents* contents) = 0; - virtual void UpdateContentRestrictions(content::WebContents* contents, int content_restrictions) = 0;
diff --git a/components/physical_web/webui/resources/physical_web.css b/components/physical_web/webui/resources/physical_web.css index 94a671e..2929820 100644 --- a/components/physical_web/webui/resources/physical_web.css +++ b/components/physical_web/webui/resources/physical_web.css
@@ -44,6 +44,7 @@ .physicalWebText .description { display: block; height: 2.5em; + line-height: 1.25; font-size: 90%; color: #444; overflow: hidden;
diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc index 3806bc9..df82562 100644 --- a/components/previews/core/previews_experiments.cc +++ b/components/previews/core/previews_experiments.cc
@@ -64,6 +64,12 @@ const char kOfflinePreviewFreshnessDurationInDays[] = "offline_preview_freshness_duration_in_days"; +// The threshold of EffectiveConnectionType above which previews will not be +// served. +// See net/nqe/effective_connection_type.h for mapping from string to value. +const char kEffectiveConnectionTypeThreshold[] = + "max_allowed_effective_connection_type"; + // The string that corresponds to enabled for the variation param experiments. const char kExperimentEnabled[] = "true"; @@ -158,6 +164,16 @@ return base::TimeDelta::FromDays(duration); } +net::EffectiveConnectionType EffectiveConnectionTypeThreshold() { + std::string param_value = ParamValue(kEffectiveConnectionTypeThreshold); + net::EffectiveConnectionType effective_connection_type; + if (!net::GetEffectiveConnectionTypeForName(param_value, + &effective_connection_type)) { + effective_connection_type = net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G; + } + return effective_connection_type; +} + } // namespace params bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
diff --git a/components/previews/core/previews_experiments.h b/components/previews/core/previews_experiments.h index 021db0a..ad0bded 100644 --- a/components/previews/core/previews_experiments.h +++ b/components/previews/core/previews_experiments.h
@@ -6,6 +6,7 @@ #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ #include "base/time/time.h" +#include "net/nqe/effective_connection_type.h" namespace previews { @@ -43,6 +44,10 @@ // shown as a preview. base::TimeDelta OfflinePreviewFreshnessDuration(); +// The threshold of EffectiveConnectionType above which previews should not be +// served. +net::EffectiveConnectionType EffectiveConnectionTypeThreshold(); + } // namespace params enum class PreviewsType {
diff --git a/components/previews/core/previews_experiments_unittest.cc b/components/previews/core/previews_experiments_unittest.cc index e5d9573..faf92cc 100644 --- a/components/previews/core/previews_experiments_unittest.cc +++ b/components/previews/core/previews_experiments_unittest.cc
@@ -4,17 +4,145 @@ #include "components/previews/core/previews_experiments.h" +#include <string> + #include "base/metrics/field_trial.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" +#include "components/variations/variations_associated_data.h" + #include "testing/gtest/include/gtest/gtest.h" +namespace previews { + namespace { using PreviewsExperimentsTest = testing::Test; +// Used as field trial values. Somewhat random yet valid values. +const char kMaxStoredHistoryLengthPerHost[] = "3"; +const char kMaxStoredHistoryLengthHostIndifferent[] = "4"; +const char kMaxHostsInBlackList[] = "13"; +const char kPerHostOptOutThreshold[] = "12"; +const char kHostIndifferentOptOutThreshold[] = "84"; +const char kPerHostBlackListDurationInDays[] = "99"; +const char kHostIndifferentBlackListDurationInDays[] = "64"; +const char kSingleOptOutDurationInSeconds[] = "28"; +const char kOfflinePreviewFreshnessDurationInDays[] = "12"; +const char kEffectiveConnectionTypeThreshold[] = "4G"; + +// Verifies that the default params are the expected values. +void VerifyDefaultParams() { + EXPECT_EQ(4u, params::MaxStoredHistoryLengthForPerHostBlackList()); + EXPECT_EQ(10u, params::MaxStoredHistoryLengthForHostIndifferentBlackList()); + EXPECT_EQ(100u, params::MaxInMemoryHostsInBlackList()); + EXPECT_EQ(2, params::PerHostBlackListOptOutThreshold()); + EXPECT_EQ(4, params::HostIndifferentBlackListOptOutThreshold()); + EXPECT_EQ(base::TimeDelta::FromDays(30), params::PerHostBlackListDuration()); + EXPECT_EQ(base::TimeDelta::FromDays(365 * 100), + params::HostIndifferentBlackListPerHostDuration()); + EXPECT_EQ(base::TimeDelta::FromSeconds(60 * 5), + params::SingleOptOutDuration()); + EXPECT_EQ(base::TimeDelta::FromDays(7), + params::OfflinePreviewFreshnessDuration()); + EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G, + params::EffectiveConnectionTypeThreshold()); +} + +// Creates a map of the params names to the const string values above. +std::map<std::string, std::string> GetFieldTrialParams() { + std::map<std::string, std::string> params; + // Assign different values than defaults. + params["per_host_max_stored_history_length"] = kMaxStoredHistoryLengthPerHost; + params["host_indifferent_max_stored_history_length"] = + kMaxStoredHistoryLengthHostIndifferent; + params["max_hosts_in_blacklist"] = kMaxHostsInBlackList; + params["per_host_opt_out_threshold"] = kPerHostOptOutThreshold; + params["host_indifferent_opt_out_threshold"] = + kHostIndifferentOptOutThreshold; + params["per_host_black_list_duration_in_days"] = + kPerHostBlackListDurationInDays; + params["host_indifferent_black_list_duration_in_days"] = + kHostIndifferentBlackListDurationInDays; + params["single_opt_out_duration_in_seconds"] = kSingleOptOutDurationInSeconds; + params["offline_preview_freshness_duration_in_days"] = + kOfflinePreviewFreshnessDurationInDays; + params["max_allowed_effective_connection_type"] = + kEffectiveConnectionTypeThreshold; + + return params; +} + +// Verifies that calling the params methods returns the correct values based on +// the const string values above. +void VerifyNewParams() { + { + size_t history_length; + EXPECT_TRUE( + base::StringToSizeT(kMaxStoredHistoryLengthPerHost, &history_length)); + EXPECT_EQ(history_length, + params::MaxStoredHistoryLengthForPerHostBlackList()); + } + { + size_t history_length; + EXPECT_TRUE(base::StringToSizeT(kMaxStoredHistoryLengthHostIndifferent, + &history_length)); + EXPECT_EQ(history_length, + params::MaxStoredHistoryLengthForHostIndifferentBlackList()); + } + { + size_t history_length; + EXPECT_TRUE(base::StringToSizeT(kMaxHostsInBlackList, &history_length)); + EXPECT_EQ(history_length, params::MaxInMemoryHostsInBlackList()); + } + { + int threshold; + EXPECT_TRUE(base::StringToInt(kPerHostOptOutThreshold, &threshold)); + EXPECT_EQ(threshold, params::PerHostBlackListOptOutThreshold()); + } + { + int threshold; + EXPECT_TRUE(base::StringToInt(kHostIndifferentOptOutThreshold, &threshold)); + EXPECT_EQ(threshold, params::HostIndifferentBlackListOptOutThreshold()); + } + { + int days; + EXPECT_TRUE(base::StringToInt(kPerHostBlackListDurationInDays, &days)); + EXPECT_EQ(base::TimeDelta::FromDays(days), + params::PerHostBlackListDuration()); + } + { + int days; + EXPECT_TRUE( + base::StringToInt(kHostIndifferentBlackListDurationInDays, &days)); + EXPECT_EQ(base::TimeDelta::FromDays(days), + params::HostIndifferentBlackListPerHostDuration()); + } + { + int seconds; + EXPECT_TRUE(base::StringToInt(kSingleOptOutDurationInSeconds, &seconds)); + EXPECT_EQ(base::TimeDelta::FromSeconds(seconds), + params::SingleOptOutDuration()); + } + { + int days; + EXPECT_TRUE( + base::StringToInt(kOfflinePreviewFreshnessDurationInDays, &days)); + EXPECT_EQ(base::TimeDelta::FromDays(days), + params::OfflinePreviewFreshnessDuration()); + } + { + net::EffectiveConnectionType effective_connection_type; + EXPECT_TRUE(net::GetEffectiveConnectionTypeForName( + kEffectiveConnectionTypeThreshold, &effective_connection_type)); + EXPECT_EQ(effective_connection_type, + params::EffectiveConnectionTypeThreshold()); + } +} + } // namespace -namespace previews { - +// Verifies that we can enable offline previews via field trial. TEST_F(PreviewsExperimentsTest, TestFieldTrialOfflinePage) { EXPECT_FALSE(IsIncludedInClientSidePreviewsExperimentsFieldTrial()); EXPECT_FALSE(IsPreviewsTypeEnabled(PreviewsType::OFFLINE)); @@ -24,6 +152,20 @@ EXPECT_TRUE(IsIncludedInClientSidePreviewsExperimentsFieldTrial()); EXPECT_TRUE(IsPreviewsTypeEnabled(PreviewsType::OFFLINE)); + variations::testing::ClearAllVariationParams(); +} + +// Verifies that we can enable offline previews via field trial and that the +// default params for previews field trials are accurate. +TEST_F(PreviewsExperimentsTest, TestAllDefaultParams) { + VerifyDefaultParams(); + base::FieldTrialList field_trial_list(nullptr); + EXPECT_TRUE(variations::AssociateVariationParams( + "ClientSidePreviews", "Enabled", GetFieldTrialParams())); + EXPECT_TRUE( + base::FieldTrialList::CreateFieldTrial("ClientSidePreviews", "Enabled")); + VerifyNewParams(); + variations::testing::ClearAllVariationParams(); } } // namespace previews
diff --git a/components/previews/core/previews_io_data.cc b/components/previews/core/previews_io_data.cc index 9c333b2..0a7af37 100644 --- a/components/previews/core/previews_io_data.cc +++ b/components/previews/core/previews_io_data.cc
@@ -113,7 +113,7 @@ return false; } if (network_quality_estimator->GetEffectiveConnectionType() > - net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G) { + params::EffectiveConnectionTypeThreshold()) { LogPreviewsEligibilityReason(PreviewsEligibilityReason::NETWORK_NOT_SLOW, type); return false;
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc index 89c4601..00a3863 100644 --- a/components/printing/renderer/print_web_view_helper.cc +++ b/components/printing/renderer/print_web_view_helper.cc
@@ -1855,11 +1855,16 @@ int dpi = static_cast<int>(params.params.dpi); // Calculate the actual page size and content area in dpi. if (page_size_in_dpi) { + // Windows uses this for the actual page size. We have scaled page size + // to get blink to reflow the page, so scale it back to the real size + // before returning it. *page_size_in_dpi = gfx::Size(static_cast<int>(ConvertUnitDouble(page_size.width(), - kPointsPerInch, dpi)), + kPointsPerInch, dpi) * + css_scale_factor), static_cast<int>(ConvertUnitDouble(page_size.height(), - kPointsPerInch, dpi))); + kPointsPerInch, dpi) * + css_scale_factor)); } if (content_area_in_dpi) {
diff --git a/components/safe_browsing/base_blocking_page.cc b/components/safe_browsing/base_blocking_page.cc index 8a6db51..2b3f8e2 100644 --- a/components/safe_browsing/base_blocking_page.cc +++ b/components/safe_browsing/base_blocking_page.cc
@@ -62,10 +62,9 @@ // static const SafeBrowsingErrorUI::SBErrorDisplayOptions -BaseBlockingPage::CreateDefaultDisplayOptions( - const UnsafeResourceList& unsafe_resources) { +BaseBlockingPage::CreateDefaultDisplayOptions() { return SafeBrowsingErrorUI::SBErrorDisplayOptions( - IsMainPageLoadBlocked(unsafe_resources), + true, // IsMainPageLoadBlocked() false, // kSafeBrowsingExtendedReportingOptInAllowed false, // is_off_the_record false, // is_extended_reporting @@ -97,7 +96,7 @@ ui_manager->history_service(web_contents), ui_manager->app_locale(), ui_manager->default_safe_page()), - CreateDefaultDisplayOptions(resources)); + CreateDefaultDisplayOptions()); blocking_page->Show(); return; }
diff --git a/components/safe_browsing/base_blocking_page.h b/components/safe_browsing/base_blocking_page.h index 3e031bba..f1cb3a90 100644 --- a/components/safe_browsing/base_blocking_page.h +++ b/components/safe_browsing/base_blocking_page.h
@@ -35,7 +35,7 @@ ~BaseBlockingPage() override; static const SafeBrowsingErrorUI::SBErrorDisplayOptions - CreateDefaultDisplayOptions(const UnsafeResourceList& unsafe_resources); + CreateDefaultDisplayOptions(); // Shows a blocking page warning the user about phishing/malware for a // specific resource.
diff --git a/components/safe_browsing/common/safebrowsing_messages.h b/components/safe_browsing/common/safebrowsing_messages.h index 1432398..1e55f1a 100644 --- a/components/safe_browsing/common/safebrowsing_messages.h +++ b/components/safe_browsing/common/safebrowsing_messages.h
@@ -15,6 +15,9 @@ // A node is essentially a frame. IPC_STRUCT_BEGIN(SafeBrowsingHostMsg_ThreatDOMDetails_Node) + // A unique ID for this node, unique to the current Render Frame. + IPC_STRUCT_MEMBER(int, node_id) + // URL of this resource. Can be empty. IPC_STRUCT_MEMBER(GURL, url) @@ -25,8 +28,14 @@ // URL of the parent node. Can be empty. IPC_STRUCT_MEMBER(GURL, parent) + // The unique ID of the parent node. Can be 0 if this is the top node. + IPC_STRUCT_MEMBER(int, parent_node_id) + // children of this node. Can be emtpy. IPC_STRUCT_MEMBER(std::vector<GURL>, children) + + // The unique IDs of the child nodes. Can be empty if there are no children. + IPC_STRUCT_MEMBER(std::vector<int>, child_node_ids) IPC_STRUCT_END() // SafeBrowsing client-side detection messages sent from the renderer to the
diff --git a/components/safe_browsing_db/android/safe_browsing_api_handler_bridge.cc b/components/safe_browsing_db/android/safe_browsing_api_handler_bridge.cc index c51337c..6798dd03 100644 --- a/components/safe_browsing_db/android/safe_browsing_api_handler_bridge.cc +++ b/components/safe_browsing_db/android/safe_browsing_api_handler_bridge.cc
@@ -102,16 +102,12 @@ callback_id)); if (result_status != RESULT_STATUS_SUCCESS) { - // TODO(nparker): If the API is consistently failing, we might want to - // turn it off altogether and retest periodically. This would - // alleviate a bad experience if GMSCore is somehow busted. if (result_status == RESULT_STATUS_TIMEOUT) { ReportUmaResult(UMA_STATUS_TIMEOUT); VLOG(1) << "Safe browsing API call timed-out"; } else { DCHECK_EQ(result_status, RESULT_STATUS_INTERNAL_ERROR); ReportUmaResult(UMA_STATUS_INTERNAL_ERROR); - LOG(WARNING) << "Safe browsing API had internal error"; } RunCallbackOnIOThread(callback.release(), SB_THREAT_TYPE_SAFE, ThreatMetadata());
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver.cc index 421c4b5..e54de762 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_driver.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver.cc
@@ -16,13 +16,13 @@ ContentSubresourceFilterDriver::~ContentSubresourceFilterDriver() {} void ContentSubresourceFilterDriver::ActivateForProvisionalLoad( - ActivationState activation_state, + ActivationLevel activation_level, const GURL& url, bool measure_performance) { // Must use legacy IPC to ensure the activation message arrives in-order, i.e. // before the load is committed on the renderer side. render_frame_host_->Send(new SubresourceFilterMsg_ActivateForProvisionalLoad( - render_frame_host_->GetRoutingID(), activation_state, url, + render_frame_host_->GetRoutingID(), activation_level, url, measure_performance)); }
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver.h b/components/subresource_filter/content/browser/content_subresource_filter_driver.h index dff92cd..b340999c 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_driver.h +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver.h
@@ -6,7 +6,7 @@ #define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_BROWSER_CONTENT_SUBRESOURCE_FILTER_DRIVER_H_ #include "base/macros.h" -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" class GURL; @@ -26,7 +26,7 @@ // Instructs the agent on the renderer to set up the subresource filter for // the currently ongoing provisional document load in the frame. - virtual void ActivateForProvisionalLoad(ActivationState activation_state, + virtual void ActivateForProvisionalLoad(ActivationLevel activation_level, const GURL& url, bool measure_performance);
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc index 0fc1ef5..63942318 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.cc
@@ -67,7 +67,7 @@ std::unique_ptr<SubresourceFilterClient> client) : content::WebContentsObserver(web_contents), client_(std::move(client)), - activation_state_(ActivationState::DISABLED), + activation_level_(ActivationLevel::DISABLED), measure_performance_(false) { content::RenderFrameHost* main_frame_host = web_contents->GetMainFrame(); if (main_frame_host && main_frame_host->IsRenderFrameLive()) @@ -88,8 +88,11 @@ } void ContentSubresourceFilterDriverFactory::OnFirstSubresourceLoadDisallowed() { - client_->ToggleNotificationVisibility(activation_state_ == - ActivationState::ENABLED); + if (ShouldSuppressNotifications()) + return; + + client_->ToggleNotificationVisibility(activation_level_ == + ActivationLevel::ENABLED); } void ContentSubresourceFilterDriverFactory::OnDocumentLoadStatistics( @@ -155,10 +158,10 @@ void ContentSubresourceFilterDriverFactory::ActivateForFrameHostIfNeeded( content::RenderFrameHost* render_frame_host, const GURL& url) { - if (activation_state_ != ActivationState::DISABLED) { + if (activation_level_ != ActivationLevel::DISABLED) { auto* driver = DriverFromFrameHost(render_frame_host); DCHECK(driver); - driver->ActivateForProvisionalLoad(GetMaximumActivationState(), url, + driver->ActivateForProvisionalLoad(GetMaximumActivationLevel(), url, measure_performance_); } } @@ -193,7 +196,7 @@ navigation_chain_.push_back(navigation_handle->GetURL()); client_->ToggleNotificationVisibility(false); - activation_state_ = ActivationState::DISABLED; + activation_level_ = ActivationLevel::DISABLED; measure_performance_ = false; aggregated_document_statistics_ = DocumentLoadStatistics(); } @@ -231,7 +234,7 @@ if (render_frame_host->GetParent()) return; - if (activation_state_ != ActivationState::DISABLED) { + if (activation_level_ != ActivationLevel::DISABLED) { UMA_HISTOGRAM_COUNTS_1000( "SubresourceFilter.PageLoad.NumSubresourceLoads.Total", aggregated_document_statistics_.num_loads_total); @@ -247,7 +250,7 @@ } if (measure_performance_) { - DCHECK(activation_state_ != ActivationState::DISABLED); + DCHECK(activation_level_ != ActivationLevel::DISABLED); UMA_HISTOGRAM_CUSTOM_MICRO_TIMES( "SubresourceFilter.PageLoad.SubresourceEvaluation.TotalWallDuration", aggregated_document_statistics_.evaluation_total_wall_duration, @@ -286,12 +289,12 @@ if (!render_frame_host->GetParent()) { RecordRedirectChainMatchPattern(); if (ShouldActivateForMainFrameURL(url)) { - activation_state_ = GetMaximumActivationState(); - measure_performance_ = activation_state_ != ActivationState::DISABLED && + activation_level_ = GetMaximumActivationLevel(); + measure_performance_ = activation_level_ != ActivationLevel::DISABLED && ShouldMeasurePerformanceForPageLoad(); ActivateForFrameHostIfNeeded(render_frame_host, url); } else { - activation_state_ = ActivationState::DISABLED; + activation_level_ = ActivationLevel::DISABLED; measure_performance_ = false; aggregated_document_statistics_ = DocumentLoadStatistics(); }
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h index 7b6e20d..49727a6 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h
@@ -32,7 +32,7 @@ class ContentSubresourceFilterDriver; class SubresourceFilterClient; -enum class ActivationState; +enum class ActivationLevel; enum class ActivationList; using HostPathSet = std::set<std::string>; @@ -133,7 +133,7 @@ HostPathSet whitelisted_hosts_; - ActivationState activation_state_; + ActivationLevel activation_level_; bool measure_performance_; // The URLs in the navigation chain.
diff --git a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc index 75db9c7..07e4429367 100644 --- a/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc +++ b/components/subresource_filter/content/browser/content_subresource_filter_driver_factory_unittest.cc
@@ -9,6 +9,7 @@ #include "components/safe_browsing_db/util.h" #include "components/subresource_filter/content/browser/content_subresource_filter_driver.h" #include "components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h" +#include "components/subresource_filter/content/common/subresource_filter_messages.h" #include "components/subresource_filter/core/browser/subresource_filter_client.h" #include "components/subresource_filter/core/browser/subresource_filter_features.h" #include "components/subresource_filter/core/browser/subresource_filter_features_test_support.h" @@ -123,15 +124,15 @@ kActivationScopeActivationList}, }; -struct ActivationStateTestData { +struct ActivationLevelTestData { bool expected_activation; - const char* const activation_state; + const char* const activation_level; }; -const ActivationStateTestData kActivationStateTestData[] = { - {true /* expected_activation */, kActivationStateDryRun}, - {true /* expected_activation */, kActivationStateEnabled}, - {false /* expected_activation */, kActivationStateDisabled}, +const ActivationLevelTestData kActivationLevelTestData[] = { + {true /* expected_activation */, kActivationLevelDryRun}, + {true /* expected_activation */, kActivationLevelEnabled}, + {false /* expected_activation */, kActivationLevelDisabled}, }; class MockSubresourceFilterDriver : public ContentSubresourceFilterDriver { @@ -143,7 +144,7 @@ ~MockSubresourceFilterDriver() override = default; MOCK_METHOD3(ActivateForProvisionalLoad, - void(ActivationState, const GURL&, bool)); + void(ActivationLevel, const GURL&, bool)); private: DISALLOW_COPY_AND_ASSIGN(MockSubresourceFilterDriver); @@ -210,7 +211,7 @@ const std::vector<GURL>& navigation_chain, safe_browsing::SBThreatType threat_type, safe_browsing::ThreatPatternType threat_type_metadata, - RedirectChainMatchPattern extected_pattern, + RedirectChainMatchPattern expected_pattern, bool expected_activation) { base::HistogramTester tester; EXPECT_CALL(*client(), ToggleNotificationVisibility(false)).Times(1); @@ -245,9 +246,9 @@ rfh_tester->SimulateNavigationCommit(navigation_chain.back()); ::testing::Mock::VerifyAndClearExpectations(driver()); - if (extected_pattern != EMPTY) { + if (expected_pattern != EMPTY) { EXPECT_THAT(tester.GetAllSamples(kMatchesPatternHistogramName), - ::testing::ElementsAre(base::Bucket(extected_pattern, 1))); + ::testing::ElementsAre(base::Bucket(expected_pattern, 1))); EXPECT_THAT( tester.GetAllSamples(kNavigationChainSize), ::testing::ElementsAre(base::Bucket(navigation_chain.size(), 1))); @@ -277,28 +278,35 @@ const std::vector<GURL>& navigation_chain, safe_browsing::SBThreatType threat_type, safe_browsing::ThreatPatternType threat_type_metadata, - RedirectChainMatchPattern extected_pattern, + RedirectChainMatchPattern expected_pattern, bool expected_activation) { BlacklistURLWithRedirectsNavigateAndCommit( blacklisted_urls, navigation_chain, threat_type, threat_type_metadata, - extected_pattern, expected_activation); + expected_pattern, expected_activation); NavigateAndCommitSubframe(GURL(kExampleLoginUrl), expected_activation); } void NavigateAndExpectActivation(const std::vector<bool>& blacklisted_urls, const std::vector<GURL>& navigation_chain, - RedirectChainMatchPattern extected_pattern, + RedirectChainMatchPattern expected_pattern, bool expected_activation) { NavigateAndExpectActivation( blacklisted_urls, navigation_chain, safe_browsing::SB_THREAT_TYPE_URL_PHISHING, safe_browsing::ThreatPatternType::SOCIAL_ENGINEERING_ADS, - extected_pattern, expected_activation); + expected_pattern, expected_activation); + } + + void EmulateDidDisallowFirstSubresourceMessage() { + factory()->OnMessageReceived( + SubresourceFilterHostMsg_DidDisallowFirstSubresource( + main_rfh()->GetRoutingID()), + main_rfh()); } void EmulateInPageNavigation(const std::vector<bool>& blacklisted_urls, - RedirectChainMatchPattern extected_pattern, + RedirectChainMatchPattern expected_pattern, bool expected_activation) { // This test examines the navigation with the following sequence of events: // DidStartProvisional(main, "example.com") @@ -309,7 +317,7 @@ // DidCommitProvisional(main, "example.com#ref") NavigateAndExpectActivation(blacklisted_urls, {GURL(kExampleUrl)}, - extected_pattern, expected_activation); + expected_pattern, expected_activation); EXPECT_CALL(*driver(), ActivateForProvisionalLoad( ::testing::_, ::testing::_, ::testing::_)) .Times(0); @@ -361,16 +369,16 @@ ContentSubresourceFilterDriverFactoryActivationScopeTest); }; -class ContentSubresourceFilterDriverFactoryActivationStateTest +class ContentSubresourceFilterDriverFactoryActivationLevelTest : public ContentSubresourceFilterDriverFactoryTest, - public ::testing::WithParamInterface<ActivationStateTestData> { + public ::testing::WithParamInterface<ActivationLevelTestData> { public: - ContentSubresourceFilterDriverFactoryActivationStateTest() {} - ~ContentSubresourceFilterDriverFactoryActivationStateTest() override {} + ContentSubresourceFilterDriverFactoryActivationLevelTest() {} + ~ContentSubresourceFilterDriverFactoryActivationLevelTest() override {} private: DISALLOW_COPY_AND_ASSIGN( - ContentSubresourceFilterDriverFactoryActivationStateTest); + ContentSubresourceFilterDriverFactoryActivationLevelTest); }; TEST_F(ContentSubresourceFilterDriverFactoryTest, @@ -379,7 +387,7 @@ // which is visited was a SB hit. base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_DISABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_DISABLE_FEATURE, kActivationLevelEnabled, kActivationScopeAllSites, kActivationListSocialEngineeringAdsInterstitial); const GURL url(kExampleUrlWithParams); @@ -393,7 +401,7 @@ TEST_F(ContentSubresourceFilterDriverFactoryTest, NoActivationWhenNoMatch) { base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, kActivationListSocialEngineeringAdsInterstitial); NavigateAndExpectActivation({false}, {GURL(kExampleUrl)}, EMPTY, @@ -406,7 +414,7 @@ // signal is always sent. base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeAllSites); EmulateInPageNavigation({false}, EMPTY, true /* expected_activation */); } @@ -415,7 +423,7 @@ SpecialCaseNavigationActivationListEnabled) { base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, kActivationListSocialEngineeringAdsInterstitial); EmulateInPageNavigation({true}, NO_REDIRECTS_HIT, @@ -426,7 +434,7 @@ SpecialCaseNavigationActivationListEnabledWithPerformanceMeasurement) { base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, kActivationListSocialEngineeringAdsInterstitial, "1" /* performance_measurement_rate */); @@ -437,13 +445,13 @@ TEST_F(ContentSubresourceFilterDriverFactoryTest, RedirectPatternTest) { base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, kActivationListSocialEngineeringAdsInterstitial); struct RedirectRedirectChainMatchPatternTestData { std::vector<bool> blacklisted_urls; std::vector<GURL> navigation_chain; - RedirectChainMatchPattern hit_extected_pattern; + RedirectChainMatchPattern hit_expected_pattern; bool expected_activation; } kRedirectRedirectChainMatchPatternTestData[] = { {{false}, {GURL(kUrlA)}, EMPTY, false}, @@ -498,18 +506,45 @@ test_data.blacklisted_urls, test_data.navigation_chain, safe_browsing::SB_THREAT_TYPE_URL_PHISHING, safe_browsing::ThreatPatternType::SOCIAL_ENGINEERING_ADS, - test_data.hit_extected_pattern, test_data.expected_activation); + test_data.hit_expected_pattern, test_data.expected_activation); NavigateAndExpectActivation({false}, {GURL("https://dummy.com")}, EMPTY, false); } } -TEST_P(ContentSubresourceFilterDriverFactoryActivationStateTest, - ActivateForFrameState) { - const ActivationStateTestData& test_data = GetParam(); +TEST_F(ContentSubresourceFilterDriverFactoryTest, NotificationVisibility) { base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, test_data.activation_state, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, + kActivationScopeAllSites); + + NavigateAndExpectActivation({false}, {GURL(kExampleUrl)}, EMPTY, + true /* expected_activation */); + EXPECT_CALL(*client(), ToggleNotificationVisibility(true)).Times(1); + EmulateDidDisallowFirstSubresourceMessage(); +} + +TEST_F(ContentSubresourceFilterDriverFactoryTest, + SuppressNotificationVisibility) { + base::FieldTrialList field_trial_list(nullptr); + testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, + kActivationScopeAllSites, "" /* activation_lists */, + "" /* performance_measurement_rate */, + "true" /* suppress_notifications */); + + NavigateAndExpectActivation({false}, {GURL(kExampleUrl)}, EMPTY, + true /* expected_activation */); + EXPECT_CALL(*client(), ToggleNotificationVisibility(::testing::_)).Times(0); + EmulateDidDisallowFirstSubresourceMessage(); +} + +TEST_P(ContentSubresourceFilterDriverFactoryActivationLevelTest, + ActivateForFrameState) { + const ActivationLevelTestData& test_data = GetParam(); + base::FieldTrialList field_trial_list(nullptr); + testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( + base::FeatureList::OVERRIDE_ENABLE_FEATURE, test_data.activation_level, kActivationScopeActivationList, kActivationListSocialEngineeringAdsInterstitial); @@ -529,7 +564,7 @@ const ActivationListTestData& test_data = GetParam(); base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, kActivationScopeActivationList, test_data.activation_list); const GURL test_url("https://example.com/nonsoceng?q=engsocnon"); @@ -548,21 +583,21 @@ const ActivationScopeTestData& test_data = GetParam(); base::FieldTrialList field_trial_list(nullptr); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( - base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationStateEnabled, + base::FeatureList::OVERRIDE_ENABLE_FEATURE, kActivationLevelEnabled, test_data.activation_scope, kActivationListSocialEngineeringAdsInterstitial); const GURL test_url(kExampleUrlWithParams); - RedirectChainMatchPattern extected_pattern = + RedirectChainMatchPattern expected_pattern = test_data.url_matches_activation_list ? NO_REDIRECTS_HIT : EMPTY; NavigateAndExpectActivation({test_data.url_matches_activation_list}, - {test_url}, extected_pattern, + {test_url}, expected_pattern, test_data.expected_activation); if (test_data.url_matches_activation_list) { factory()->AddHostOfURLToWhitelistSet(test_url); NavigateAndExpectActivation({test_data.url_matches_activation_list}, - {GURL(kExampleUrlWithParams)}, extected_pattern, + {GURL(kExampleUrlWithParams)}, expected_pattern, false /* expected_activation */); } }; @@ -577,8 +612,8 @@ ::testing::ValuesIn(kActivationScopeTestData)); INSTANTIATE_TEST_CASE_P( - ActivationStateTest, - ContentSubresourceFilterDriverFactoryActivationStateTest, - ::testing::ValuesIn(kActivationStateTestData)); + ActivationLevelTest, + ContentSubresourceFilterDriverFactoryActivationLevelTest, + ::testing::ValuesIn(kActivationLevelTestData)); } // namespace subresource_filter
diff --git a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc index cb6b79d..fab4ae86 100644 --- a/components/subresource_filter/content/browser/verified_ruleset_dealer.cc +++ b/components/subresource_filter/content/browser/verified_ruleset_dealer.cc
@@ -14,6 +14,8 @@ namespace subresource_filter { +// VerifiedRulesetDealer and its Handle. --------------------------------------- + VerifiedRulesetDealer::VerifiedRulesetDealer() = default; VerifiedRulesetDealer::~VerifiedRulesetDealer() = default; @@ -78,4 +80,37 @@ base::Unretained(dealer_.get()), base::Passed(&file))); } +// VerifiedRuleset and its Handle. --------------------------------------------- + +VerifiedRuleset::VerifiedRuleset() { + thread_checker_.DetachFromThread(); +} + +VerifiedRuleset::~VerifiedRuleset() { + DCHECK(thread_checker_.CalledOnValidThread()); +} + +void VerifiedRuleset::Initialize(VerifiedRulesetDealer* dealer) { + DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK(dealer); + ruleset_ = dealer->GetRuleset(); +} + +VerifiedRuleset::Handle::Handle(VerifiedRulesetDealer::Handle* dealer_handle) + : task_runner_(dealer_handle->task_runner()), + ruleset_(new VerifiedRuleset, base::OnTaskRunnerDeleter(task_runner_)) { + dealer_handle->GetDealerAsync(base::Bind(&VerifiedRuleset::Initialize, + base::Unretained(ruleset_.get()))); +} + +VerifiedRuleset::Handle::~Handle() { + DCHECK(thread_checker_.CalledOnValidThread()); +} + +void VerifiedRuleset::Handle::GetRulesetAsync( + base::Callback<void(VerifiedRuleset*)> callback) { + DCHECK(thread_checker_.CalledOnValidThread()); + task_runner_->PostTask(FROM_HERE, base::Bind(callback, ruleset_.get())); +} + } // namespace subresource_filter
diff --git a/components/subresource_filter/content/browser/verified_ruleset_dealer.h b/components/subresource_filter/content/browser/verified_ruleset_dealer.h index 187b7ed..e3e248a 100644 --- a/components/subresource_filter/content/browser/verified_ruleset_dealer.h +++ b/components/subresource_filter/content/browser/verified_ruleset_dealer.h
@@ -68,6 +68,10 @@ explicit Handle(scoped_refptr<base::SequencedTaskRunner> task_runner); ~Handle(); + // Returns the |task_runner| on which the VerifiedRulesetDealer, as well as + // the MemoryMappedRulesets it creates, should be accessed. + base::SequencedTaskRunner* task_runner() { return task_runner_; } + // Invokes |callback| on |task_runner|, providing a pointer to the underlying // VerifiedRulesetDealer as an argument. The pointer is guaranteed to be valid // at least until the callback returns. @@ -81,7 +85,65 @@ // Note: Raw pointer, |dealer_| already holds a reference to |task_runner_|. base::SequencedTaskRunner* task_runner_; std::unique_ptr<VerifiedRulesetDealer, base::OnTaskRunnerDeleter> dealer_; + base::ThreadChecker thread_checker_; + DISALLOW_COPY_AND_ASSIGN(Handle); +}; + +// Holds a strong reference to MemoryMappedRuleset, and provides acceess to it. +// +// Initially holds an empty reference, allowing this object to be created on the +// UI-thread synchronously, hence letting the Handle to be created synchronously +// and be immediately used by clients on the UI-thread, while the +// MemoryMappedRuleset is retrieved on the |task_runner| in a deferred manner. +class VerifiedRuleset { + public: + class Handle; + + VerifiedRuleset(); + ~VerifiedRuleset(); + + // Can return nullptr even after initialization in case no ruleset is + // available, or if the ruleset is corrupted. + const MemoryMappedRuleset* Get() const { + DCHECK(thread_checker_.CalledOnValidThread()); + return ruleset_.get(); + } + + private: + // Initializes |ruleset_| with the one provided by the ruleset |dealer|. + void Initialize(VerifiedRulesetDealer* dealer); + + scoped_refptr<const MemoryMappedRuleset> ruleset_; + base::ThreadChecker thread_checker_; + + DISALLOW_COPY_AND_ASSIGN(VerifiedRuleset); +}; + +// The UI-thread handle that owns a VerifiedRuleset living on a dedicated +// sequenced |task_runner|, same as the VerifiedRulesetDealer lives on. Provides +// asynchronous access to the instance, and destroys it asynchronously. +class VerifiedRuleset::Handle { + public: + // Creates a VerifiedRuleset and initializes it asynchronously on a + // |task_runner| using |dealer_handle|. The instance remains owned by this + // handle, but living and accessed on the |task_runner|. + explicit Handle(VerifiedRulesetDealer::Handle* dealer_handle); + ~Handle(); + + // Returns the |task_runner| on which the VerifiedRuleset, as well as the + // MemoryMappedRuleset it holds a reference to, should be accessed. + base::SequencedTaskRunner* task_runner() { return task_runner_; } + + // Invokes |callback| on |task_runner|, providing a pointer to the underlying + // VerifiedRuleset as an argument. The pointer is guaranteed to be valid at + // least until the callback returns. + void GetRulesetAsync(base::Callback<void(VerifiedRuleset*)> callback); + + private: + // Note: Raw pointer, |ruleset_| already holds a reference to |task_runner_|. + base::SequencedTaskRunner* task_runner_; + std::unique_ptr<VerifiedRuleset, base::OnTaskRunnerDeleter> ruleset_; base::ThreadChecker thread_checker_; DISALLOW_COPY_AND_ASSIGN(Handle);
diff --git a/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc b/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc index 4182e1c8..5977117 100644 --- a/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc +++ b/components/subresource_filter/content/browser/verified_ruleset_dealer_unittest.cc
@@ -223,16 +223,18 @@ void ExpectRulesetState(bool expected_availability, RulesetVerificationStatus expected_status = - RulesetVerificationStatus::NOT_VERIFIED) const { + RulesetVerificationStatus::NOT_VERIFIED, + bool expected_cached = false) const { ASSERT_EQ(1, invocation_counter_); EXPECT_EQ(expected_availability, is_ruleset_file_available_); - EXPECT_FALSE(has_cached_ruleset_); + EXPECT_EQ(expected_cached, has_cached_ruleset_); EXPECT_EQ(expected_status, status_); } - void ExpectRulesetContents( - const std::vector<uint8_t> expected_contents) const { - ExpectRulesetState(true, RulesetVerificationStatus::INTACT); + void ExpectRulesetContents(const std::vector<uint8_t> expected_contents, + bool expected_cached = false) const { + ExpectRulesetState(true, RulesetVerificationStatus::INTACT, + expected_cached); EXPECT_TRUE(ruleset_is_created_); EXPECT_EQ(expected_contents, contents_); } @@ -336,4 +338,218 @@ read_ruleset_2.ExpectRulesetContents(rulesets().indexed_2().contents); } +// Tests for VerifiedRuleset::Handle. ------------------------------------------ + +namespace { + +class TestVerifiedRulesetClient { + public: + TestVerifiedRulesetClient() = default; + + base::Callback<void(VerifiedRuleset*)> GetCallback() { + return base::Bind(&TestVerifiedRulesetClient::Callback, + base::Unretained(this)); + } + + void ExpectNoRuleset() const { + ASSERT_EQ(1, invocation_counter_); + EXPECT_FALSE(has_ruleset_); + } + + void ExpectRulesetContents( + const std::vector<uint8_t> expected_contents) const { + ASSERT_EQ(1, invocation_counter_); + EXPECT_EQ(expected_contents, contents_); + } + + private: + void Callback(VerifiedRuleset* ruleset) { + ++invocation_counter_; + ASSERT_TRUE(ruleset); + has_ruleset_ = !!ruleset->Get(); + if (has_ruleset_) + contents_ = ReadRulesetContents(ruleset->Get()); + } + + bool has_ruleset_ = false; + std::vector<uint8_t> contents_; + + int invocation_counter_ = 0; + + DISALLOW_COPY_AND_ASSIGN(TestVerifiedRulesetClient); +}; + +} // namespace + +class SubresourceFilterVerifiedRulesetHandleTest : public ::testing::Test { + public: + SubresourceFilterVerifiedRulesetHandleTest() = default; + + protected: + void SetUp() override { + rulesets_.CreateRulesets(true /* many_rules */); + task_runner_ = new base::TestSimpleTaskRunner; + dealer_handle_.reset(new VerifiedRulesetDealer::Handle(task_runner_)); + } + + void TearDown() override { + dealer_handle_.reset(nullptr); + task_runner_->RunUntilIdle(); + } + + const TestRulesets& rulesets() const { return rulesets_; } + base::TestSimpleTaskRunner* task_runner() { return task_runner_.get(); } + + VerifiedRulesetDealer::Handle* dealer_handle() { + return dealer_handle_.get(); + } + + std::unique_ptr<VerifiedRuleset::Handle> CreateRulesetHandle() { + return std::unique_ptr<VerifiedRuleset::Handle>( + new VerifiedRuleset::Handle(dealer_handle())); + } + + private: + TestRulesets rulesets_; + scoped_refptr<base::TestSimpleTaskRunner> task_runner_; + std::unique_ptr<VerifiedRulesetDealer::Handle> dealer_handle_; + + DISALLOW_COPY_AND_ASSIGN(SubresourceFilterVerifiedRulesetHandleTest); +}; + +TEST_F(SubresourceFilterVerifiedRulesetHandleTest, + RulesetHandleKeepsRulesetMemoryMappedAndVerified) { + TestVerifiedRulesetDealerClient created_handle; + TestVerifiedRulesetClient read_ruleset; + TestVerifiedRulesetDealerClient deleted_handle; + + dealer_handle()->SetRulesetFile( + testing::TestRuleset::Open(rulesets().indexed_1())); + + auto ruleset_handle = CreateRulesetHandle(); + dealer_handle()->GetDealerAsync(created_handle.GetCallback()); + ruleset_handle->GetRulesetAsync(read_ruleset.GetCallback()); + ruleset_handle.reset(nullptr); + dealer_handle()->GetDealerAsync(deleted_handle.GetCallback()); + task_runner()->RunUntilIdle(); + + created_handle.ExpectRulesetContents(rulesets().indexed_1().contents, true); + read_ruleset.ExpectRulesetContents(rulesets().indexed_1().contents); + deleted_handle.ExpectRulesetState(true, RulesetVerificationStatus::INTACT); +} + +TEST_F(SubresourceFilterVerifiedRulesetHandleTest, + RulesetUnmappedOnlyAfterLastHandleIsDeleted) { + TestVerifiedRulesetDealerClient created_handles; + TestVerifiedRulesetClient read_ruleset_from_handle_1; + TestVerifiedRulesetClient read_ruleset_from_handle_2; + TestVerifiedRulesetDealerClient deleted_handle_1; + TestVerifiedRulesetClient read_ruleset_again_from_handle_2; + TestVerifiedRulesetDealerClient deleted_both_handles; + + dealer_handle()->SetRulesetFile( + testing::TestRuleset::Open(rulesets().indexed_1())); + + auto ruleset_handle_1 = CreateRulesetHandle(); + auto ruleset_handle_2 = CreateRulesetHandle(); + dealer_handle()->GetDealerAsync(created_handles.GetCallback()); + ruleset_handle_1->GetRulesetAsync(read_ruleset_from_handle_1.GetCallback()); + ruleset_handle_2->GetRulesetAsync(read_ruleset_from_handle_2.GetCallback()); + + ruleset_handle_1.reset(nullptr); + dealer_handle()->GetDealerAsync(deleted_handle_1.GetCallback()); + ruleset_handle_2->GetRulesetAsync( + read_ruleset_again_from_handle_2.GetCallback()); + + ruleset_handle_2.reset(nullptr); + dealer_handle()->GetDealerAsync(deleted_both_handles.GetCallback()); + + task_runner()->RunUntilIdle(); + + created_handles.ExpectRulesetContents(rulesets().indexed_1().contents, true); + read_ruleset_from_handle_1.ExpectRulesetContents( + rulesets().indexed_1().contents); + read_ruleset_from_handle_2.ExpectRulesetContents( + rulesets().indexed_1().contents); + deleted_handle_1.ExpectRulesetContents(rulesets().indexed_1().contents, true); + read_ruleset_again_from_handle_2.ExpectRulesetContents( + rulesets().indexed_1().contents); + deleted_both_handles.ExpectRulesetState(true, + RulesetVerificationStatus::INTACT); +} + +TEST_F(SubresourceFilterVerifiedRulesetHandleTest, + OldRulesetRemainsMappedAfterUpdateUntilHandleIsDeleted) { + TestVerifiedRulesetDealerClient created_handle_1; + TestVerifiedRulesetClient read_from_handle_1; + TestVerifiedRulesetDealerClient created_handle_2_after_update; + TestVerifiedRulesetClient read_from_handle_2; + TestVerifiedRulesetClient read_again_from_handle_1; + TestVerifiedRulesetClient read_from_handle_1_after_update; + TestVerifiedRulesetClient read_from_handle_2_after_update; + TestVerifiedRulesetDealerClient deleted_all_handles; + + dealer_handle()->SetRulesetFile( + testing::TestRuleset::Open(rulesets().indexed_1())); + + auto ruleset_handle_1 = CreateRulesetHandle(); + dealer_handle()->GetDealerAsync(created_handle_1.GetCallback()); + ruleset_handle_1->GetRulesetAsync(read_from_handle_1.GetCallback()); + + dealer_handle()->SetRulesetFile( + testing::TestRuleset::Open(rulesets().indexed_2())); + auto ruleset_handle_2 = CreateRulesetHandle(); + dealer_handle()->GetDealerAsync(created_handle_2_after_update.GetCallback()); + ruleset_handle_2->GetRulesetAsync(read_from_handle_2.GetCallback()); + ruleset_handle_1->GetRulesetAsync(read_again_from_handle_1.GetCallback()); + + ruleset_handle_1 = CreateRulesetHandle(); + ruleset_handle_1->GetRulesetAsync( + read_from_handle_1_after_update.GetCallback()); + ruleset_handle_2->GetRulesetAsync( + read_from_handle_2_after_update.GetCallback()); + + ruleset_handle_1.reset(nullptr); + ruleset_handle_2.reset(nullptr); + dealer_handle()->GetDealerAsync(deleted_all_handles.GetCallback()); + + task_runner()->RunUntilIdle(); + + created_handle_1.ExpectRulesetContents(rulesets().indexed_1().contents, true); + read_from_handle_1.ExpectRulesetContents(rulesets().indexed_1().contents); + created_handle_2_after_update.ExpectRulesetContents( + rulesets().indexed_2().contents, true); + read_from_handle_2.ExpectRulesetContents(rulesets().indexed_2().contents); + read_again_from_handle_1.ExpectRulesetContents( + rulesets().indexed_1().contents); + read_from_handle_1_after_update.ExpectRulesetContents( + rulesets().indexed_2().contents); + read_from_handle_2_after_update.ExpectRulesetContents( + rulesets().indexed_2().contents); + deleted_all_handles.ExpectRulesetState(true, + RulesetVerificationStatus::INTACT); +} + +TEST_F(SubresourceFilterVerifiedRulesetHandleTest, + CorruptRulesetIsNotHandedOut) { + TestVerifiedRulesetDealerClient created_handle; + TestVerifiedRulesetClient read_ruleset; + TestVerifiedRulesetDealerClient deleted_handle; + + testing::TestRuleset::CorruptByTruncating(rulesets().indexed_1(), 4096); + dealer_handle()->SetRulesetFile( + testing::TestRuleset::Open(rulesets().indexed_1())); + + auto ruleset_handle = CreateRulesetHandle(); + dealer_handle()->GetDealerAsync(created_handle.GetCallback()); + ruleset_handle->GetRulesetAsync(read_ruleset.GetCallback()); + ruleset_handle.reset(nullptr); + dealer_handle()->GetDealerAsync(deleted_handle.GetCallback()); + task_runner()->RunUntilIdle(); + + created_handle.ExpectRulesetState(true, RulesetVerificationStatus::CORRUPT); + read_ruleset.ExpectNoRuleset(); + deleted_handle.ExpectRulesetState(true, RulesetVerificationStatus::CORRUPT); +} + } // namespace subresource_filter
diff --git a/components/subresource_filter/content/common/subresource_filter_messages.h b/components/subresource_filter/content/common/subresource_filter_messages.h index c1c92ac..209c684 100644 --- a/components/subresource_filter/content/common/subresource_filter_messages.h +++ b/components/subresource_filter/content/common/subresource_filter_messages.h
@@ -6,17 +6,17 @@ #include "base/time/time.h" #include "components/subresource_filter/content/common/document_load_statistics.h" -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" #include "content/public/common/common_param_traits_macros.h" -#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message.h" +#include "ipc/ipc_message_macros.h" #include "ipc/ipc_platform_file.h" #include "url/ipc/url_param_traits.h" #define IPC_MESSAGE_START SubresourceFilterMsgStart -IPC_ENUM_TRAITS_MAX_VALUE(subresource_filter::ActivationState, - subresource_filter::ActivationState::LAST); +IPC_ENUM_TRAITS_MAX_VALUE(subresource_filter::ActivationLevel, + subresource_filter::ActivationLevel::LAST); IPC_STRUCT_TRAITS_BEGIN(subresource_filter::DocumentLoadStatistics) IPC_STRUCT_TRAITS_MEMBER(num_loads_total) @@ -40,9 +40,9 @@ // Instructs the renderer to activate subresource filtering for the currently // ongoing provisional document load in a frame. The message must arrive after // the provisional load starts, but before it is committed on the renderer side. -// If no message arrives, the default behavior is ActivationState::DISABLED. +// If no message arrives, the default behavior is ActivationLevel::DISABLED. IPC_MESSAGE_ROUTED3(SubresourceFilterMsg_ActivateForProvisionalLoad, - subresource_filter::ActivationState /* activation_state */, + subresource_filter::ActivationLevel /* activation_level */, GURL /* url */, bool /* measure_performance */);
diff --git a/components/subresource_filter/content/renderer/document_subresource_filter.cc b/components/subresource_filter/content/renderer/document_subresource_filter.cc index 3debaea..42da608 100644 --- a/components/subresource_filter/content/renderer/document_subresource_filter.cc +++ b/components/subresource_filter/content/renderer/document_subresource_filter.cc
@@ -76,12 +76,12 @@ } // namespace DocumentSubresourceFilter::DocumentSubresourceFilter( - ActivationState activation_state, + ActivationLevel activation_level, bool measure_performance, const scoped_refptr<const MemoryMappedRuleset>& ruleset, const std::vector<GURL>& ancestor_document_urls, const base::Closure& first_disallowed_load_callback) - : activation_state_(activation_state), + : activation_level_(activation_level), measure_performance_(measure_performance), ruleset_(ruleset), ruleset_matcher_(ruleset_->data(), ruleset_->length()), @@ -96,7 +96,7 @@ SCOPED_UMA_HISTOGRAM_MICRO_THREAD_TIMER( "SubresourceFilter.DocumentLoad.Activation.CPUDuration"); - DCHECK_NE(activation_state_, ActivationState::DISABLED); + DCHECK_NE(activation_level_, ActivationLevel::DISABLED); DCHECK(ruleset); url::Origin parent_document_origin; @@ -161,7 +161,7 @@ GURL(resourceUrl), *document_origin_, ToElementType(request_context), generic_blocking_rules_disabled_)) { ++statistics_.num_loads_matching_rules; - if (activation_state_ == ActivationState::ENABLED) { + if (activation_level_ == ActivationLevel::ENABLED) { if (!first_disallowed_load_callback_.is_null()) { DCHECK_EQ(statistics_.num_loads_disallowed, 0); first_disallowed_load_callback_.Run();
diff --git a/components/subresource_filter/content/renderer/document_subresource_filter.h b/components/subresource_filter/content/renderer/document_subresource_filter.h index 8c15cb8..d09ac3b 100644 --- a/components/subresource_filter/content/renderer/document_subresource_filter.h +++ b/components/subresource_filter/content/renderer/document_subresource_filter.h
@@ -15,7 +15,7 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "components/subresource_filter/content/common/document_load_statistics.h" -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" #include "components/subresource_filter/core/common/indexed_ruleset.h" #include "third_party/WebKit/public/platform/WebDocumentSubresourceFilter.h" #include "url/gurl.h" @@ -32,8 +32,8 @@ public base::SupportsWeakPtr<DocumentSubresourceFilter> { public: // Constructs a new filter that will: - // -- Operate at the prescribed |activation_state|, which must be either - // ActivationState::DRYRUN or ActivationState::ENABLED. In the former + // -- Operate at the prescribed |activation_level|, which must be either + // ActivationLevel::DRYRUN or ActivationLevel::ENABLED. In the former // case filtering will be performed but no loads will be disallowed. // -- Hold a reference to and use |ruleset| for its entire lifetime. // -- Expect |ancestor_document_urls| to be the URLs of documents loaded into @@ -42,7 +42,7 @@ // -- Invoke |first_disallowed_load_callback|, if it is non-null, on the // first disallowed subresource load. DocumentSubresourceFilter( - ActivationState activation_state, + ActivationLevel activation_level, bool measure_performance, const scoped_refptr<const MemoryMappedRuleset>& ruleset, const std::vector<GURL>& ancestor_document_urls, @@ -56,7 +56,7 @@ blink::WebURLRequest::RequestContext) override; private: - const ActivationState activation_state_; + const ActivationLevel activation_level_; const bool measure_performance_; scoped_refptr<const MemoryMappedRuleset> ruleset_; @@ -68,7 +68,7 @@ base::Closure first_disallowed_load_callback_; // Even when subresource filtering is activated at the page level by the - // |activation_state| passed into the constructor, the current document or + // |activation_level| passed into the constructor, the current document or // ancestors thereof may still match special filtering rules that specifically // disable the application of other types of rules on these documents. See // proto::ActivationType for details.
diff --git a/components/subresource_filter/content/renderer/document_subresource_filter_unittest.cc b/components/subresource_filter/content/renderer/document_subresource_filter_unittest.cc index 6bb11d74..f3e78c7 100644 --- a/components/subresource_filter/content/renderer/document_subresource_filter_unittest.cc +++ b/components/subresource_filter/content/renderer/document_subresource_filter_unittest.cc
@@ -79,7 +79,7 @@ blink::WebURLRequest::RequestContextImage; TestCallbackReceiver first_disallowed_load_callback_receiver; DocumentSubresourceFilter filter( - ActivationState::DRYRUN, true, ruleset(), std::vector<GURL>(), + ActivationLevel::DRYRUN, true, ruleset(), std::vector<GURL>(), first_disallowed_load_callback_receiver.closure()); EXPECT_TRUE(filter.allowLoad(GURL(kTestAlphaURL), request_context)); EXPECT_TRUE(filter.allowLoad(GURL(kTestAlphaDataURI), request_context)); @@ -98,7 +98,7 @@ auto test_impl = [this](bool measure_performance) { blink::WebURLRequest::RequestContext request_context = blink::WebURLRequest::RequestContextImage; - DocumentSubresourceFilter filter(ActivationState::ENABLED, + DocumentSubresourceFilter filter(ActivationLevel::ENABLED, measure_performance, ruleset(), std::vector<GURL>(), base::Closure()); EXPECT_FALSE(filter.allowLoad(GURL(kTestAlphaURL), request_context)); @@ -129,7 +129,7 @@ blink::WebURLRequest::RequestContextImage; TestCallbackReceiver first_disallowed_load_callback_receiver; DocumentSubresourceFilter filter( - ActivationState::ENABLED, true, ruleset(), std::vector<GURL>(), + ActivationLevel::ENABLED, true, ruleset(), std::vector<GURL>(), first_disallowed_load_callback_receiver.closure()); EXPECT_TRUE(filter.allowLoad(GURL(kTestAlphaDataURI), request_context)); EXPECT_EQ(0u, first_disallowed_load_callback_receiver.callback_count());
diff --git a/components/subresource_filter/content/renderer/subresource_filter_agent.cc b/components/subresource_filter/content/renderer/subresource_filter_agent.cc index 876cea1..b2982b6 100644 --- a/components/subresource_filter/content/renderer/subresource_filter_agent.cc +++ b/components/subresource_filter/content/renderer/subresource_filter_agent.cc
@@ -29,7 +29,7 @@ UnverifiedRulesetDealer* ruleset_dealer) : content::RenderFrameObserver(render_frame), ruleset_dealer_(ruleset_dealer), - activation_state_for_provisional_load_(ActivationState::DISABLED) { + activation_level_for_provisional_load_(ActivationLevel::DISABLED) { DCHECK(ruleset_dealer); } @@ -68,21 +68,21 @@ } void SubresourceFilterAgent::OnActivateForProvisionalLoad( - ActivationState activation_state, + ActivationLevel activation_level, const GURL& url, bool measure_performance) { - activation_state_for_provisional_load_ = activation_state; + activation_level_for_provisional_load_ = activation_level; url_for_provisional_load_ = url; measure_performance_ = measure_performance; } void SubresourceFilterAgent::RecordHistogramsOnLoadCommitted() { UMA_HISTOGRAM_ENUMERATION( - "SubresourceFilter.DocumentLoad.ActivationState", - static_cast<int>(activation_state_for_provisional_load_), - static_cast<int>(ActivationState::LAST) + 1); + "SubresourceFilter.DocumentLoad.ActivationLevel", + static_cast<int>(activation_level_for_provisional_load_), + static_cast<int>(ActivationLevel::LAST) + 1); - if (activation_state_for_provisional_load_ != ActivationState::DISABLED) { + if (activation_level_for_provisional_load_ != ActivationLevel::DISABLED) { UMA_HISTOGRAM_BOOLEAN("SubresourceFilter.DocumentLoad.RulesetIsAvailable", ruleset_dealer_->IsRulesetFileAvailable()); } @@ -144,7 +144,7 @@ (!ds || static_cast<GURL>(ds->getRequest().url()) != url_for_provisional_load_)) { - activation_state_for_provisional_load_ = ActivationState::DISABLED; + activation_level_for_provisional_load_ = ActivationLevel::DISABLED; measure_performance_ = false; } else { url_for_provisional_load_ = GURL(); @@ -162,7 +162,7 @@ if (ancestor_document_urls.front().SchemeIsHTTPOrHTTPS() || ancestor_document_urls.front().SchemeIsFile()) { RecordHistogramsOnLoadCommitted(); - if (activation_state_for_provisional_load_ != ActivationState::DISABLED && + if (activation_level_for_provisional_load_ != ActivationLevel::DISABLED && ruleset_dealer_->IsRulesetFileAvailable()) { base::Closure first_disallowed_load_callback( base::Bind(&SubresourceFilterAgent:: @@ -170,14 +170,14 @@ AsWeakPtr())); std::unique_ptr<DocumentSubresourceFilter> filter( new DocumentSubresourceFilter( - activation_state_for_provisional_load_, measure_performance_, + activation_level_for_provisional_load_, measure_performance_, ruleset_dealer_->GetRuleset(), ancestor_document_urls, first_disallowed_load_callback)); filter_for_last_committed_load_ = filter->AsWeakPtr(); SetSubresourceFilterForCommittedLoad(std::move(filter)); } } - activation_state_for_provisional_load_ = ActivationState::DISABLED; + activation_level_for_provisional_load_ = ActivationLevel::DISABLED; } void SubresourceFilterAgent::DidFinishLoad() {
diff --git a/components/subresource_filter/content/renderer/subresource_filter_agent.h b/components/subresource_filter/content/renderer/subresource_filter_agent.h index 2eb53c2..9a8d01a 100644 --- a/components/subresource_filter/content/renderer/subresource_filter_agent.h +++ b/components/subresource_filter/content/renderer/subresource_filter_agent.h
@@ -11,7 +11,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "components/subresource_filter/content/common/document_load_statistics.h" -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" #include "content/public/renderer/render_frame_observer.h" #include "url/gurl.h" @@ -62,7 +62,7 @@ const DocumentLoadStatistics& statistics); private: - void OnActivateForProvisionalLoad(ActivationState activation_state, + void OnActivateForProvisionalLoad(ActivationLevel activation_level, const GURL& url, bool measure_performance); void RecordHistogramsOnLoadCommitted(); @@ -79,7 +79,7 @@ // Owned by the ChromeContentRendererClient and outlives us. UnverifiedRulesetDealer* ruleset_dealer_; - ActivationState activation_state_for_provisional_load_; + ActivationLevel activation_level_for_provisional_load_; GURL url_for_provisional_load_; bool measure_performance_ = false; base::WeakPtr<DocumentSubresourceFilter> filter_for_last_committed_load_;
diff --git a/components/subresource_filter/content/renderer/subresource_filter_agent_unittest.cc b/components/subresource_filter/content/renderer/subresource_filter_agent_unittest.cc index 453c6f9..7a8b9bd0 100644 --- a/components/subresource_filter/content/renderer/subresource_filter_agent_unittest.cc +++ b/components/subresource_filter/content/renderer/subresource_filter_agent_unittest.cc
@@ -79,8 +79,8 @@ // Histogram names. constexpr const char kDocumentLoadRulesetIsAvailable[] = "SubresourceFilter.DocumentLoad.RulesetIsAvailable"; -constexpr const char kDocumentLoadActivationState[] = - "SubresourceFilter.DocumentLoad.ActivationState"; +constexpr const char kDocumentLoadActivationLevel[] = + "SubresourceFilter.DocumentLoad.ActivationLevel"; constexpr const char kSubresourcesEvaluated[] = "SubresourceFilter.DocumentLoad.NumSubresourceLoads.Evaluated"; constexpr const char kSubresourcesTotal[] = @@ -120,25 +120,25 @@ testing::TestRuleset::Open(test_ruleset_pair.indexed)); } - void StartLoadWithoutSettingActivationState() { + void StartLoadWithoutSettingActivationLevel() { agent_as_rfo()->DidStartProvisionalLoad(); agent_as_rfo()->DidCommitProvisionalLoad( true /* is_new_navigation */, false /* is_same_page_navigation */); } - void PerformSamePageNavigationWithoutSettingActivationState() { + void PerformSamePageNavigationWithoutSettingActivationLevel() { agent_as_rfo()->DidStartProvisionalLoad(); agent_as_rfo()->DidCommitProvisionalLoad( true /* is_new_navigation */, true /* is_same_page_navigation */); // No DidFinishLoad is called in this case. } - void StartLoadAndSetActivationState(ActivationState activation_state, + void StartLoadAndSetActivationLevel(ActivationLevel activation_level, bool measure_performance = false) { agent_as_rfo()->DidStartProvisionalLoad(); EXPECT_TRUE(agent_as_rfo()->OnMessageReceived( SubresourceFilterMsg_ActivateForProvisionalLoad( - 0, activation_state, GURL(), measure_performance))); + 0, activation_level, GURL(), measure_performance))); agent_as_rfo()->DidCommitProvisionalLoad( true /* is_new_navigation */, false /* is_same_page_navigation */); } @@ -196,11 +196,11 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestBothURLsPathSuffix)); ExpectNoSubresourceFilterGetsInjected(); - StartLoadWithoutSettingActivationState(); + StartLoadWithoutSettingActivationLevel(); FinishLoad(); histogram_tester.ExpectUniqueSample( - kDocumentLoadActivationState, static_cast<int>(ActivationState::DISABLED), + kDocumentLoadActivationLevel, static_cast<int>(ActivationLevel::DISABLED), 1); histogram_tester.ExpectTotalCount(kDocumentLoadRulesetIsAvailable, 0); @@ -217,7 +217,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestBothURLsPathSuffix)); ExpectNoSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::DISABLED); + StartLoadAndSetActivationLevel(ActivationLevel::DISABLED); FinishLoad(); } @@ -225,11 +225,11 @@ EnabledButRulesetUnavailable_NoFilterIsInjected) { base::HistogramTester histogram_tester; ExpectNoSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); FinishLoad(); histogram_tester.ExpectUniqueSample( - kDocumentLoadActivationState, static_cast<int>(ActivationState::ENABLED), + kDocumentLoadActivationLevel, static_cast<int>(ActivationLevel::ENABLED), 1); histogram_tester.ExpectUniqueSample(kDocumentLoadRulesetIsAvailable, 0, 1); @@ -248,10 +248,10 @@ EXPECT_CALL(*agent(), GetAncestorDocumentURLs()) .WillOnce(::testing::Return( std::vector<GURL>({GURL("about:blank"), GURL("http://outer.com/")}))); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); FinishLoad(); - histogram_tester.ExpectTotalCount(kDocumentLoadActivationState, 0); + histogram_tester.ExpectTotalCount(kDocumentLoadActivationLevel, 0); histogram_tester.ExpectTotalCount(kDocumentLoadRulesetIsAvailable, 0); histogram_tester.ExpectTotalCount(kSubresourcesTotal, 0); @@ -269,7 +269,7 @@ SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); ExpectSignalAboutFirstSubresourceDisallowed(); @@ -281,12 +281,12 @@ // In-page navigation should not count as a new load. ExpectNoSubresourceFilterGetsInjected(); ExpectNoSignalAboutFirstSubresourceDisallowed(); - PerformSamePageNavigationWithoutSettingActivationState(); + PerformSamePageNavigationWithoutSettingActivationLevel(); ExpectLoadAllowed(kTestFirstURL, false); ExpectLoadAllowed(kTestSecondURL, true); ExpectNoSubresourceFilterGetsInjected(); - StartLoadWithoutSettingActivationState(); + StartLoadWithoutSettingActivationLevel(); FinishLoad(); // Resource loads after the in-page navigation should not be counted toward @@ -295,10 +295,10 @@ histogram_tester.ExpectUniqueSample(kSubresourcesEvaluated, 2, 1); histogram_tester.ExpectUniqueSample(kSubresourcesMatchedRules, 1, 1); histogram_tester.ExpectUniqueSample(kSubresourcesDisallowed, 1, 1); - EXPECT_THAT(histogram_tester.GetAllSamples(kDocumentLoadActivationState), + EXPECT_THAT(histogram_tester.GetAllSamples(kDocumentLoadActivationLevel), ::testing::ElementsAre( - base::Bucket(static_cast<int>(ActivationState::DISABLED), 1), - base::Bucket(static_cast<int>(ActivationState::ENABLED), 1))); + base::Bucket(static_cast<int>(ActivationLevel::DISABLED), 1), + base::Bucket(static_cast<int>(ActivationLevel::ENABLED), 1))); histogram_tester.ExpectUniqueSample(kDocumentLoadRulesetIsAvailable, 1, 1); } @@ -308,7 +308,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED, + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED, measure_performance); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); @@ -322,7 +322,7 @@ FinishLoad(); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED, + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED, measure_performance); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); @@ -334,8 +334,8 @@ FinishLoad(); histogram_tester.ExpectUniqueSample( - kDocumentLoadActivationState, - static_cast<int>(ActivationState::ENABLED), 2); + kDocumentLoadActivationLevel, + static_cast<int>(ActivationLevel::ENABLED), 2); histogram_tester.ExpectUniqueSample(kDocumentLoadRulesetIsAvailable, 1, 2); EXPECT_THAT(histogram_tester.GetAllSamples(kSubresourcesTotal), @@ -360,7 +360,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); // Set the new ruleset just after the deadline for being used for the current @@ -375,7 +375,7 @@ FinishLoad(); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); ExpectSignalAboutFirstSubresourceDisallowed(); @@ -397,7 +397,7 @@ agent_as_rfo()->DidStartProvisionalLoad(); EXPECT_TRUE(agent_as_rfo()->OnMessageReceived( SubresourceFilterMsg_ActivateForProvisionalLoad( - 0, ActivationState::ENABLED, GURL(), true))); + 0, ActivationLevel::ENABLED, GURL(), true))); agent_as_rfo()->DidStartProvisionalLoad(); agent_as_rfo()->DidCommitProvisionalLoad(true /* is_new_navigation */, false /* is_same_page_navigation */); @@ -409,7 +409,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::DRYRUN); + StartLoadAndSetActivationLevel(ActivationLevel::DRYRUN); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); // In dry-run mode, loads to the first URL should be recorded as @@ -421,8 +421,8 @@ ExpectDocumentLoadStatisticsSent(); FinishLoad(); - histogram_tester.ExpectUniqueSample(kDocumentLoadActivationState, - static_cast<int>(ActivationState::DRYRUN), + histogram_tester.ExpectUniqueSample(kDocumentLoadActivationLevel, + static_cast<int>(ActivationLevel::DRYRUN), 1); histogram_tester.ExpectUniqueSample(kDocumentLoadRulesetIsAvailable, 1, 1); @@ -441,7 +441,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); ExpectSignalAboutFirstSubresourceDisallowed(); @@ -453,7 +453,7 @@ FinishLoad(); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); ExpectLoadAllowed(kTestSecondURL, true); @@ -468,7 +468,7 @@ ASSERT_NO_FATAL_FAILURE( SetTestRulesetToDisallowURLsWithPathSuffix(kTestFirstURLPathSuffix)); ExpectSubresourceFilterGetsInjected(); - StartLoadAndSetActivationState(ActivationState::ENABLED); + StartLoadAndSetActivationLevel(ActivationLevel::ENABLED); ASSERT_TRUE(::testing::Mock::VerifyAndClearExpectations(agent())); auto filter = agent()->TakeFilter();
diff --git a/components/subresource_filter/core/browser/subresource_filter_features.cc b/components/subresource_filter/core/browser/subresource_filter_features.cc index 9ac0acf..9d319f3 100644 --- a/components/subresource_filter/core/browser/subresource_filter_features.cc +++ b/components/subresource_filter/core/browser/subresource_filter_features.cc
@@ -6,6 +6,7 @@ #include <string> +#include "base/metrics/field_trial_params.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" @@ -16,10 +17,11 @@ const base::Feature kSafeBrowsingSubresourceFilter{ "SubresourceFilter", base::FEATURE_DISABLED_BY_DEFAULT}; -const char kActivationStateParameterName[] = "activation_state"; -const char kActivationStateDryRun[] = "dryrun"; -const char kActivationStateEnabled[] = "enabled"; -const char kActivationStateDisabled[] = "disabled"; +// Legacy name `activation_state` is used in variation parameters. +const char kActivationLevelParameterName[] = "activation_state"; +const char kActivationLevelDryRun[] = "dryrun"; +const char kActivationLevelEnabled[] = "enabled"; +const char kActivationLevelDisabled[] = "disabled"; const char kActivationScopeParameterName[] = "activation_scope"; const char kActivationScopeAllSites[] = "all_sites"; @@ -34,14 +36,16 @@ const char kPerformanceMeasurementRateParameterName[] = "performance_measurement_rate"; -ActivationState GetMaximumActivationState() { - std::string activation_state = variations::GetVariationParamValueByFeature( - kSafeBrowsingSubresourceFilter, kActivationStateParameterName); - if (base::LowerCaseEqualsASCII(activation_state, kActivationStateEnabled)) - return ActivationState::ENABLED; - else if (base::LowerCaseEqualsASCII(activation_state, kActivationStateDryRun)) - return ActivationState::DRYRUN; - return ActivationState::DISABLED; +const char kSuppressNotificationsParameterName[] = "suppress_notifications"; + +ActivationLevel GetMaximumActivationLevel() { + std::string activation_level = variations::GetVariationParamValueByFeature( + kSafeBrowsingSubresourceFilter, kActivationLevelParameterName); + if (base::LowerCaseEqualsASCII(activation_level, kActivationLevelEnabled)) + return ActivationLevel::ENABLED; + else if (base::LowerCaseEqualsASCII(activation_level, kActivationLevelDryRun)) + return ActivationLevel::DRYRUN; + return ActivationLevel::DISABLED; } ActivationScope GetCurrentActivationScope() { @@ -83,4 +87,10 @@ return value < 1 ? value : 1; } +bool ShouldSuppressNotifications() { + return base::GetFieldTrialParamByFeatureAsBool( + kSafeBrowsingSubresourceFilter, kSuppressNotificationsParameterName, + false /* default value */); +} + } // namespace subresource_filter
diff --git a/components/subresource_filter/core/browser/subresource_filter_features.h b/components/subresource_filter/core/browser/subresource_filter_features.h index 11f54ff..4594651 100644 --- a/components/subresource_filter/core/browser/subresource_filter_features.h +++ b/components/subresource_filter/core/browser/subresource_filter_features.h
@@ -6,20 +6,20 @@ #define COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_ #include "base/feature_list.h" +#include "components/subresource_filter/core/common/activation_level.h" #include "components/subresource_filter/core/common/activation_list.h" #include "components/subresource_filter/core/common/activation_scope.h" -#include "components/subresource_filter/core/common/activation_state.h" namespace subresource_filter { // The master toggle to enable/disable the Safe Browsing Subresource Filter. extern const base::Feature kSafeBrowsingSubresourceFilter; -// Name/values of the variation parameter controlling maximum activation state. -extern const char kActivationStateParameterName[]; -extern const char kActivationStateDryRun[]; -extern const char kActivationStateEnabled[]; -extern const char kActivationStateDisabled[]; +// Name/values of the variation parameter controlling maximum activation level. +extern const char kActivationLevelParameterName[]; +extern const char kActivationLevelDryRun[]; +extern const char kActivationLevelEnabled[]; +extern const char kActivationLevelDisabled[]; extern const char kActivationScopeParameterName[]; extern const char kActivationScopeAllSites[]; @@ -32,10 +32,12 @@ extern const char kPerformanceMeasurementRateParameterName[]; +extern const char kSuppressNotificationsParameterName[]; + // Returns the maximum degree to which subresource filtering should be activated -// on any RenderFrame. This will be ActivationState::DISABLED unless the feature -// is enabled and variation parameters prescribe a higher activation state. -ActivationState GetMaximumActivationState(); +// on any RenderFrame. This will be ActivationLevel::DISABLED unless the feature +// is enabled and variation parameters prescribe a higher activation level. +ActivationLevel GetMaximumActivationLevel(); // Returns the current activation scope, that is, the subset of page loads where // subresource filtering should be activated. The function returns @@ -53,6 +55,10 @@ // 0 unless a greater frequency is specified by variation parameters. double GetPerformanceMeasurementRate(); +// Returns whether notifications indicating that a subresource was disallowed +// should be suppressed in the UI. +bool ShouldSuppressNotifications(); + } // namespace subresource_filter #endif // COMPONENTS_SUBRESOURCE_FILTER_SUBRESOURCE_FILTER_FEATURES_H_
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc b/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc index a6be80b..adcf692 100644 --- a/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc +++ b/components/subresource_filter/core/browser/subresource_filter_features_test_support.cc
@@ -22,17 +22,19 @@ ScopedSubresourceFilterFeatureToggle::ScopedSubresourceFilterFeatureToggle( base::FeatureList::OverrideState feature_state, - const std::string& maximum_activation_state, + const std::string& maximum_activation_level, const std::string& activation_scope, const std::string& activation_lists, - const std::string& performance_measurement_rate) + const std::string& performance_measurement_rate, + const std::string& suppress_notifications) : ScopedSubresourceFilterFeatureToggle( feature_state, - {{kActivationStateParameterName, maximum_activation_state}, + {{kActivationLevelParameterName, maximum_activation_level}, {kActivationScopeParameterName, activation_scope}, {kActivationListsParameterName, activation_lists}, {kPerformanceMeasurementRateParameterName, - performance_measurement_rate}}) {} + performance_measurement_rate}, + {kSuppressNotificationsParameterName, suppress_notifications}}) {} ScopedSubresourceFilterFeatureToggle::ScopedSubresourceFilterFeatureToggle( base::FeatureList::OverrideState feature_state,
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_test_support.h b/components/subresource_filter/core/browser/subresource_filter_features_test_support.h index 6fe38513..6da330ad1 100644 --- a/components/subresource_filter/core/browser/subresource_filter_features_test_support.h +++ b/components/subresource_filter/core/browser/subresource_filter_features_test_support.h
@@ -16,16 +16,17 @@ namespace testing { // Helper to override the state of the |kSafeBrowsingSubresourceFilter| feature, -// and its variation parameters, e.g., maximum activation state and activation +// and its variation parameters, e.g., maximum activation level and activation // scope. Expects a pre-existing global base::FieldTrialList singleton. class ScopedSubresourceFilterFeatureToggle { public: ScopedSubresourceFilterFeatureToggle( base::FeatureList::OverrideState feature_state, - const std::string& maximum_activation_state, + const std::string& maximum_activation_level, const std::string& activation_scope, const std::string& activation_lists = std::string(), - const std::string& performance_measurement_rate = std::string()); + const std::string& performance_measurement_rate = std::string(), + const std::string& suppress_notifications = std::string()); ScopedSubresourceFilterFeatureToggle( base::FeatureList::OverrideState feature_state,
diff --git a/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc b/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc index d2ab51d..55fb1981 100644 --- a/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc +++ b/components/subresource_filter/core/browser/subresource_filter_features_unittest.cc
@@ -12,37 +12,37 @@ namespace subresource_filter { -TEST(SubresourceFilterFeaturesTest, ActivationState) { +TEST(SubresourceFilterFeaturesTest, ActivationLevel) { const struct { bool feature_enabled; - const char* activation_state_param; - ActivationState expected_activation_state; - } kTestCases[] = {{false, "", ActivationState::DISABLED}, - {false, "disabled", ActivationState::DISABLED}, - {false, "dryrun", ActivationState::DISABLED}, - {false, "enabled", ActivationState::DISABLED}, - {false, "%$ garbage !%", ActivationState::DISABLED}, - {true, "", ActivationState::DISABLED}, - {true, "disable", ActivationState::DISABLED}, - {true, "Disable", ActivationState::DISABLED}, - {true, "disabled", ActivationState::DISABLED}, - {true, "%$ garbage !%", ActivationState::DISABLED}, - {true, kActivationStateDryRun, ActivationState::DRYRUN}, - {true, kActivationStateEnabled, ActivationState::ENABLED}, - {true, "Enabled", ActivationState::ENABLED}}; + const char* activation_level_param; + ActivationLevel expected_activation_level; + } kTestCases[] = {{false, "", ActivationLevel::DISABLED}, + {false, "disabled", ActivationLevel::DISABLED}, + {false, "dryrun", ActivationLevel::DISABLED}, + {false, "enabled", ActivationLevel::DISABLED}, + {false, "%$ garbage !%", ActivationLevel::DISABLED}, + {true, "", ActivationLevel::DISABLED}, + {true, "disable", ActivationLevel::DISABLED}, + {true, "Disable", ActivationLevel::DISABLED}, + {true, "disabled", ActivationLevel::DISABLED}, + {true, "%$ garbage !%", ActivationLevel::DISABLED}, + {true, kActivationLevelDryRun, ActivationLevel::DRYRUN}, + {true, kActivationLevelEnabled, ActivationLevel::ENABLED}, + {true, "Enabled", ActivationLevel::ENABLED}}; for (const auto& test_case : kTestCases) { SCOPED_TRACE(::testing::Message("Enabled = ") << test_case.feature_enabled); - SCOPED_TRACE(::testing::Message("ActivationStateParam = \"") - << test_case.activation_state_param << "\""); + SCOPED_TRACE(::testing::Message("ActivationLevelParam = \"") + << test_case.activation_level_param << "\""); base::FieldTrialList field_trial_list(nullptr /* entropy_provider */); testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE : base::FeatureList::OVERRIDE_USE_DEFAULT, - test_case.activation_state_param, kActivationScopeNoSites); + test_case.activation_level_param, kActivationScopeNoSites); - EXPECT_EQ(test_case.expected_activation_state, GetMaximumActivationState()); + EXPECT_EQ(test_case.expected_activation_level, GetMaximumActivationLevel()); EXPECT_EQ(ActivationScope::NO_SITES, GetCurrentActivationScope()); } } @@ -75,48 +75,48 @@ testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE : base::FeatureList::OVERRIDE_USE_DEFAULT, - kActivationStateDisabled, test_case.activation_scope_param); + kActivationLevelDisabled, test_case.activation_scope_param); - EXPECT_EQ(ActivationState::DISABLED, GetMaximumActivationState()); + EXPECT_EQ(ActivationLevel::DISABLED, GetMaximumActivationLevel()); EXPECT_EQ(test_case.expected_activation_scope, GetCurrentActivationScope()); } } -TEST(SubresourceFilterFeaturesTest, ActivationStateAndScope) { +TEST(SubresourceFilterFeaturesTest, ActivationLevelAndScope) { const struct { bool feature_enabled; - const char* activation_state_param; - ActivationState expected_activation_state; + const char* activation_level_param; + ActivationLevel expected_activation_level; const char* activation_scope_param; ActivationScope expected_activation_scope; } kTestCases[] = { - {false, kActivationStateDisabled, ActivationState::DISABLED, + {false, kActivationLevelDisabled, ActivationLevel::DISABLED, kActivationScopeNoSites, ActivationScope::NO_SITES}, - {true, kActivationStateDisabled, ActivationState::DISABLED, + {true, kActivationLevelDisabled, ActivationLevel::DISABLED, kActivationScopeNoSites, ActivationScope::NO_SITES}, - {true, kActivationStateDisabled, ActivationState::DISABLED, + {true, kActivationLevelDisabled, ActivationLevel::DISABLED, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {true, kActivationStateDisabled, ActivationState::DISABLED, + {true, kActivationLevelDisabled, ActivationLevel::DISABLED, kActivationScopeActivationList, ActivationScope::ACTIVATION_LIST}, - {true, kActivationStateDisabled, ActivationState::DISABLED, + {true, kActivationLevelDisabled, ActivationLevel::DISABLED, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {true, kActivationStateDryRun, ActivationState::DRYRUN, + {true, kActivationLevelDryRun, ActivationLevel::DRYRUN, kActivationScopeNoSites, ActivationScope::NO_SITES}, - {true, kActivationStateDryRun, ActivationState::DRYRUN, + {true, kActivationLevelDryRun, ActivationLevel::DRYRUN, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {true, kActivationStateDryRun, ActivationState::DRYRUN, + {true, kActivationLevelDryRun, ActivationLevel::DRYRUN, kActivationScopeActivationList, ActivationScope::ACTIVATION_LIST}, - {true, kActivationStateDryRun, ActivationState::DRYRUN, + {true, kActivationLevelDryRun, ActivationLevel::DRYRUN, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {true, kActivationStateEnabled, ActivationState::ENABLED, + {true, kActivationLevelEnabled, ActivationLevel::ENABLED, kActivationScopeNoSites, ActivationScope::NO_SITES}, - {true, kActivationStateEnabled, ActivationState::ENABLED, + {true, kActivationLevelEnabled, ActivationLevel::ENABLED, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {true, kActivationStateEnabled, ActivationState::ENABLED, + {true, kActivationLevelEnabled, ActivationLevel::ENABLED, kActivationScopeActivationList, ActivationScope::ACTIVATION_LIST}, - {true, kActivationStateEnabled, ActivationState::ENABLED, + {true, kActivationLevelEnabled, ActivationLevel::ENABLED, kActivationScopeAllSites, ActivationScope::ALL_SITES}, - {false, kActivationStateEnabled, ActivationState::DISABLED, + {false, kActivationLevelEnabled, ActivationLevel::DISABLED, kActivationScopeAllSites, ActivationScope::NO_SITES}}; for (const auto& test_case : kTestCases) { @@ -124,10 +124,10 @@ testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE : base::FeatureList::OVERRIDE_USE_DEFAULT, - test_case.activation_state_param, test_case.activation_scope_param); + test_case.activation_level_param, test_case.activation_scope_param); EXPECT_EQ(test_case.expected_activation_scope, GetCurrentActivationScope()); - EXPECT_EQ(test_case.expected_activation_state, GetMaximumActivationState()); + EXPECT_EQ(test_case.expected_activation_level, GetMaximumActivationLevel()); } } @@ -176,7 +176,7 @@ testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE : base::FeatureList::OVERRIDE_USE_DEFAULT, - kActivationStateDisabled, kActivationScopeNoSites, + kActivationLevelDisabled, kActivationScopeNoSites, test_case.activation_list_param); EXPECT_EQ(test_case.expected_activation_list, GetCurrentActivationList()); @@ -219,4 +219,37 @@ } } +TEST(SubresourceFilterFeaturesTest, SuppressNotifications) { + const struct { + bool feature_enabled; + const char* suppress_notifications_param; + bool expected_suppress_notifications_value; + } kTestCases[] = {{false, "", false}, + {false, "true", false}, + {false, "false", false}, + {false, "invalid value", false}, + {true, "", false}, + {true, "false", false}, + {true, "invalid value", false}, + {true, "True", false}, + {true, "TRUE", false}, + {true, "true", true}}; + + for (const auto& test_case : kTestCases) { + SCOPED_TRACE(::testing::Message("Enabled = ") << test_case.feature_enabled); + SCOPED_TRACE(::testing::Message("SuppressNotificationsParam = \"") + << test_case.suppress_notifications_param << "\""); + + base::FieldTrialList field_trial_list(nullptr /* entropy_provider */); + testing::ScopedSubresourceFilterFeatureToggle scoped_feature_toggle( + test_case.feature_enabled ? base::FeatureList::OVERRIDE_ENABLE_FEATURE + : base::FeatureList::OVERRIDE_USE_DEFAULT, + {{kSuppressNotificationsParameterName, + test_case.suppress_notifications_param}}); + + EXPECT_EQ(test_case.expected_suppress_notifications_value, + ShouldSuppressNotifications()); + } +} + } // namespace subresource_filter
diff --git a/components/subresource_filter/core/common/BUILD.gn b/components/subresource_filter/core/common/BUILD.gn index 5e260b7..ea11db72 100644 --- a/components/subresource_filter/core/common/BUILD.gn +++ b/components/subresource_filter/core/common/BUILD.gn
@@ -4,11 +4,12 @@ static_library("common") { sources = [ + "activation_level.cc", + "activation_level.h", "activation_list.cc", "activation_list.h", "activation_scope.cc", "activation_scope.h", - "activation_state.cc", "activation_state.h", "closed_hash_map.h", "copying_file_stream.cc",
diff --git a/components/subresource_filter/core/common/activation_state.cc b/components/subresource_filter/core/common/activation_level.cc similarity index 62% rename from components/subresource_filter/core/common/activation_state.cc rename to components/subresource_filter/core/common/activation_level.cc index 3461eb8..14fc77ad 100644 --- a/components/subresource_filter/core/common/activation_state.cc +++ b/components/subresource_filter/core/common/activation_level.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/subresource_filter/core/common/activation_state.h" +#include "components/subresource_filter/core/common/activation_level.h" #include <ostream> @@ -10,15 +10,15 @@ namespace subresource_filter { -std::ostream& operator<<(std::ostream& os, const ActivationState& state) { - switch (state) { - case ActivationState::DISABLED: +std::ostream& operator<<(std::ostream& os, const ActivationLevel& level) { + switch (level) { + case ActivationLevel::DISABLED: os << "DISABLED"; break; - case ActivationState::DRYRUN: + case ActivationLevel::DRYRUN: os << "DRYRUN"; break; - case ActivationState::ENABLED: + case ActivationLevel::ENABLED: os << "ENABLED"; break; default:
diff --git a/components/subresource_filter/core/common/activation_level.h b/components/subresource_filter/core/common/activation_level.h new file mode 100644 index 0000000..097264a --- /dev/null +++ b/components/subresource_filter/core/common/activation_level.h
@@ -0,0 +1,27 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_ACTIVATION_LEVEL_H_ +#define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_ACTIVATION_LEVEL_H_ + +#include <iosfwd> + +namespace subresource_filter { + +// Degrees to which the subresource filtering mechanism can be activated. +enum class ActivationLevel { + DISABLED, + // Subresource loads are matched against filtering rules, but all loads are + // allowed to proceed regardless. Used for stability and performance testing. + DRYRUN, + ENABLED, + LAST = ENABLED, +}; + +// For logging use only. +std::ostream& operator<<(std::ostream& os, const ActivationLevel& level); + +} // namespace subresource_filter + +#endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_ACTIVATION_LEVEL_H_
diff --git a/components/subresource_filter/core/common/activation_state.h b/components/subresource_filter/core/common/activation_state.h index 4f568d5..fc84569 100644 --- a/components/subresource_filter/core/common/activation_state.h +++ b/components/subresource_filter/core/common/activation_state.h
@@ -1,26 +1,39 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_ACTIVATION_STATE_H_ #define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_ACTIVATION_STATE_H_ -#include <iosfwd> +#include "components/subresource_filter/core/common/activation_level.h" namespace subresource_filter { -// Degrees to which the subresource filtering mechanism can be activated. -enum class ActivationState { - DISABLED, - // Subresource loads are matched against filtering rules, but all loads are - // allowed to proceed regardless. Used for stability and performance testing. - DRYRUN, - ENABLED, - LAST = ENABLED, -}; +// Encompasses all details of whether/how subresource filtering should be +// activated in a given frame in the frame hierarchy. +struct ActivationState { + // The degree to which subresource filtering is activated for the page load. + ActivationLevel activation_level = ActivationLevel::DISABLED; -// For logging use only. -std::ostream& operator<<(std::ostream& os, const ActivationState& state); + // Even when subresource filtering is activated at the page level, a document + // in the current frame (and/or ancestors thereof) may still match special + // filtering rules that specifically disable using certain types of rules for + // filtering subresources of that document (and/or of documents in descendent + // frames). See proto::ActivationType for details. + // + // |filtering_disabled_for_document| indicates whether the document in this + // frame is subject to a whitelist rule with DOCUMENT activation type. + // + // |generic_blocking_rules_disabled| indicates whether the document in this + // frame is subject to a whitelist rule with GENERICBLOCK activation type, and + // is only defined if |filtering_disabled_for_document| is false. + bool filtering_disabled_for_document = false; + bool generic_blocking_rules_disabled = false; + + // Whether or not extended performance measurements are enabled for the + // current page load (across all frames). + bool measure_performance = false; +}; } // namespace subresource_filter
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc index 4c5d56f..6efaeef 100644 --- a/components/sync/driver/model_type_controller.cc +++ b/components/sync/driver/model_type_controller.cc
@@ -59,6 +59,14 @@ } } +void CallDisableSyncHelper(SyncClient* sync_client, ModelType type) { + base::WeakPtr<ModelTypeSyncBridge> bridge = + sync_client->GetSyncBridgeForModelType(type); + if (bridge) { + bridge->DisableSync(); + } +} + void ReportError(ModelType model_type, scoped_refptr<base::SingleThreadTaskRunner> ui_thread, const ModelErrorHandler& error_handler, @@ -221,8 +229,7 @@ if ((state() == MODEL_LOADED || state() == RUNNING) && (!sync_prefs_.IsFirstSetupComplete() || !preferred_types.Has(type()))) { model_thread_->PostTask( - FROM_HERE, base::Bind(&ModelTypeSyncBridge::DisableSync, - sync_client_->GetSyncBridgeForModelType(type()))); + FROM_HERE, base::Bind(&CallDisableSyncHelper, sync_client_, type())); } state_ = NOT_RUNNING;
diff --git a/components/test_runner/web_ax_object_proxy.cc b/components/test_runner/web_ax_object_proxy.cc index 21174b3..90df73a 100644 --- a/components/test_runner/web_ax_object_proxy.cc +++ b/components/test_runner/web_ax_object_proxy.cc
@@ -599,6 +599,7 @@ .SetProperty("isRichlyEditable", &WebAXObjectProxy::IsRichlyEditable) .SetProperty("isFocused", &WebAXObjectProxy::IsFocused) .SetProperty("isFocusable", &WebAXObjectProxy::IsFocusable) + .SetProperty("isModal", &WebAXObjectProxy::IsModal) .SetProperty("isSelected", &WebAXObjectProxy::IsSelected) .SetProperty("isSelectable", &WebAXObjectProxy::IsSelectable) .SetProperty("isMultiSelectable", &WebAXObjectProxy::IsMultiSelectable) @@ -977,6 +978,11 @@ return accessibility_object_.canSetFocusAttribute(); } +bool WebAXObjectProxy::IsModal() { + accessibility_object_.updateLayoutAndCheckValidity(); + return accessibility_object_.isModal(); +} + bool WebAXObjectProxy::IsSelected() { accessibility_object_.updateLayoutAndCheckValidity(); return accessibility_object_.isSelected();
diff --git a/components/test_runner/web_ax_object_proxy.h b/components/test_runner/web_ax_object_proxy.h index d13a08d..bd618fe 100644 --- a/components/test_runner/web_ax_object_proxy.h +++ b/components/test_runner/web_ax_object_proxy.h
@@ -97,6 +97,7 @@ bool IsRichlyEditable(); bool IsFocused(); bool IsFocusable(); + bool IsModal(); bool IsSelected(); bool IsSelectable(); bool IsMultiSelectable();
diff --git a/content/app/BUILD.gn b/content/app/BUILD.gn index 38402be..cdd9410 100644 --- a/content/app/BUILD.gn +++ b/content/app/BUILD.gn
@@ -54,6 +54,7 @@ "//device/generic_sensor", "//device/geolocation", "//device/power_save_blocker", + "//device/sensors", "//device/time_zone_monitor", "//device/usb", "//device/vibration",
diff --git a/content/app/DEPS b/content/app/DEPS index 81c303d..d001ffa1 100644 --- a/content/app/DEPS +++ b/content/app/DEPS
@@ -7,6 +7,7 @@ "+device/generic_sensor", "+device/geolocation", "+device/power_save_blocker", + "+device/sensors", "+device/time_zone_monitor", "+device/usb", "+device/vibration",
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc index 2aebbb76..77a7111b 100644 --- a/content/app/android/library_loader_hooks.cc +++ b/content/app/android/library_loader_hooks.cc
@@ -30,6 +30,7 @@ #include "device/gamepad/android/gamepad_jni_registrar.h" #include "device/generic_sensor/android/sensors_jni_registrar.h" #include "device/geolocation/android/geolocation_jni_registrar.h" +#include "device/sensors/android/device_sensor_jni_registrar.h" #include "device/time_zone_monitor/android/time_zone_monitor_jni_registrar.h" #include "device/usb/android/usb_jni_registrar.h" #include "media/base/android/media_jni_registrar.h" @@ -82,6 +83,9 @@ if (!device::android::RegisterBluetoothJni(env)) return false; + if (!device::android::RegisterDeviceSensorJni(env)) + return false; + if (!device::android::RegisterGamepadJni(env)) return false;
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 7641725..2147285 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -76,7 +76,7 @@ "//device/nfc:mojo_bindings", "//device/power_save_blocker", "//device/screen_orientation/public/interfaces", - "//device/sensors/public/cpp", + "//device/sensors", "//device/vibration", "//device/vr", "//device/wake_lock", @@ -129,7 +129,6 @@ "//third_party/WebKit/public:resources", "//third_party/angle:angle_common", "//third_party/icu", - "//third_party/kasko:kasko_features", "//third_party/libyuv", "//third_party/re2", "//third_party/zlib", @@ -435,25 +434,6 @@ # needed on all platforms. "compositor/surface_utils.cc", "compositor/surface_utils.h", - "device_sensors/ambient_light_mac.cc", - "device_sensors/ambient_light_mac.h", - "device_sensors/data_fetcher_shared_memory.h", - "device_sensors/data_fetcher_shared_memory_android.cc", - "device_sensors/data_fetcher_shared_memory_base.cc", - "device_sensors/data_fetcher_shared_memory_base.h", - "device_sensors/data_fetcher_shared_memory_chromeos.cc", - "device_sensors/data_fetcher_shared_memory_default.cc", - "device_sensors/data_fetcher_shared_memory_mac.cc", - "device_sensors/data_fetcher_shared_memory_win.cc", - "device_sensors/device_sensor_host.cc", - "device_sensors/device_sensor_host.h", - "device_sensors/device_sensor_service.cc", - "device_sensors/device_sensor_service.h", - "device_sensors/device_sensors_consts.h", - "device_sensors/sensor_manager_android.cc", - "device_sensors/sensor_manager_android.h", - "device_sensors/sensor_manager_chromeos.cc", - "device_sensors/sensor_manager_chromeos.h", "devtools/browser_devtools_agent_host.cc", "devtools/browser_devtools_agent_host.h", "devtools/devtools_agent_host_impl.cc", @@ -1572,7 +1552,6 @@ } if (is_win) { - sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ] defines += [ # This prevents the inclusion of atlhost.h which paired # with the windows 8 sdk it does the wrong thing. @@ -1589,7 +1568,6 @@ "dxguid.lib", "imm32.lib", "oleacc.lib", - "sensorsapi.lib", "portabledeviceguids.lib", ] } @@ -1813,7 +1791,6 @@ ] sources -= [ "browser_ipc_logging.cc", - "device_sensors/data_fetcher_shared_memory_default.cc", "media/session/audio_focus_delegate_default.cc", "media/session/audio_focus_manager.cc", "media/session/audio_focus_manager.h", @@ -1859,12 +1836,10 @@ } if (is_mac) { - sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ] deps += [ "//media", "//sandbox/mac:sandbox", "//third_party/mozilla", - "//third_party/sudden_motion_sensor", "//ui/accelerated_widget_mac", ] libs += [ @@ -1875,7 +1850,6 @@ } if (is_chromeos) { - sources -= [ "device_sensors/data_fetcher_shared_memory_default.cc" ] deps += [ "//chromeos", "//chromeos:power_manager_proto",
diff --git a/content/browser/DEPS b/content/browser/DEPS index 375720da..d31cef3 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS
@@ -23,7 +23,7 @@ "+device/nfc", "+device/power_save_blocker", "+device/screen_orientation/public/interfaces", - "+device/sensors/public", + "+device/sensors", "+device/vibration", # For Vibration API "+device/vr", # For WebVR API "+device/wake_lock",
diff --git a/content/browser/android/browser_jni_registrar.cc b/content/browser/android/browser_jni_registrar.cc index c9cde11..084ca80f 100644 --- a/content/browser/android/browser_jni_registrar.cc +++ b/content/browser/android/browser_jni_registrar.cc
@@ -23,7 +23,6 @@ #include "content/browser/android/load_url_params.h" #include "content/browser/android/tracing_controller_android.h" #include "content/browser/android/web_contents_observer_proxy.h" -#include "content/browser/device_sensors/sensor_manager_android.h" #include "content/browser/frame_host/navigation_controller_android.h" #include "content/browser/media/session/audio_focus_delegate_android.h" #include "content/browser/media/session/media_session_android.h" @@ -61,7 +60,6 @@ {"NavigationControllerAndroid", content::NavigationControllerAndroid::Register}, {"RegisterImeAdapter", content::RegisterImeAdapter}, - {"SensorManagerAndroid", content::SensorManagerAndroid::Register}, {"SpeechRecognizerImplAndroid", content::SpeechRecognizerImplAndroid::RegisterSpeechRecognizer}, {"TracingControllerAndroid", content::RegisterTracingControllerAndroid},
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 4c5e325..d70a6a4 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -52,7 +52,6 @@ #include "components/tracing/common/tracing_switches.h" #include "content/browser/audio_manager_thread.h" #include "content/browser/browser_thread_impl.h" -#include "content/browser/device_sensors/device_sensor_service.h" #include "content/browser/dom_storage/dom_storage_area.h" #include "content/browser/download/download_resource_handler.h" #include "content/browser/download/save_file_manager.h" @@ -92,6 +91,7 @@ #include "content/public/common/result_codes.h" #include "device/battery/battery_status_service.h" #include "device/gamepad/gamepad_service.h" +#include "device/sensors/device_sensor_service.h" #include "media/base/media.h" #include "media/base/user_input_monitor.h" #include "media/midi/midi_service.h" @@ -1372,7 +1372,7 @@ } { TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); - DeviceSensorService::GetInstance()->Shutdown(); + device::DeviceSensorService::GetInstance()->Shutdown(); } #if !defined(OS_ANDROID) {
diff --git a/content/browser/device_sensors/DEPS b/content/browser/device_sensors/DEPS index fac77c68..860720f 100644 --- a/content/browser/device_sensors/DEPS +++ b/content/browser/device_sensors/DEPS
@@ -1,4 +1,3 @@ include_rules = [ "+device/sensors/public/cpp", - "+third_party/sudden_motion_sensor", ]
diff --git a/content/browser/device_sensors/device_sensor_browsertest.cc b/content/browser/device_sensors/device_sensor_browsertest.cc index 5dafe96..df8fbc7 100644 --- a/content/browser/device_sensors/device_sensor_browsertest.cc +++ b/content/browser/device_sensors/device_sensor_browsertest.cc
@@ -7,8 +7,6 @@ #include "base/synchronization/waitable_event.h" #include "base/threading/platform_thread.h" #include "build/build_config.h" -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" -#include "content/browser/device_sensors/device_sensor_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" @@ -18,6 +16,8 @@ #include "content/public/test/test_utils.h" #include "content/shell/browser/shell.h" #include "content/shell/browser/shell_javascript_dialog_manager.h" +#include "device/sensors/data_fetcher_shared_memory.h" +#include "device/sensors/device_sensor_service.h" #include "device/sensors/public/cpp/device_light_hardware_buffer.h" #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" @@ -26,7 +26,7 @@ namespace { -class FakeDataFetcher : public DataFetcherSharedMemory { +class FakeDataFetcher : public device::DataFetcherSharedMemory { public: FakeDataFetcher() : sensor_data_available_(true) {} ~FakeDataFetcher() override {} @@ -57,31 +57,31 @@ orientation_stopped_callback_ = orientation_stopped_callback; } - bool Start(ConsumerType consumer_type, void* buffer) override { + bool Start(device::ConsumerType consumer_type, void* buffer) override { EXPECT_TRUE(buffer); switch (consumer_type) { - case CONSUMER_TYPE_MOTION: { - DeviceMotionHardwareBuffer* motion_buffer = - static_cast<DeviceMotionHardwareBuffer*>(buffer); + case device::CONSUMER_TYPE_MOTION: { + device::DeviceMotionHardwareBuffer* motion_buffer = + static_cast<device::DeviceMotionHardwareBuffer*>(buffer); if (sensor_data_available_) UpdateMotion(motion_buffer); SetMotionBufferReady(motion_buffer); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, motion_started_callback_); } break; - case CONSUMER_TYPE_ORIENTATION: { - DeviceOrientationHardwareBuffer* orientation_buffer = - static_cast<DeviceOrientationHardwareBuffer*>(buffer); + case device::CONSUMER_TYPE_ORIENTATION: { + device::DeviceOrientationHardwareBuffer* orientation_buffer = + static_cast<device::DeviceOrientationHardwareBuffer*>(buffer); if (sensor_data_available_) UpdateOrientation(orientation_buffer); SetOrientationBufferReady(orientation_buffer); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, orientation_started_callback_); } break; - case CONSUMER_TYPE_LIGHT: { - DeviceLightHardwareBuffer* light_buffer = - static_cast<DeviceLightHardwareBuffer*>(buffer); + case device::CONSUMER_TYPE_LIGHT: { + device::DeviceLightHardwareBuffer* light_buffer = + static_cast<device::DeviceLightHardwareBuffer*>(buffer); UpdateLight(light_buffer, sensor_data_available_ ? 100 @@ -95,17 +95,17 @@ return true; } - bool Stop(ConsumerType consumer_type) override { + bool Stop(device::ConsumerType consumer_type) override { switch (consumer_type) { - case CONSUMER_TYPE_MOTION: + case device::CONSUMER_TYPE_MOTION: BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, motion_stopped_callback_); break; - case CONSUMER_TYPE_ORIENTATION: + case device::CONSUMER_TYPE_ORIENTATION: BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, orientation_stopped_callback_); break; - case CONSUMER_TYPE_LIGHT: + case device::CONSUMER_TYPE_LIGHT: BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, light_stopped_callback_); break; @@ -125,19 +125,20 @@ sensor_data_available_ = available; } - void SetMotionBufferReady(DeviceMotionHardwareBuffer* buffer) { + void SetMotionBufferReady(device::DeviceMotionHardwareBuffer* buffer) { buffer->seqlock.WriteBegin(); buffer->data.allAvailableSensorsAreActive = true; buffer->seqlock.WriteEnd(); } - void SetOrientationBufferReady(DeviceOrientationHardwareBuffer* buffer) { + void SetOrientationBufferReady( + device::DeviceOrientationHardwareBuffer* buffer) { buffer->seqlock.WriteBegin(); buffer->data.allAvailableSensorsAreActive = true; buffer->seqlock.WriteEnd(); } - void UpdateMotion(DeviceMotionHardwareBuffer* buffer) { + void UpdateMotion(device::DeviceMotionHardwareBuffer* buffer) { buffer->seqlock.WriteBegin(); buffer->data.accelerationX = 1; buffer->data.hasAccelerationX = true; @@ -165,7 +166,7 @@ buffer->seqlock.WriteEnd(); } - void UpdateOrientation(DeviceOrientationHardwareBuffer* buffer) { + void UpdateOrientation(device::DeviceOrientationHardwareBuffer* buffer) { buffer->seqlock.WriteBegin(); buffer->data.alpha = 1; buffer->data.hasAlpha = true; @@ -177,7 +178,7 @@ buffer->seqlock.WriteEnd(); } - void UpdateLight(DeviceLightHardwareBuffer* buffer, double lux) { + void UpdateLight(device::DeviceLightHardwareBuffer* buffer, double lux) { buffer->seqlock.WriteBegin(); buffer->data.value = lux; buffer->seqlock.WriteEnd(); @@ -235,7 +236,8 @@ orientation_started_runloop_->QuitClosure()); fetcher_->SetOrientationStoppedCallback( orientation_stopped_runloop_->QuitClosure()); - DeviceSensorService::GetInstance()->SetDataFetcherForTesting(fetcher_); + device::DeviceSensorService::GetInstance()->SetDataFetcherForTesting( + fetcher_); } void SetUpOnIOThread() {
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc index 0fec3f3..7b18af8ef 100644 --- a/content/browser/download/download_request_core.cc +++ b/content/browser/download/download_request_core.cc
@@ -356,13 +356,12 @@ // Create a new buffer, which will be handed to the download thread for file // writing and deletion. bool DownloadRequestCore::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(buf && buf_size); DCHECK(!read_buffer_.get()); - *buf_size = min_size < 0 ? kReadBufSize : min_size; + *buf_size = kReadBufSize; read_buffer_ = new net::IOBuffer(*buf_size); *buf = read_buffer_.get(); return true;
diff --git a/content/browser/download/download_request_core.h b/content/browser/download/download_request_core.h index aed9b60..4fc3f75 100644 --- a/content/browser/download/download_request_core.h +++ b/content/browser/download/download_request_core.h
@@ -70,8 +70,7 @@ // URLRequest::Read(). Call OnReadCompleted() when the Read operation // completes. bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size); + int* buf_size); // Used to notify DownloadRequestCore that the caller is about to abort the // outer request. |reason| will be used as the final interrupt reason when
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc index 30cf6fa..e52984a 100644 --- a/content/browser/download/download_resource_handler.cc +++ b/content/browser/download/download_resource_handler.cc
@@ -172,9 +172,8 @@ // Create a new buffer, which will be handed to the download thread for file // writing and deletion. bool DownloadResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { - return core_.OnWillRead(buf, buf_size, min_size); + int* buf_size) { + return core_.OnWillRead(buf, buf_size); } // Pass the buffer to the download file writer.
diff --git a/content/browser/download/download_resource_handler.h b/content/browser/download/download_resource_handler.h index 360770a..0847f75 100644 --- a/content/browser/download/download_resource_handler.h +++ b/content/browser/download/download_resource_handler.h
@@ -67,8 +67,7 @@ // Create a new buffer, which will be handed to the download thread for file // writing and deletion. bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override;
diff --git a/content/browser/download/save_file_resource_handler.cc b/content/browser/download/save_file_resource_handler.cc index 6ac4a09e..efea74f 100644 --- a/content/browser/download/save_file_resource_handler.cc +++ b/content/browser/download/save_file_resource_handler.cc
@@ -71,12 +71,11 @@ } bool SaveFileResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { DCHECK_EQ(AuthorizationState::AUTHORIZED, authorization_state_); DCHECK(buf && buf_size); if (!read_buffer_.get()) { - *buf_size = min_size < 0 ? kReadBufSize : min_size; + *buf_size = kReadBufSize; read_buffer_ = new net::IOBuffer(*buf_size); } *buf = read_buffer_.get();
diff --git a/content/browser/download/save_file_resource_handler.h b/content/browser/download/save_file_resource_handler.h index ef8f97e4..63f061d 100644 --- a/content/browser/download/save_file_resource_handler.h +++ b/content/browser/download/save_file_resource_handler.h
@@ -68,8 +68,7 @@ // Creates a new buffer, which will be handed to the download thread for file // writing and deletion. bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; // Passes the buffer to the download file writer. void OnReadCompleted(int bytes_read,
diff --git a/content/browser/download/url_downloader.cc b/content/browser/download/url_downloader.cc index 0de4615..7f6019a 100644 --- a/content/browser/download/url_downloader.cc +++ b/content/browser/download/url_downloader.cc
@@ -143,7 +143,7 @@ // doesn't use the buffer. scoped_refptr<net::IOBuffer> buf; int buf_size; - if (!core_.OnWillRead(&buf, &buf_size, -1)) { + if (!core_.OnWillRead(&buf, &buf_size)) { int result = request_->CancelWithError(net::ERR_ABORTED); base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&UrlDownloader::ResponseCompleted,
diff --git a/content/browser/frame_host/DEPS b/content/browser/frame_host/DEPS index a6068f73..09569cb 100644 --- a/content/browser/frame_host/DEPS +++ b/content/browser/frame_host/DEPS
@@ -5,8 +5,6 @@ "-content/public/browser/web_contents.h", "-content/public/browser/web_contents_delegate.h", "-content/public/browser/web_contents_view.h", - - "+third_party/kasko", ] specific_include_rules = {
diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc index 9aafa8aa..dd86fca 100644 --- a/content/browser/frame_host/debug_urls.cc +++ b/content/browser/frame_host/debug_urls.cc
@@ -22,7 +22,6 @@ #include "content/public/common/content_constants.h" #include "content/public/common/url_constants.h" #include "ppapi/features/features.h" -#include "third_party/kasko/kasko_features.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_PLUGINS) @@ -49,12 +48,6 @@ const char kAsanCorruptHeap[] = "/browser-corrupt-heap"; #endif -#if BUILDFLAG(ENABLE_KASKO) -// Define the Kasko debug URLs. -const char kKaskoCrashDomain[] = "kasko"; -const char kKaskoSendReport[] = "/send-report"; -#endif - void HandlePpapiFlashDebugURL(const GURL& url) { #if BUILDFLAG(ENABLE_PLUGINS) bool crash = url == kChromeUIPpapiFlashCrashURL; @@ -72,50 +65,6 @@ #endif } -bool IsKaskoDebugURL(const GURL& url) { -#if BUILDFLAG(ENABLE_KASKO) - return (url.is_valid() && url.SchemeIs(kChromeUIScheme) && - url.DomainIs(kKaskoCrashDomain) && - url.path_piece() == kKaskoSendReport); -#else - return false; -#endif -} - -void HandleKaskoDebugURL() { -#if BUILDFLAG(ENABLE_KASKO) - // Signature of the exported crash key setting function. - using SetCrashKeyValueImplPtr = void(__cdecl *)(const wchar_t*, - const wchar_t*); - // Signature of an enhanced crash reporting function. - using ReportCrashWithProtobufPtr = void(__cdecl *)(EXCEPTION_POINTERS*, - const char*); - - HMODULE exe_hmodule = ::GetModuleHandle(NULL); - - // First, set a crash key using the exported function reserved for Kasko - // clients (SyzyASAN for now). - SetCrashKeyValueImplPtr set_crash_key_value_impl = - reinterpret_cast<SetCrashKeyValueImplPtr>( - ::GetProcAddress(exe_hmodule, "SetCrashKeyValueImpl")); - if (set_crash_key_value_impl) - set_crash_key_value_impl(L"kasko-set-crash-key-value-impl", L"true"); - else - NOTREACHED(); - - // Next, invoke a crash report via Kasko. - ReportCrashWithProtobufPtr report_crash_with_protobuf = - reinterpret_cast<ReportCrashWithProtobufPtr>( - ::GetProcAddress(exe_hmodule, "ReportCrashWithProtobuf")); - if (report_crash_with_protobuf) - report_crash_with_protobuf(NULL, "Invoked from debug url."); - else - NOTREACHED(); -#else - NOTIMPLEMENTED(); -#endif -} - bool IsAsanDebugURL(const GURL& url) { #if defined(SYZYASAN) if (!base::debug::IsBinaryInstrumented()) @@ -197,11 +146,6 @@ if (IsAsanDebugURL(url)) return HandleAsanDebugURL(url); - if (IsKaskoDebugURL(url)) { - HandleKaskoDebugURL(); - return true; - } - if (url == kChromeUIBrowserCrashURL) { // Induce an intentional crash in the browser process. CHECK(false);
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc index 05d05de..8168f10 100644 --- a/content/browser/loader/async_resource_handler.cc +++ b/content/browser/loader/async_resource_handler.cc
@@ -368,10 +368,8 @@ } bool AsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { DCHECK(!has_controller()); - DCHECK_EQ(-1, min_size); // TODO(mmenke): Should fail with ERR_INSUFFICIENT_RESOURCES here. if (!CheckForSufficientResource())
diff --git a/content/browser/loader/async_resource_handler.h b/content/browser/loader/async_resource_handler.h index f498d4c..dff9e67 100644 --- a/content/browser/loader/async_resource_handler.h +++ b/content/browser/loader/async_resource_handler.h
@@ -51,8 +51,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/detachable_resource_handler.cc b/content/browser/loader/detachable_resource_handler.cc index 85ac2d3..c534a25 100644 --- a/content/browser/loader/detachable_resource_handler.cc +++ b/content/browser/loader/detachable_resource_handler.cc
@@ -184,10 +184,8 @@ } bool DetachableResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { if (!next_handler_) { - DCHECK_EQ(-1, min_size); if (!read_buffer_.get()) read_buffer_ = new net::IOBuffer(kReadBufSize); *buf = read_buffer_; @@ -195,7 +193,7 @@ return true; } - return next_handler_->OnWillRead(buf, buf_size, min_size); + return next_handler_->OnWillRead(buf, buf_size); } void DetachableResourceHandler::OnReadCompleted( @@ -226,7 +224,9 @@ is_finished_ = true; - next_handler_->OnResponseCompleted(status, std::move(controller)); + HoldController(std::move(controller)); + next_handler_->OnResponseCompleted(status, + base::MakeUnique<Controller>(this)); } void DetachableResourceHandler::OnDataDownloaded(int bytes_downloaded) {
diff --git a/content/browser/loader/detachable_resource_handler.h b/content/browser/loader/detachable_resource_handler.h index cda6bbc..c9599a24 100644 --- a/content/browser/loader/detachable_resource_handler.h +++ b/content/browser/loader/detachable_resource_handler.h
@@ -61,8 +61,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/intercepting_resource_handler.cc b/content/browser/loader/intercepting_resource_handler.cc index f1527f0..902ba30 100644 --- a/content/browser/loader/intercepting_resource_handler.cc +++ b/content/browser/loader/intercepting_resource_handler.cc
@@ -93,15 +93,13 @@ } bool InterceptingResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { if (state_ == State::PASS_THROUGH) - return next_handler_->OnWillRead(buf, buf_size, min_size); + return next_handler_->OnWillRead(buf, buf_size); DCHECK_EQ(State::STARTING, state_); - DCHECK_EQ(-1, min_size); - if (!next_handler_->OnWillRead(buf, buf_size, min_size)) + if (!next_handler_->OnWillRead(buf, buf_size)) return false; first_read_buffer_ = *buf; @@ -286,7 +284,7 @@ first_read_buffer_ = nullptr; first_read_buffer_size_ = 0; } else { - if (!next_handler_->OnWillRead(&buffer, &size, -1)) { + if (!next_handler_->OnWillRead(&buffer, &size)) { Cancel(); return; } @@ -318,7 +316,7 @@ scoped_refptr<net::IOBuffer> buf; int size = 0; - if (!next_handler_->OnWillRead(&buf, &size, -1)) { + if (!next_handler_->OnWillRead(&buf, &size)) { Cancel(); return; }
diff --git a/content/browser/loader/intercepting_resource_handler.h b/content/browser/loader/intercepting_resource_handler.h index 183a1aa..56e6e0a 100644 --- a/content/browser/loader/intercepting_resource_handler.h +++ b/content/browser/loader/intercepting_resource_handler.h
@@ -46,8 +46,7 @@ ResourceResponse* response, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/intercepting_resource_handler_unittest.cc b/content/browser/loader/intercepting_resource_handler_unittest.cc index 9d2a21e..5e41a48f 100644 --- a/content/browser/loader/intercepting_resource_handler_unittest.cc +++ b/content/browser/loader/intercepting_resource_handler_unittest.cc
@@ -103,7 +103,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_handler_->buffer()); @@ -119,7 +119,7 @@ EXPECT_EQ(kData, old_handler_body_); // Make sure another read behaves as expected. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(mock_loader_->io_buffer(), old_handler_->buffer()); ASSERT_EQ(MockResourceLoader::Status::IDLE, @@ -136,7 +136,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_handler_->buffer()); @@ -167,7 +167,7 @@ EXPECT_EQ(kData, new_handler_body); // Make sure another read behaves as expected. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(mock_loader_->io_buffer(), new_test_handler->buffer()); ASSERT_EQ(MockResourceLoader::Status::IDLE, @@ -192,7 +192,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -227,7 +227,7 @@ EXPECT_EQ(kData, new_handler_body); // Make sure another read behaves as expected. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(mock_loader_->io_buffer(), new_test_handler->buffer()); ASSERT_EQ(MockResourceLoader::Status::IDLE, @@ -243,7 +243,7 @@ // handler should tell the caller to fail. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead()); EXPECT_EQ(net::ERR_ABORTED, mock_loader_->error_code()); } @@ -255,7 +255,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -283,7 +283,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -312,7 +312,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -351,7 +351,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -398,7 +398,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_NE(mock_loader_->io_buffer(), old_buffer.get()); @@ -471,7 +471,7 @@ EXPECT_EQ(net::URLRequestStatus::IO_PENDING, new_handler_status.status()); // Final EOF byte is read. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted("")); @@ -505,7 +505,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); // Simulate the MimeSniffingResourceHandler asking the // InterceptingResourceHandler to switch to a new handler. @@ -546,7 +546,7 @@ // Simulate the MimeSniffingResourceHandler buffering the data. ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); // Simulate the MimeSniffingResourceHandler asking the // InterceptingResourceHandler to switch to a new handler.
diff --git a/content/browser/loader/layered_resource_handler.cc b/content/browser/loader/layered_resource_handler.cc index 050e7e1..d1cf3a4 100644 --- a/content/browser/loader/layered_resource_handler.cc +++ b/content/browser/loader/layered_resource_handler.cc
@@ -48,10 +48,9 @@ } bool LayeredResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { DCHECK(next_handler_.get()); - return next_handler_->OnWillRead(buf, buf_size, min_size); + return next_handler_->OnWillRead(buf, buf_size); } void LayeredResourceHandler::OnReadCompleted(
diff --git a/content/browser/loader/layered_resource_handler.h b/content/browser/loader/layered_resource_handler.h index 9e92741..0a3846c1 100644 --- a/content/browser/loader/layered_resource_handler.h +++ b/content/browser/loader/layered_resource_handler.h
@@ -38,8 +38,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc index 0ce78bf0..e90fa81 100644 --- a/content/browser/loader/mime_sniffing_resource_handler.cc +++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -216,19 +216,16 @@ } bool MimeSniffingResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { if (state_ == STATE_STREAMING) - return next_handler_->OnWillRead(buf, buf_size, min_size); - - DCHECK_EQ(-1, min_size); + return next_handler_->OnWillRead(buf, buf_size); if (read_buffer_.get()) { CHECK_LT(bytes_read_, read_buffer_size_); *buf = new DependentIOBuffer(read_buffer_.get(), bytes_read_); *buf_size = read_buffer_size_ - bytes_read_; } else { - if (!next_handler_->OnWillRead(buf, buf_size, min_size)) + if (!next_handler_->OnWillRead(buf, buf_size)) return false; read_buffer_ = *buf;
diff --git a/content/browser/loader/mime_sniffing_resource_handler.h b/content/browser/loader/mime_sniffing_resource_handler.h index 73cef65f..47a9dff9 100644 --- a/content/browser/loader/mime_sniffing_resource_handler.h +++ b/content/browser/loader/mime_sniffing_resource_handler.h
@@ -89,8 +89,7 @@ ResourceResponse* response, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/mime_sniffing_resource_handler_unittest.cc b/content/browser/loader/mime_sniffing_resource_handler_unittest.cc index 5580e9a3..0cc90f6 100644 --- a/content/browser/loader/mime_sniffing_resource_handler_unittest.cc +++ b/content/browser/loader/mime_sniffing_resource_handler_unittest.cc
@@ -367,7 +367,7 @@ // Read some data to sniff the mime type. This will ask the next // ResourceHandler for a buffer. - mock_loader.OnWillRead(-1); + mock_loader.OnWillRead(); if (!will_read) { EXPECT_EQ(MockResourceLoader::Status::CANCELED, mock_loader.status()); @@ -543,7 +543,7 @@ // The MimeSniffingResourceHandler should be acting as a pass-through // ResourceHandler. - mock_loader.OnWillRead(-1); + mock_loader.OnWillRead(); if (!will_read) { EXPECT_EQ(MockResourceLoader::Status::CANCELED, mock_loader.status());
diff --git a/content/browser/loader/mock_resource_loader.cc b/content/browser/loader/mock_resource_loader.cc index 0003fd5..56ed554c 100644 --- a/content/browser/loader/mock_resource_loader.cc +++ b/content/browser/loader/mock_resource_loader.cc
@@ -93,13 +93,13 @@ return status_; } -MockResourceLoader::Status MockResourceLoader::OnWillRead(int min_size) { +MockResourceLoader::Status MockResourceLoader::OnWillRead() { EXPECT_FALSE(weak_factory_.HasWeakPtrs()); EXPECT_EQ(Status::IDLE, status_); status_ = Status::CALLING_HANDLER; bool result = - resource_handler_->OnWillRead(&io_buffer_, &io_buffer_size_, min_size); + resource_handler_->OnWillRead(&io_buffer_, &io_buffer_size_); // The second case isn't really allowed, but a number of classes do it // anyways. @@ -113,7 +113,6 @@ EXPECT_FALSE(io_buffer_); status_ = Status::CANCELED; } else { - EXPECT_LE(min_size, io_buffer_size_); EXPECT_LT(0, io_buffer_size_); EXPECT_TRUE(io_buffer_); status_ = Status::IDLE;
diff --git a/content/browser/loader/mock_resource_loader.h b/content/browser/loader/mock_resource_loader.h index b3e962e8..23ad76f 100644 --- a/content/browser/loader/mock_resource_loader.h +++ b/content/browser/loader/mock_resource_loader.h
@@ -59,7 +59,7 @@ Status OnRequestRedirected(const net::RedirectInfo& redirect_info, scoped_refptr<ResourceResponse> response); Status OnResponseStarted(scoped_refptr<ResourceResponse> response); - Status OnWillRead(int min_size); + Status OnWillRead(); Status OnReadCompleted(base::StringPiece bytes); Status OnResponseCompleted(const net::URLRequestStatus& status);
diff --git a/content/browser/loader/mojo_async_resource_handler.cc b/content/browser/loader/mojo_async_resource_handler.cc index 4d42b594..86822fb 100644 --- a/content/browser/loader/mojo_async_resource_handler.cc +++ b/content/browser/loader/mojo_async_resource_handler.cc
@@ -230,10 +230,7 @@ } bool MojoAsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { - DCHECK_EQ(-1, min_size); - + int* buf_size) { // TODO(mmenke): Cancel with net::ERR_INSUFFICIENT_RESOURCES instead. if (!CheckForSufficientResource()) return false;
diff --git a/content/browser/loader/mojo_async_resource_handler.h b/content/browser/loader/mojo_async_resource_handler.h index 6d93f6ec..4dd975c8 100644 --- a/content/browser/loader/mojo_async_resource_handler.h +++ b/content/browser/loader/mojo_async_resource_handler.h
@@ -71,8 +71,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/mojo_async_resource_handler_unittest.cc b/content/browser/loader/mojo_async_resource_handler_unittest.cc index 35648fa..96515e0b 100644 --- a/content/browser/loader/mojo_async_resource_handler_unittest.cc +++ b/content/browser/loader/mojo_async_resource_handler_unittest.cc
@@ -533,7 +533,7 @@ TEST_F(MojoAsyncResourceHandlerTest, OnWillReadAndInFlightRequests) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); EXPECT_EQ(0, rdh_.num_in_flight_requests_for_testing()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); EXPECT_EQ(1, rdh_.num_in_flight_requests_for_testing()); handler_ = nullptr; EXPECT_EQ(0, rdh_.num_in_flight_requests_for_testing()); @@ -543,7 +543,7 @@ rdh_.set_max_num_in_flight_requests_per_process(0); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead()); // TODO(mmenke): Make this fail with net::ERR_INSUFFICIENT_RESOURCES. EXPECT_EQ(net::ERR_ABORTED, mock_loader_->error_code()); EXPECT_EQ(1, rdh_.num_in_flight_requests_for_testing()); @@ -553,7 +553,7 @@ TEST_F(MojoAsyncResourceHandlerTest, OnWillReadAndOnReadCompleted) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); // The buffer size that the mime sniffer requires implicitly. ASSERT_GE(mock_loader_->io_buffer_size(), kSizeMimeSnifferRequiresForFirstOnWillRead); @@ -585,7 +585,7 @@ MojoAsyncResourceHandler::SetAllocationSizeForTesting(2); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); // The buffer size that the mime sniffer requires implicitly. ASSERT_GE(mock_loader_->io_buffer_size(), kSizeMimeSnifferRequiresForFirstOnWillRead); @@ -619,7 +619,7 @@ TEST_F(MojoAsyncResourceHandlerTest, IOBufferFromOnWillReadShouldRemainValidEvenIfHandlerIsGone) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); // The io_buffer size that the mime sniffer requires implicitly. ASSERT_GE(mock_loader_->io_buffer_size(), kSizeMimeSnifferRequiresForFirstOnWillRead); @@ -719,7 +719,7 @@ TEST_F(MojoAsyncResourceHandlerTest, ResponseCompletionShouldCloseDataPipe) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted("AB")); url_loader_client_.RunUntilResponseBodyArrived(); @@ -748,7 +748,7 @@ TEST_F(MojoAsyncResourceHandlerTest, OutOfBandCancelDuringBodyTransmission) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); std::string data(mock_loader_->io_buffer_size(), 'a'); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, mock_loader_->OnReadCompleted(data)); @@ -786,13 +786,13 @@ TEST_F(MojoAsyncResourceHandlerTest, BeginWriteFailsOnWillRead) { handler_->set_begin_write_expectation(MOJO_RESULT_UNKNOWN); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead()); } TEST_F(MojoAsyncResourceHandlerTest, BeginWriteReturnsShouldWaitOnWillRead) { handler_->set_begin_write_expectation(MOJO_RESULT_SHOULD_WAIT); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); } TEST_F(MojoAsyncResourceHandlerTest, @@ -801,7 +801,7 @@ ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); size_t written = 0; while (true) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); MockResourceLoader::Status result = mock_loader_->OnReadCompleted( std::string(mock_loader_->io_buffer_size(), 'X')); written += mock_loader_->io_buffer_size(); @@ -837,12 +837,12 @@ MojoAsyncResourceHandler::SetAllocationSizeForTesting(2); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); handler_->set_end_write_expectation(MOJO_RESULT_UNKNOWN); - ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::CANCELED, mock_loader_->OnWillRead()); } TEST_F(MojoAsyncResourceHandlerTest, EndWriteFailsOnReadCompleted) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); handler_->set_end_write_expectation(MOJO_RESULT_SHOULD_WAIT); ASSERT_EQ(MockResourceLoader::Status::CANCELED, @@ -854,7 +854,7 @@ EndWriteFailsOnReadCompletedWithInsufficientInitialCapacity) { MojoAsyncResourceHandler::SetAllocationSizeForTesting(2); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); handler_->set_end_write_expectation(MOJO_RESULT_SHOULD_WAIT); ASSERT_EQ(MockResourceLoader::Status::CANCELED, @@ -866,7 +866,7 @@ EndWriteFailsOnResumeWithInsufficientInitialCapacity) { MojoAsyncResourceHandler::SetAllocationSizeForTesting(8); ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); while (true) { MockResourceLoader::Status result = mock_loader_->OnReadCompleted( @@ -875,7 +875,7 @@ break; ASSERT_EQ(MockResourceLoader::Status::IDLE, result); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); } url_loader_client_.RunUntilResponseBodyArrived(); @@ -969,7 +969,7 @@ TEST_P(MojoAsyncResourceHandlerWithAllocationSizeTest, OnWillReadWithLongContents) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); std::string expected; for (int i = 0; i < 3 * mock_loader_->io_buffer_size() + 2; ++i) expected += ('A' + i % 26); @@ -981,7 +981,7 @@ while (actual.size() < expected.size()) { while (written < expected.size() && mock_loader_->status() == MockResourceLoader::Status::IDLE) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); const size_t to_be_written = std::min(static_cast<size_t>(mock_loader_->io_buffer_size()), expected.size() - written); @@ -1018,7 +1018,7 @@ TEST_P(MojoAsyncResourceHandlerWithAllocationSizeTest, BeginWriteFailsOnReadCompleted) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); handler_->set_begin_write_expectation(MOJO_RESULT_UNKNOWN); ASSERT_EQ(MockResourceLoader::Status::CANCELED, @@ -1029,7 +1029,7 @@ TEST_P(MojoAsyncResourceHandlerWithAllocationSizeTest, BeginWriteReturnsShouldWaitOnReadCompleted) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); handler_->set_begin_write_expectation(MOJO_RESULT_SHOULD_WAIT); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, @@ -1040,11 +1040,11 @@ TEST_P(MojoAsyncResourceHandlerWithAllocationSizeTest, BeginWriteFailsOnResume) { ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(0)); while (true) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); MockResourceLoader::Status result = mock_loader_->OnReadCompleted( std::string(mock_loader_->io_buffer_size(), 'A')); if (result == MockResourceLoader::Status::CALLBACK_PENDING) @@ -1074,7 +1074,7 @@ ASSERT_TRUE(CallOnWillStartAndOnResponseStarted()); while (true) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); MockResourceLoader::Status result = mock_loader_->OnReadCompleted( std::string(mock_loader_->io_buffer_size(), 'A')); if (result == MockResourceLoader::Status::CALLBACK_PENDING) @@ -1197,7 +1197,7 @@ ASSERT_FALSE(url_loader_client_.has_received_response()); url_loader_client_.RunUntilResponseReceived(); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_FALSE(url_loader_client_.response_body().is_valid()); @@ -1242,7 +1242,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillStart(request_->url())); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnResponseStarted(
diff --git a/content/browser/loader/navigation_resource_handler.cc b/content/browser/loader/navigation_resource_handler.cc index 15de158..0c35c8e 100644 --- a/content/browser/loader/navigation_resource_handler.cc +++ b/content/browser/loader/navigation_resource_handler.cc
@@ -155,10 +155,9 @@ } bool NavigationResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { DCHECK(!has_controller()); - writer_.OnWillRead(buf, buf_size, min_size); + writer_.OnWillRead(buf, buf_size, -1); return true; }
diff --git a/content/browser/loader/navigation_resource_handler.h b/content/browser/loader/navigation_resource_handler.h index 8b143819..935b203 100644 --- a/content/browser/loader/navigation_resource_handler.h +++ b/content/browser/loader/navigation_resource_handler.h
@@ -55,8 +55,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/redirect_to_file_resource_handler.cc b/content/browser/loader/redirect_to_file_resource_handler.cc index f22fccc..b9784b06 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.cc +++ b/content/browser/loader/redirect_to_file_resource_handler.cc
@@ -187,10 +187,7 @@ bool RedirectToFileResourceHandler::OnWillRead( scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { - DCHECK_EQ(-1, min_size); - + int* buf_size) { if (buf_->capacity() < next_buffer_size_) buf_->SetCapacity(next_buffer_size_);
diff --git a/content/browser/loader/redirect_to_file_resource_handler.h b/content/browser/loader/redirect_to_file_resource_handler.h index 2de7c87..7c91cac 100644 --- a/content/browser/loader/redirect_to_file_resource_handler.h +++ b/content/browser/loader/redirect_to_file_resource_handler.h
@@ -69,8 +69,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/redirect_to_file_resource_handler_unittest.cc b/content/browser/loader/redirect_to_file_resource_handler_unittest.cc index 08ff0c9..666bc67 100644 --- a/content/browser/loader/redirect_to_file_resource_handler_unittest.cc +++ b/content/browser/loader/redirect_to_file_resource_handler_unittest.cc
@@ -335,7 +335,7 @@ EXPECT_EQ(expected_total_bytes_downloaded, test_handler_->total_bytes_downloaded()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted("")); ASSERT_EQ(MockResourceLoader::Status::IDLE, @@ -378,7 +378,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data)); // Wait for the write to complete, in the async case. @@ -399,7 +399,7 @@ for (size_t offset = 0; offset < test_data.length(); offset += kBytesPerRead) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); size_t length = std::min(kBytesPerRead, test_data.length() - offset); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted( @@ -421,7 +421,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data)); // Wait for the writes to complete, in the async case. @@ -444,7 +444,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, mock_loader_->OnReadCompleted(test_data)); // Wait for the writes to complete. @@ -469,12 +469,12 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ( MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr(0, kFirstWriteSize))); // Next read completes before first write succeeds. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr( kFirstWriteSize, sizeof(test_data) - kFirstWriteSize))); @@ -503,12 +503,12 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ( MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr(0, kFirstWriteSize))); // Next read completes before first write succeeds. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, mock_loader_->OnReadCompleted(test_data.substr( kFirstWriteSize, sizeof(test_data) - kFirstWriteSize))); @@ -555,7 +555,7 @@ int offset = 0; for (int read_size : read_sizes) { - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, mock_loader_->OnReadCompleted( base::StringPiece(test_data.data() + offset, read_size))); @@ -582,13 +582,13 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data)); EXPECT_EQ(0, test_handler_->total_bytes_downloaded()); // While data is being written to the disk, the request completes. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted("")); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, @@ -621,19 +621,19 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ( MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr(0, kFirstWriteSize))); // Next read completes before first write succeeds. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr( kFirstWriteSize, sizeof(test_data) - kFirstWriteSize))); EXPECT_EQ(0, test_handler_->total_bytes_downloaded()); // While the first write is still going on, the request completes. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted("")); ASSERT_EQ(MockResourceLoader::Status::CALLBACK_PENDING, @@ -657,7 +657,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data)); @@ -667,7 +667,7 @@ test_handler_->total_bytes_downloaded()); // Next read fails and request is torn down synchronously. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnResponseCompleted( net::URLRequestStatus::FromError(net::ERR_FAILED))); @@ -688,7 +688,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data)); EXPECT_EQ(0, test_handler_->total_bytes_downloaded()); @@ -724,12 +724,12 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ( MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr(0, kFirstWriteSize))); // Next read completes before first write succeeds. - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted(test_data.substr( kFirstWriteSize, sizeof(test_data) - kFirstWriteSize))); @@ -774,7 +774,7 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); mock_loader_->OnReadCompleted(test_data); // Wait for the write to complete, in the async case. base::RunLoop().RunUntilIdle(); @@ -805,11 +805,11 @@ ASSERT_EQ(MockResourceLoader::Status::IDLE, OnResponseStartedAndWaitForResult()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnReadCompleted( base::StringPiece(test_data.data(), kFirstWriteSize))); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(-1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); mock_loader_->OnReadCompleted(base::StringPiece( test_data.data() + kFirstWriteSize, test_data.size() - kFirstWriteSize)); // Wait for the write to complete, in the async case.
diff --git a/content/browser/loader/resource_handler.h b/content/browser/loader/resource_handler.h index 350f954..cf4a5a0 100644 --- a/content/browser/loader/resource_handler.h +++ b/content/browser/loader/resource_handler.h
@@ -101,8 +101,7 @@ // out-params. This call will be followed by either OnReadCompleted (on // successful read or EOF) or OnResponseCompleted (on error). If // OnReadCompleted is called, the buffer may be recycled. Otherwise, it may - // not be recycled and may potentially outlive the handler. If |min_size| is - // not -1, it is the minimum size of the returned buffer. + // not be recycled and may potentially outlive the handler. // // Unlike other methods, may be called synchronously on Resume, for // performance reasons. @@ -112,8 +111,7 @@ // TODO(mmenke): Make this method use a ResourceController, and allow it to // succeed asynchronously. virtual bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) = 0; + int* buf_size) = 0; // Data (*bytes_read bytes) was written into the buffer provided by // OnWillRead. The request will not continue until one of |controller|'s
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index 02d24a8..da6649b 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc
@@ -662,7 +662,7 @@ tracked_objects::ScopedTracker tracking_profile2( FROM_HERE_WITH_EXPLICIT_FUNCTION("475761 OnWillRead()")); - if (!handler_->OnWillRead(&buf, &buf_size, -1)) { + if (!handler_->OnWillRead(&buf, &buf_size)) { // Cancel the request, which will then call back into |this| to inform it // of a "read error". Cancel();
diff --git a/content/browser/loader/resource_scheduler.cc b/content/browser/loader/resource_scheduler.cc index 1cd91c3e..6973687 100644 --- a/content/browser/loader/resource_scheduler.cc +++ b/content/browser/loader/resource_scheduler.cc
@@ -421,6 +421,10 @@ } void OnWillInsertBody() { + // Can be called multiple times per RVH in the case of out-of-process + // iframes. + if (has_html_body_) + return; has_html_body_ = true; LoadAnyStartablePendingRequests(RequestStartTrigger::BODY_REACHED); }
diff --git a/content/browser/loader/resource_scheduler_filter.cc b/content/browser/loader/resource_scheduler_filter.cc index 0738ec18..71719ee 100644 --- a/content/browser/loader/resource_scheduler_filter.cc +++ b/content/browser/loader/resource_scheduler_filter.cc
@@ -4,71 +4,46 @@ #include "content/browser/loader/resource_scheduler_filter.h" -#include <stdint.h> - -#include "base/macros.h" #include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/browser/loader/resource_scheduler.h" #include "content/common/frame_messages.h" -#include "content/common/view_messages.h" +#include "ipc/ipc_message_macros.h" #include "ui/base/page_transition_types.h" namespace content { -namespace { -const uint32_t kFilteredMessageClasses[] = { - FrameMsgStart, ViewMsgStart, -}; -} // namespace ResourceSchedulerFilter::ResourceSchedulerFilter(int child_id) - : BrowserMessageFilter( - kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), - child_id_(child_id) { -} + : BrowserMessageFilter(FrameMsgStart), child_id_(child_id) {} -ResourceSchedulerFilter::~ResourceSchedulerFilter() { -} +ResourceSchedulerFilter::~ResourceSchedulerFilter() {} bool ResourceSchedulerFilter::OnMessageReceived(const IPC::Message& message) { - ResourceScheduler* scheduler = - ResourceDispatcherHostImpl::Get()->scheduler(); - // scheduler can be NULL during shutdown, in which case it's ok to ignore the - // renderer's messages. + ResourceScheduler* scheduler = ResourceDispatcherHostImpl::Get()->scheduler(); if (!scheduler) return false; - - switch (message.type()) { - case FrameHostMsg_DidCommitProvisionalLoad::ID: { - base::PickleIterator iter(message); - FrameHostMsg_DidCommitProvisionalLoad_Params params; - if (!IPC::ParamTraits<FrameHostMsg_DidCommitProvisionalLoad_Params>::Read( - &message, &iter, ¶ms)) { - break; - } - if (ui::PageTransitionIsMainFrame(params.transition) && - !params.was_within_same_page) { - // We need to track the RenderViewHost routing_id because of downstream - // dependencies (crbug.com/392171 DownloadRequestHandle, - // SaveFileManager, ResourceDispatcherHostImpl, MediaStreamUIProxy, - // SpeechRecognitionDispatcherHost and possibly others). They look up - // the view based on the ID stored in the resource requests. - // Once those dependencies are unwound or moved to RenderFrameHost - // (crbug.com/304341) we can move the client to be based on the - // routing_id of the RenderFrameHost. - scheduler->OnNavigate(child_id_, params.render_view_routing_id); - } - break; - } - - case ViewHostMsg_WillInsertBody::ID: - scheduler->OnWillInsertBody(child_id_, message.routing_id()); - break; - - default: - break; - } - + IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(ResourceSchedulerFilter, message, scheduler) + IPC_MESSAGE_HANDLER(FrameHostMsg_DidCommitProvisionalLoad, + OnDidCommitProvisionalLoad) + IPC_MESSAGE_HANDLER(FrameHostMsg_WillInsertBody, OnWillInsertBody) + IPC_END_MESSAGE_MAP() return false; } +void ResourceSchedulerFilter::OnDidCommitProvisionalLoad( + ResourceScheduler* scheduler, + const FrameHostMsg_DidCommitProvisionalLoad_Params& params) { + // TODO(csharrison): This isn't quite right for OOPIF, as we *do* want to + // propagate OnNavigate to the client associated with the OOPIF's RVH. This + // should not result in show-stopping bugs, just poorer loading performance. + if (ui::PageTransitionIsMainFrame(params.transition) && + !params.was_within_same_page) { + scheduler->OnNavigate(child_id_, params.render_view_routing_id); + } +} + +void ResourceSchedulerFilter::OnWillInsertBody(ResourceScheduler* scheduler, + int render_view_routing_id) { + scheduler->OnWillInsertBody(child_id_, render_view_routing_id); +} + } // namespace content
diff --git a/content/browser/loader/resource_scheduler_filter.h b/content/browser/loader/resource_scheduler_filter.h index 0a6c23a..8a6fd06 100644 --- a/content/browser/loader/resource_scheduler_filter.h +++ b/content/browser/loader/resource_scheduler_filter.h
@@ -5,10 +5,15 @@ #ifndef CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_FILTER_H_ #define CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_FILTER_H_ +#include "base/macros.h" #include "content/public/browser/browser_message_filter.h" +struct FrameHostMsg_DidCommitProvisionalLoad_Params; + namespace content { +class ResourceScheduler; + // This class listens for incoming ViewHostMsgs that are applicable to the // ResourceScheduler and invokes the appropriate notifications. It must be // inserted before the RenderMessageFilter, because the ResourceScheduler runs @@ -18,13 +23,21 @@ public: explicit ResourceSchedulerFilter(int child_id); - // BrowserMessageFilter methods: + // BrowserMessageFilter: bool OnMessageReceived(const IPC::Message& message) override; private: ~ResourceSchedulerFilter() override; + void OnDidCommitProvisionalLoad( + ResourceScheduler* scheduler, + const FrameHostMsg_DidCommitProvisionalLoad_Params& params); + void OnWillInsertBody(ResourceScheduler* scheduler, + int render_view_routing_id); + int child_id_; + + DISALLOW_COPY_AND_ASSIGN(ResourceSchedulerFilter); }; } // namespace content
diff --git a/content/browser/loader/stream_resource_handler.cc b/content/browser/loader/stream_resource_handler.cc index 117c193..17e232a 100644 --- a/content/browser/loader/stream_resource_handler.cc +++ b/content/browser/loader/stream_resource_handler.cc
@@ -44,9 +44,8 @@ } bool StreamResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { - writer_.OnWillRead(buf, buf_size, min_size); + int* buf_size) { + writer_.OnWillRead(buf, buf_size, -1); return true; }
diff --git a/content/browser/loader/stream_resource_handler.h b/content/browser/loader/stream_resource_handler.h index 719c30bce..9f69994 100644 --- a/content/browser/loader/stream_resource_handler.h +++ b/content/browser/loader/stream_resource_handler.h
@@ -47,8 +47,7 @@ // Create a new buffer to store received data. bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; // A read was completed, forward the data to the Stream. void OnReadCompleted(int bytes_read,
diff --git a/content/browser/loader/sync_resource_handler.cc b/content/browser/loader/sync_resource_handler.cc index 3dbea2d..3124302 100644 --- a/content/browser/loader/sync_resource_handler.cc +++ b/content/browser/loader/sync_resource_handler.cc
@@ -97,9 +97,7 @@ } bool SyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { - DCHECK(min_size == -1); + int* buf_size) { *buf = read_buffer_.get(); *buf_size = kReadBufSize; return true;
diff --git a/content/browser/loader/sync_resource_handler.h b/content/browser/loader/sync_resource_handler.h index c9ece9d..38fa416 100644 --- a/content/browser/loader/sync_resource_handler.h +++ b/content/browser/loader/sync_resource_handler.h
@@ -43,8 +43,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/test_resource_handler.cc b/content/browser/loader/test_resource_handler.cc index a4e0816..1f8c970 100644 --- a/content/browser/loader/test_resource_handler.cc +++ b/content/browser/loader/test_resource_handler.cc
@@ -142,8 +142,7 @@ } bool TestResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) { + int* buf_size) { EXPECT_FALSE(canceled_); EXPECT_FALSE(expect_on_data_downloaded_); EXPECT_EQ(0, on_response_completed_called_);
diff --git a/content/browser/loader/test_resource_handler.h b/content/browser/loader/test_resource_handler.h index a65c70d..911300e 100644 --- a/content/browser/loader/test_resource_handler.h +++ b/content/browser/loader/test_resource_handler.h
@@ -53,8 +53,7 @@ void OnWillStart(const GURL& url, std::unique_ptr<ResourceController> controller) override; bool OnWillRead(scoped_refptr<net::IOBuffer>* buf, - int* buf_size, - int min_size) override; + int* buf_size) override; void OnReadCompleted(int bytes_read, std::unique_ptr<ResourceController> controller) override; void OnResponseCompleted(
diff --git a/content/browser/loader/throttling_resource_handler_unittest.cc b/content/browser/loader/throttling_resource_handler_unittest.cc index 0b507b0..aced0f5 100644 --- a/content/browser/loader/throttling_resource_handler_unittest.cc +++ b/content/browser/loader/throttling_resource_handler_unittest.cc
@@ -201,7 +201,7 @@ void FinishRequestSuccessfully() { EXPECT_EQ(0, test_handler_->on_will_read_called()); - ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead(1)); + ASSERT_EQ(MockResourceLoader::Status::IDLE, mock_loader_->OnWillRead()); EXPECT_EQ(1, test_handler_->on_will_read_called()); EXPECT_EQ(0, test_handler_->on_read_completed_called());
diff --git a/content/browser/media/android/media_player_renderer.cc b/content/browser/media/android/media_player_renderer.cc index 2f8e9e6..7e5874a 100644 --- a/content/browser/media/android/media_player_renderer.cc +++ b/content/browser/media/android/media_player_renderer.cc
@@ -40,19 +40,17 @@ CancelScopedSurfaceRequest(); } -void MediaPlayerRenderer::Initialize( - media::DemuxerStreamProvider* demuxer_stream_provider, - media::RendererClient* client, - const media::PipelineStatusCB& init_cb) { +void MediaPlayerRenderer::Initialize(media::MediaResource* media_resource, + media::RendererClient* client, + const media::PipelineStatusCB& init_cb) { DVLOG(1) << __func__; DCHECK_CURRENTLY_ON(BrowserThread::UI); renderer_client_ = client; - if (demuxer_stream_provider->GetType() != - media::DemuxerStreamProvider::Type::URL) { - DLOG(ERROR) << "DemuxerStreamProvider is not of Type URL"; + if (media_resource->GetType() != media::MediaResource::Type::URL) { + DLOG(ERROR) << "MediaResource is not of Type URL"; init_cb.Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); return; } @@ -61,7 +59,7 @@ media::MediaServiceThrottler::GetInstance()->GetDelayForClientCreation(); if (creation_delay.is_zero()) { - CreateMediaPlayer(demuxer_stream_provider->GetMediaUrlParams(), init_cb); + CreateMediaPlayer(media_resource->GetMediaUrlParams(), init_cb); return; } @@ -69,7 +67,7 @@ BrowserThread::UI, FROM_HERE, base::Bind(&MediaPlayerRenderer::CreateMediaPlayer, weak_factory_.GetWeakPtr(), - demuxer_stream_provider->GetMediaUrlParams(), init_cb), + media_resource->GetMediaUrlParams(), init_cb), creation_delay); }
diff --git a/content/browser/media/android/media_player_renderer.h b/content/browser/media/android/media_player_renderer.h index 129e240..9debfc3 100644 --- a/content/browser/media/android/media_player_renderer.h +++ b/content/browser/media/android/media_player_renderer.h
@@ -13,8 +13,8 @@ #include "content/public/browser/render_frame_host.h" #include "media/base/android/media_player_bridge.h" #include "media/base/android/media_player_manager.h" -#include "media/base/demuxer_stream_provider.h" #include "media/base/media_log.h" +#include "media/base/media_resource.h" #include "media/base/renderer.h" #include "media/base/renderer_client.h" #include "url/gurl.h" @@ -47,7 +47,7 @@ ~MediaPlayerRenderer() override; // media::Renderer implementation - void Initialize(media::DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(media::MediaResource* media_resource, media::RendererClient* client, const media::PipelineStatusCB& init_cb) override; void SetCdm(media::CdmContext* cdm_context,
diff --git a/content/browser/media/session/media_session_impl.h b/content/browser/media/session/media_session_impl.h index a34699a..6ed0ce4 100644 --- a/content/browser/media/session/media_session_impl.h +++ b/content/browser/media/session/media_session_impl.h
@@ -85,9 +85,6 @@ } #endif // defined(OS_ANDROID) - void AddObserver(MediaSessionObserver* observer); - void RemoveObserver(MediaSessionObserver* observer); - void NotifyMediaSessionMetadataChange( const base::Optional<MediaMetadata>& metadata); void NotifyMediaSessionActionsChange( @@ -138,6 +135,9 @@ // recovered. CONTENT_EXPORT void StopDucking() override; + void AddObserver(MediaSessionObserver* observer) override; + void RemoveObserver(MediaSessionObserver* observer) override; + // Returns if the session can be controlled by Resume() and Suspend calls // above. CONTENT_EXPORT bool IsControllable() const;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 7a2b7c2..1b0b57a 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -65,7 +65,6 @@ #include "content/browser/cache_storage/cache_storage_context_impl.h" #include "content/browser/cache_storage/cache_storage_dispatcher_host.h" #include "content/browser/child_process_security_policy_impl.h" -#include "content/browser/device_sensors/device_sensor_host.h" #include "content/browser/dom_storage/dom_storage_context_wrapper.h" #include "content/browser/dom_storage/dom_storage_message_filter.h" #include "content/browser/fileapi/fileapi_message_filter.h" @@ -166,6 +165,7 @@ #include "content/public/common/url_constants.h" #include "device/battery/battery_monitor_impl.h" #include "device/gamepad/gamepad_monitor.h" +#include "device/sensors/device_sensor_host.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/gpu_switches.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" @@ -1281,19 +1281,23 @@ #if defined(OS_ANDROID) // On Android the device sensors implementations need to run on the UI thread // to communicate to Java. - AddUIThreadInterface(registry.get(), base::Bind(&DeviceLightHost::Create)); - AddUIThreadInterface(registry.get(), base::Bind(&DeviceMotionHost::Create)); AddUIThreadInterface(registry.get(), - base::Bind(&DeviceOrientationHost::Create)); + base::Bind(&device::DeviceLightHost::Create)); AddUIThreadInterface(registry.get(), - base::Bind(&DeviceOrientationAbsoluteHost::Create)); + base::Bind(&device::DeviceMotionHost::Create)); + AddUIThreadInterface(registry.get(), + base::Bind(&device::DeviceOrientationHost::Create)); + AddUIThreadInterface( + registry.get(), + base::Bind(&device::DeviceOrientationAbsoluteHost::Create)); #else // On platforms other than Android the device sensors implementations run on // the IO thread. - registry->AddInterface(base::Bind(&DeviceLightHost::Create)); - registry->AddInterface(base::Bind(&DeviceMotionHost::Create)); - registry->AddInterface(base::Bind(&DeviceOrientationHost::Create)); - registry->AddInterface(base::Bind(&DeviceOrientationAbsoluteHost::Create)); + registry->AddInterface(base::Bind(&device::DeviceLightHost::Create)); + registry->AddInterface(base::Bind(&device::DeviceMotionHost::Create)); + registry->AddInterface(base::Bind(&device::DeviceOrientationHost::Create)); + registry->AddInterface( + base::Bind(&device::DeviceOrientationAbsoluteHost::Create)); #endif // defined(OS_ANDROID) registry->AddInterface(base::Bind(&device::GamepadMonitor::Create));
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 592bad2..dc7233d 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -8,11 +8,14 @@ #include <stdint.h> #include <algorithm> +#include <map> #include <vector> +#include "base/bind.h" +#include "base/callback.h" #include "base/command_line.h" #include "base/location.h" -#include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "base/sequenced_task_runner.h" #include "base/single_thread_task_runner.h" @@ -44,6 +47,7 @@ #include "content/common/input_messages.h" #include "content/common/renderer.mojom.h" #include "content/common/view_messages.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/interstitial_page_delegate.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/notification_observer.h" @@ -64,6 +68,8 @@ #include "ipc/ipc_security_test_util.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "net/test/embedded_test_server/http_request.h" +#include "net/test/embedded_test_server/http_response.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" @@ -9183,4 +9189,154 @@ FrameHostMsg_ContextMenu(rfh->GetRoutingID(), ContextMenuParams())); } +// Test harness that allows for "barrier" style delaying of requests matching +// certain paths. Call SetDelayedRequestsForPath to delay requests, then +// SetUpEmbeddedTestServer to register handlers and start the server. +class RequestDelayingSitePerProcessBrowserTest + : public SitePerProcessBrowserTest { + public: + RequestDelayingSitePerProcessBrowserTest() + : test_server_(base::MakeUnique<net::EmbeddedTestServer>()) {} + + // Must be called after any calls to SetDelayedRequestsForPath. + void SetUpEmbeddedTestServer() { + host_resolver()->AddRule("*", "127.0.0.1"); + SetupCrossSiteRedirector(test_server_.get()); + test_server_->RegisterRequestHandler(base::Bind( + &RequestDelayingSitePerProcessBrowserTest::HandleMockResource, + base::Unretained(this))); + ASSERT_TRUE(test_server_->Start()); + } + + // Delays |num_delayed| requests with URLs whose path parts match |path|. When + // the |num_delayed| + 1 request matching the path comes in, the rest are + // unblocked. + // Note: must be called on the UI thread before |test_server_| is started. + void SetDelayedRequestsForPath(const std::string& path, int num_delayed) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK(!test_server_->Started()); + num_remaining_requests_to_delay_for_path_[path] = num_delayed; + } + + private: + // Called on the test server's thread. + void AddDelayedResponse(const net::test_server::SendBytesCallback& send, + const net::test_server::SendCompleteCallback& done) { + // Just create a closure that closes the socket without sending a response. + // This will propagate an error to the underlying request. + send_response_closures_.push_back(base::Bind(send, "", done)); + } + + // Custom embedded test server handler. Looks for requests matching + // num_remaining_requests_to_delay_for_path_, and delays them if necessary. As + // soon as a single request comes in and: + // 1) It matches a delayed path + // 2) No path has any more requests to delay + // Then we release the barrier and finish all delayed requests. + std::unique_ptr<net::test_server::HttpResponse> HandleMockResource( + const net::test_server::HttpRequest& request) { + auto it = + num_remaining_requests_to_delay_for_path_.find(request.GetURL().path()); + if (it == num_remaining_requests_to_delay_for_path_.end()) + return nullptr; + + // If there are requests to delay for this path, make a delayed request + // which will be finished later. Otherwise fall through to the bottom and + // send an empty response. + if (it->second > 0) { + --it->second; + return base::MakeUnique<DelayedResponse>(this); + } + MaybeStartRequests(); + return std::unique_ptr<net::test_server::BasicHttpResponse>(); + } + + // If there are no more requests to delay, post a series of tasks finishing + // all the delayed tasks. This will be called on the test server's thread. + void MaybeStartRequests() { + for (auto it : num_remaining_requests_to_delay_for_path_) { + if (it.second > 0) + return; + } + for (const auto it : send_response_closures_) { + it.Run(); + } + } + + // This class passes the callbacks needed to respond to a request to the + // underlying test fixture. + class DelayedResponse : public net::test_server::BasicHttpResponse { + public: + explicit DelayedResponse( + RequestDelayingSitePerProcessBrowserTest* test_harness) + : test_harness_(test_harness) {} + void SendResponse( + const net::test_server::SendBytesCallback& send, + const net::test_server::SendCompleteCallback& done) override { + test_harness_->AddDelayedResponse(send, done); + } + + private: + RequestDelayingSitePerProcessBrowserTest* test_harness_; + + DISALLOW_COPY_AND_ASSIGN(DelayedResponse); + }; + + // Set of closures to call which will complete delayed requests. May only be + // modified on the test_server_'s thread. + std::vector<base::Closure> send_response_closures_; + + // Map from URL paths to the number of requests to delay for that particular + // path. Initialized on the UI thread but modified and read on the test + // server's thread after the |test_server_| is started. + std::map<std::string, int> num_remaining_requests_to_delay_for_path_; + + // Don't use embedded_test_server() because this one requires custom + // initialization. + std::unique_ptr<net::EmbeddedTestServer> test_server_; +}; + +// Regression tests for https://crbug.com/678206, where the request throttling +// in ResourceScheduler was not updated for OOPIFs. This resulted in a single +// hung delayable request (e.g. video) starving all other delayable requests. +// The tests work by delaying n requests in a cross-domain iframe. Once the n + +// 1st request goes through to the network stack (ensuring it was not starved), +// the delayed request completed. +// +// If the logic is not correct, these tests will time out, as the n + 1st +// request will never start. +IN_PROC_BROWSER_TEST_F(RequestDelayingSitePerProcessBrowserTest, + DelayableSubframeRequestsOneFrame) { + std::string path = "/mock-video.mp4"; + SetDelayedRequestsForPath(path, 2); + SetUpEmbeddedTestServer(); + GURL url(embedded_test_server()->GetURL( + "a.com", base::StringPrintf("/site_isolation/" + "subframes_with_resources.html?urls=%s&" + "numSubresources=3", + path.c_str()))); + EXPECT_TRUE(NavigateToURL(shell(), url)); + bool result; + EXPECT_TRUE(ExecuteScriptAndExtractBool(shell(), "createFrames()", &result)); + EXPECT_TRUE(result); +} + +IN_PROC_BROWSER_TEST_F(RequestDelayingSitePerProcessBrowserTest, + DelayableSubframeRequestsTwoFrames) { + std::string path0 = "/mock-video0.mp4"; + std::string path1 = "/mock-video1.mp4"; + SetDelayedRequestsForPath(path0, 2); + SetDelayedRequestsForPath(path1, 2); + SetUpEmbeddedTestServer(); + GURL url(embedded_test_server()->GetURL( + "a.com", base::StringPrintf("/site_isolation/" + "subframes_with_resources.html?urls=%s,%s&" + "numSubresources=3", + path0.c_str(), path1.c_str()))); + EXPECT_TRUE(NavigateToURL(shell(), url)); + bool result; + EXPECT_TRUE(ExecuteScriptAndExtractBool(shell(), "createFrames()", &result)); + EXPECT_TRUE(result); +} + } // namespace content
diff --git a/content/browser/site_per_process_browsertest.h b/content/browser/site_per_process_browsertest.h index 32861ec..fe8b84b0 100644 --- a/content/browser/site_per_process_browsertest.h +++ b/content/browser/site_per_process_browsertest.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/macros.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/test/content_browser_test.h" #include "content/shell/browser/shell.h" @@ -33,6 +34,8 @@ private: FrameTreeVisualizer visualizer_; + + DISALLOW_COPY_AND_ASSIGN(SitePerProcessBrowserTest); }; } // namespace content
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 9eab635..050a03f 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -600,7 +600,6 @@ "//components/leveldb/public/interfaces", "//content/public/common:interfaces", "//device/power_monitor/public/interfaces", - "//device/sensors/public/interfaces", # TODO(mcasas): remove the following dep after https://crbug.com/653994 "//gpu/ipc/common:interfaces",
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 13529225..ad1b666 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -1105,6 +1105,12 @@ int32_t /* subframe_routing_id */, content::FrameOwnerProperties /* frame_owner_properties */) +// Notifies the browser that document has parsed the body. This is used by the +// ResourceScheduler as an indication that bandwidth contention won't block +// first paint. +IPC_MESSAGE_ROUTED1(FrameHostMsg_WillInsertBody, + int /* render_view_routing_id */) + // Changes the title for the page in the UI when the page is navigated or the // title changes. Sent for top-level frames. IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle,
diff --git a/content/common/view_messages.h b/content/common/view_messages.h index e10872a..f12fa45f 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h
@@ -824,11 +824,6 @@ gfx::Size, /* Size of zoomed image */ cc::SharedBitmapId /* id */) -// Notifies the browser that document has parsed the body. This is used by the -// ResourceScheduler as an indication that bandwidth contention won't block -// first paint. -IPC_MESSAGE_ROUTED0(ViewHostMsg_WillInsertBody) - // Notification that the urls for the favicon of a site has been determined. IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateFaviconURL, std::vector<content::FaviconURL> /* candidates */)
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index b9d1f1b..0dce483 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -43,6 +43,7 @@ "//device/nfc:mojo_bindings_java", "//device/nfc/android:java", "//device/power_save_blocker:java", + "//device/sensors:java", "//device/time_zone_monitor:java", "//device/usb:java", "//device/vibration:mojo_bindings_java", @@ -128,7 +129,6 @@ "java/src/org/chromium/content/browser/ContentViewRenderView.java", "java/src/org/chromium/content/browser/ContentViewStatics.java", "java/src/org/chromium/content/browser/ContextualSearchClient.java", - "java/src/org/chromium/content/browser/DeviceSensors.java", "java/src/org/chromium/content/browser/DeviceUtils.java", "java/src/org/chromium/content/browser/FloatingActionModeCallback.java", "java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java", @@ -291,8 +291,6 @@ sources = [ "//content/browser/android/content_view_core_impl.cc", "//content/browser/android/gesture_event_type.h", - "//content/browser/device_sensors/device_sensors_consts.h", - "//content/browser/device_sensors/sensor_manager_android.h", "//content/public/browser/download_item.h", "//content/public/browser/invalidate_type.h", "//content/public/browser/navigation_controller.h", @@ -327,7 +325,6 @@ "java/src/org/chromium/content/browser/ContentViewCore.java", "java/src/org/chromium/content/browser/ContentViewRenderView.java", "java/src/org/chromium/content/browser/ContentViewStatics.java", - "java/src/org/chromium/content/browser/DeviceSensors.java", "java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java", "java/src/org/chromium/content/browser/InterstitialPageDelegateAndroid.java", "java/src/org/chromium/content/browser/MediaResourceGetter.java", @@ -401,7 +398,6 @@ "javatests/src/org/chromium/content/browser/ContentViewPopupZoomerTest.java", "javatests/src/org/chromium/content/browser/ContentViewScrollingTest.java", "javatests/src/org/chromium/content/browser/ContentViewZoomingTest.java", - "javatests/src/org/chromium/content/browser/DeviceSensorsTest.java", "javatests/src/org/chromium/content/browser/EmailAddressDetectionTest.java", "javatests/src/org/chromium/content/browser/EncodeHtmlDataUriTest.java", "javatests/src/org/chromium/content/browser/GestureDetectorResetTest.java",
diff --git a/content/public/browser/media_session.h b/content/public/browser/media_session.h index 509629f..8a0fe0a 100644 --- a/content/public/browser/media_session.h +++ b/content/public/browser/media_session.h
@@ -16,6 +16,7 @@ namespace content { +class MediaSessionObserver; class WebContents; // MediaSession manages the media session and audio focus for a given @@ -65,6 +66,12 @@ protected: MediaSession() = default; + + private: + friend class MediaSessionObserver; + + virtual void AddObserver(MediaSessionObserver* observer) = 0; + virtual void RemoveObserver(MediaSessionObserver* observer) = 0; }; } // namespace content
diff --git a/content/public/browser/media_session_observer.cc b/content/public/browser/media_session_observer.cc index f3a9ea01..dfd4e11 100644 --- a/content/public/browser/media_session_observer.cc +++ b/content/public/browser/media_session_observer.cc
@@ -9,7 +9,7 @@ namespace content { MediaSessionObserver::MediaSessionObserver(MediaSession* media_session) - : media_session_(static_cast<MediaSessionImpl*>(media_session)) { + : media_session_(media_session) { if (media_session_) media_session_->AddObserver(this); }
diff --git a/content/public/browser/media_session_observer.h b/content/public/browser/media_session_observer.h index 34f69e8..9c60dde 100644 --- a/content/public/browser/media_session_observer.h +++ b/content/public/browser/media_session_observer.h
@@ -21,7 +21,6 @@ namespace content { class MediaSession; -class MediaSessionImpl; // The observer for observing MediaSession events. class CONTENT_EXPORT MediaSessionObserver { @@ -49,7 +48,7 @@ protected: // Create a MediaSessionObserver and start observing a session. - MediaSessionObserver(MediaSession* media_session); + explicit MediaSessionObserver(MediaSession* media_session); // Destruct a MediaSessionObserver and remove it from the session if it's // still observing. virtual ~MediaSessionObserver(); @@ -60,7 +59,7 @@ void StopObserving(); // Weak pointer to MediaSession - MediaSessionImpl* media_session_; + MediaSession* media_session_; DISALLOW_COPY_AND_ASSIGN(MediaSessionObserver); };
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 8bdcc97..b8634aa 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -431,6 +431,7 @@ "//device/gamepad/public/interfaces", "//device/screen_orientation/public/interfaces", "//device/sensors/public/cpp", + "//device/sensors/public/interfaces", "//device/usb/public/interfaces", "//device/vibration:mojo_bindings", "//gin",
diff --git a/content/renderer/device_sensors/device_light_event_pump.cc b/content/renderer/device_sensors/device_light_event_pump.cc index d9ebdb0..3d82e83 100644 --- a/content/renderer/device_sensors/device_light_event_pump.cc +++ b/content/renderer/device_sensors/device_light_event_pump.cc
@@ -31,7 +31,7 @@ void DeviceLightEventPump::FireEvent() { DCHECK(listener()); - DeviceLightData data; + device::DeviceLightData data; if (reader_->GetLatestData(&data) && ShouldFireEvent(data.value)) { last_seen_data_ = data.value; listener()->didChangeDeviceLight(data.value);
diff --git a/content/renderer/device_sensors/device_light_event_pump.h b/content/renderer/device_sensors/device_light_event_pump.h index a67c026..8795916 100644 --- a/content/renderer/device_sensors/device_light_event_pump.h +++ b/content/renderer/device_sensors/device_light_event_pump.h
@@ -19,7 +19,7 @@ namespace content { -typedef SharedMemorySeqLockReader<DeviceLightData> +typedef SharedMemorySeqLockReader<device::DeviceLightData> DeviceLightSharedMemoryReader; class CONTENT_EXPORT DeviceLightEventPump
diff --git a/content/renderer/device_sensors/device_light_event_pump_unittest.cc b/content/renderer/device_sensors/device_light_event_pump_unittest.cc index 7fd5dfc..47269b6 100644 --- a/content/renderer/device_sensors/device_light_event_pump_unittest.cc +++ b/content/renderer/device_sensors/device_light_event_pump_unittest.cc
@@ -33,11 +33,11 @@ did_change_device_light_ = value; } - const DeviceLightData& data() const { return data_; } + const device::DeviceLightData& data() const { return data_; } private: bool did_change_device_light_; - DeviceLightData data_; + device::DeviceLightData data_; DISALLOW_COPY_AND_ASSIGN(MockDeviceLightListener); }; @@ -71,14 +71,14 @@ void SetUp() override { listener_.reset(new MockDeviceLightListener); light_pump_.reset(new DeviceLightEventPumpForTesting); - shared_memory_ = - mojo::SharedBufferHandle::Create(sizeof(DeviceLightHardwareBuffer)); - mapping_ = shared_memory_->Map(sizeof(DeviceLightHardwareBuffer)); + shared_memory_ = mojo::SharedBufferHandle::Create( + sizeof(device::DeviceLightHardwareBuffer)); + mapping_ = shared_memory_->Map(sizeof(device::DeviceLightHardwareBuffer)); ASSERT_TRUE(mapping_); } void InitBuffer() { - DeviceLightData& data = buffer()->data; + device::DeviceLightData& data = buffer()->data; data.value = 1.0; } @@ -88,8 +88,8 @@ return shared_memory_->Clone( mojo::SharedBufferHandle::AccessMode::READ_ONLY); } - DeviceLightHardwareBuffer* buffer() { - return reinterpret_cast<DeviceLightHardwareBuffer*>(mapping_.get()); + device::DeviceLightHardwareBuffer* buffer() { + return reinterpret_cast<device::DeviceLightHardwareBuffer*>(mapping_.get()); } private: @@ -110,7 +110,7 @@ base::RunLoop().Run(); - const DeviceLightData& received_data = listener()->data(); + const device::DeviceLightData& received_data = listener()->data(); EXPECT_TRUE(listener()->did_change_device_light()); EXPECT_EQ(1, static_cast<double>(received_data.value)); } @@ -121,7 +121,7 @@ base::RunLoop().Run(); - const DeviceLightData& received_data = listener()->data(); + const device::DeviceLightData& received_data = listener()->data(); EXPECT_TRUE(listener()->did_change_device_light()); EXPECT_FALSE(received_data.value); } @@ -134,7 +134,7 @@ base::RunLoop().Run(); - const DeviceLightData& received_data = listener()->data(); + const device::DeviceLightData& received_data = listener()->data(); EXPECT_TRUE(listener()->did_change_device_light()); EXPECT_EQ(1, static_cast<double>(received_data.value));
diff --git a/content/renderer/device_sensors/device_motion_event_pump_unittest.cc b/content/renderer/device_sensors/device_motion_event_pump_unittest.cc index 92ae1f3..642a704 100644 --- a/content/renderer/device_sensors/device_motion_event_pump_unittest.cc +++ b/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
@@ -95,11 +95,11 @@ void SetUp() override { listener_.reset(new MockDeviceMotionListener); motion_pump_.reset(new DeviceMotionEventPumpForTesting); - shared_memory_ = - mojo::SharedBufferHandle::Create(sizeof(DeviceMotionHardwareBuffer)); - mapping_ = shared_memory_->Map(sizeof(DeviceMotionHardwareBuffer)); + shared_memory_ = mojo::SharedBufferHandle::Create( + sizeof(device::DeviceMotionHardwareBuffer)); + mapping_ = shared_memory_->Map(sizeof(device::DeviceMotionHardwareBuffer)); ASSERT_TRUE(mapping_); - memset(buffer(), 0, sizeof(DeviceMotionHardwareBuffer)); + memset(buffer(), 0, sizeof(device::DeviceMotionHardwareBuffer)); } void InitBuffer(bool allAvailableSensorsActive) { @@ -119,8 +119,9 @@ return shared_memory_->Clone( mojo::SharedBufferHandle::AccessMode::READ_ONLY); } - DeviceMotionHardwareBuffer* buffer() { - return reinterpret_cast<DeviceMotionHardwareBuffer*>(mapping_.get()); + device::DeviceMotionHardwareBuffer* buffer() { + return reinterpret_cast<device::DeviceMotionHardwareBuffer*>( + mapping_.get()); } private:
diff --git a/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc b/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc index 0eaa297..6fffbfcd 100644 --- a/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc +++ b/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
@@ -80,10 +80,11 @@ listener_.reset(new MockDeviceOrientationListener); orientation_pump_.reset(new DeviceOrientationEventPumpForTesting); shared_memory_ = mojo::SharedBufferHandle::Create( - sizeof(DeviceOrientationHardwareBuffer)); - mapping_ = shared_memory_->Map(sizeof(DeviceOrientationHardwareBuffer)); + sizeof(device::DeviceOrientationHardwareBuffer)); + mapping_ = + shared_memory_->Map(sizeof(device::DeviceOrientationHardwareBuffer)); ASSERT_TRUE(mapping_); - memset(buffer(), 0, sizeof(DeviceOrientationHardwareBuffer)); + memset(buffer(), 0, sizeof(device::DeviceOrientationHardwareBuffer)); } void InitBuffer() { @@ -110,8 +111,9 @@ return shared_memory_->Clone( mojo::SharedBufferHandle::AccessMode::READ_ONLY); } - DeviceOrientationHardwareBuffer* buffer() { - return reinterpret_cast<DeviceOrientationHardwareBuffer*>(mapping_.get()); + device::DeviceOrientationHardwareBuffer* buffer() { + return reinterpret_cast<device::DeviceOrientationHardwareBuffer*>( + mapping_.get()); } private:
diff --git a/content/renderer/media/android/media_player_renderer_client.cc b/content/renderer/media/android/media_player_renderer_client.cc index 3bd225c..43cfa0d 100644 --- a/content/renderer/media/android/media_player_renderer_client.cc +++ b/content/renderer/media/android/media_player_renderer_client.cc
@@ -25,7 +25,7 @@ MediaPlayerRendererClient::~MediaPlayerRendererClient() {} void MediaPlayerRendererClient::Initialize( - media::DemuxerStreamProvider* demuxer_stream_provider, + media::MediaResource* media_resource, media::RendererClient* client, const media::PipelineStatusCB& init_cb) { DCHECK(media_task_runner_->BelongsToCurrentThread()); @@ -46,11 +46,11 @@ base::Unretained(this)), gfx::Size(1, 1), compositor_task_runner_, base::Bind(&MediaPlayerRendererClient::OnStreamTextureWrapperInitialized, - weak_factory_.GetWeakPtr(), demuxer_stream_provider)); + weak_factory_.GetWeakPtr(), media_resource)); } void MediaPlayerRendererClient::OnStreamTextureWrapperInitialized( - media::DemuxerStreamProvider* demuxer_stream_provider, + media::MediaResource* media_resource, bool success) { DCHECK(media_task_runner_->BelongsToCurrentThread()); if (!success) { @@ -60,7 +60,7 @@ } mojo_renderer_->Initialize( - demuxer_stream_provider, this, + media_resource, this, base::Bind(&MediaPlayerRendererClient::OnRemoteRendererInitialized, weak_factory_.GetWeakPtr())); }
diff --git a/content/renderer/media/android/media_player_renderer_client.h b/content/renderer/media/android/media_player_renderer_client.h index 1f63e358..d234710 100644 --- a/content/renderer/media/android/media_player_renderer_client.h +++ b/content/renderer/media/android/media_player_renderer_client.h
@@ -10,7 +10,7 @@ #include "base/memory/weak_ptr.h" #include "content/common/content_export.h" #include "media/base/android/stream_texture_wrapper.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/renderer.h" #include "media/base/renderer_client.h" #include "media/base/video_renderer_sink.h" @@ -45,7 +45,7 @@ ~MediaPlayerRendererClient() override; // media::Renderer implementation. - void Initialize(media::DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(media::MediaResource* media_resource, media::RendererClient* client, const media::PipelineStatusCB& init_cb) override; void SetCdm(media::CdmContext* cdm_context, @@ -71,9 +71,8 @@ void OnFrameAvailable(); private: - void OnStreamTextureWrapperInitialized( - media::DemuxerStreamProvider* demuxer_stream_provider, - bool success); + void OnStreamTextureWrapperInitialized(media::MediaResource* media_resource, + bool success); void OnRemoteRendererInitialized(media::PipelineStatus status); void OnScopedSurfaceRequested(const base::UnguessableToken& request_token);
diff --git a/content/renderer/media/gpu/rtc_video_decoder.cc b/content/renderer/media/gpu/rtc_video_decoder.cc index 01c136c..8564111 100644 --- a/content/renderer/media/gpu/rtc_video_decoder.cc +++ b/content/renderer/media/gpu/rtc_video_decoder.cc
@@ -110,6 +110,9 @@ case webrtc::kVideoCodecVP8: profile = media::VP8PROFILE_ANY; break; + case webrtc::kVideoCodecVP9: + profile = media::VP9PROFILE_MIN; + break; case webrtc::kVideoCodecH264: profile = media::H264PROFILE_MAIN; break;
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc index 4c42938..988185b 100644 --- a/content/renderer/media/gpu/rtc_video_encoder.cc +++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -41,6 +41,8 @@ switch (type) { case webrtc::kVideoCodecVP8: return media::VP8PROFILE_ANY; + case webrtc::kVideoCodecVP9: + return media::VP9PROFILE_MIN; case webrtc::kVideoCodecH264: // TODO(magjed): WebRTC is only using Baseline profile for now. Update // once http://crbug/webrtc/6337 is fixed.
diff --git a/content/renderer/media/user_media_client_impl_unittest.cc b/content/renderer/media/user_media_client_impl_unittest.cc index 1e6e6e3..43a957f 100644 --- a/content/renderer/media/user_media_client_impl_unittest.cc +++ b/content/renderer/media/user_media_client_impl_unittest.cc
@@ -153,34 +153,26 @@ create_source_that_fails_(false), video_source_(NULL) {} - void RequestUserMedia(const blink::WebUserMediaRequest& user_media_request) { + void RequestUserMediaForTest( + const blink::WebUserMediaRequest& user_media_request) { state_ = REQUEST_NOT_COMPLETE; requestUserMedia(user_media_request); base::RunLoop().RunUntilIdle(); } - void RequestUserMedia() { + void RequestUserMediaForTest() { blink::WebUserMediaRequest user_media_request = blink::WebUserMediaRequest::createForTesting( CreateDefaultConstraints(), CreateDefaultConstraints()); - RequestUserMedia(user_media_request); + RequestUserMediaForTest(user_media_request); } - void RequestMediaDevices() { + void RequestMediaDevicesForTest() { blink::WebMediaDevicesRequest media_devices_request; state_ = REQUEST_NOT_COMPLETE; requestMediaDevices(media_devices_request); } - void SetMediaDeviceChangeObserver() { - blink::WebMediaDeviceChangeObserver observer(true); - setMediaDeviceChangeObserver(observer); - } - - void RemoveMediaDeviceChangeObserver() { - setMediaDeviceChangeObserver(blink::WebMediaDeviceChangeObserver()); - } - void GetUserMediaRequestSucceeded( const blink::WebMediaStream& stream, blink::WebUserMediaRequest request_info) override { @@ -332,7 +324,7 @@ } blink::WebMediaStream RequestLocalMediaStream() { - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); FakeMediaStreamDispatcherRequestUserMediaComplete(); StartMockedVideoSource(); @@ -389,7 +381,7 @@ blink::WebUserMediaRequest request = blink::WebUserMediaRequest::createForTesting(audio_constraints, null_constraints); - user_media_client_impl_->RequestUserMedia(request); + user_media_client_impl_->RequestUserMediaForTest(request); bool result = user_media_client_impl_->UserMediaRequestHasAutomaticDeviceSelection( ms_dispatcher_->audio_input_request_id()); @@ -408,7 +400,7 @@ blink::WebUserMediaRequest request = blink::WebUserMediaRequest::createForTesting(audio_constraints, video_constraints); - user_media_client_impl_->RequestUserMedia(request); + user_media_client_impl_->RequestUserMediaForTest(request); FakeMediaStreamDispatcherRequestUserMediaComplete(); StartMockedVideoSource(); @@ -576,7 +568,7 @@ // This test what happens if a video source to a MediaSteam fails to start. TEST_F(UserMediaClientImplTest, MediaVideoSourceFailToStart) { - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); FakeMediaStreamDispatcherRequestUserMediaComplete(); FailToStartMockedVideoSource(); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_FAILED, @@ -592,7 +584,7 @@ // This test what happens if an audio source fail to initialize. TEST_F(UserMediaClientImplTest, MediaAudioSourceFailToInitialize) { user_media_client_impl_->SetCreateSourceThatFails(true); - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); FakeMediaStreamDispatcherRequestUserMediaComplete(); StartMockedVideoSource(); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_FAILED, @@ -608,7 +600,7 @@ // This test what happens if UserMediaClientImpl is deleted before a source has // started. TEST_F(UserMediaClientImplTest, MediaStreamImplShutDown) { - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); FakeMediaStreamDispatcherRequestUserMediaComplete(); EXPECT_EQ(1, ms_dispatcher_->request_stream_counter()); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_NOT_COMPLETE, @@ -619,7 +611,7 @@ // This test what happens if a new document is loaded in the frame while the // MediaStream is being generated by the MediaStreamDispatcher. TEST_F(UserMediaClientImplTest, ReloadFrameWhileGeneratingStream) { - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); LoadNewDocumentInFrame(); EXPECT_EQ(1, ms_dispatcher_->request_stream_counter()); EXPECT_EQ(0, ms_dispatcher_->stop_audio_device_counter()); @@ -631,7 +623,7 @@ // This test what happens if a newdocument is loaded in the frame while the // sources are being started. TEST_F(UserMediaClientImplTest, ReloadFrameWhileGeneratingSources) { - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); FakeMediaStreamDispatcherRequestUserMediaComplete(); EXPECT_EQ(1, ms_dispatcher_->request_stream_counter()); LoadNewDocumentInFrame(); @@ -665,7 +657,7 @@ } TEST_F(UserMediaClientImplTest, EnumerateMediaDevices) { - user_media_client_impl_->RequestMediaDevices(); + user_media_client_impl_->RequestMediaDevicesForTest(); base::RunLoop().RunUntilIdle(); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_SUCCEEDED, @@ -722,7 +714,7 @@ TEST_F(UserMediaClientImplTest, RenderToAssociatedSinkConstraint) { // For a null UserMediaRequest (no audio requested), we expect false. - user_media_client_impl_->RequestUserMedia(); + user_media_client_impl_->RequestUserMediaForTest(); EXPECT_FALSE( user_media_client_impl_->UserMediaRequestHasAutomaticDeviceSelection( ms_dispatcher_->audio_input_request_id())); @@ -766,7 +758,8 @@ EXPECT_CALL( media_devices_dispatcher_, SubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _, _)); - user_media_client_impl_->SetMediaDeviceChangeObserver(); + user_media_client_impl_->setMediaDeviceChangeObserver( + blink::WebMediaDeviceChangeObserver(true)); base::RunLoop().RunUntilIdle(); base::WeakPtr<MediaDevicesEventDispatcher> event_dispatcher = @@ -786,7 +779,9 @@ EXPECT_CALL( media_devices_dispatcher_, UnsubscribeDeviceChangeNotifications(MEDIA_DEVICE_TYPE_AUDIO_OUTPUT, _)); - user_media_client_impl_->RemoveMediaDeviceChangeObserver(); + + user_media_client_impl_->setMediaDeviceChangeObserver( + blink::WebMediaDeviceChangeObserver()); base::RunLoop().RunUntilIdle(); } @@ -822,7 +817,7 @@ blink::WebUserMediaRequest request = blink::WebUserMediaRequest::createForTesting( audio_constraints, blink::WebMediaConstraints()); - user_media_client_impl_->RequestUserMedia(request); + user_media_client_impl_->RequestUserMediaForTest(request); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_FAILED, user_media_client_impl_->request_state()); } @@ -833,7 +828,7 @@ blink::WebUserMediaRequest request = blink::WebUserMediaRequest::createForTesting(blink::WebMediaConstraints(), video_constraints); - user_media_client_impl_->RequestUserMedia(request); + user_media_client_impl_->RequestUserMediaForTest(request); EXPECT_EQ(UserMediaClientImplUnderTest::REQUEST_FAILED, user_media_client_impl_->request_state()); }
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index d28c0f4..5a5060f 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -4530,10 +4530,8 @@ void RenderFrameImpl::willInsertBody(blink::WebLocalFrame* frame) { DCHECK(!frame_ || frame_ == frame); - if (!frame->parent()) { - render_view_->Send(new ViewHostMsg_WillInsertBody( - render_view_->GetRoutingID())); - } + Send(new FrameHostMsg_WillInsertBody(routing_id_, + render_view_->GetRoutingID())); } void RenderFrameImpl::reportFindInPageMatchCount(int request_id,
diff --git a/content/shell/android/BUILD.gn b/content/shell/android/BUILD.gn index 1dfcd4e..3eed8d5 100644 --- a/content/shell/android/BUILD.gn +++ b/content/shell/android/BUILD.gn
@@ -158,6 +158,7 @@ deps = [ "//base:base_javatests", "//content/public/android:content_javatests", + "//device/sensors:javatests", "//net/android:net_javatests", "//third_party/android_support_test_runner:runner_java", ]
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc index 4df4e49c..04c0d689 100644 --- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc +++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
@@ -1143,8 +1143,7 @@ })); ON_CALL(*user_descriptor, WriteRemoteDescriptor(_, _, _)) - .WillByDefault(Invoke([adapter_ptr, device_ptr, user_descriptor_ptr, - disconnect, succeeds]( + .WillByDefault(Invoke([adapter_ptr, device_ptr, disconnect, succeeds]( const std::vector<uint8_t>& value, const base::Closure& callback, const BluetoothRemoteGattDescriptor::ErrorCallback& error_callback) { base::Closure pending; @@ -1848,4 +1847,4 @@ base::StringPrintf("%012" PRIx64, addr)); } -} // namespace content \ No newline at end of file +} // namespace content
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 873128a..aafb8c5 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -710,6 +710,7 @@ "//device/generic_sensor", "//device/power_save_blocker", "//device/screen_orientation/public/interfaces", + "//device/sensors", "//device/sensors/public/cpp", "//device/vibration:mojo_bindings", "//device/wake_lock", @@ -1020,9 +1021,6 @@ "../browser/database_tracker_unittest.cc", "../browser/database_util_unittest.cc", "../browser/databases_table_unittest.cc", - "../browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc", - "../browser/device_sensors/sensor_manager_android_unittest.cc", - "../browser/device_sensors/sensor_manager_chromeos_unittest.cc", "../browser/devtools/devtools_http_handler_unittest.cc", "../browser/devtools/devtools_manager_unittest.cc", "../browser/devtools/protocol/tracing_handler_unittest.cc",
diff --git a/content/test/data/generic_sensor/ambient_light_sensor_test.html b/content/test/data/generic_sensor/ambient_light_sensor_test.html index 939d29a..25d46a6 100644 --- a/content/test/data/generic_sensor/ambient_light_sensor_test.html +++ b/content/test/data/generic_sensor/ambient_light_sensor_test.html
@@ -5,9 +5,9 @@ var timeOrigin; var sensor; function onAmbientLightReadingChange() { - if (sensor.reading.illuminance == 50 && - sensor.reading.timeStamp > timeOrigin && - sensor.reading.timeStamp < window.performance.now()) { + if (sensor.illuminance == 50 && + sensor.timestamp > timeOrigin && + sensor.timestamp < window.performance.now()) { pass(); } else { fail();
diff --git a/content/test/data/site_isolation/subframe_resources.html b/content/test/data/site_isolation/subframe_resources.html new file mode 100644 index 0000000..9ea40ec --- /dev/null +++ b/content/test/data/site_isolation/subframe_resources.html
@@ -0,0 +1,22 @@ +<body> +<p>Load a bunch of videos. +<script> +var url = new URL(location); +var subresourceUrl = url.searchParams.get('url'); +var numSubresources = parseInt(url.searchParams.get('numSubresources'), 10); + +var numDone = 0; +function onVideoDone() { + numDone++; + if (numDone == numSubresources) + parent.postMessage('loaded', '*'); +} + +for (var i = 0; i < numSubresources; i++) { + var video = document.createElement('video'); + video.src = subresourceUrl + "?" + i; + video.onerror = onVideoDone; + video.onload = onVideoDone; + document.body.appendChild(video); +} +</script>
diff --git a/content/test/data/site_isolation/subframes_with_resources.html b/content/test/data/site_isolation/subframes_with_resources.html new file mode 100644 index 0000000..775b8895 --- /dev/null +++ b/content/test/data/site_isolation/subframes_with_resources.html
@@ -0,0 +1,25 @@ +<p> Load a bunch of frames containing videos. +<script> +var url = new URL(location); +var urls = url.searchParams.get('urls').split(','); +var numFrames = urls.length; +var numSubresources = parseInt(url.searchParams.get('numSubresources'), 10); +function createFrames() { + for (var i = 0; i < numFrames; i++) { + var frame = document.createElement('iframe'); + frame.src = + "/cross-site/example.com/site_isolation/subframe_resources.html?url=" + + urls[i] + "&numSubresources=" + numSubresources; + document.body.appendChild(frame); + } +} + +// Wait for |numFrame| messages. Each message is received when a given frame +// finishes (errors/completes) all of its subresources. +var numMessages = 0; +window.addEventListener('message', function(e) { + numMessages++; + if (numMessages == numFrames) + window.domAutomationController.send(true); +}); +</script>
diff --git a/device/BUILD.gn b/device/BUILD.gn index c3d35260..f26a6bb 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn
@@ -70,6 +70,9 @@ "generic_sensor/platform_sensor_provider_unittest.cc", "power_monitor/power_monitor_message_broadcaster_unittest.cc", "power_monitor/public/cpp/power_monitor_broadcast_source_unittest.cc", + "sensors/data_fetcher_shared_memory_base_unittest.cc", + "sensors/sensor_manager_android_unittest.cc", + "sensors/sensor_manager_chromeos_unittest.cc", "test/run_all_unittests.cc", "wake_lock/wake_lock_service_context_unittest.cc", ] @@ -94,6 +97,9 @@ "//device/power_monitor/public/cpp", "//device/power_monitor/public/interfaces", "//device/power_save_blocker", + "//device/sensors", + "//device/sensors/public/cpp", + "//device/sensors/public/interfaces", "//device/wake_lock", "//mojo/common", "//mojo/edk/system", @@ -101,6 +107,7 @@ "//net", "//testing/gmock", "//testing/gtest", + "//third_party/WebKit/public:blink", "//third_party/WebKit/public:blink_headers", "//tools/usb_gadget", "//url", @@ -184,6 +191,7 @@ ":bluetooth_test_jni_headers", "//device/geolocation:geolocation_java", "//device/geolocation:geolocation_java_test_support", + "//device/sensors:java", "//device/usb:java", ] deps -= [ "//device/battery" ]
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc index 81e189e..f5f34339 100644 --- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
@@ -130,6 +130,8 @@ void DoNothingOnError( device::BluetoothGattService::GattErrorCode /*error_code*/) {} +void DoNothingOnAdvertisementError( + device::BluetoothAdvertisement::ErrorCode /*error_code*/) {} void SetIntervalErrorCallbackConnector( const device::BluetoothAdapter::AdvertisementErrorCallback& error_callback, @@ -188,6 +190,16 @@ delete it.second; profile_queues_.clear(); + // This may call unregister on advertisements that have already been + // unregistered but that's fine. The advertisement object keeps a track of + // the fact that it has been already unregistered and will call our empty + // error callback with an "Already unregistered" error, which we'll ignore. + for (auto& it : advertisements_) { + it->Unregister(base::Bind(&base::DoNothing), + base::Bind(&DoNothingOnAdvertisementError)); + } + advertisements_.clear(); + bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->RemoveObserver( this); bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->RemoveObserver( @@ -478,6 +490,7 @@ scoped_refptr<BluetoothAdvertisementBlueZ> advertisement( new BluetoothAdvertisementBlueZ(std::move(advertisement_data), this)); advertisement->Register(base::Bind(callback, advertisement), error_callback); + advertisements_.emplace_back(advertisement); } void BluetoothAdapterBlueZ::SetAdvertisingInterval(
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.h b/device/bluetooth/bluez/bluetooth_adapter_bluez.h index 58f12f0..5e9be8e 100644 --- a/device/bluetooth/bluez/bluetooth_adapter_bluez.h +++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.h
@@ -46,6 +46,7 @@ class BluetoothBlueZTest; class BluetoothAdapterProfileBlueZ; +class BluetoothAdvertisementBlueZ; class BluetoothDeviceBlueZ; class BluetoothLocalGattCharacteristicBlueZ; class BluetoothLocalGattServiceBlueZ; @@ -491,6 +492,14 @@ std::unique_ptr<BluetoothGattApplicationServiceProvider> gatt_application_provider_; + // List of advertisements registered with this adapter. This list is used + // to ensure we unregister any advertisements that were registered with + // this adapter on adapter shutdown. This is a sub-optimal solution since + // we'll keep a list of all advertisements ever created by this adapter (the + // unregistered ones will just be inactive). This will be fixed with + // crbug.com/687396. + std::vector<scoped_refptr<BluetoothAdvertisementBlueZ>> advertisements_; + // Note: This should remain the last member so it'll be destroyed and // invalidate its weak pointers before any other members are destroyed. base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_;
diff --git a/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc b/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc index 0adece73..7b938ff0 100644 --- a/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc
@@ -13,7 +13,6 @@ #include "base/logging.h" #include "base/strings/string_util.h" #include "dbus/bus.h" -#include "dbus/object_path.h" #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" #include "device/bluetooth/dbus/bluetooth_le_advertising_manager_client.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h" @@ -71,7 +70,7 @@ BluetoothAdvertisementBlueZ::BluetoothAdvertisementBlueZ( std::unique_ptr<device::BluetoothAdvertisement::Data> data, scoped_refptr<BluetoothAdapterBlueZ> adapter) - : adapter_(adapter) { + : adapter_path_(adapter->object_path()) { // Generate a new object path - make sure that we strip any -'s from the // generated GUID string since object paths can only contain alphanumeric // characters and _ characters. @@ -99,7 +98,7 @@ bluez::BluezDBusManager::Get() ->GetBluetoothLEAdvertisingManagerClient() ->RegisterAdvertisement( - adapter_->object_path(), provider_->object_path(), success_callback, + adapter_path_, provider_->object_path(), success_callback, base::Bind(&RegisterErrorCallbackConnector, error_callback)); } @@ -122,9 +121,8 @@ bluez::BluezDBusManager::Get() ->GetBluetoothLEAdvertisingManagerClient() ->UnregisterAdvertisement( - adapter_->object_path(), provider_->object_path(), success_callback, + adapter_path_, provider_->object_path(), success_callback, base::Bind(&UnregisterErrorCallbackConnector, error_callback)); - provider_.reset(); } void BluetoothAdvertisementBlueZ::Released() {
diff --git a/device/bluetooth/bluez/bluetooth_advertisement_bluez.h b/device/bluetooth/bluez/bluetooth_advertisement_bluez.h index 010ed26..98be931d 100644 --- a/device/bluetooth/bluez/bluetooth_advertisement_bluez.h +++ b/device/bluetooth/bluez/bluetooth_advertisement_bluez.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/macros.h" +#include "dbus/object_path.h" #include "device/bluetooth/bluetooth_adapter.h" #include "device/bluetooth/bluetooth_advertisement.h" #include "device/bluetooth/bluetooth_export.h" @@ -52,7 +53,7 @@ ~BluetoothAdvertisementBlueZ() override; // Adapter this advertisement is advertising on. - scoped_refptr<BluetoothAdapterBlueZ> adapter_; + dbus::ObjectPath adapter_path_; std::unique_ptr<bluez::BluetoothLEAdvertisementServiceProvider> provider_; DISALLOW_COPY_AND_ASSIGN(BluetoothAdvertisementBlueZ);
diff --git a/device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc index bbf8b36d..1d220053 100644 --- a/device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc +++ b/device/bluetooth/bluez/bluetooth_advertisement_bluez_unittest.cc
@@ -75,6 +75,7 @@ observer_.reset(); // The adapter should outlive the advertisement. advertisement_ = nullptr; + BluetoothAdapterFactory::Shutdown(); adapter_ = nullptr; bluez::BluezDBusManager::Shutdown(); } @@ -268,4 +269,16 @@ ExpectError(BluetoothAdvertisement::ERROR_ADVERTISEMENT_DOES_NOT_EXIST); } +TEST_F(BluetoothAdvertisementBlueZTest, UnregisterAfterAdapterShutdown) { + scoped_refptr<BluetoothAdvertisement> advertisement = CreateAdvertisement(); + ExpectSuccess(); + EXPECT_TRUE(advertisement); + + // Shutdown the default adapter. + BluetoothAdapterFactory::Shutdown(); + + UnregisterAdvertisement(advertisement); + ExpectError(BluetoothAdvertisement::ERROR_ADVERTISEMENT_DOES_NOT_EXIST); +} + } // namespace bluez
diff --git a/device/generic_sensor/public/cpp/sensor_reading.h b/device/generic_sensor/public/cpp/sensor_reading.h index bd1f7d0..90848d7 100644 --- a/device/generic_sensor/public/cpp/sensor_reading.h +++ b/device/generic_sensor/public/cpp/sensor_reading.h
@@ -45,7 +45,8 @@ ~SensorReading(); SensorReading(const SensorReading& other); SensorReadingField<double> timestamp; - SensorReadingField<double> values[3]; + constexpr static int kValuesCount = 3; + SensorReadingField<double> values[kValuesCount]; }; // This structure represents sensor reading buffer: sensor reading and seqlock
diff --git a/device/sensors/BUILD.gn b/device/sensors/BUILD.gn new file mode 100644 index 0000000..c47c2ef --- /dev/null +++ b/device/sensors/BUILD.gn
@@ -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("//build/config/features.gni") + +if (is_android) { + import("//build/config/android/rules.gni") # For generate_jni(). +} + +component("sensors") { + sources = [ + "ambient_light_mac.cc", + "ambient_light_mac.h", + "android/device_sensor_jni_registrar.cc", + "android/device_sensor_jni_registrar.h", + "data_fetcher_shared_memory.h", + "data_fetcher_shared_memory_android.cc", + "data_fetcher_shared_memory_base.cc", + "data_fetcher_shared_memory_base.h", + "data_fetcher_shared_memory_chromeos.cc", + "data_fetcher_shared_memory_default.cc", + "data_fetcher_shared_memory_mac.cc", + "data_fetcher_shared_memory_win.cc", + "device_sensor_export.h", + "device_sensor_host.cc", + "device_sensor_host.h", + "device_sensor_service.cc", + "device_sensor_service.h", + "device_sensors_consts.h", + "sensor_manager_android.cc", + "sensor_manager_android.h", + "sensor_manager_chromeos.cc", + "sensor_manager_chromeos.h", + ] + + defines = [ "DEVICE_SENSOR_IMPLEMENTATION" ] + + deps = [ + "//base", + "//device/sensors/public/cpp", + "//mojo/public/cpp/bindings", + ] + + public_deps = [ + "//device/sensors/public/interfaces", + ] + + if (is_win) { + sources -= [ "data_fetcher_shared_memory_default.cc" ] + libs = [ + "sensorsapi.lib", + "portabledeviceguids.lib", + ] + } + if (is_android) { + sources -= [ "data_fetcher_shared_memory_default.cc" ] + deps += [ ":device_sensors_jni_headers" ] + } + if (is_mac) { + sources -= [ "data_fetcher_shared_memory_default.cc" ] + deps += [ "//third_party/sudden_motion_sensor" ] + libs = [ + "CoreFoundation.framework", + "IOKit.framework", + ] + } + if (is_chromeos) { + sources -= [ "data_fetcher_shared_memory_default.cc" ] + deps += [ + "//chromeos", + "//ui/gfx", + ] + } +} + +if (is_android) { + generate_jni("device_sensors_jni_headers") { + sources = [ + "android/java/src/org/chromium/device/sensors/DeviceSensors.java", + ] + jni_package = "sensors" + } + + android_library("java") { + java_files = + [ "android/java/src/org/chromium/device/sensors/DeviceSensors.java" ] + deps = [ + "//base:base_java", + "//third_party/android_tools:android_support_annotations_java", + ] + srcjar_deps = [ ":device_sensors_android_java_enums_srcjar" ] + } + + android_library("javatests") { + testonly = true + java_files = [ "android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java" ] + deps = [ + ":java", + "//third_party/android_support_test_runner:runner_java", + ] + } + + java_cpp_enum("device_sensors_android_java_enums_srcjar") { + sources = [ + "device_sensors_consts.h", + "sensor_manager_android.h", + ] + } +}
diff --git a/device/sensors/DEPS b/device/sensors/DEPS new file mode 100644 index 0000000..7695ca6 --- /dev/null +++ b/device/sensors/DEPS
@@ -0,0 +1,5 @@ +include_rules = [ + "+jni", + "+third_party/sudden_motion_sensor", + "+ui/gfx", +]
diff --git a/content/browser/device_sensors/ambient_light_mac.cc b/device/sensors/ambient_light_mac.cc similarity index 95% rename from content/browser/device_sensors/ambient_light_mac.cc rename to device/sensors/ambient_light_mac.cc index c660679..9d2417d4 100644 --- a/content/browser/device_sensors/ambient_light_mac.cc +++ b/device/sensors/ambient_light_mac.cc
@@ -4,14 +4,14 @@ // This file is based on http://osxbook.com/book/bonus/chapter10/light/ -#include "content/browser/device_sensors/ambient_light_mac.h" +#include "device/sensors/ambient_light_mac.h" #include <utility> #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_ioobject.h" -namespace content { +namespace device { namespace { enum LmuFunctionIndex { @@ -77,4 +77,4 @@ return kr == KERN_SUCCESS; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/ambient_light_mac.h b/device/sensors/ambient_light_mac.h similarity index 79% rename from content/browser/device_sensors/ambient_light_mac.h rename to device/sensors/ambient_light_mac.h index 6d4af75..f777dbc7 100644 --- a/content/browser/device_sensors/ambient_light_mac.h +++ b/device/sensors/ambient_light_mac.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 CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_ +#ifndef DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_ +#define DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_ #include <IOKit/IOKitLib.h> #include <stdint.h> @@ -12,7 +12,7 @@ #include "base/macros.h" -namespace content { +namespace device { // Provides an interface to retrieve ambient light data from MacBooks. class AmbientLightSensor { @@ -38,6 +38,6 @@ DISALLOW_COPY_AND_ASSIGN(AmbientLightSensor); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_ +#endif // DEVICE_SENSORS_AMBIENT_LIGHT_MAC_H_
diff --git a/device/sensors/android/device_sensor_jni_registrar.cc b/device/sensors/android/device_sensor_jni_registrar.cc new file mode 100644 index 0000000..8ce8db2 --- /dev/null +++ b/device/sensors/android/device_sensor_jni_registrar.cc
@@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "device/sensors/android/device_sensor_jni_registrar.h" + +#include "base/android/jni_android.h" +#include "base/android/jni_registrar.h" +#include "device/sensors/sensor_manager_android.h" + +namespace device { +namespace android { +namespace { + +const base::android::RegistrationMethod kRegisteredMethods[] = { + {"SensorManagerAndroid", device::SensorManagerAndroid::Register}, +}; + +} // namespace + +bool RegisterDeviceSensorJni(JNIEnv* env) { + return RegisterNativeMethods(env, kRegisteredMethods, + arraysize(kRegisteredMethods)); +} + +} // namespace android +} // namespace device
diff --git a/device/sensors/android/device_sensor_jni_registrar.h b/device/sensors/android/device_sensor_jni_registrar.h new file mode 100644 index 0000000..db788846 --- /dev/null +++ b/device/sensors/android/device_sensor_jni_registrar.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 DEVICE_SENSOR_ANDROID_DEVICE_SENSOR_JNI_REGISTRAR_H_ +#define DEVICE_SENSOR_ANDROID_DEVICE_SENSOR_JNI_REGISTRAR_H_ + +#include <jni.h> + +#include "device/sensors/device_sensor_export.h" + +namespace device { +namespace android { + +bool DEVICE_SENSOR_EXPORT RegisterDeviceSensorJni(JNIEnv* env); + +} // namespace android +} // namespace device + +#endif // DEVICE_SENSOR_ANDROID_DEVICE_SENSOR_JNI_REGISTRAR_H_
diff --git a/content/public/android/java/src/org/chromium/content/browser/DeviceSensors.java b/device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java similarity index 99% rename from content/public/android/java/src/org/chromium/content/browser/DeviceSensors.java rename to device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java index e2e91f3..90f59f8 100644 --- a/content/public/android/java/src/org/chromium/content/browser/DeviceSensors.java +++ b/device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.content.browser; +package org.chromium.device.sensors; import android.content.Context; import android.hardware.Sensor; @@ -26,7 +26,7 @@ /** * Android implementation of the device {motion|orientation|light} APIs. */ -@JNINamespace("content") +@JNINamespace("device") class DeviceSensors implements SensorEventListener { private static final String TAG = "cr.DeviceSensors"; @@ -612,7 +612,7 @@ /** * Native JNI calls, - * see content/browser/device_sensors/sensor_manager_android.cc + * see device/sensors/sensor_manager_android.cc */ /**
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/DeviceSensorsTest.java b/device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java similarity index 99% rename from content/public/android/javatests/src/org/chromium/content/browser/DeviceSensorsTest.java rename to device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java index 4bf9c794..988f092 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/DeviceSensorsTest.java +++ b/device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package org.chromium.content.browser; +package org.chromium.device.sensors; import android.content.Context; import android.hardware.Sensor;
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory.h b/device/sensors/data_fetcher_shared_memory.h similarity index 86% rename from content/browser/device_sensors/data_fetcher_shared_memory.h rename to device/sensors/data_fetcher_shared_memory.h index 6b209ae..8ad3074 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory.h +++ b/device/sensors/data_fetcher_shared_memory.h
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ +#ifndef DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ +#define DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ #include "base/macros.h" #include "build/build_config.h" -#include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" +#include "device/sensors/data_fetcher_shared_memory_base.h" #if !defined(OS_ANDROID) #include "device/sensors/public/cpp/device_light_hardware_buffer.h" @@ -22,7 +22,7 @@ #include "base/win/scoped_comptr.h" #endif -namespace content { +namespace device { #if defined(OS_CHROMEOS) class SensorManagerChromeOS; @@ -30,7 +30,7 @@ class AmbientLightSensor; #endif -class CONTENT_EXPORT DataFetcherSharedMemory +class DEVICE_SENSOR_EXPORT DataFetcherSharedMemory : public DataFetcherSharedMemoryBase { public: @@ -85,6 +85,6 @@ DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemory); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_ +#endif // DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_H_
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_android.cc b/device/sensors/data_fetcher_shared_memory_android.cc similarity index 92% rename from content/browser/device_sensors/data_fetcher_shared_memory_android.cc rename to device/sensors/data_fetcher_shared_memory_android.cc index 3109f210..d86b24a 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_android.cc +++ b/device/sensors/data_fetcher_shared_memory_android.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" #include "base/logging.h" -#include "content/browser/device_sensors/sensor_manager_android.h" #include "device/sensors/public/cpp/device_light_hardware_buffer.h" #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" +#include "device/sensors/sensor_manager_android.h" -namespace content { +namespace device { DataFetcherSharedMemory::DataFetcherSharedMemory() { } @@ -71,4 +71,4 @@ SensorManagerAndroid::GetInstance()->Shutdown(); } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base.cc b/device/sensors/data_fetcher_shared_memory_base.cc similarity index 97% rename from content/browser/device_sensors/data_fetcher_shared_memory_base.cc rename to device/sensors/data_fetcher_shared_memory_base.cc index 34191f80..84dde1c 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_base.cc +++ b/device/sensors/data_fetcher_shared_memory_base.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" +#include "device/sensors/data_fetcher_shared_memory_base.h" #include <stddef.h> #include <string.h> @@ -19,7 +19,7 @@ #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" -namespace content { +namespace device { namespace { @@ -243,4 +243,4 @@ return polling_thread_ ? polling_thread_->IsTimerRunning() : false; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base.h b/device/sensors/data_fetcher_shared_memory_base.h similarity index 88% rename from content/browser/device_sensors/data_fetcher_shared_memory_base.h rename to device/sensors/data_fetcher_shared_memory_base.h index f8326aa..2fa3663c 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_base.h +++ b/device/sensors/data_fetcher_shared_memory_base.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 CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ +#ifndef DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ +#define DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ #include <map> #include <memory> @@ -11,18 +11,18 @@ #include "base/macros.h" #include "base/memory/shared_memory.h" #include "base/message_loop/message_loop.h" -#include "content/browser/device_sensors/device_sensors_consts.h" -#include "content/common/content_export.h" +#include "device/sensors/device_sensor_export.h" +#include "device/sensors/device_sensors_consts.h" #include "mojo/public/cpp/system/buffer.h" -namespace content { +namespace device { // Sensor data fetchers should derive from this base class and implement // the abstract Start() and Stop() methods. // If the fetcher requires polling it should also implement IsPolling() // to return true and the Fetch() method which will be called from the // polling thread to fetch data at regular intervals. -class CONTENT_EXPORT DataFetcherSharedMemoryBase { +class DEVICE_SENSOR_EXPORT DataFetcherSharedMemoryBase { public: // Starts updating the shared memory buffer with sensor data at // regular intervals. Returns true if the relevant sensors could @@ -98,6 +98,6 @@ DISALLOW_COPY_AND_ASSIGN(DataFetcherSharedMemoryBase); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_ +#endif // DEVICE_SENSORS_DATA_FETCHER_SHARED_MEMORY_BASE_H_
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc b/device/sensors/data_fetcher_shared_memory_base_unittest.cc similarity index 98% rename from content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc rename to device/sensors/data_fetcher_shared_memory_base_unittest.cc index 54e76be..a393f20d 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc +++ b/device/sensors/data_fetcher_shared_memory_base_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory_base.h" +#include "device/sensors/data_fetcher_shared_memory_base.h" #include "base/logging.h" #include "base/macros.h" @@ -15,7 +15,7 @@ #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" #include "testing/gtest/include/gtest/gtest.h" -namespace content { +namespace device { namespace { @@ -606,4 +606,4 @@ } // namespace -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc b/device/sensors/data_fetcher_shared_memory_chromeos.cc similarity index 92% rename from content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc rename to device/sensors/data_fetcher_shared_memory_chromeos.cc index d7d04ed..d9d3a24 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc +++ b/device/sensors/data_fetcher_shared_memory_chromeos.cc
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" -#include "content/browser/device_sensors/sensor_manager_chromeos.h" +#include "device/sensors/sensor_manager_chromeos.h" -namespace content { +namespace device { DataFetcherSharedMemory::DataFetcherSharedMemory() { } @@ -69,4 +69,4 @@ return false; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_default.cc b/device/sensors/data_fetcher_shared_memory_default.cc similarity index 88% rename from content/browser/device_sensors/data_fetcher_shared_memory_default.cc rename to device/sensors/data_fetcher_shared_memory_default.cc index 9e8dc3d..d6dd665 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_default.cc +++ b/device/sensors/data_fetcher_shared_memory_default.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" namespace { -bool SetMotionBuffer(content::DeviceMotionHardwareBuffer* buffer, +bool SetMotionBuffer(device::DeviceMotionHardwareBuffer* buffer, bool enabled) { if (!buffer) return false; @@ -20,7 +20,7 @@ } bool SetOrientationBuffer( - content::DeviceOrientationHardwareBuffer* buffer, bool enabled) { + device::DeviceOrientationHardwareBuffer* buffer, bool enabled) { if (!buffer) return false; buffer->seqlock.WriteBegin(); @@ -29,7 +29,7 @@ return true; } -bool SetLightBuffer(content::DeviceLightHardwareBuffer* buffer, +bool SetLightBuffer(device::DeviceLightHardwareBuffer* buffer, double lux) { if (!buffer) return false; @@ -41,7 +41,7 @@ } // namespace -namespace content { +namespace device { DataFetcherSharedMemory::DataFetcherSharedMemory() {} @@ -92,4 +92,4 @@ return false; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc b/device/sensors/data_fetcher_shared_memory_mac.cc similarity index 94% rename from content/browser/device_sensors/data_fetcher_shared_memory_mac.cc rename to device/sensors/data_fetcher_shared_memory_mac.cc index ab455aa6..1826068b 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_mac.cc +++ b/device/sensors/data_fetcher_shared_memory_mac.cc
@@ -2,23 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" #include <stdint.h> #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/single_thread_task_runner.h" -#include "content/browser/device_sensors/ambient_light_mac.h" +#include "device/sensors/ambient_light_mac.h" #include "device/sensors/public/cpp/device_util_mac.h" #include "third_party/sudden_motion_sensor/sudden_motion_sensor_mac.h" -namespace { +namespace device { const double kMeanGravity = 9.80665; -void FetchLight(content::AmbientLightSensor* sensor, - content::DeviceLightHardwareBuffer* buffer) { +void FetchLight(AmbientLightSensor* sensor, DeviceLightHardwareBuffer* buffer) { DCHECK(sensor); DCHECK(buffer); // Macbook pro has 2 lux values, left and right, we take the average. @@ -28,14 +27,14 @@ if (!sensor->ReadSensorValue(lux_value)) return; uint64_t mean = (lux_value[0] + lux_value[1]) / 2; - double lux = device::LMUvalueToLux(mean); + double lux = LMUvalueToLux(mean); buffer->seqlock.WriteBegin(); buffer->data.value = lux; buffer->seqlock.WriteEnd(); } void FetchMotion(SuddenMotionSensor* sensor, - content::DeviceMotionHardwareBuffer* buffer) { + DeviceMotionHardwareBuffer* buffer) { DCHECK(sensor); DCHECK(buffer); @@ -55,7 +54,7 @@ } void FetchOrientation(SuddenMotionSensor* sensor, - content::DeviceOrientationHardwareBuffer* buffer) { + DeviceOrientationHardwareBuffer* buffer) { DCHECK(sensor); DCHECK(buffer); @@ -111,10 +110,6 @@ buffer->seqlock.WriteEnd(); } -} // namespace - -namespace content { - DataFetcherSharedMemory::DataFetcherSharedMemory() { } @@ -257,4 +252,4 @@ return false; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/data_fetcher_shared_memory_win.cc b/device/sensors/data_fetcher_shared_memory_win.cc similarity index 98% rename from content/browser/device_sensors/data_fetcher_shared_memory_win.cc rename to device/sensors/data_fetcher_shared_memory_win.cc index b2a6ad9..38e81dbe 100644 --- a/content/browser/device_sensors/data_fetcher_shared_memory_win.cc +++ b/device/sensors/data_fetcher_shared_memory_win.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" #include <GuidDef.h> #include <InitGuid.h> @@ -19,7 +19,7 @@ const double kMeanGravity = 9.80665; -void SetLightBuffer(content::DeviceLightHardwareBuffer* buffer, double lux) { +void SetLightBuffer(device::DeviceLightHardwareBuffer* buffer, double lux) { DCHECK(buffer); buffer->seqlock.WriteBegin(); buffer->data.value = lux; @@ -28,8 +28,7 @@ } // namespace - -namespace content { +namespace device { class DataFetcherSharedMemory::SensorEventSink : public ISensorEvents, public base::win::IUnknownImpl { @@ -494,4 +493,4 @@ } } -} // namespace content +} // namespace device
diff --git a/device/sensors/device_sensor_export.h b/device/sensors/device_sensor_export.h new file mode 100644 index 0000000..2e31825 --- /dev/null +++ b/device/sensors/device_sensor_export.h
@@ -0,0 +1,29 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef DEVICE_SENSORS_DEVICE_SENSOR_EXPORT_H_ +#define DEVICE_SENSORS_DEVICE_SENSOR_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(DEVICE_SENSOR_IMPLEMENTATION) +#define DEVICE_SENSOR_EXPORT __declspec(dllexport) +#else +#define DEVICE_SENSOR_EXPORT __declspec(dllimport) +#endif // defined(DEVICE_SENSOR_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(DEVICE_SENSOR_IMPLEMENTATION) +#define DEVICE_SENSOR_EXPORT __attribute__((visibility("default"))) +#else +#define DEVICE_SENSOR_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define DEVICE_SENSOR_EXPORT +#endif + +#endif // DEVICE_SENSORS_DEVICE_SENSOR_EXPORT_H_
diff --git a/content/browser/device_sensors/device_sensor_host.cc b/device/sensors/device_sensor_host.cc similarity index 74% rename from content/browser/device_sensors/device_sensor_host.cc rename to device/sensors/device_sensor_host.cc index 06c898a..c0260f4 100644 --- a/content/browser/device_sensors/device_sensor_host.cc +++ b/device/sensors/device_sensor_host.cc
@@ -2,14 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/device_sensor_host.h" +#include "device/sensors/device_sensor_host.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" -#include "content/browser/device_sensors/device_sensor_service.h" +#include "device/sensors/device_sensor_export.h" +#include "device/sensors/device_sensor_service.h" #include "mojo/public/cpp/bindings/strong_binding.h" -namespace content { +namespace device { template <typename MojoInterface, ConsumerType consumer_type> void DeviceSensorHost<MojoInterface, consumer_type>::Create( @@ -60,13 +61,15 @@ DeviceSensorService::GetInstance()->RemoveConsumer(consumer_type); } -template class DeviceSensorHost<device::mojom::LightSensor, - CONSUMER_TYPE_LIGHT>; -template class DeviceSensorHost<device::mojom::MotionSensor, - CONSUMER_TYPE_MOTION>; -template class DeviceSensorHost<device::mojom::OrientationSensor, - CONSUMER_TYPE_ORIENTATION>; -template class DeviceSensorHost<device::mojom::OrientationAbsoluteSensor, - CONSUMER_TYPE_ORIENTATION_ABSOLUTE>; +template class DEVICE_SENSOR_EXPORT + DeviceSensorHost<device::mojom::LightSensor, CONSUMER_TYPE_LIGHT>; +template class DEVICE_SENSOR_EXPORT + DeviceSensorHost<device::mojom::MotionSensor, CONSUMER_TYPE_MOTION>; +template class DEVICE_SENSOR_EXPORT + DeviceSensorHost<device::mojom::OrientationSensor, + CONSUMER_TYPE_ORIENTATION>; +template class DEVICE_SENSOR_EXPORT + DeviceSensorHost<device::mojom::OrientationAbsoluteSensor, + CONSUMER_TYPE_ORIENTATION_ABSOLUTE>; -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/device_sensor_host.h b/device/sensors/device_sensor_host.h similarity index 81% rename from content/browser/device_sensors/device_sensor_host.h rename to device/sensors/device_sensor_host.h index e7fceb3..be9ff721 100644 --- a/content/browser/device_sensors/device_sensor_host.h +++ b/device/sensors/device_sensor_host.h
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_ +#ifndef DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_ +#define DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_ #include "base/macros.h" #include "base/memory/shared_memory.h" -#include "content/browser/device_sensors/device_sensors_consts.h" +#include "device/sensors/device_sensors_consts.h" #include "device/sensors/public/interfaces/light.mojom.h" #include "device/sensors/public/interfaces/motion.mojom.h" #include "device/sensors/public/interfaces/orientation.mojom.h" #include "mojo/public/cpp/bindings/interface_request.h" -namespace content { +namespace device { // A base class for device sensor related mojo interface implementations. template <typename MojoInterface, ConsumerType consumer_type> -class DeviceSensorHost : public MojoInterface { +class DeviceSensorHost : NON_EXPORTED_BASE(public MojoInterface) { public: static void Create(mojo::InterfaceRequest<MojoInterface> request); @@ -48,6 +48,6 @@ DeviceSensorHost<device::mojom::OrientationAbsoluteSensor, CONSUMER_TYPE_ORIENTATION_ABSOLUTE>; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_ +#endif // DEVICE_SENSORS_DEVICE_SENSOR_HOST_H_
diff --git a/content/browser/device_sensors/device_sensor_service.cc b/device/sensors/device_sensor_service.cc similarity index 94% rename from content/browser/device_sensors/device_sensor_service.cc rename to device/sensors/device_sensor_service.cc index 8276007..12ffa6b 100644 --- a/content/browser/device_sensors/device_sensor_service.cc +++ b/device/sensors/device_sensor_service.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/device_sensor_service.h" +#include "device/sensors/device_sensor_service.h" #include "base/bind.h" #include "base/logging.h" #include "base/memory/singleton.h" -#include "content/browser/device_sensors/data_fetcher_shared_memory.h" +#include "device/sensors/data_fetcher_shared_memory.h" -namespace content { +namespace device { DeviceSensorService::DeviceSensorService() : num_light_readers_(0), @@ -110,4 +110,4 @@ data_fetcher_.reset(test_data_fetcher); } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/device_sensor_service.h b/device/sensors/device_sensor_service.h similarity index 84% rename from content/browser/device_sensors/device_sensor_service.h rename to device/sensors/device_sensor_service.h index 00946b4..17ae9f8 100644 --- a/content/browser/device_sensors/device_sensor_service.h +++ b/device/sensors/device_sensor_service.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 CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ +#ifndef DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ +#define DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ #include <memory> @@ -12,18 +12,18 @@ #include "base/memory/shared_memory.h" #include "base/memory/singleton.h" #include "base/threading/thread_checker.h" -#include "content/browser/device_sensors/device_sensors_consts.h" -#include "content/common/content_export.h" +#include "device/sensors/device_sensor_export.h" +#include "device/sensors/device_sensors_consts.h" #include "mojo/public/cpp/system/buffer.h" -namespace content { +namespace device { class DataFetcherSharedMemory; // Owns the data fetcher for Device Motion and Orientation and keeps track of // the number of consumers currently using the data. The data fetcher is stopped // when there are no consumers. -class CONTENT_EXPORT DeviceSensorService { +class DEVICE_SENSOR_EXPORT DeviceSensorService { public: // Returns the DeviceSensorService singleton. static DeviceSensorService* GetInstance(); @@ -68,6 +68,6 @@ DISALLOW_COPY_AND_ASSIGN(DeviceSensorService); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_ +#endif // DEVICE_SENSORS_DEVICE_SENSOR_SERVICE_H_
diff --git a/content/browser/device_sensors/device_sensors_consts.h b/device/sensors/device_sensors_consts.h similarity index 79% rename from content/browser/device_sensors/device_sensors_consts.h rename to device/sensors/device_sensors_consts.h index ae2b5bd..0c7f411 100644 --- a/content/browser/device_sensors/device_sensors_consts.h +++ b/device/sensors/device_sensors_consts.h
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_ +#ifndef DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_ +#define DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_ #include "base/time/time.h" -namespace content { +namespace device { // Constants related to the Device {Motion|Orientation|Light} APIs. // A Java counterpart will be generated for this enum. -// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.browser +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.sensors enum ConsumerType { CONSUMER_TYPE_MOTION = 1 << 0, CONSUMER_TYPE_ORIENTATION = 1 << 1, @@ -34,6 +34,6 @@ const int kLightSensorIntervalMicroseconds = base::Time::kMicrosecondsPerSecond / kLightSensorSamplingRateHz; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_ +#endif // DEVICE_SENSORS_DEVICE_SENSORS_CONSTS_H_
diff --git a/device/sensors/public/cpp/device_light_data.h b/device/sensors/public/cpp/device_light_data.h index d0aba2c..71a4bcc 100644 --- a/device/sensors/public/cpp/device_light_data.h +++ b/device/sensors/public/cpp/device_light_data.h
@@ -5,7 +5,7 @@ #ifndef DEVICE_SENSORS_PUBLIC_CPP_DEVICE_LIGHT_DATA_H_ #define DEVICE_SENSORS_PUBLIC_CPP_DEVICE_LIGHT_DATA_H_ -namespace content { +namespace device { // This struct is intentionally POD and fixed size so that it can be stored // in shared memory between the sensor interface impl and its clients. @@ -16,6 +16,6 @@ double value; }; -} // namespace content +} // namespace device #endif // DEVICE_SENSORS_PUBLIC_CPP_DEVICE_LIGHT_DATA_H_
diff --git a/device/sensors/public/cpp/device_light_hardware_buffer.h b/device/sensors/public/cpp/device_light_hardware_buffer.h index 281656d..039d22ad 100644 --- a/device/sensors/public/cpp/device_light_hardware_buffer.h +++ b/device/sensors/public/cpp/device_light_hardware_buffer.h
@@ -8,11 +8,10 @@ #include "device/base/synchronization/shared_memory_seqlock_buffer.h" #include "device/sensors/public/cpp/device_light_data.h" -namespace content { +namespace device { -typedef device::SharedMemorySeqLockBuffer<DeviceLightData> - DeviceLightHardwareBuffer; +typedef SharedMemorySeqLockBuffer<DeviceLightData> DeviceLightHardwareBuffer; -} // namespace content +} // namespace device #endif // DEVICE_SENSORS_PUBLIC_CPP_DEVICE_LIGHT_HARDWARE_BUFFER_H_
diff --git a/device/sensors/public/cpp/device_motion_hardware_buffer.h b/device/sensors/public/cpp/device_motion_hardware_buffer.h index 97fa00f..7a203a6 100644 --- a/device/sensors/public/cpp/device_motion_hardware_buffer.h +++ b/device/sensors/public/cpp/device_motion_hardware_buffer.h
@@ -8,11 +8,11 @@ #include "device/base/synchronization/shared_memory_seqlock_buffer.h" #include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h" -namespace content { +namespace device { -typedef device::SharedMemorySeqLockBuffer<blink::WebDeviceMotionData> +typedef SharedMemorySeqLockBuffer<blink::WebDeviceMotionData> DeviceMotionHardwareBuffer; -} // namespace content +} // namespace device #endif // DEVICE_SENSORS_PUBLIC_CPP_DEVICE_MOTION_HARDWARE_BUFFER_H_
diff --git a/device/sensors/public/cpp/device_orientation_hardware_buffer.h b/device/sensors/public/cpp/device_orientation_hardware_buffer.h index 79b03f71..8258f0d 100644 --- a/device/sensors/public/cpp/device_orientation_hardware_buffer.h +++ b/device/sensors/public/cpp/device_orientation_hardware_buffer.h
@@ -8,11 +8,11 @@ #include "device/base/synchronization/shared_memory_seqlock_buffer.h" #include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h" -namespace content { +namespace device { -typedef device::SharedMemorySeqLockBuffer<blink::WebDeviceOrientationData> +typedef SharedMemorySeqLockBuffer<blink::WebDeviceOrientationData> DeviceOrientationHardwareBuffer; -} // namespace content +} // namespace device #endif // DEVICE_SENSORS_PUBLIC_CPP_DEVICE_ORIENTATION_HARDWARE_BUFFER_H_
diff --git a/content/browser/device_sensors/sensor_manager_android.cc b/device/sensors/sensor_manager_android.cc similarity index 95% rename from content/browser/device_sensors/sensor_manager_android.cc rename to device/sensors/sensor_manager_android.cc index 65f57711..0be7338 100644 --- a/content/browser/device_sensors/sensor_manager_android.cc +++ b/device/sensors/sensor_manager_android.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/sensor_manager_android.h" +#include "device/sensors/sensor_manager_android.h" #include <string.h> @@ -20,12 +20,13 @@ namespace { void UpdateDeviceOrientationHistogram( - content::SensorManagerAndroid::OrientationSensorType type) { - UMA_HISTOGRAM_ENUMERATION("InertialSensor.DeviceOrientationSensorAndroid", - type, content::SensorManagerAndroid::ORIENTATION_SENSOR_MAX); + device::SensorManagerAndroid::OrientationSensorType type) { + UMA_HISTOGRAM_ENUMERATION( + "InertialSensor.DeviceOrientationSensorAndroid", type, + device::SensorManagerAndroid::ORIENTATION_SENSOR_MAX); } -void SetOrientation(content::DeviceOrientationHardwareBuffer* buffer, +void SetOrientation(device::DeviceOrientationHardwareBuffer* buffer, double alpha, double beta, double gamma) { buffer->seqlock.WriteBegin(); buffer->data.alpha = alpha; @@ -37,9 +38,9 @@ buffer->seqlock.WriteEnd(); } -void SetOrientationBufferStatus( - content::DeviceOrientationHardwareBuffer* buffer, - bool ready, bool absolute) { +void SetOrientationBufferStatus(device::DeviceOrientationHardwareBuffer* buffer, + bool ready, + bool absolute) { buffer->seqlock.WriteBegin(); buffer->data.absolute = absolute; buffer->data.allAvailableSensorsAreActive = ready; @@ -48,7 +49,7 @@ } // namespace -namespace content { +namespace device { SensorManagerAndroid::SensorManagerAndroid() : number_active_device_motion_sensors_(0), @@ -451,4 +452,4 @@ is_shutdown_ = true; } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/sensor_manager_android.h b/device/sensors/sensor_manager_android.h similarity index 91% rename from content/browser/device_sensors/sensor_manager_android.h rename to device/sensors/sensor_manager_android.h index 058b6eb..4d299ef 100644 --- a/content/browser/device_sensors/sensor_manager_android.h +++ b/device/sensors/sensor_manager_android.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 CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_ +#ifndef DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_ +#define DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_ #include <memory> @@ -11,8 +11,8 @@ #include "base/macros.h" #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" -#include "content/browser/device_sensors/device_sensors_consts.h" -#include "content/common/content_export.h" +#include "device/sensors/device_sensor_export.h" +#include "device/sensors/device_sensors_consts.h" #include "device/sensors/public/cpp/device_light_hardware_buffer.h" #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" @@ -22,14 +22,14 @@ struct DefaultSingletonTraits; } -namespace content { +namespace device { // Android implementation of Device {Motion|Orientation|Light} API. // // Android's SensorManager has a push API, so when Got*() methods are called // by the system the browser process puts the received data into a shared // memory buffer, which is read by the renderer processes. -class CONTENT_EXPORT SensorManagerAndroid { +class DEVICE_SENSOR_EXPORT SensorManagerAndroid { public: // Must be called at startup, before GetInstance(). static bool Register(JNIEnv* env); @@ -86,7 +86,7 @@ void Shutdown(); // A Java counterpart will be generated for this enum. - // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content.browser + // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.sensors // When adding new constants don't modify the order as they are used for UMA. enum OrientationSensorType { NOT_AVAILABLE = 0, @@ -153,6 +153,6 @@ DISALLOW_COPY_AND_ASSIGN(SensorManagerAndroid); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_ +#endif // DEVICE_SENSORS_SENSOR_MANAGER_ANDROID_H_
diff --git a/content/browser/device_sensors/sensor_manager_android_unittest.cc b/device/sensors/sensor_manager_android_unittest.cc similarity index 97% rename from content/browser/device_sensors/sensor_manager_android_unittest.cc rename to device/sensors/sensor_manager_android_unittest.cc index 98137aae..b98dfb8 100644 --- a/content/browser/device_sensors/sensor_manager_android_unittest.cc +++ b/device/sensors/sensor_manager_android_unittest.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/sensor_manager_android.h" +#include "device/sensors/sensor_manager_android.h" #include <memory> #include "base/android/jni_android.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" -#include "content/browser/device_sensors/device_sensors_consts.h" +#include "device/sensors/device_sensors_consts.h" #include "testing/gtest/include/gtest/gtest.h" -namespace content { +namespace device { namespace { @@ -189,4 +189,4 @@ } // namespace -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/sensor_manager_chromeos.cc b/device/sensors/sensor_manager_chromeos.cc similarity index 96% rename from content/browser/device_sensors/sensor_manager_chromeos.cc rename to device/sensors/sensor_manager_chromeos.cc index 55019ea..02dfb93 100644 --- a/content/browser/device_sensors/sensor_manager_chromeos.cc +++ b/device/sensors/sensor_manager_chromeos.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/sensor_manager_chromeos.h" +#include "device/sensors/sensor_manager_chromeos.h" #include <math.h> #include "chromeos/accelerometer/accelerometer_reader.h" #include "chromeos/accelerometer/accelerometer_types.h" -#include "content/browser/device_sensors/device_sensors_consts.h" +#include "device/sensors/device_sensors_consts.h" #include "ui/gfx/geometry/vector3d_f.h" namespace { @@ -16,7 +16,7 @@ const double kRad2deg = 180.0 / M_PI; } -namespace content { +namespace device { SensorManagerChromeOS::SensorManagerChromeOS() : motion_buffer_(nullptr), orientation_buffer_(nullptr) { @@ -165,4 +165,4 @@ orientation_buffer_->seqlock.WriteEnd(); } -} // namespace content +} // namespace device
diff --git a/content/browser/device_sensors/sensor_manager_chromeos.h b/device/sensors/sensor_manager_chromeos.h similarity index 87% rename from content/browser/device_sensors/sensor_manager_chromeos.h rename to device/sensors/sensor_manager_chromeos.h index 7af9231..8557a9b1 100644 --- a/content/browser/device_sensors/sensor_manager_chromeos.h +++ b/device/sensors/sensor_manager_chromeos.h
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_ -#define CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_ +#ifndef DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_ +#define DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_ #include "base/macros.h" #include "base/threading/thread_checker.h" #include "chromeos/accelerometer/accelerometer_reader.h" #include "chromeos/accelerometer/accelerometer_types.h" -#include "content/common/content_export.h" +#include "device/sensors/device_sensor_export.h" #include "device/sensors/public/cpp/device_motion_hardware_buffer.h" #include "device/sensors/public/cpp/device_orientation_hardware_buffer.h" -namespace content { +namespace device { // Observes Chrome OS accelerometer sensors, and provides updated device // orientation information. -class CONTENT_EXPORT SensorManagerChromeOS +class DEVICE_SENSOR_EXPORT SensorManagerChromeOS : public chromeos::AccelerometerReader::Observer { public: SensorManagerChromeOS(); @@ -64,6 +64,6 @@ DISALLOW_COPY_AND_ASSIGN(SensorManagerChromeOS); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_ +#endif // DEVICE_SENSORS_SENSOR_MANAGER_CHROMEOS_H_
diff --git a/content/browser/device_sensors/sensor_manager_chromeos_unittest.cc b/device/sensors/sensor_manager_chromeos_unittest.cc similarity index 96% rename from content/browser/device_sensors/sensor_manager_chromeos_unittest.cc rename to device/sensors/sensor_manager_chromeos_unittest.cc index 7a15eb8..10b95a2 100644 --- a/content/browser/device_sensors/sensor_manager_chromeos_unittest.cc +++ b/device/sensors/sensor_manager_chromeos_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/device_sensors/sensor_manager_chromeos.h" +#include "device/sensors/sensor_manager_chromeos.h" #include <memory> @@ -16,10 +16,10 @@ const double kMeanGravity = -9.80665; -// Isolated content::SensorManagerChromeOS from the active +// Isolated device::SensorManagerChromeOS from the active // chromeos::AccelerometerReader. This allows for direct control over which // accelerometer events are provided to the sensor manager. -class TestSensorManagerChromeOS : public content::SensorManagerChromeOS { +class TestSensorManagerChromeOS : public device::SensorManagerChromeOS { public: TestSensorManagerChromeOS() {} ~TestSensorManagerChromeOS() override {}; @@ -34,7 +34,7 @@ } // namespace -namespace content { +namespace device { class SensorManagerChromeOSTest : public testing::Test { public: @@ -226,4 +226,4 @@ EXPECT_FLOAT_EQ(45.0f, orientation->data.gamma); } -} // namespace content +} // namespace device
diff --git a/device/vr/android/gvr/gvr_delegate.h b/device/vr/android/gvr/gvr_delegate.h index 57d4d87..2e75a97 100644 --- a/device/vr/android/gvr/gvr_delegate.h +++ b/device/vr/android/gvr/gvr_delegate.h
@@ -10,10 +10,6 @@ #include "device/vr/vr_service.mojom.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" -namespace gvr { -class GvrApi; -} // namespace gvr - namespace device { constexpr gvr::Sizei kInvalidRenderTargetSize = {0, 0}; @@ -25,14 +21,15 @@ virtual void UpdateWebVRTextureBounds(int16_t frame_index, const gvr::Rectf& left_bounds, const gvr::Rectf& right_bounds) = 0; - virtual gvr::Sizei GetWebVRCompositorSurfaceSize() = 0; - virtual void SetWebVRRenderSurfaceSize(int width, int height) = 0; - // TODO(mthiesse): This function is not threadsafe. crbug.com/674594 - virtual gvr::GvrApi* gvr_api() = 0; virtual void OnVRVsyncProviderRequest( mojom::VRVSyncProviderRequest request) = 0; virtual void UpdateVSyncInterval(long timebase_nanos, double interval_seconds) = 0; + virtual bool SupportsPresentation() = 0; + virtual void ResetPose() = 0; + virtual void CreateVRDisplayInfo( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback, + uint32_t device_id) = 0; protected: virtual ~GvrDelegate() {} @@ -44,11 +41,11 @@ static GvrDelegateProvider* GetInstance(); virtual void SetDeviceProvider(GvrDeviceProvider* device_provider) = 0; + virtual void ClearDeviceProvider() = 0; virtual void RequestWebVRPresent( const base::Callback<void(bool)>& callback) = 0; virtual void ExitWebVRPresent() = 0; - virtual GvrDelegate* GetNonPresentingDelegate() = 0; - virtual void DestroyNonPresentingDelegate() = 0; + virtual GvrDelegate* GetDelegate() = 0; virtual void SetListeningForActivate(bool listening) = 0; protected:
diff --git a/device/vr/android/gvr/gvr_device.cc b/device/vr/android/gvr/gvr_device.cc index a8efa67a..5abea2b 100644 --- a/device/vr/android/gvr/gvr_device.cc +++ b/device/vr/android/gvr/gvr_device.cc
@@ -19,138 +19,25 @@ namespace device { -GvrDevice::GvrDevice(GvrDeviceProvider* provider, GvrDelegate* delegate) - : VRDevice(), delegate_(delegate), gvr_provider_(provider) {} +GvrDevice::GvrDevice(GvrDeviceProvider* provider) + : VRDevice(), gvr_provider_(provider) {} GvrDevice::~GvrDevice() {} -mojom::VRDisplayInfoPtr GvrDevice::GetVRDevice() { - TRACE_EVENT0("input", "GvrDevice::GetVRDevice"); - - mojom::VRDisplayInfoPtr device = mojom::VRDisplayInfo::New(); - - device->index = id(); - - device->capabilities = mojom::VRDisplayCapabilities::New(); - device->capabilities->hasOrientation = true; - device->capabilities->hasPosition = false; - device->capabilities->hasExternalDisplay = false; - device->capabilities->canPresent = true; - - device->leftEye = mojom::VREyeParameters::New(); - device->rightEye = mojom::VREyeParameters::New(); - mojom::VREyeParametersPtr& left_eye = device->leftEye; - mojom::VREyeParametersPtr& right_eye = device->rightEye; - - left_eye->fieldOfView = mojom::VRFieldOfView::New(); - right_eye->fieldOfView = mojom::VRFieldOfView::New(); - - left_eye->offset.resize(3); - right_eye->offset.resize(3); - - // Set the render target size to "invalid" to indicate that - // we can't render into it yet. Other code uses this to check - // for valid state. - gvr::Sizei render_target_size = kInvalidRenderTargetSize; - left_eye->renderWidth = render_target_size.width / 2; - left_eye->renderHeight = render_target_size.height; - - right_eye->renderWidth = left_eye->renderWidth; - right_eye->renderHeight = left_eye->renderHeight; - - gvr::GvrApi* gvr_api = GetGvrApi(); - if (!gvr_api) { - // We may not be able to get an instance of GvrApi right away, so - // stub in some data till we have one. - device->displayName = "Unknown"; - - left_eye->fieldOfView->upDegrees = 45; - left_eye->fieldOfView->downDegrees = 45; - left_eye->fieldOfView->leftDegrees = 45; - left_eye->fieldOfView->rightDegrees = 45; - - right_eye->fieldOfView->upDegrees = 45; - right_eye->fieldOfView->downDegrees = 45; - right_eye->fieldOfView->leftDegrees = 45; - right_eye->fieldOfView->rightDegrees = 45; - - left_eye->offset[0] = -0.0; - left_eye->offset[1] = -0.0; - left_eye->offset[2] = -0.03; - - right_eye->offset[0] = 0.0; - right_eye->offset[1] = 0.0; - right_eye->offset[2] = 0.03; - - // Tell the delegate not to draw yet, to avoid a race condition - // (and visible wobble) on entering VR. - if (delegate_) { - delegate_->SetWebVRRenderSurfaceSize(kInvalidRenderTargetSize.width, - kInvalidRenderTargetSize.height); - } - - return device; +void GvrDevice::GetVRDevice( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) { + GvrDelegate* delegate = GetGvrDelegate(); + if (delegate) { + delegate->CreateVRDisplayInfo(callback, id()); + } else { + callback.Run(nullptr); } - - // In compositor mode, we have to use the current compositor window's - // surface size. Would be nice to change it, but that needs more browser - // internals to be modified. TODO(klausw,crbug.com/655722): remove this once - // we can pick our own surface size. - gvr::Sizei compositor_size = delegate_->GetWebVRCompositorSurfaceSize(); - left_eye->renderWidth = compositor_size.width / 2; - left_eye->renderHeight = compositor_size.height; - right_eye->renderWidth = left_eye->renderWidth; - right_eye->renderHeight = left_eye->renderHeight; - - std::string vendor = gvr_api->GetViewerVendor(); - std::string model = gvr_api->GetViewerModel(); - device->displayName = vendor + " " + model; - - gvr::BufferViewportList gvr_buffer_viewports = - gvr_api->CreateEmptyBufferViewportList(); - gvr_buffer_viewports.SetToRecommendedBufferViewports(); - - gvr::BufferViewport eye_viewport = gvr_api->CreateBufferViewport(); - gvr_buffer_viewports.GetBufferViewport(GVR_LEFT_EYE, &eye_viewport); - gvr::Rectf eye_fov = eye_viewport.GetSourceFov(); - left_eye->fieldOfView->upDegrees = eye_fov.top; - left_eye->fieldOfView->downDegrees = eye_fov.bottom; - left_eye->fieldOfView->leftDegrees = eye_fov.left; - left_eye->fieldOfView->rightDegrees = eye_fov.right; - - eye_viewport = gvr_api->CreateBufferViewport(); - gvr_buffer_viewports.GetBufferViewport(GVR_RIGHT_EYE, &eye_viewport); - eye_fov = eye_viewport.GetSourceFov(); - right_eye->fieldOfView->upDegrees = eye_fov.top; - right_eye->fieldOfView->downDegrees = eye_fov.bottom; - right_eye->fieldOfView->leftDegrees = eye_fov.left; - right_eye->fieldOfView->rightDegrees = eye_fov.right; - - gvr::Mat4f left_eye_mat = gvr_api->GetEyeFromHeadMatrix(GVR_LEFT_EYE); - left_eye->offset[0] = -left_eye_mat.m[0][3]; - left_eye->offset[1] = -left_eye_mat.m[1][3]; - left_eye->offset[2] = -left_eye_mat.m[2][3]; - - gvr::Mat4f right_eye_mat = gvr_api->GetEyeFromHeadMatrix(GVR_RIGHT_EYE); - right_eye->offset[0] = -right_eye_mat.m[0][3]; - right_eye->offset[1] = -right_eye_mat.m[1][3]; - right_eye->offset[2] = -right_eye_mat.m[2][3]; - - if (delegate_) { - delegate_->SetWebVRRenderSurfaceSize(2 * left_eye->renderWidth, - left_eye->renderHeight); - } - - return device; } void GvrDevice::ResetPose() { - gvr::GvrApi* gvr_api = GetGvrApi(); - - // Should never call RecenterTracking when using with Daydream viewers. On - // those devices recentering should only be done via the controller. - if (gvr_api && gvr_api->GetViewerType() == GVR_VIEWER_TYPE_CARDBOARD) - gvr_api->RecenterTracking(); + GvrDelegate* delegate = GetGvrDelegate(); + if (delegate) + delegate->ResetPose(); } void GvrDevice::RequestPresent(const base::Callback<void(bool)>& callback) { @@ -159,8 +46,9 @@ void GvrDevice::SetSecureOrigin(bool secure_origin) { secure_origin_ = secure_origin; - if (delegate_) - delegate_->SetWebVRSecureOrigin(secure_origin_); + GvrDelegate* delegate = GetGvrDelegate(); + if (delegate) + delegate->SetWebVRSecureOrigin(secure_origin_); } void GvrDevice::ExitPresent() { @@ -169,14 +57,16 @@ } void GvrDevice::SubmitFrame(mojom::VRPosePtr pose) { - if (delegate_) - delegate_->SubmitWebVRFrame(); + GvrDelegate* delegate = GetGvrDelegate(); + if (delegate) + delegate->SubmitWebVRFrame(); } void GvrDevice::UpdateLayerBounds(int16_t frame_index, mojom::VRLayerBoundsPtr left_bounds, mojom::VRLayerBoundsPtr right_bounds) { - if (!delegate_) + GvrDelegate* delegate = GetGvrDelegate(); + if (!delegate) return; gvr::Rectf left_gvr_bounds; @@ -191,30 +81,32 @@ right_gvr_bounds.right = right_bounds->left + right_bounds->width; right_gvr_bounds.bottom = 1.0f - (right_bounds->top + right_bounds->height); - delegate_->UpdateWebVRTextureBounds(frame_index, left_gvr_bounds, - right_gvr_bounds); + delegate->UpdateWebVRTextureBounds(frame_index, left_gvr_bounds, + right_gvr_bounds); } void GvrDevice::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { - if (delegate_) - delegate_->OnVRVsyncProviderRequest(std::move(request)); + GvrDelegate* delegate = GetGvrDelegate(); + if (delegate) + delegate->OnVRVsyncProviderRequest(std::move(request)); } -void GvrDevice::SetDelegate(GvrDelegate* delegate) { - delegate_ = delegate; - +void GvrDevice::OnDelegateChanged() { + GvrDelegate* delegate = GetGvrDelegate(); + if (!delegate || !delegate->SupportsPresentation()) + OnExitPresent(); // Notify the clients that this device has changed - if (delegate_) { - delegate_->SetWebVRSecureOrigin(secure_origin_); - OnChanged(); - } + if (delegate) + delegate->SetWebVRSecureOrigin(secure_origin_); + + OnChanged(); } -gvr::GvrApi* GvrDevice::GetGvrApi() { - if (!delegate_) - return nullptr; - - return delegate_->gvr_api(); +GvrDelegate* GvrDevice::GetGvrDelegate() { + GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance(); + if (delegate_provider) + return delegate_provider->GetDelegate(); + return nullptr; } } // namespace device
diff --git a/device/vr/android/gvr/gvr_device.h b/device/vr/android/gvr/gvr_device.h index 8ca44fa9..55fb95f3 100644 --- a/device/vr/android/gvr/gvr_device.h +++ b/device/vr/android/gvr/gvr_device.h
@@ -8,22 +8,19 @@ #include "base/macros.h" #include "device/vr/vr_device.h" -namespace gvr { -class GvrApi; -} // namespace gvr - namespace device { class GvrDeviceProvider; class GvrDelegate; -class GvrDevice : public VRDevice { +class DEVICE_VR_EXPORT GvrDevice : public VRDevice { public: - GvrDevice(GvrDeviceProvider* provider, GvrDelegate* delegate); + GvrDevice(GvrDeviceProvider* provider); ~GvrDevice() override; // VRDevice - mojom::VRDisplayInfoPtr GetVRDevice() override; + void GetVRDevice( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override; void ResetPose() override; void RequestPresent(const base::Callback<void(bool)>& callback) override; @@ -35,13 +32,11 @@ mojom::VRLayerBoundsPtr left_bounds, mojom::VRLayerBoundsPtr right_bounds) override; void GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) override; - - void SetDelegate(GvrDelegate* delegate); + void OnDelegateChanged(); private: - gvr::GvrApi* GetGvrApi(); + GvrDelegate* GetGvrDelegate(); - GvrDelegate* delegate_; GvrDeviceProvider* gvr_provider_; bool secure_origin_ = false;
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc index 26d1c59..971fd7fc 100644 --- a/device/vr/android/gvr/gvr_device_provider.cc +++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -12,129 +12,69 @@ #include "base/android/scoped_java_ref.h" #include "device/vr/android/gvr/gvr_delegate.h" #include "device/vr/android/gvr/gvr_device.h" -#include "device/vr/android/gvr/gvr_gamepad_data_fetcher.h" #include "device/vr/vr_device.h" #include "device/vr/vr_device_manager.h" #include "device/vr/vr_service.mojom.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_controller.h" -#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" - -using base::android::AttachCurrentThread; -using base::android::GetApplicationContext; namespace device { -GvrDeviceProvider::GvrDeviceProvider() {} +GvrDeviceProvider::GvrDeviceProvider() + : vr_device_(base::MakeUnique<GvrDevice>(this)) {} GvrDeviceProvider::~GvrDeviceProvider() { - GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory( - GAMEPAD_SOURCE_GVR); - device::GvrDelegateProvider* delegate_provider = device::GvrDelegateProvider::GetInstance(); if (delegate_provider) { delegate_provider->ExitWebVRPresent(); - delegate_provider->DestroyNonPresentingDelegate(); - delegate_provider->SetDeviceProvider(nullptr); + delegate_provider->ClearDeviceProvider(); } } void GvrDeviceProvider::GetDevices(std::vector<VRDevice*>* devices) { Initialize(); - - if (vr_device_) - devices->push_back(vr_device_.get()); + devices->push_back(vr_device_.get()); } void GvrDeviceProvider::Initialize() { + // TODO(mthiesse): Clean up how we connect the GvrDelegateProvider to the + // GvrDeviceProvider so we don't have to call this function multiple times. + // Ideally the DelegateProvider would always be available, and GetInstance() + // would create it. + if (initialized_) + return; device::GvrDelegateProvider* delegate_provider = device::GvrDelegateProvider::GetInstance(); if (!delegate_provider) return; delegate_provider->SetDeviceProvider(this); - if (!vr_device_) { - vr_device_.reset( - new GvrDevice(this, delegate_provider->GetNonPresentingDelegate())); - } + initialized_ = true; } void GvrDeviceProvider::RequestPresent( const base::Callback<void(bool)>& callback) { + Initialize(); device::GvrDelegateProvider* delegate_provider = device::GvrDelegateProvider::GetInstance(); if (!delegate_provider) return callback.Run(false); - // RequestWebVRPresent is async as a render thread may be created. + // RequestWebVRPresent is async as we may trigger a DON flow that pauses + // Chrome. delegate_provider->RequestWebVRPresent(callback); } // VR presentation exit requested by the API. void GvrDeviceProvider::ExitPresent() { - SwitchToNonPresentingDelegate(); - // If we're presenting currently stop. + Initialize(); GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance(); if (delegate_provider) delegate_provider->ExitWebVRPresent(); } -void GvrDeviceProvider::OnGvrDelegateReady(GvrDelegate* delegate) { - if (!vr_device_) - return; - VLOG(1) << "Switching to presenting delegate"; - vr_device_->SetDelegate(delegate); - GamepadDataFetcherManager::GetInstance()->AddFactory( - new GvrGamepadDataFetcher::Factory(delegate, vr_device_->id())); -} - -// VR presentation exit requested by the delegate (probably via UI). -void GvrDeviceProvider::OnGvrDelegateRemoved() { - if (!vr_device_) - return; - - SwitchToNonPresentingDelegate(); - vr_device_->OnExitPresent(); -} - -void GvrDeviceProvider::OnNonPresentingDelegateRemoved() { - if (!vr_device_) - return; - vr_device_->SetDelegate(nullptr); -} - -void GvrDeviceProvider::OnDisplayBlur() { - if (!vr_device_) - return; - vr_device_->OnBlur(); -} - -void GvrDeviceProvider::OnDisplayFocus() { - if (!vr_device_) - return; - vr_device_->OnFocus(); -} - -void GvrDeviceProvider::OnDisplayActivate() { - if (!vr_device_) - return; - vr_device_->OnActivate(mojom::VRDisplayEventReason::MOUNTED); -} - -void GvrDeviceProvider::SwitchToNonPresentingDelegate() { - GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance(); - if (!vr_device_ || !delegate_provider) - return; - - VLOG(1) << "Switching to non-presenting delegate"; - vr_device_->SetDelegate(delegate_provider->GetNonPresentingDelegate()); - - // Remove GVR gamepad polling. - GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory( - GAMEPAD_SOURCE_GVR); -} - void GvrDeviceProvider::SetListeningForActivate(bool listening) { + Initialize(); device::GvrDelegateProvider* delegate_provider = device::GvrDelegateProvider::GetInstance(); if (!delegate_provider)
diff --git a/device/vr/android/gvr/gvr_device_provider.h b/device/vr/android/gvr/gvr_device_provider.h index 6bbef04..5793021 100644 --- a/device/vr/android/gvr/gvr_device_provider.h +++ b/device/vr/android/gvr/gvr_device_provider.h
@@ -14,7 +14,6 @@ namespace device { -class GvrDelegate; class GvrDevice; class DEVICE_VR_EXPORT GvrDeviceProvider : public VRDeviceProvider { @@ -31,20 +30,11 @@ void RequestPresent(const base::Callback<void(bool)>& callback); void ExitPresent(); - void OnGvrDelegateReady(GvrDelegate* delegate); - void OnGvrDelegateRemoved(); - - // TODO(mthiesse): Make the NonPresentingDelegate owned by this class so that - // it cannot be removed. - void OnNonPresentingDelegateRemoved(); - void OnDisplayBlur(); - void OnDisplayFocus(); - void OnDisplayActivate(); + GvrDevice* Device() { return vr_device_.get(); } private: - void SwitchToNonPresentingDelegate(); - std::unique_ptr<GvrDevice> vr_device_; + bool initialized_ = false; DISALLOW_COPY_AND_ASSIGN(GvrDeviceProvider); };
diff --git a/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc b/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc index be21ce9..d4eed15 100644 --- a/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc +++ b/device/vr/android/gvr/gvr_gamepad_data_fetcher.cc
@@ -9,6 +9,7 @@ #include "device/vr/android/gvr/gvr_delegate.h" #include "third_party/WebKit/public/platform/WebGamepads.h" +#include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h" namespace device { @@ -29,36 +30,38 @@ using namespace blink; -GvrGamepadDataFetcher::Factory::Factory(GvrDelegate* delegate, +GvrGamepadDataFetcher::Factory::Factory(gvr_context* context, unsigned int display_id) - : delegate_(delegate), display_id_(display_id) {} + : context_(context), display_id_(display_id) {} GvrGamepadDataFetcher::Factory::~Factory() {} std::unique_ptr<GamepadDataFetcher> GvrGamepadDataFetcher::Factory::CreateDataFetcher() { - if (!delegate_) - return nullptr; - return base::MakeUnique<GvrGamepadDataFetcher>(delegate_, display_id_); + return base::MakeUnique<GvrGamepadDataFetcher>(context_, display_id_); } GamepadSource GvrGamepadDataFetcher::Factory::source() { return GAMEPAD_SOURCE_GVR; } -GvrGamepadDataFetcher::GvrGamepadDataFetcher(GvrDelegate* delegate, +GvrGamepadDataFetcher::GvrGamepadDataFetcher(gvr_context* context, unsigned int display_id) : display_id_(display_id) { - gvr::GvrApi* gvr_api = delegate->gvr_api(); controller_api_.reset(new gvr::ControllerApi()); int32_t options = gvr::ControllerApi::DefaultOptions(); options |= GVR_CONTROLLER_ENABLE_GYRO; - bool success = controller_api_->Init(options, gvr_api->GetContext()); + + // TODO(mthiesse): Use of the gvr_context on multiple threads isn't guaranteed + // to be threadsafe. All gvr context usage should be moved to VR Shell's GL + // thread. crbug.com/674594 + std::unique_ptr<gvr::GvrApi> gvr = gvr::GvrApi::WrapNonOwned(context); + // TODO(bajones): Monitor changes to the controller handedness. + handedness_ = gvr->GetUserPrefs().GetControllerHandedness(); + + bool success = controller_api_->Init(options, context); if (!success) controller_api_.reset(nullptr); - - // TODO(bajones): Monitor changes to the controller handedness. - handedness_ = gvr_api->GetUserPrefs().GetControllerHandedness(); } GvrGamepadDataFetcher::~GvrGamepadDataFetcher() {}
diff --git a/device/vr/android/gvr/gvr_gamepad_data_fetcher.h b/device/vr/android/gvr/gvr_gamepad_data_fetcher.h index 5b105c4..35f3d93 100644 --- a/device/vr/android/gvr/gvr_gamepad_data_fetcher.h +++ b/device/vr/android/gvr/gvr_gamepad_data_fetcher.h
@@ -8,28 +8,27 @@ #include <string> #include "device/gamepad/gamepad_data_fetcher.h" +#include "device/vr/vr_export.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_controller.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" namespace device { -class GvrDelegate; - -class GvrGamepadDataFetcher : public GamepadDataFetcher { +class DEVICE_VR_EXPORT GvrGamepadDataFetcher : public GamepadDataFetcher { public: class Factory : public GamepadDataFetcherFactory { public: - Factory(GvrDelegate* delegate, unsigned int display_id); + Factory(gvr_context* context, unsigned int display_id); ~Factory() override; std::unique_ptr<GamepadDataFetcher> CreateDataFetcher() override; GamepadSource source() override; private: - GvrDelegate* delegate_; + gvr_context* context_; unsigned int display_id_; }; - GvrGamepadDataFetcher(GvrDelegate* delegate, unsigned int display_id); + GvrGamepadDataFetcher(gvr_context* context, unsigned int display_id); ~GvrGamepadDataFetcher() override; GamepadSource source() override;
diff --git a/device/vr/test/fake_vr_device.cc b/device/vr/test/fake_vr_device.cc index d0853de..c6999050 100644 --- a/device/vr/test/fake_vr_device.cc +++ b/device/vr/test/fake_vr_device.cc
@@ -54,9 +54,10 @@ device_ = device.Clone(); } -mojom::VRDisplayInfoPtr FakeVRDevice::GetVRDevice() { +void FakeVRDevice::GetVRDevice( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) { mojom::VRDisplayInfoPtr display = device_.Clone(); - return display.Clone(); + callback.Run(std::move(display)); } void FakeVRDevice::ResetPose() {}
diff --git a/device/vr/test/fake_vr_device.h b/device/vr/test/fake_vr_device.h index 188d82e..178610ea 100644 --- a/device/vr/test/fake_vr_device.h +++ b/device/vr/test/fake_vr_device.h
@@ -22,7 +22,9 @@ void SetVRDevice(const mojom::VRDisplayInfoPtr& device); - mojom::VRDisplayInfoPtr GetVRDevice() override; + // VRDevice + void GetVRDevice( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) override; void ResetPose() override; void RequestPresent(const base::Callback<void(bool)>& callback) override;
diff --git a/device/vr/vr_device.cc b/device/vr/vr_device.cc index b89fc44..52d81bc 100644 --- a/device/vr/vr_device.cc +++ b/device/vr/vr_device.cc
@@ -10,7 +10,8 @@ unsigned int VRDevice::next_id_ = 1; -VRDevice::VRDevice() : presenting_display_(nullptr), id_(next_id_) { +VRDevice::VRDevice() + : presenting_display_(nullptr), id_(next_id_), weak_ptr_factory_(this) { // Prevent wraparound. Devices with this ID will be treated as invalid. if (next_id_ != VR_DEVICE_LAST_ID) next_id_++; @@ -43,19 +44,24 @@ } void VRDevice::OnChanged() { - mojom::VRDisplayInfoPtr vr_device_info = GetVRDevice(); + base::Callback<void(mojom::VRDisplayInfoPtr)> callback = base::Bind( + &VRDevice::OnVRDisplayInfoCreated, weak_ptr_factory_.GetWeakPtr()); + GetVRDevice(callback); +} + +void VRDevice::OnVRDisplayInfoCreated(mojom::VRDisplayInfoPtr vr_device_info) { if (vr_device_info.is_null()) return; - for (const auto& display : displays_) display->client()->OnChanged(vr_device_info.Clone()); } void VRDevice::OnExitPresent() { + if (!presenting_display_) + return; auto it = displays_.find(presenting_display_); - if (it != displays_.end()) - (*it)->client()->OnExitPresent(); - + CHECK(it != displays_.end()); + (*it)->client()->OnExitPresent(); SetPresentingDisplay(nullptr); }
diff --git a/device/vr/vr_device.h b/device/vr/vr_device.h index d2ed8fa..be836ee 100644 --- a/device/vr/vr_device.h +++ b/device/vr/vr_device.h
@@ -23,7 +23,8 @@ unsigned int id() const { return id_; } - virtual mojom::VRDisplayInfoPtr GetVRDevice() = 0; + virtual void GetVRDevice( + const base::Callback<void(mojom::VRDisplayInfoPtr)>& callback) = 0; virtual void ResetPose() = 0; virtual void RequestPresent(const base::Callback<void(bool)>& callback) = 0; @@ -55,6 +56,8 @@ void SetPresentingDisplay(VRDisplayImpl* display); private: + void OnVRDisplayInfoCreated(mojom::VRDisplayInfoPtr vr_device_info); + std::set<VRDisplayImpl*> displays_; VRDisplayImpl* presenting_display_; @@ -63,6 +66,8 @@ static unsigned int next_id_; + base::WeakPtrFactory<VRDevice> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(VRDevice); };
diff --git a/device/vr/vr_display_impl.cc b/device/vr/vr_display_impl.cc index c99b7dfc..c14f8b7 100644 --- a/device/vr/vr_display_impl.cc +++ b/device/vr/vr_display_impl.cc
@@ -15,11 +15,17 @@ device_(device), service_(service), weak_ptr_factory_(this) { - mojom::VRDisplayInfoPtr display_info = device->GetVRDevice(); - if (service->client()) { - service->client()->OnDisplayConnected(binding_.CreateInterfacePtrAndBind(), - mojo::MakeRequest(&client_), - std::move(display_info)); + base::Callback<void(mojom::VRDisplayInfoPtr)> callback = base::Bind( + &VRDisplayImpl::OnVRDisplayInfoCreated, weak_ptr_factory_.GetWeakPtr()); + device->GetVRDevice(callback); +} + +void VRDisplayImpl::OnVRDisplayInfoCreated( + mojom::VRDisplayInfoPtr display_info) { + if (service_->client()) { + service_->client()->OnDisplayConnected(binding_.CreateInterfacePtrAndBind(), + mojo::MakeRequest(&client_), + std::move(display_info)); } }
diff --git a/device/vr/vr_display_impl.h b/device/vr/vr_display_impl.h index 02a1e1a..7116d52 100644 --- a/device/vr/vr_display_impl.h +++ b/device/vr/vr_display_impl.h
@@ -45,6 +45,8 @@ bool secure_origin, bool success); + void OnVRDisplayInfoCreated(mojom::VRDisplayInfoPtr display_info); + mojo::Binding<mojom::VRDisplay> binding_; mojom::VRDisplayClientPtr client_; device::VRDevice* device_;
diff --git a/docs/android_studio.md b/docs/android_studio.md index 2a10aa7a..f8e69c5b 100644 --- a/docs/android_studio.md +++ b/docs/android_studio.md
@@ -117,10 +117,12 @@ * Java editing and gradle compile works. * Instrumentation tests included as androidTest. * Symlinks to existing .so files in jniLibs (doesn't generate them). +* Editing resource xml files. ### What doesn't work (yet) ([crbug](https://bugs.chromium.org/p/chromium/issues/detail?id=620034)) -* Make gradle aware of resources and assets +* Make gradle aware of assets +* Layout editor * Add a mode in which gradle is responsible for generating `R.java` * Add support for native code editing * Make the "Make Project" button work correctly
diff --git a/docs/testing/web_platform_tests.md b/docs/testing/web_platform_tests.md index d9d387c6..6243dee0 100644 --- a/docs/testing/web_platform_tests.md +++ b/docs/testing/web_platform_tests.md
@@ -97,5 +97,5 @@ It's still possible to make direct pull requests to web-platform-tests. The processes for getting new tests committed the W3C repos are at -[http://testthewebforward.org/docs/]. Some specifics are at -[http://testthewebforward.org/docs/github-101.html]. +http://testthewebforward.org/docs/. Some specifics are at +http://testthewebforward.org/docs/github-101.html.
diff --git a/extensions/browser/api/declarative_content/content_rules_registry.h b/extensions/browser/api/declarative_content/content_rules_registry.h index 239687f..2c67160 100644 --- a/extensions/browser/api/declarative_content/content_rules_registry.h +++ b/extensions/browser/api/declarative_content/content_rules_registry.h
@@ -13,9 +13,8 @@ namespace content { class BrowserContext; +class NavigationHandle; class WebContents; -struct FrameNavigateParams; -struct LoadCommittedDetails; } namespace extensions { @@ -48,10 +47,11 @@ content::WebContents* contents) = 0; // Applies all content rules given that a tab was just navigated. - virtual void DidNavigateMainFrame( + // This corresponds to the notification of the same name in + // content::WebContentsObserver. + virtual void DidFinishNavigation( content::WebContents* tab, - const content::LoadCommittedDetails& details, - const content::FrameNavigateParams& params) = 0; + content::NavigationHandle* navigation_handle) = 0; protected: ~ContentRulesRegistry() override {}
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index 3160619..e804db05 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc
@@ -306,18 +306,6 @@ url::kStandardSchemeSeparator + extension_id + "/"); } -bool Extension::ShowConfigureContextMenus() const { - // Normally we don't show a context menu for component actions, but when - // re-design is enabled we show them in the toolbar (if they have an action), - // and it is weird to have a random button that has no context menu when the - // rest do. - if (location() == Manifest::COMPONENT || - location() == Manifest::EXTERNAL_COMPONENT) - return FeatureSwitch::extension_action_redesign()->IsEnabled(); - - return true; -} - bool Extension::OverlapsWithOrigin(const GURL& origin) const { if (url() == origin) return true;
diff --git a/extensions/common/extension.h b/extensions/common/extension.h index bab44d4..a5c2702 100644 --- a/extensions/common/extension.h +++ b/extensions/common/extension.h
@@ -233,9 +233,6 @@ // Returns the base extension url for a given |extension_id|. static GURL GetBaseURLFromExtensionId(const ExtensionId& extension_id); - // Whether context menu should be shown for page and browser actions. - bool ShowConfigureContextMenus() const; - // Returns true if this extension or app includes areas within |origin|. bool OverlapsWithOrigin(const GURL& origin) const;
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc index e38190c..637b488 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc
@@ -34,6 +34,14 @@ IsolateHolder::IsolateHolder( scoped_refptr<base::SingleThreadTaskRunner> task_runner, AccessMode access_mode) + : IsolateHolder(std::move(task_runner), + AccessMode::kSingleThread, + kAllowAtomicsWait) {} + +IsolateHolder::IsolateHolder( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + AccessMode access_mode, + AllowAtomicsWaitMode atomics_wait_mode) : access_mode_(access_mode) { v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator; CHECK(allocator) << "You need to invoke gin::IsolateHolder::Initialize first"; @@ -43,6 +51,7 @@ params.constraints.ConfigureDefaults(base::SysInfo::AmountOfPhysicalMemory(), base::SysInfo::AmountOfVirtualMemory()); params.array_buffer_allocator = allocator; + params.allow_atomics_wait = atomics_wait_mode == kAllowAtomicsWait; isolate_ = v8::Isolate::New(params); isolate_data_.reset( new PerIsolateData(isolate_, allocator, access_mode, task_runner));
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h index 62b871085..0d9cb3b 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h
@@ -41,6 +41,12 @@ kUseLocker }; + // Whether Atomics.wait can be called on this isolate. + enum AllowAtomicsWaitMode { + kDisallowAtomicsWait, + kAllowAtomicsWait + }; + // Indicates whether V8 works with stable or experimental v8 extras. enum V8ExtrasMode { kStableV8Extras, @@ -51,6 +57,9 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner); IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, AccessMode access_mode); + IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, + AccessMode access_mode, + AllowAtomicsWaitMode atomics_wait_mode); ~IsolateHolder(); // Should be invoked once before creating IsolateHolder instances to
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc index cd05f97..334d49b 100644 --- a/headless/app/headless_shell.cc +++ b/headless/app/headless_shell.cc
@@ -285,7 +285,7 @@ if (c == EOF || c == '\n') { break; } - expression << c; + expression << static_cast<char>(c); } if (expression.str() == "quit") { Shutdown();
diff --git a/headless/public/util/dom_tree_extractor_browsertest.cc b/headless/public/util/dom_tree_extractor_browsertest.cc index 22b2379..cd1dc24 100644 --- a/headless/public/util/dom_tree_extractor_browsertest.cc +++ b/headless/public/util/dom_tree_extractor_browsertest.cc
@@ -189,6 +189,7 @@ "nodeName": "HTML", "nodeType": 1, "nodeValue": "", + "parentId": 1, "styleIndex": 0 })raw_string", @@ -200,7 +201,8 @@ "nodeId": 3, "nodeName": "HEAD", "nodeType": 1, - "nodeValue": "" + "nodeValue": "", + "parentId": 2 })raw_string", R"raw_string({ @@ -211,7 +213,8 @@ "nodeId": 4, "nodeName": "TITLE", "nodeType": 1, - "nodeValue": "" + "nodeValue": "", + "parentId": 3 })raw_string", R"raw_string({ @@ -220,7 +223,8 @@ "nodeId": 5, "nodeName": "#text", "nodeType": 3, - "nodeValue": "Hello world!" + "nodeValue": "Hello world!", + "parentId": 4 })raw_string", R"raw_string({ @@ -232,7 +236,8 @@ "nodeId": 6, "nodeName": "LINK", "nodeType": 1, - "nodeValue": "" + "nodeValue": "", + "parentId": 3 })raw_string", R"raw_string({ @@ -250,6 +255,7 @@ "nodeName": "BODY", "nodeType": 1, "nodeValue": "", + "parentId": 2, "styleIndex": 1 })raw_string", @@ -268,6 +274,7 @@ "nodeName": "DIV", "nodeType": 1, "nodeValue": "", + "parentId": 7, "styleIndex": 0 })raw_string", @@ -286,6 +293,7 @@ "nodeName": "H1", "nodeType": 1, "nodeValue": "", + "parentId": 8, "styleIndex": 2 })raw_string", @@ -313,6 +321,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "Some text.", + "parentId": 9, "styleIndex": 2 })raw_string", @@ -334,6 +343,7 @@ "nodeName": "IFRAME", "nodeType": 1, "nodeValue": "", + "parentId": 8, "styleIndex": 6 })raw_string", @@ -366,6 +376,7 @@ "nodeName": "HTML", "nodeType": 1, "nodeValue": "", + "parentId": 12, "styleIndex": 3 })raw_string", @@ -377,7 +388,8 @@ "nodeId": 14, "nodeName": "HEAD", "nodeType": 1, - "nodeValue": "" + "nodeValue": "", + "parentId": 13 })raw_string", R"raw_string({ @@ -395,6 +407,7 @@ "nodeName": "BODY", "nodeType": 1, "nodeValue": "", + "parentId": 13, "styleIndex": 4 })raw_string", @@ -413,6 +426,7 @@ "nodeName": "H1", "nodeType": 1, "nodeValue": "", + "parentId": 15, "styleIndex": 5 })raw_string", @@ -440,6 +454,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "Hello from the iframe!", + "parentId": 16, "styleIndex": 5 })raw_string", @@ -458,6 +473,7 @@ "nodeName": "DIV", "nodeType": 1, "nodeValue": "", + "parentId": 8, "styleIndex": 0 })raw_string", @@ -476,6 +492,7 @@ "nodeName": "DIV", "nodeType": 1, "nodeValue": "", + "parentId": 18, "styleIndex": 0 })raw_string", @@ -494,6 +511,7 @@ "nodeName": "DIV", "nodeType": 1, "nodeValue": "", + "parentId": 19, "styleIndex": 0 })raw_string", @@ -512,6 +530,7 @@ "nodeName": "A", "nodeType": 1, "nodeValue": "", + "parentId": 20, "styleIndex": 7 })raw_string", @@ -539,6 +558,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "Google!", + "parentId": 21, "styleIndex": 7 })raw_string", @@ -557,6 +577,7 @@ "nodeName": "P", "nodeType": 1, "nodeValue": "", + "parentId": 20, "styleIndex": 8 })raw_string", @@ -584,6 +605,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "A paragraph!", + "parentId": 23, "styleIndex": 8 })raw_string", @@ -613,6 +635,7 @@ "nodeName": "BR", "nodeType": 1, "nodeValue": "", + "parentId": 20, "styleIndex": 6 })raw_string", @@ -631,9 +654,9 @@ "nodeName": "DIV", "nodeType": 1, "nodeValue": "", + "parentId": 20, "styleIndex": 9 - } - )raw_string", + })raw_string", R"raw_string({ "backendNodeId": 29, @@ -659,6 +682,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "Some ", + "parentId": 26, "styleIndex": 9 })raw_string", @@ -677,6 +701,7 @@ "nodeName": "EM", "nodeType": 1, "nodeValue": "", + "parentId": 26, "styleIndex": 10 })raw_string", @@ -704,6 +729,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": "green", + "parentId": 28, "styleIndex": 10 })raw_string", @@ -731,6 +757,7 @@ "nodeName": "#text", "nodeType": 3, "nodeValue": " text...", + "parentId": 26, "styleIndex": 9 })raw_string"};
diff --git a/ios/chrome/browser/suggestions/BUILD.gn b/ios/chrome/browser/suggestions/BUILD.gn index 66a24012..c7034812 100644 --- a/ios/chrome/browser/suggestions/BUILD.gn +++ b/ios/chrome/browser/suggestions/BUILD.gn
@@ -16,6 +16,7 @@ "//base", "//components/browser_sync", "//components/image_fetcher", + "//components/image_fetcher/ios", "//components/keyed_service/ios", "//components/leveldb_proto", "//components/signin/core/browser",
diff --git a/ios/chrome/browser/suggestions/image_fetcher_impl.h b/ios/chrome/browser/suggestions/image_fetcher_impl.h index dfa1ae5..b31ba56 100644 --- a/ios/chrome/browser/suggestions/image_fetcher_impl.h +++ b/ios/chrome/browser/suggestions/image_fetcher_impl.h
@@ -24,16 +24,13 @@ namespace image_fetcher { class ImageFetcherDelegate; +class IOSImageDataFetcherWrapper; } namespace net { class URLRequestContextGetter; } -namespace web { -class ImageDataFetcher; -} - namespace suggestions { // A class used to fetch server images asynchronously. @@ -55,7 +52,7 @@ override; private: - std::unique_ptr<web::ImageDataFetcher> image_fetcher_; + std::unique_ptr<image_fetcher::IOSImageDataFetcherWrapper> image_fetcher_; image_fetcher::ImageFetcherDelegate* delegate_;
diff --git a/ios/chrome/browser/suggestions/image_fetcher_impl.mm b/ios/chrome/browser/suggestions/image_fetcher_impl.mm index c701dfc4..b351c30e 100644 --- a/ios/chrome/browser/suggestions/image_fetcher_impl.mm +++ b/ios/chrome/browser/suggestions/image_fetcher_impl.mm
@@ -9,7 +9,7 @@ #include "base/memory/ptr_util.h" #include "base/threading/sequenced_worker_pool.h" #include "components/image_fetcher/image_fetcher_delegate.h" -#import "ios/web/public/image_fetcher/image_data_fetcher.h" +#include "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h" #include "net/url_request/url_request_context_getter.h" #include "skia/ext/skia_utils_ios.h" #include "ui/gfx/image/image.h" @@ -23,9 +23,10 @@ ImageFetcherImpl::ImageFetcherImpl( net::URLRequestContextGetter* url_request_context, base::SequencedWorkerPool* blocking_pool) - : image_fetcher_(base::MakeUnique<web::ImageDataFetcher>(blocking_pool)) { - image_fetcher_->SetRequestContextGetter(url_request_context); -} + : image_fetcher_( + base::MakeUnique<image_fetcher::IOSImageDataFetcherWrapper>( + url_request_context, + blocking_pool)) {} ImageFetcherImpl::~ImageFetcherImpl() { } @@ -38,8 +39,7 @@ void ImageFetcherImpl::SetDataUseServiceName( DataUseServiceName data_use_service_name) { - // Not implemented - will be obsolete once iOS also uses - // image_fetcher::ImageDataFetcher. + image_fetcher_->SetDataUseServiceName(data_use_service_name); } void ImageFetcherImpl::StartOrQueueNetworkRequest( @@ -58,8 +58,8 @@ const std::string fetch_id(id); // If image_fetcher_ is destroyed the request will be cancelled and this block // will never be called. A reference to delegate_ can be kept. - web::ImageFetchedCallback fetcher_callback = - ^(const GURL& original_url, int response_code, NSData* data) { + image_fetcher::IOSImageDataFetcherCallback fetcher_callback = + ^(NSData* data) { if (data) { // Most likely always returns 1x images. UIImage* ui_image = [UIImage imageWithData:data scale:1]; @@ -78,7 +78,7 @@ delegate_->OnImageFetched(fetch_id, empty_image); } }; - image_fetcher_->StartDownload(image_url, fetcher_callback); + image_fetcher_->FetchImageDataWebpDecoded(image_url, fetcher_callback); } } // namespace suggestions
diff --git a/ios/chrome/browser/ui/elements/BUILD.gn b/ios/chrome/browser/ui/elements/BUILD.gn index 2eb19d6..e7c79a3 100644 --- a/ios/chrome/browser/ui/elements/BUILD.gn +++ b/ios/chrome/browser/ui/elements/BUILD.gn
@@ -20,6 +20,7 @@ } source_set("unit_tests") { + configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ "activity_overlay_coordinator_unittest.mm",
diff --git a/ios/chrome/browser/ui/elements/activity_overlay_coordinator_unittest.mm b/ios/chrome/browser/ui/elements/activity_overlay_coordinator_unittest.mm index 32729d3b..55d31d6 100644 --- a/ios/chrome/browser/ui/elements/activity_overlay_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/elements/activity_overlay_coordinator_unittest.mm
@@ -4,34 +4,35 @@ #import "ios/chrome/browser/ui/elements/activity_overlay_coordinator.h" -#include "base/ios/weak_nsobject.h" #include "base/test/ios/wait_util.h" #import "ios/chrome/browser/ui/elements/activity_overlay_view_controller.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + // Tests that invoking start and stop on the coordinator presents and dismisses // the activity overlay view, respectively. TEST(ActivityOverlayCoordinatorTest, StartAndStop) { - base::WeakNSObject<UIView> overlay_view; + __weak UIView* overlay_view; @autoreleasepool { - UIViewController* base_view_controller = - [[[UIViewController alloc] init] autorelease]; + UIViewController* base_view_controller = [[UIViewController alloc] init]; ActivityOverlayCoordinator* coordinator = - [[[ActivityOverlayCoordinator alloc] - initWithBaseViewController:base_view_controller] autorelease]; + [[ActivityOverlayCoordinator alloc] + initWithBaseViewController:base_view_controller]; EXPECT_EQ(0u, [base_view_controller.childViewControllers count]); [coordinator start]; EXPECT_EQ(1u, [base_view_controller.childViewControllers count]); - overlay_view.reset( - [base_view_controller.childViewControllers firstObject].view); + overlay_view = [base_view_controller.childViewControllers firstObject].view; EXPECT_TRUE( [[base_view_controller.view subviews] containsObject:overlay_view]); [coordinator stop]; EXPECT_EQ(0u, [base_view_controller.childViewControllers count]); } - EXPECT_FALSE(overlay_view.get()); + EXPECT_FALSE(overlay_view); }
diff --git a/ios/chrome/browser/ui/elements/selector_coordinator_unittest.mm b/ios/chrome/browser/ui/elements/selector_coordinator_unittest.mm index 606cbb0..7ba092d 100644 --- a/ios/chrome/browser/ui/elements/selector_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/elements/selector_coordinator_unittest.mm
@@ -12,6 +12,10 @@ #include "third_party/ocmock/OCMock/OCMock.h" #include "third_party/ocmock/gtest_support.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + @interface SelectorCoordinator ()<SelectorViewControllerDelegate> // The view controller for the picker view the coordinator presents. Exposed for // testing. @@ -23,8 +27,8 @@ TEST(SelectorCoordinatorTest, StartAndStop) { UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow]; UIViewController* rootViewController = keyWindow.rootViewController; - SelectorCoordinator* coordinator = [[[SelectorCoordinator alloc] - initWithBaseViewController:rootViewController] autorelease]; + SelectorCoordinator* coordinator = [[SelectorCoordinator alloc] + initWithBaseViewController:rootViewController]; void (^testSteps)(void) = ^{ [coordinator start]; @@ -46,8 +50,8 @@ TEST(SelectorCoordinatorTest, Delegate) { UIWindow* keyWindow = [[UIApplication sharedApplication] keyWindow]; UIViewController* rootViewController = keyWindow.rootViewController; - SelectorCoordinator* coordinator = [[[SelectorCoordinator alloc] - initWithBaseViewController:rootViewController] autorelease]; + SelectorCoordinator* coordinator = [[SelectorCoordinator alloc] + initWithBaseViewController:rootViewController]; id delegate = [OCMockObject mockForProtocol:@protocol(SelectorCoordinatorDelegate)]; coordinator.delegate = delegate;
diff --git a/ios/chrome/browser/ui/elements/selector_picker_view_controller_unittest.mm b/ios/chrome/browser/ui/elements/selector_picker_view_controller_unittest.mm index 219f9b4..e88d38f6 100644 --- a/ios/chrome/browser/ui/elements/selector_picker_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/elements/selector_picker_view_controller_unittest.mm
@@ -11,6 +11,10 @@ #include "third_party/ocmock/OCMock/OCMock.h" #include "third_party/ocmock/gtest_support.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + @interface SelectorPickerViewController () // The displayed UINavigationBar. Exposed for testing. @property(nonatomic, retain) UINavigationBar* navigationBar; @@ -26,9 +30,8 @@ NSOrderedSet<NSString*>* options = [NSOrderedSet orderedSetWithArray:@[ option1, option2 ]]; SelectorPickerViewController* selector_picker_view_controller = - [[[SelectorPickerViewController alloc] initWithOptions:options - default:option1] - autorelease]; + [[SelectorPickerViewController alloc] initWithOptions:options + default:option1]; id delegate = [OCMockObject mockForProtocol:@protocol(SelectorViewControllerDelegate)]; [[delegate expect] selectorViewController:selector_picker_view_controller @@ -42,7 +45,12 @@ animated:NO]; UIBarButtonItem* rightButton = selector_picker_view_controller.navigationBar.topItem.rightBarButtonItem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" [selector_picker_view_controller performSelector:rightButton.action]; +#pragma clang diagnostic pop + EXPECT_OCMOCK_VERIFY(delegate); } @@ -54,9 +62,8 @@ NSOrderedSet<NSString*>* options = [NSOrderedSet orderedSetWithArray:@[ option1, option2 ]]; SelectorPickerViewController* selector_picker_view_controller = - [[[SelectorPickerViewController alloc] initWithOptions:options - default:option2] - autorelease]; + [[SelectorPickerViewController alloc] initWithOptions:options + default:option2]; id delegate = [OCMockObject mockForProtocol:@protocol(SelectorViewControllerDelegate)]; [[delegate expect] selectorViewController:selector_picker_view_controller @@ -70,7 +77,11 @@ animated:NO]; UIBarButtonItem* leftButton = selector_picker_view_controller.navigationBar.topItem.leftBarButtonItem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" [selector_picker_view_controller performSelector:leftButton.action]; +#pragma clang diagnostic pop EXPECT_OCMOCK_VERIFY(delegate); } @@ -83,9 +94,8 @@ NSOrderedSet<NSString*>* options = [NSOrderedSet orderedSetWithArray:@[ option1, option2, option3 ]]; SelectorPickerViewController* selector_picker_view_controller = - [[[SelectorPickerViewController alloc] initWithOptions:options - default:option2] - autorelease]; + [[SelectorPickerViewController alloc] initWithOptions:options + default:option2]; [selector_picker_view_controller loadView]; [selector_picker_view_controller viewDidLoad];
diff --git a/ios/net/BUILD.gn b/ios/net/BUILD.gn index 818ee63..8a77282 100644 --- a/ios/net/BUILD.gn +++ b/ios/net/BUILD.gn
@@ -79,6 +79,9 @@ sources = [ "cookies/cookie_cache_unittest.cc", "cookies/cookie_creation_time_manager_unittest.mm", + "cookies/cookie_store_ios_persistent_unittest.mm", + "cookies/cookie_store_ios_test_util.h", + "cookies/cookie_store_ios_test_util.mm", "cookies/cookie_store_ios_unittest.mm", "cookies/system_cookie_util_unittest.mm", "http_response_headers_util_unittest.mm",
diff --git a/ios/net/cookies/cookie_store_ios_persistent_unittest.mm b/ios/net/cookies/cookie_store_ios_persistent_unittest.mm new file mode 100644 index 0000000..1a41211 --- /dev/null +++ b/ios/net/cookies/cookie_store_ios_persistent_unittest.mm
@@ -0,0 +1,128 @@ +// 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/net/cookies/cookie_store_ios_persistent.h" + +#import <Foundation/Foundation.h> + +#include <memory> + +#include "base/bind_helpers.h" +#include "base/memory/ptr_util.h" +#include "base/memory/ref_counted.h" +#include "base/message_loop/message_loop.h" +#include "base/run_loop.h" +#import "ios/net/cookies/cookie_store_ios_test_util.h" +#include "net/cookies/cookie_store_unittest.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace net { + +struct InactiveCookieStoreIOSTestTraits { + static std::unique_ptr<net::CookieStore> Create() { + return base::MakeUnique<CookieStoreIOSPersistent>(nullptr); + } + + static const bool is_cookie_monster = false; + static const bool supports_http_only = false; + static const bool supports_non_dotted_domains = true; + static const bool preserves_trailing_dots = true; + static const bool filters_schemes = false; + static const bool has_path_prefix_bug = false; + static const int creation_time_granularity_in_ms = 0; + static const int enforces_prefixes = true; + static const bool enforce_strict_secure = false; + + base::MessageLoop loop_; +}; + +INSTANTIATE_TYPED_TEST_CASE_P(InactiveCookieStoreIOS, + CookieStoreTest, + InactiveCookieStoreIOSTestTraits); + +namespace { + +// Test fixture to exercise net::CookieStoreIOSPersistent created with +// TestPersistentCookieStore back-end and not synchronized with +// NSHTTPCookieStorage. +class CookieStoreIOSPersistentTest : public testing::Test { + public: + CookieStoreIOSPersistentTest() + : kTestCookieURL("http://foo.google.com/bar"), + backend_(new net::TestPersistentCookieStore), + store_( + base::MakeUnique<net::CookieStoreIOSPersistent>(backend_.get())) { + cookie_changed_callback_ = store_->AddCallbackForCookie( + kTestCookieURL, "abc", + base::Bind(&net::RecordCookieChanges, &cookies_changed_, + &cookies_removed_)); + } + + ~CookieStoreIOSPersistentTest() override {} + + // Gets the cookies. |callback| will be called on completion. + void GetCookies(const net::CookieStore::GetCookiesCallback& callback) { + net::CookieOptions options; + options.set_include_httponly(); + store_->GetCookiesWithOptionsAsync(kTestCookieURL, options, callback); + } + + // Sets a cookie. + void SetCookie(const std::string& cookie_line) { + net::SetCookie(cookie_line, kTestCookieURL, store_.get()); + } + + private: + const GURL kTestCookieURL; + + protected: + base::MessageLoop loop_; + scoped_refptr<net::TestPersistentCookieStore> backend_; + std::unique_ptr<net::CookieStoreIOS> store_; + std::unique_ptr<net::CookieStore::CookieChangedSubscription> + cookie_changed_callback_; + std::vector<net::CanonicalCookie> cookies_changed_; + std::vector<bool> cookies_removed_; +}; + +} // namespace + +TEST_F(CookieStoreIOSPersistentTest, SetCookieCallsHook) { + ClearCookies(); + SetCookie("abc=def"); + EXPECT_EQ(0U, cookies_changed_.size()); + EXPECT_EQ(0U, cookies_removed_.size()); + backend_->RunLoadedCallback(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(1U, cookies_changed_.size()); + EXPECT_EQ(1U, cookies_removed_.size()); + EXPECT_EQ("abc", cookies_changed_[0].Name()); + EXPECT_EQ("def", cookies_changed_[0].Value()); + EXPECT_FALSE(cookies_removed_[0]); + + // Replacing an existing cookie is actually a two-phase delete + set + // operation, so we get an extra notification. + SetCookie("abc=ghi"); + EXPECT_EQ(3U, cookies_changed_.size()); + EXPECT_EQ(3U, cookies_removed_.size()); + EXPECT_EQ("abc", cookies_changed_[1].Name()); + EXPECT_EQ("def", cookies_changed_[1].Value()); + EXPECT_TRUE(cookies_removed_[1]); + EXPECT_EQ("abc", cookies_changed_[2].Name()); + EXPECT_EQ("ghi", cookies_changed_[2].Value()); + EXPECT_FALSE(cookies_removed_[2]); +} + +// Tests that cookies can be read before the backend is loaded. +TEST_F(CookieStoreIOSPersistentTest, NotSynchronized) { + // Start fetching the cookie. + GetCookieCallback callback; + GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); + // Backend loading completes. + backend_->RunLoadedCallback(); + EXPECT_TRUE(callback.did_run()); + EXPECT_EQ("a=b", callback.cookie_line()); +} + +} // namespace net \ No newline at end of file
diff --git a/ios/net/cookies/cookie_store_ios_test_util.h b/ios/net/cookies/cookie_store_ios_test_util.h new file mode 100644 index 0000000..436ffebf --- /dev/null +++ b/ios/net/cookies/cookie_store_ios_test_util.h
@@ -0,0 +1,83 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_NET_COOKIES_COOKIE_STORE_IOS_TEST_UTIL_H_ +#define IOS_NET_COOKIES_COOKIE_STORE_IOS_TEST_UTIL_H_ + +#include <string> +#include <vector> + +#include "base/callback_forward.h" +#include "net/cookies/cookie_monster.h" +#include "net/cookies/cookie_store.h" +#include "url/gurl.h" + +namespace net { + +class CanonicalCookie; + +// Test net::CookieMonster::PersistentCookieStore allowing to control when the +// initialization completes. +class TestPersistentCookieStore + : public net::CookieMonster::PersistentCookieStore { + public: + TestPersistentCookieStore(); + + // Runs the completion callback with a "a=b" cookie. + void RunLoadedCallback(); + + bool flushed(); + + private: + // net::CookieMonster::PersistentCookieStore implementation: + void Load(const LoadedCallback& loaded_callback) override; + void LoadCookiesForKey(const std::string& key, + const LoadedCallback& loaded_callback) override; + void AddCookie(const net::CanonicalCookie& cc) override; + void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override; + void DeleteCookie(const net::CanonicalCookie& cc) override; + void SetForceKeepSessionState() override; + void Flush(const base::Closure& callback) override; + + ~TestPersistentCookieStore() override; + + const GURL kTestCookieURL; + LoadedCallback loaded_callback_; + bool flushed_; +}; + +// Helper callback to be passed to CookieStore::GetCookiesWithOptionsAsync(). +class GetCookieCallback { + public: + GetCookieCallback(); + + // Returns true if the callback has been run. + bool did_run(); + + // Returns the parameter of the callback. + const std::string& cookie_line(); + + void Run(const std::string& cookie_line); + + private: + bool did_run_; + std::string cookie_line_; +}; + +void RecordCookieChanges(std::vector<net::CanonicalCookie>* out_cookies, + std::vector<bool>* out_removes, + const net::CanonicalCookie& cookie, + net::CookieStore::ChangeCause cause); + +// Sets a cookie. +void SetCookie(const std::string& cookie_line, + const GURL& url, + net::CookieStore* store); + +// Clears the underlying NSHTTPCookieStorage. +void ClearCookies(); + +} // namespace net + +#endif // IOS_NET_COOKIES_COOKIE_STORE_IOS_TEST_UTIL_H_
diff --git a/ios/net/cookies/cookie_store_ios_test_util.mm b/ios/net/cookies/cookie_store_ios_test_util.mm new file mode 100644 index 0000000..f3771b6 --- /dev/null +++ b/ios/net/cookies/cookie_store_ios_test_util.mm
@@ -0,0 +1,141 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/net/cookies/cookie_store_ios_test_util.h" + +#import <Foundation/Foundation.h> + +#include "base/run_loop.h" +#import "ios/net/cookies/cookie_store_ios.h" +#include "net/cookies/canonical_cookie.h" +#include "net/cookies/cookie_options.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace net { + +namespace { + +void IgnoreBoolean(bool not_used) {} + +} // namespace + +#pragma mark - +#pragma mark TestPersistentCookieStore + +TestPersistentCookieStore::TestPersistentCookieStore() + : kTestCookieURL("http://foo.google.com/bar"), flushed_(false) {} + +TestPersistentCookieStore::~TestPersistentCookieStore() = default; + +#pragma mark - +#pragma mark TestPersistentCookieStore methods + +void TestPersistentCookieStore::RunLoadedCallback() { + std::vector<std::unique_ptr<net::CanonicalCookie>> cookies; + net::CookieOptions options; + options.set_include_httponly(); + + std::unique_ptr<net::CanonicalCookie> cookie(net::CanonicalCookie::Create( + kTestCookieURL, "a=b", base::Time::Now(), options)); + cookies.push_back(std::move(cookie)); + + std::unique_ptr<net::CanonicalCookie> bad_canonical_cookie( + net::CanonicalCookie::Create( + GURL("http://domain/"), "name", "\x81r\xe4\xbd\xa0\xe5\xa5\xbd", + std::string(), "/path/", + base::Time(), // creation + base::Time(), // expires + false, // secure + false, // httponly + net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT)); + cookies.push_back(std::move(bad_canonical_cookie)); + loaded_callback_.Run(std::move(cookies)); +} + +bool TestPersistentCookieStore::flushed() { + return flushed_; +} + +#pragma mark - +#pragma mark Private methods + +void TestPersistentCookieStore::Load(const LoadedCallback& loaded_callback) { + loaded_callback_ = loaded_callback; +} + +void TestPersistentCookieStore::LoadCookiesForKey( + const std::string& key, + const LoadedCallback& loaded_callback) { + loaded_callback_ = loaded_callback; +} + +void TestPersistentCookieStore::AddCookie(const net::CanonicalCookie& cc) {} + +void TestPersistentCookieStore::UpdateCookieAccessTime( + const net::CanonicalCookie& cc) {} + +void TestPersistentCookieStore::DeleteCookie(const net::CanonicalCookie& cc) {} + +void TestPersistentCookieStore::SetForceKeepSessionState() {} + +void TestPersistentCookieStore::Flush(const base::Closure& callback) { + flushed_ = true; +} + +#pragma mark - +#pragma mark GetCookieCallback + +GetCookieCallback::GetCookieCallback() : did_run_(false) {} + +#pragma mark - +#pragma mark GetCookieCallback methods + +bool GetCookieCallback::did_run() { + return did_run_; +} + +const std::string& GetCookieCallback::cookie_line() { + return cookie_line_; +} + +void GetCookieCallback::Run(const std::string& cookie_line) { + ASSERT_FALSE(did_run_); + did_run_ = true; + cookie_line_ = cookie_line; +} + +//------------------------------------------------------------------------------ + +void RecordCookieChanges(std::vector<net::CanonicalCookie>* out_cookies, + std::vector<bool>* out_removes, + const net::CanonicalCookie& cookie, + net::CookieStore::ChangeCause cause) { + DCHECK(out_cookies); + out_cookies->push_back(cookie); + if (out_removes) + out_removes->push_back(net::CookieStore::ChangeCauseIsDeletion(cause)); +} + +void SetCookie(const std::string& cookie_line, + const GURL& url, + net::CookieStore* store) { + net::CookieOptions options; + options.set_include_httponly(); + store->SetCookieWithOptionsAsync(url, cookie_line, options, + base::Bind(&IgnoreBoolean)); + net::CookieStoreIOS::NotifySystemCookiesChanged(); + // Wait until the flush is posted. + base::RunLoop().RunUntilIdle(); +} + +void ClearCookies() { + NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + [store setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; + NSArray* cookies = [store cookies]; + for (NSHTTPCookie* cookie in cookies) + [store deleteCookie:cookie]; + EXPECT_EQ(0u, [[store cookies] count]); +} + +} // namespace net \ No newline at end of file
diff --git a/ios/net/cookies/cookie_store_ios_unittest.mm b/ios/net/cookies/cookie_store_ios_unittest.mm index fb4554e..329e846 100644 --- a/ios/net/cookies/cookie_store_ios_unittest.mm +++ b/ios/net/cookies/cookie_store_ios_unittest.mm
@@ -14,23 +14,11 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" -#import "ios/net/cookies/cookie_store_ios_persistent.h" +#import "ios/net/cookies/cookie_store_ios_test_util.h" #import "net/base/mac/url_conversions.h" #include "net/cookies/cookie_store_unittest.h" #include "testing/gtest/include/gtest/gtest.h" -namespace { -// Clears the underlying NSHTTPCookieStorage. -void ClearCookies() { - NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - [store setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; - NSArray* cookies = [store cookies]; - for (NSHTTPCookie* cookie in cookies) - [store deleteCookie:cookie]; - EXPECT_EQ(0u, [[store cookies] count]); -} -} // namespace - namespace net { struct CookieStoreIOSTestTraits { @@ -50,123 +38,13 @@ base::MessageLoop loop_; }; -struct InactiveCookieStoreIOSTestTraits { - static std::unique_ptr<net::CookieStore> Create() { - return base::MakeUnique<CookieStoreIOSPersistent>(nullptr); - } - - static const bool is_cookie_monster = false; - static const bool supports_http_only = false; - static const bool supports_non_dotted_domains = true; - static const bool preserves_trailing_dots = true; - static const bool filters_schemes = false; - static const bool has_path_prefix_bug = false; - static const int creation_time_granularity_in_ms = 0; - static const int enforces_prefixes = true; - static const bool enforce_strict_secure = false; - - base::MessageLoop loop_; -}; - -} // namespace net - -namespace net { - INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS, CookieStoreTest, CookieStoreIOSTestTraits); -INSTANTIATE_TYPED_TEST_CASE_P(InactiveCookieStoreIOS, - CookieStoreTest, - InactiveCookieStoreIOSTestTraits); - -} // namespace net namespace { -// Test net::CookieMonster::PersistentCookieStore allowing to control when the -// initialization completes. -class TestPersistentCookieStore - : public net::CookieMonster::PersistentCookieStore { - public: - TestPersistentCookieStore() - : kTestCookieURL("http://foo.google.com/bar"), flushed_(false) {} - - // Runs the completion callback with a "a=b" cookie. - void RunLoadedCallback() { - std::vector<std::unique_ptr<net::CanonicalCookie>> cookies; - net::CookieOptions options; - options.set_include_httponly(); - - std::unique_ptr<net::CanonicalCookie> cookie(net::CanonicalCookie::Create( - kTestCookieURL, "a=b", base::Time::Now(), options)); - cookies.push_back(std::move(cookie)); - - // Some canonical cookies cannot be converted into System cookies, for - // example if value is not valid utf8. Such cookies are ignored. - std::unique_ptr<net::CanonicalCookie> bad_canonical_cookie( - net::CanonicalCookie::Create(GURL("http://domain/"), "name", - "\x81r\xe4\xbd\xa0\xe5\xa5\xbd", - std::string(), "/path/", - base::Time(), // creation - base::Time(), // expires - false, // secure - false, // httponly - net::CookieSameSite::DEFAULT_MODE, - net::COOKIE_PRIORITY_DEFAULT)); - cookies.push_back(std::move(bad_canonical_cookie)); - loaded_callback_.Run(std::move(cookies)); - } - - bool flushed() { return flushed_; } - - private: - // net::CookieMonster::PersistentCookieStore implementation: - void Load(const LoadedCallback& loaded_callback) override { - loaded_callback_ = loaded_callback; - } - - void LoadCookiesForKey(const std::string& key, - const LoadedCallback& loaded_callback) override { - loaded_callback_ = loaded_callback; - } - - void AddCookie(const net::CanonicalCookie& cc) override {} - void UpdateCookieAccessTime(const net::CanonicalCookie& cc) override {} - void DeleteCookie(const net::CanonicalCookie& cc) override {} - void SetForceKeepSessionState() override {} - void Flush(const base::Closure& callback) override { flushed_ = true; } - - private: - ~TestPersistentCookieStore() override {} - - const GURL kTestCookieURL; - LoadedCallback loaded_callback_; - bool flushed_; -}; - -// Helper callback to be passed to CookieStore::GetCookiesWithOptionsAsync(). -class GetCookieCallback { - public: - GetCookieCallback() : did_run_(false) {} - - // Returns true if the callback has been run. - bool did_run() { return did_run_; } - - // Returns the parameter of the callback. - const std::string& cookie_line() { return cookie_line_; } - - void Run(const std::string& cookie_line) { - ASSERT_FALSE(did_run_); - did_run_ = true; - cookie_line_ = cookie_line; - } - - private: - bool did_run_; - std::string cookie_line_; -}; - // Helper callback to be passed to CookieStore::GetAllCookiesForURLAsync(). class GetAllCookiesCallback { public: @@ -189,18 +67,6 @@ net::CookieList cookie_list_; }; -namespace { - -void RecordCookieChanges(std::vector<net::CanonicalCookie>* out_cookies, - std::vector<bool>* out_removes, - const net::CanonicalCookie& cookie, - net::CookieStore::ChangeCause cause) { - DCHECK(out_cookies); - out_cookies->push_back(cookie); - if (out_removes) - out_removes->push_back(net::CookieStore::ChangeCauseIsDeletion(cause)); -} - void IgnoreBoolean(bool ignored) { } @@ -209,79 +75,24 @@ } // namespace -// Sets a cookie. -void SetCookie(const std::string& cookie_line, - const GURL& url, - net::CookieStore* store) { - net::CookieOptions options; - options.set_include_httponly(); - store->SetCookieWithOptionsAsync(url, cookie_line, options, - base::Bind(&IgnoreBoolean)); - net::CookieStoreIOS::NotifySystemCookiesChanged(); - // Wait until the flush is posted. - base::RunLoop().RunUntilIdle(); -} - -// Test fixture to exersize net::CookieStoreIOS created with -// TestPersistentCookieStore backend and not synchronized with -// NSHTTPCookieStorage. -class NotSynchronizedCookieStoreIOSWithBackend : public testing::Test { - public: - NotSynchronizedCookieStoreIOSWithBackend() - : kTestCookieURL("http://foo.google.com/bar"), - backend_(new TestPersistentCookieStore), - store_(base::MakeUnique<net::CookieStoreIOSPersistent>(backend_.get())) - { - cookie_changed_callback_ = store_->AddCallbackForCookie( - kTestCookieURL, "abc", - base::Bind(&RecordCookieChanges, &cookies_changed_, &cookies_removed_)); - } - - ~NotSynchronizedCookieStoreIOSWithBackend() override {} - - // Gets the cookies. |callback| will be called on completion. - void GetCookies(const net::CookieStore::GetCookiesCallback& callback) { - net::CookieOptions options; - options.set_include_httponly(); - store_->GetCookiesWithOptionsAsync(kTestCookieURL, options, callback); - } - - // Sets a cookie. - void SetCookie(const std::string& cookie_line) { - ::SetCookie(cookie_line, kTestCookieURL, store_.get()); - } - - private: - const GURL kTestCookieURL; - - protected: - base::MessageLoop loop_; - scoped_refptr<TestPersistentCookieStore> backend_; - std::unique_ptr<net::CookieStoreIOS> store_; - std::unique_ptr<net::CookieStore::CookieChangedSubscription> - cookie_changed_callback_; - std::vector<net::CanonicalCookie> cookies_changed_; - std::vector<bool> cookies_removed_; -}; - // Test fixture to exersize net::CookieStoreIOS created without backend and // synchronized with |[NSHTTPCookieStorage sharedHTTPCookieStorage]|. -class SynchronizedCookieStoreIOS : public testing::Test { +class CookieStoreIOSTest : public testing::Test { public: - SynchronizedCookieStoreIOS() + CookieStoreIOSTest() : kTestCookieURL("http://foo.google.com/bar"), kTestCookieURL2("http://foo.google.com/baz"), kTestCookieURL3("http://foo.google.com"), kTestCookieURL4("http://bar.google.com/bar"), backend_(new TestPersistentCookieStore), store_(base::MakeUnique<net::CookieStoreIOS>( - [NSHTTPCookieStorage sharedHTTPCookieStorage])) { + [NSHTTPCookieStorage sharedHTTPCookieStorage])) { cookie_changed_callback_ = store_->AddCallbackForCookie( kTestCookieURL, "abc", base::Bind(&RecordCookieChanges, &cookies_changed_, &cookies_removed_)); } - ~SynchronizedCookieStoreIOS() override {} + ~CookieStoreIOSTest() override {} // Gets the cookies. |callback| will be called on completion. void GetCookies(const net::CookieStore::GetCookiesCallback& callback) { @@ -292,7 +103,7 @@ // Sets a cookie. void SetCookie(const std::string& cookie_line) { - ::SetCookie(cookie_line, kTestCookieURL, store_.get()); + net::SetCookie(cookie_line, kTestCookieURL, store_.get()); } void SetSystemCookie(const GURL& url, @@ -340,37 +151,7 @@ std::vector<bool> cookies_removed_; }; -} // namespace - -namespace net { - -TEST_F(NotSynchronizedCookieStoreIOSWithBackend, SetCookieCallsHook) { - ClearCookies(); - SetCookie("abc=def"); - EXPECT_EQ(0U, cookies_changed_.size()); - EXPECT_EQ(0U, cookies_removed_.size()); - backend_->RunLoadedCallback(); - base::RunLoop().RunUntilIdle(); - EXPECT_EQ(1U, cookies_changed_.size()); - EXPECT_EQ(1U, cookies_removed_.size()); - EXPECT_EQ("abc", cookies_changed_[0].Name()); - EXPECT_EQ("def", cookies_changed_[0].Value()); - EXPECT_FALSE(cookies_removed_[0]); - - // Replacing an existing cookie is actually a two-phase delete + set - // operation, so we get an extra notification. - SetCookie("abc=ghi"); - EXPECT_EQ(3U, cookies_changed_.size()); - EXPECT_EQ(3U, cookies_removed_.size()); - EXPECT_EQ("abc", cookies_changed_[1].Name()); - EXPECT_EQ("def", cookies_changed_[1].Value()); - EXPECT_TRUE(cookies_removed_[1]); - EXPECT_EQ("abc", cookies_changed_[2].Name()); - EXPECT_EQ("ghi", cookies_changed_[2].Value()); - EXPECT_FALSE(cookies_removed_[2]); -} - -TEST_F(SynchronizedCookieStoreIOS, SetCookieCallsHookWhenSynchronized) { +TEST_F(CookieStoreIOSTest, SetCookieCallsHookWhenSynchronized) { GetCookies(base::Bind(&IgnoreString)); ClearCookies(); SetCookie("abc=def"); @@ -392,7 +173,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, DeleteCallsHook) { +TEST_F(CookieStoreIOSTest, DeleteCallsHook) { GetCookies(base::Bind(&IgnoreString)); ClearCookies(); SetCookie("abc=def"); @@ -404,7 +185,7 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(SynchronizedCookieStoreIOS, SameValueDoesNotCallHook) { +TEST_F(CookieStoreIOSTest, SameValueDoesNotCallHook) { GetCookieCallback callback; GetCookies(base::Bind(&IgnoreString)); ClearCookies(); @@ -438,18 +219,7 @@ EXPECT_EQ("b", cookie.Value()); } -// Tests that cookies can be read before the backend is loaded. -TEST_F(NotSynchronizedCookieStoreIOSWithBackend, NotSynchronized) { - // Start fetching the cookie. - GetCookieCallback callback; - GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); - // Backend loading completes. - backend_->RunLoadedCallback(); - EXPECT_TRUE(callback.did_run()); - EXPECT_EQ("a=b", callback.cookie_line()); -} - -TEST_F(SynchronizedCookieStoreIOS, NoInitialNotifyWithNoCookie) { +TEST_F(CookieStoreIOSTest, NoInitialNotifyWithNoCookie) { std::vector<net::CanonicalCookie> cookies; store_->AddCallbackForCookie( kTestCookieURL, "abc", @@ -457,7 +227,7 @@ EXPECT_EQ(0U, cookies.size()); } -TEST_F(SynchronizedCookieStoreIOS, NoInitialNotifyWithSystemCookie) { +TEST_F(CookieStoreIOSTest, NoInitialNotifyWithSystemCookie) { SetSystemCookie(kTestCookieURL, "abc", "def"); std::vector<net::CanonicalCookie> cookies; store_->AddCallbackForCookie( @@ -467,7 +237,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, NotifyOnAdd) { +TEST_F(CookieStoreIOSTest, NotifyOnAdd) { std::vector<net::CanonicalCookie> cookies; std::vector<bool> removes; std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = @@ -491,7 +261,7 @@ DeleteSystemCookie(kTestCookieURL, "ghi"); } -TEST_F(SynchronizedCookieStoreIOS, NotifyOnChange) { +TEST_F(CookieStoreIOSTest, NotifyOnChange) { std::vector<net::CanonicalCookie> cookies; std::vector<bool> removes; std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = @@ -514,7 +284,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, NotifyOnDelete) { +TEST_F(CookieStoreIOSTest, NotifyOnDelete) { std::vector<net::CanonicalCookie> cookies; std::vector<bool> removes; SetSystemCookie(kTestCookieURL, "abc", "def"); @@ -534,7 +304,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, NoNotifyOnNoChange) { +TEST_F(CookieStoreIOSTest, NoNotifyOnNoChange) { std::vector<net::CanonicalCookie> cookies; std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = store_->AddCallbackForCookie( @@ -548,7 +318,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, MultipleNotifies) { +TEST_F(CookieStoreIOSTest, MultipleNotifies) { std::vector<net::CanonicalCookie> cookies; std::vector<net::CanonicalCookie> cookies2; std::vector<net::CanonicalCookie> cookies3; @@ -583,7 +353,7 @@ DeleteSystemCookie(kTestCookieURL4, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, LessSpecificNestedCookie) { +TEST_F(CookieStoreIOSTest, LessSpecificNestedCookie) { std::vector<net::CanonicalCookie> cookies; SetSystemCookie(kTestCookieURL2, "abc", "def"); std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = @@ -596,7 +366,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, MoreSpecificNestedCookie) { +TEST_F(CookieStoreIOSTest, MoreSpecificNestedCookie) { std::vector<net::CanonicalCookie> cookies; SetSystemCookie(kTestCookieURL3, "abc", "def"); std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = @@ -609,7 +379,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, MoreSpecificNestedCookieWithSameValue) { +TEST_F(CookieStoreIOSTest, MoreSpecificNestedCookieWithSameValue) { std::vector<net::CanonicalCookie> cookies; SetSystemCookie(kTestCookieURL3, "abc", "def"); std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle = @@ -622,7 +392,7 @@ DeleteSystemCookie(kTestCookieURL, "abc"); } -TEST_F(SynchronizedCookieStoreIOS, RemoveCallback) { +TEST_F(CookieStoreIOSTest, RemoveCallback) { std::vector<net::CanonicalCookie> cookies; SetSystemCookie(kTestCookieURL, "abc", "def"); std::unique_ptr<net::CookieStore::CookieChangedSubscription> handle =
diff --git a/ios/public/provider/chrome/browser/user_feedback/BUILD.gn b/ios/public/provider/chrome/browser/user_feedback/BUILD.gn index efd22991..3121086 100644 --- a/ios/public/provider/chrome/browser/user_feedback/BUILD.gn +++ b/ios/public/provider/chrome/browser/user_feedback/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("user_feedback") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "user_feedback_provider.h", "user_feedback_provider.mm",
diff --git a/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.mm b/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.mm index 84c719e..1722761 100644 --- a/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.mm +++ b/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.mm
@@ -4,6 +4,10 @@ #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + UserFeedbackProvider::UserFeedbackProvider() {} UserFeedbackProvider::~UserFeedbackProvider() {}
diff --git a/ios/public/provider/chrome/browser/voice/BUILD.gn b/ios/public/provider/chrome/browser/voice/BUILD.gn index 02e838ac..dc80ad5 100644 --- a/ios/public/provider/chrome/browser/voice/BUILD.gn +++ b/ios/public/provider/chrome/browser/voice/BUILD.gn
@@ -25,6 +25,7 @@ } source_set("test_support") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "test_audio_session_controller.cc", "test_audio_session_controller.h",
diff --git a/ios/public/provider/chrome/browser/voice/test_voice_search_provider.mm b/ios/public/provider/chrome/browser/voice/test_voice_search_provider.mm index 0e89087..03ab77b 100644 --- a/ios/public/provider/chrome/browser/voice/test_voice_search_provider.mm +++ b/ios/public/provider/chrome/browser/voice/test_voice_search_provider.mm
@@ -4,18 +4,21 @@ #import "ios/public/provider/chrome/browser/voice/test_voice_search_provider.h" -#include "base/mac/scoped_nsobject.h" #import "ios/public/provider/chrome/browser/voice/voice_search_language.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + TestVoiceSearchProvider::TestVoiceSearchProvider() {} TestVoiceSearchProvider::~TestVoiceSearchProvider() {} NSArray* TestVoiceSearchProvider::GetAvailableLanguages() const { - base::scoped_nsobject<VoiceSearchLanguage> en([[VoiceSearchLanguage alloc] - initWithIdentifier:@"en-US" - displayName:@"English (US)" - localizationPreference:nil]); + VoiceSearchLanguage* en = + [[VoiceSearchLanguage alloc] initWithIdentifier:@"en-US" + displayName:@"English (US)" + localizationPreference:nil]; return @[ en ]; }
diff --git a/ios/showcase/tab_grid/BUILD.gn b/ios/showcase/tab_grid/BUILD.gn index 0da6a0b8..127468d 100644 --- a/ios/showcase/tab_grid/BUILD.gn +++ b/ios/showcase/tab_grid/BUILD.gn
@@ -24,6 +24,7 @@ ] deps = [ "//ios/showcase/test", + "//ios/testing/earl_grey:earl_grey_support", "//ios/third_party/earl_grey", ] configs += [ "//build/config/compiler:enable_arc" ]
diff --git a/ios/showcase/tab_grid/sc_tab_grid_egtest.mm b/ios/showcase/tab_grid/sc_tab_grid_egtest.mm index e343032..8d790cc7 100644 --- a/ios/showcase/tab_grid/sc_tab_grid_egtest.mm +++ b/ios/showcase/tab_grid/sc_tab_grid_egtest.mm
@@ -5,6 +5,7 @@ #import <EarlGrey/EarlGrey.h> #import "ios/showcase/test/showcase_test_case.h" +#import "ios/testing/earl_grey/disabled_test_macros.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -18,6 +19,11 @@ // Tests launching TabGridViewController and tapping a cell. - (void)testLaunchAndTappingCell { +// TODO(crbug.com/687865): enable the test. It was flaky on device. +#if !TARGET_IPHONE_SIMULATOR + EARL_GREY_TEST_DISABLED( + @"Disabled for devices because it is flaky on iPhone"); +#endif [[EarlGrey selectElementWithMatcher:grey_text(@"TabGridViewController")] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Tab 0_button")]
diff --git a/ios/web/public/image_fetcher/webp_decoder.h b/ios/web/public/image_fetcher/webp_decoder.h index 268ffc3..46fdb23 100644 --- a/ios/web/public/image_fetcher/webp_decoder.h +++ b/ios/web/public/image_fetcher/webp_decoder.h
@@ -44,7 +44,7 @@ static size_t GetHeaderSize(); // Main entry point. - void OnDataReceived(const base::scoped_nsobject<NSData>& data); + void OnDataReceived(NSData* data); // Stops the decoding. void Stop();
diff --git a/ios/web/public/image_fetcher/webp_decoder.mm b/ios/web/public/image_fetcher/webp_decoder.mm index e783844..9528822 100644 --- a/ios/web/public/image_fetcher/webp_decoder.mm +++ b/ios/web/public/image_fetcher/webp_decoder.mm
@@ -106,7 +106,7 @@ WebPFreeDecBuffer(&config_.output); } -void WebpDecoder::OnDataReceived(const base::scoped_nsobject<NSData>& data) { +void WebpDecoder::OnDataReceived(NSData* data) { DCHECK(data); switch (state_) { case READING_FEATURES:
diff --git a/ios/web/shell/test/context_menu_egtest.mm b/ios/web/shell/test/context_menu_egtest.mm index ddd7895..46f665e 100644 --- a/ios/web/shell/test/context_menu_egtest.mm +++ b/ios/web/shell/test/context_menu_egtest.mm
@@ -27,6 +27,7 @@ using testing::ContextMenuItemWithText; using testing::ElementToDismissContextMenu; +using web::WebViewContainingText; // Context menu test cases for the web shell. @interface ContextMenuTestCase : ShellBaseTestCase @@ -36,26 +37,24 @@ // Tests context menu appears on a regular link. - (void)testContextMenu { -// TODO(crbug.com/687546): Tests disabled on devices. -#if !TARGET_IPHONE_SIMULATOR - EARL_GREY_TEST_DISABLED(@"Disabled for devices because it is very flaky."); -#endif - // Create map of canned responses and set up the test HTML server. std::map<GURL, std::string> responses; GURL initialURL = web::test::HttpServer::MakeUrl("http://contextMenuOpen"); GURL destinationURL = web::test::HttpServer::MakeUrl("http://destination"); // The initial page contains a link to the destination URL. std::string linkID = "link"; + std::string linkText = "link for context menu"; responses[initialURL] = "<body>" "<a href='" + - destinationURL.spec() + "' id='" + linkID + - "'>link for context menu</a>" + destinationURL.spec() + "' id='" + linkID + "'>" + linkText + + "</a>" "</span></body>"; web::test::SetUpSimpleHttpServer(responses); [ShellEarlGrey loadURL:initialURL]; + [[EarlGrey selectElementWithMatcher:WebViewContainingText(linkText)] + assertWithMatcher:grey_notNil()]; [[EarlGrey selectElementWithMatcher:web::WebView()] performAction:web::longPressElementForContextMenu( @@ -85,14 +84,17 @@ // The initial page contains a link to the destination URL that has an // ancestor that disables the context menu via -webkit-touch-callout. std::string linkID = "link"; + std::string linkText = "no-callout link"; responses[initialURL] = "<body><a href='" + destinationURL.spec() + "' style='-webkit-touch-callout: none' id='" + - linkID + - "'>no-callout link</a>" + linkID + "'>" + linkText + + "</a>" "</body>"; web::test::SetUpSimpleHttpServer(responses); [ShellEarlGrey loadURL:initialURL]; + [[EarlGrey selectElementWithMatcher:WebViewContainingText(linkText)] + assertWithMatcher:grey_notNil()]; [[EarlGrey selectElementWithMatcher:web::WebView()] performAction:web::longPressElementForContextMenu( @@ -115,15 +117,18 @@ // The initial page contains a link to the destination URL that has an // ancestor that disables the context menu via -webkit-touch-callout. std::string linkID = "link"; + std::string linkText = "ancestor no-callout link"; responses[initialURL] = "<body style='-webkit-touch-callout: none'>" "<a href='" + - destinationURL.spec() + "' id='" + linkID + - "'>ancestor no-callout link</a>" + destinationURL.spec() + "' id='" + linkID + "'>" + linkText + + "</a>" "</body>"; web::test::SetUpSimpleHttpServer(responses); [ShellEarlGrey loadURL:initialURL]; + [[EarlGrey selectElementWithMatcher:WebViewContainingText(linkText)] + assertWithMatcher:grey_notNil()]; [[EarlGrey selectElementWithMatcher:web::WebView()] performAction:web::longPressElementForContextMenu( @@ -146,16 +151,19 @@ // The initial page contains a link to the destination URL that has an // ancestor that disables the context menu via -webkit-touch-callout. std::string linkID = "link"; + std::string linkText = "override no-callout link"; responses[initialURL] = "<body style='-webkit-touch-callout: none'>" "<a href='" + destinationURL.spec() + "' style='-webkit-touch-callout: default' id='" + - linkID + - "'>override no-callout link</a>" + linkID + "'>" + linkText + + "</a>" "</body>"; web::test::SetUpSimpleHttpServer(responses); [ShellEarlGrey loadURL:initialURL]; + [[EarlGrey selectElementWithMatcher:WebViewContainingText(linkText)] + assertWithMatcher:grey_notNil()]; [[EarlGrey selectElementWithMatcher:web::WebView()] performAction:web::longPressElementForContextMenu(
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc index 5fa88ea..68454ae 100644 --- a/ipc/ipc_mojo_bootstrap.cc +++ b/ipc/ipc_mojo_bootstrap.cc
@@ -107,6 +107,8 @@ Endpoint* receiver_endpoint = new Endpoint(this, receiver_id); endpoints_.insert({ sender_id, sender_endpoint }); endpoints_.insert({ receiver_id, receiver_endpoint }); + sender_endpoint->set_handle_created(); + receiver_endpoint->set_handle_created(); } mojo::ScopedInterfaceEndpointHandle sender_handle = @@ -144,6 +146,7 @@ endpoint->set_peer_closed(); endpoints_.insert({ id, endpoint }); + endpoint->set_handle_created(); *local_endpoint = CreateScopedInterfaceEndpointHandle(id, true); *remote_endpoint = CreateScopedInterfaceEndpointHandle(id, false); } @@ -247,63 +250,45 @@ friend class Endpoint; friend class ControlMessageProxyThunk; - // Message objects cannot be destroyed under the controller's lock, if they - // contain ScopedInterfaceEndpointHandle objects. - // IncomingMessageWrapper is used to wrap messages which haven't got the - // payload interface IDs deserialized into ScopedInterfaceEndpointHandles. - // Wrapper objects are always destroyed under the controller's lock. When a - // wrapper is destroyed and the message hasn't been consumed, the wrapper is - // responsible to send endpoint closed notifications. - class IncomingMessageWrapper { + // MessageWrapper objects are always destroyed under the controller's lock. On + // destruction, if the message it wrappers contains + // ScopedInterfaceEndpointHandles (which cannot be destructed under the + // controller's lock), the wrapper unlocks to clean them up. + class MessageWrapper { public: - IncomingMessageWrapper() = default; + MessageWrapper() = default; - IncomingMessageWrapper(ChannelAssociatedGroupController* controller, - mojo::Message* message) - : controller_(controller), value_(std::move(*message)) { - DCHECK(value_.associated_endpoint_handles()->empty()); - } + MessageWrapper(ChannelAssociatedGroupController* controller, + mojo::Message message) + : controller_(controller), value_(std::move(message)) {} - IncomingMessageWrapper(IncomingMessageWrapper&& other) + MessageWrapper(MessageWrapper&& other) : controller_(other.controller_), value_(std::move(other.value_)) {} - ~IncomingMessageWrapper() { - if (value_.IsNull()) + ~MessageWrapper() { + if (value_.associated_endpoint_handles()->empty()) return; controller_->lock_.AssertAcquired(); - - uint32_t num_ids = value_.payload_num_interface_ids(); - const uint32_t* ids = value_.payload_interface_ids(); - for (uint32_t i = 0; i < num_ids; ++i) { + { base::AutoUnlock unlocker(controller_->lock_); - controller_->control_message_proxy_.NotifyPeerEndpointClosed( - ids[i], base::nullopt); + value_.mutable_associated_endpoint_handles()->clear(); } } - IncomingMessageWrapper& operator=(IncomingMessageWrapper&& other) { + MessageWrapper& operator=(MessageWrapper&& other) { controller_ = other.controller_; value_ = std::move(other.value_); return *this; } - // Must be called outside of the controller's lock. - bool TakeMessage(mojo::Message* output) { - DCHECK(!value_.IsNull()); - - *output = std::move(value_); - return output->DeserializeAssociatedEndpointHandles(controller_); - } - - const mojo::Message& value() const { return value_; } + mojo::Message& value() { return value_; } private: ChannelAssociatedGroupController* controller_ = nullptr; - // It must not hold any ScopedInterfaceEndpointHandle objects. mojo::Message value_; - DISALLOW_COPY_AND_ASSIGN(IncomingMessageWrapper); + DISALLOW_COPY_AND_ASSIGN(MessageWrapper); }; class Endpoint : public base::RefCountedThreadSafe<Endpoint>, @@ -384,7 +369,7 @@ sync_watcher_.reset(); } - uint32_t EnqueueSyncMessage(IncomingMessageWrapper message) { + uint32_t EnqueueSyncMessage(MessageWrapper message) { controller_->lock_.AssertAcquired(); uint32_t id = GenerateSyncMessageId(); sync_messages_.emplace(id, std::move(message)); @@ -398,11 +383,11 @@ sync_message_event_->Signal(); } - IncomingMessageWrapper PopSyncMessage(uint32_t id) { + MessageWrapper PopSyncMessage(uint32_t id) { controller_->lock_.AssertAcquired(); if (sync_messages_.empty() || sync_messages_.front().first != id) - return IncomingMessageWrapper(); - IncomingMessageWrapper message = std::move(sync_messages_.front().second); + return MessageWrapper(); + MessageWrapper message = std::move(sync_messages_.front().second); sync_messages_.pop(); return message; } @@ -457,7 +442,7 @@ base::AutoLock locker(controller_->lock_); bool more_to_process = false; if (!sync_messages_.empty()) { - IncomingMessageWrapper message_wrapper = + MessageWrapper message_wrapper = std::move(sync_messages_.front().second); sync_messages_.pop(); @@ -465,9 +450,8 @@ mojo::InterfaceEndpointClient* client = client_; { base::AutoUnlock unlocker(controller_->lock_); - mojo::Message message; - dispatch_succeeded = message_wrapper.TakeMessage(&message) && - client->HandleIncomingMessage(&message); + dispatch_succeeded = + client->HandleIncomingMessage(&message_wrapper.value()); } if (!sync_messages_.empty()) @@ -535,7 +519,7 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner_; std::unique_ptr<mojo::SyncHandleWatcher> sync_watcher_; std::unique_ptr<MojoEvent> sync_message_event_; - std::queue<std::pair<uint32_t, IncomingMessageWrapper>> sync_messages_; + std::queue<std::pair<uint32_t, MessageWrapper>> sync_messages_; uint32_t next_sync_message_id_ = 0; DISALLOW_COPY_AND_ASSIGN(Endpoint); @@ -689,33 +673,41 @@ lock_.AssertAcquired(); DCHECK(!inserted || !*inserted); - auto iter = endpoints_.find(id); - if (iter != endpoints_.end()) - return iter->second.get(); - - Endpoint* endpoint = new Endpoint(this, id); - endpoints_.insert({ id, endpoint }); - if (inserted) - *inserted = true; + Endpoint* endpoint = FindEndpoint(id); + if (!endpoint) { + endpoint = new Endpoint(this, id); + endpoints_.insert({id, endpoint}); + if (inserted) + *inserted = true; + } return endpoint; } + Endpoint* FindEndpoint(mojo::InterfaceId id) { + lock_.AssertAcquired(); + auto iter = endpoints_.find(id); + return iter != endpoints_.end() ? iter->second.get() : nullptr; + } + // mojo::MessageReceiver: bool Accept(mojo::Message* message) override { DCHECK(thread_checker_.CalledOnValidThread()); - if (mojo::PipeControlMessageHandler::IsPipeControlMessage(message)) { - return message->DeserializeAssociatedEndpointHandles(this) && - control_message_handler_.Accept(message); - } + if (!message->DeserializeAssociatedEndpointHandles(this)) + return false; + + if (mojo::PipeControlMessageHandler::IsPipeControlMessage(message)) + return control_message_handler_.Accept(message); mojo::InterfaceId id = message->interface_id(); DCHECK(mojo::IsValidInterfaceId(id)); base::AutoLock locker(lock_); - Endpoint* endpoint = GetEndpointForDispatch(id, true /* create */); - mojo::InterfaceEndpointClient* client = - endpoint ? endpoint->client() : nullptr; + Endpoint* endpoint = FindEndpoint(id); + if (!endpoint) + return true; + + mojo::InterfaceEndpointClient* client = endpoint->client(); if (!client || !endpoint->task_runner()->BelongsToCurrentThread()) { // No client has been bound yet or the client runs tasks on another // thread. We assume the other thread must always be the one on which @@ -726,7 +718,7 @@ DCHECK(proxy_task_runner_); if (message->has_flag(mojo::Message::kFlagIsSync)) { - IncomingMessageWrapper message_wrapper(this, message); + MessageWrapper message_wrapper(this, std::move(*message)); // Sync messages may need to be handled by the endpoint if it's blocking // on a sync reply. We pass ownership of the message to the endpoint's // sync message queue. If the endpoint was blocking, it will dequeue the @@ -754,8 +746,7 @@ !message->has_flag(mojo::Message::kFlagIsResponse)); base::AutoUnlock unlocker(lock_); - return message->DeserializeAssociatedEndpointHandles(this) && - client->HandleIncomingMessage(message); + return client->HandleIncomingMessage(message); } void AcceptOnProxyThread(mojo::Message message) { @@ -765,9 +756,7 @@ DCHECK(mojo::IsValidInterfaceId(id) && !mojo::IsMasterInterfaceId(id)); base::AutoLock locker(lock_); - IncomingMessageWrapper message_wrapper(this, &message); - - Endpoint* endpoint = GetEndpointForDispatch(id, false /* create */); + Endpoint* endpoint = FindEndpoint(id); if (!endpoint) return; @@ -778,14 +767,12 @@ DCHECK(endpoint->task_runner()->BelongsToCurrentThread()); // Sync messages should never make their way to this method. - DCHECK(!message_wrapper.value().has_flag(mojo::Message::kFlagIsSync)); + DCHECK(!message.has_flag(mojo::Message::kFlagIsSync)); bool result = false; { base::AutoUnlock unlocker(lock_); - mojo::Message message; - result = message_wrapper.TakeMessage(&message) && - client->HandleIncomingMessage(&message); + result = client->HandleIncomingMessage(&message); } if (!result) @@ -796,14 +783,12 @@ DCHECK(proxy_task_runner_->BelongsToCurrentThread()); base::AutoLock locker(lock_); - Endpoint* endpoint = - GetEndpointForDispatch(interface_id, false /* create */); + Endpoint* endpoint = FindEndpoint(interface_id); if (!endpoint) return; DCHECK(endpoint->task_runner()->BelongsToCurrentThread()); - IncomingMessageWrapper message_wrapper = - endpoint->PopSyncMessage(message_id); + MessageWrapper message_wrapper = endpoint->PopSyncMessage(message_id); // The message must have already been dequeued by the endpoint waking up // from a sync wait. Nothing to do. @@ -817,28 +802,13 @@ bool result = false; { base::AutoUnlock unlocker(lock_); - mojo::Message message; - result = message_wrapper.TakeMessage(&message) && - client->HandleIncomingMessage(&message); + result = client->HandleIncomingMessage(&message_wrapper.value()); } if (!result) RaiseError(); } - Endpoint* GetEndpointForDispatch(mojo::InterfaceId id, bool create) { - lock_.AssertAcquired(); - auto iter = endpoints_.find(id); - if (iter != endpoints_.end()) - return iter->second.get(); - if (!create) - return nullptr; - bool inserted = false; - Endpoint* endpoint = FindOrInsertEndpoint(id, &inserted); - DCHECK(inserted); - return endpoint; - } - // mojo::PipeControlMessageHandlerDelegate: bool OnPeerAssociatedEndpointClosed( mojo::InterfaceId id,
diff --git a/mash/simple_wm/simple_wm.cc b/mash/simple_wm/simple_wm.cc index 90fd986..b8f98a75 100644 --- a/mash/simple_wm/simple_wm.cc +++ b/mash/simple_wm/simple_wm.cc
@@ -399,10 +399,6 @@ // Don't care. } -aura::client::CaptureClient* SimpleWM::GetCaptureClient() { - return wm_state_.capture_controller(); -} - aura::PropertyConverter* SimpleWM::GetPropertyConverter() { return &property_converter_; }
diff --git a/mash/simple_wm/simple_wm.h b/mash/simple_wm/simple_wm.h index c648897..a0a05356 100644 --- a/mash/simple_wm/simple_wm.h +++ b/mash/simple_wm/simple_wm.h
@@ -67,7 +67,6 @@ void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // aura::WindowManagerDelegate:
diff --git a/media/BUILD.gn b/media/BUILD.gn index 1350606..a91d170 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn
@@ -78,7 +78,7 @@ "/DELAYLOAD:mfreadwrite.dll", ] } - if (media_use_ffmpeg && is_android) { + if (disable_ffmpeg_video_decoders) { defines += [ "DISABLE_FFMPEG_VIDEO_DECODERS" ] } } @@ -364,7 +364,7 @@ if (is_android) { # On Android, FFmpeg is built without video decoders. We only # support hardware video decoding. - if (media_use_ffmpeg) { + if (disable_ffmpeg_video_decoders) { sources -= [ "filters/ffmpeg_video_decoder.cc", "filters/ffmpeg_video_decoder.h",
diff --git a/media/base/BUILD.gn b/media/base/BUILD.gn index 29dcccd..8a67938 100644 --- a/media/base/BUILD.gn +++ b/media/base/BUILD.gn
@@ -135,8 +135,6 @@ "demuxer.h", "demuxer_stream.cc", "demuxer_stream.h", - "demuxer_stream_provider.cc", - "demuxer_stream_provider.h", "djb2.cc", "djb2.h", "eme_constants.h", @@ -168,6 +166,8 @@ "media_observer.h", "media_permission.cc", "media_permission.h", + "media_resource.cc", + "media_resource.h", "media_switches.cc", "media_switches.h", "media_track.cc",
diff --git a/media/base/demuxer.h b/media/base/demuxer.h index 6fa71a5..71cdc6d1 100644 --- a/media/base/demuxer.h +++ b/media/base/demuxer.h
@@ -14,9 +14,9 @@ #include "base/time/time.h" #include "media/base/data_source.h" #include "media/base/demuxer_stream.h" -#include "media/base/demuxer_stream_provider.h" #include "media/base/eme_constants.h" #include "media/base/media_export.h" +#include "media/base/media_resource.h" #include "media/base/media_track.h" #include "media/base/pipeline_status.h" #include "media/base/ranges.h" @@ -58,7 +58,7 @@ virtual ~DemuxerHost(); }; -class MEDIA_EXPORT Demuxer : public DemuxerStreamProvider { +class MEDIA_EXPORT Demuxer : public MediaResource { public: // A new potentially encrypted stream has been parsed. // First parameter - The type of initialization data.
diff --git a/media/base/demuxer_stream_provider.cc b/media/base/demuxer_stream_provider.cc deleted file mode 100644 index 7253417..0000000 --- a/media/base/demuxer_stream_provider.cc +++ /dev/null
@@ -1,22 +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 "media/base/demuxer_stream_provider.h" - -namespace media { - -DemuxerStreamProvider::DemuxerStreamProvider() {} - -DemuxerStreamProvider::~DemuxerStreamProvider() {} - -MediaUrlParams DemuxerStreamProvider::GetMediaUrlParams() const { - NOTREACHED(); - return MediaUrlParams{GURL(), GURL()}; -} - -DemuxerStreamProvider::Type DemuxerStreamProvider::GetType() const { - return STREAM; -} - -} // namespace media
diff --git a/media/base/fake_demuxer_stream.cc b/media/base/fake_demuxer_stream.cc index 54de722..01bfe77 100644 --- a/media/base/fake_demuxer_stream.cc +++ b/media/base/fake_demuxer_stream.cc
@@ -215,19 +215,16 @@ base::ResetAndReturn(&read_cb_).Run(kOk, buffer); } -FakeDemuxerStreamProvider::FakeDemuxerStreamProvider( - int num_video_configs, - int num_video_buffers_in_one_config, - bool is_video_encrypted) +FakeMediaResource::FakeMediaResource(int num_video_configs, + int num_video_buffers_in_one_config, + bool is_video_encrypted) : fake_video_stream_(num_video_configs, num_video_buffers_in_one_config, - is_video_encrypted) { -} + is_video_encrypted) {} -FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { -} +FakeMediaResource::~FakeMediaResource() {} -DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { +DemuxerStream* FakeMediaResource::GetStream(DemuxerStream::Type type) { if (type == DemuxerStream::Type::AUDIO) return nullptr; return &fake_video_stream_;
diff --git a/media/base/fake_demuxer_stream.h b/media/base/fake_demuxer_stream.h index d090fe6..14b86ff 100644 --- a/media/base/fake_demuxer_stream.h +++ b/media/base/fake_demuxer_stream.h
@@ -9,7 +9,7 @@ #include "base/memory/ref_counted.h" #include "media/base/audio_decoder_config.h" #include "media/base/demuxer_stream.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/video_decoder_config.h" namespace base { @@ -103,21 +103,21 @@ DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStream); }; -class FakeDemuxerStreamProvider : public DemuxerStreamProvider { +class FakeMediaResource : public MediaResource { public: // Note: FakeDemuxerStream currently only supports a fake video DemuxerStream. - FakeDemuxerStreamProvider(int num_video_configs, - int num_video_buffers_in_one_config, - bool is_video_encrypted); - ~FakeDemuxerStreamProvider() override; + FakeMediaResource(int num_video_configs, + int num_video_buffers_in_one_config, + bool is_video_encrypted); + ~FakeMediaResource() override; - // DemuxerStreamProvider implementation. + // MediaResource implementation. DemuxerStream* GetStream(DemuxerStream::Type type) override; private: FakeDemuxerStream fake_video_stream_; - DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStreamProvider); + DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); }; } // namespace media
diff --git a/media/base/media_resource.cc b/media/base/media_resource.cc new file mode 100644 index 0000000..ee157f3 --- /dev/null +++ b/media/base/media_resource.cc
@@ -0,0 +1,22 @@ +// 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 "media/base/media_resource.h" + +namespace media { + +MediaResource::MediaResource() {} + +MediaResource::~MediaResource() {} + +MediaUrlParams MediaResource::GetMediaUrlParams() const { + NOTREACHED(); + return MediaUrlParams{GURL(), GURL()}; +} + +MediaResource::Type MediaResource::GetType() const { + return STREAM; +} + +} // namespace media
diff --git a/media/base/demuxer_stream_provider.h b/media/base/media_resource.h similarity index 61% rename from media/base/demuxer_stream_provider.h rename to media/base/media_resource.h index 3534550..2cd9019 100644 --- a/media/base/demuxer_stream_provider.h +++ b/media/base/media_resource.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 MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ -#define MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ +#ifndef MEDIA_BASE_MEDIA_RESOURCE_H_ +#define MEDIA_BASE_MEDIA_RESOURCE_H_ #include "base/macros.h" #include "media/base/demuxer_stream.h" @@ -13,34 +13,28 @@ namespace media { -// Abstract class that defines how to retrieve "media sources" in DemuxerStream -// form (for most cases) or URL form (for the MediaPlayerRenderer case). -// -// The sub-classes do not stricly provide demuxer streams, but because all -// sub-classes are for the moment Demuxers, this class has not been renamed to -// "MediaProvider". This class would be a good candidate for renaming, if -// ever Pipeline were to support this class directly, instead of the Demuxer -// interface. -// TODO(tguilbert): Rename this class. See crbug.com/658062. +// Abstract class that defines how to retrieve "media resources" in +// DemuxerStream form (for most cases) or URL form (for the MediaPlayerRenderer +// case). // // The derived classes must return a non-null value for the getter method // associated with their type, and return a null/empty value for other getters. -class MEDIA_EXPORT DemuxerStreamProvider { +class MEDIA_EXPORT MediaResource { public: enum Type { - STREAM, // Indicates GetStream() should be used + STREAM, // Indicates GetStreams() should be used URL, // Indicates GetUrl() should be used }; - DemuxerStreamProvider(); - virtual ~DemuxerStreamProvider(); + MediaResource(); + virtual ~MediaResource(); // For Type::STREAM: // Returns the first stream of the given stream type (which is not allowed // to be DemuxerStream::TEXT), or NULL if that type of stream is not // present. // NOTE: Once a DemuxerStream pointer is returned from GetStream it is - // guaranteed to stay valid for as long as the Demuxer/DemuxerStreamProvider + // guaranteed to stay valid for as long as the Demuxer/MediaResource // is alive. But make no assumption that once GetStream returned a non-null // pointer for some stream type then all subsequent calls will also return // non-null pointer for the same stream type. In MSE Javascript code can @@ -57,12 +51,12 @@ // Should not be called. virtual MediaUrlParams GetMediaUrlParams() const; - virtual DemuxerStreamProvider::Type GetType() const; + virtual MediaResource::Type GetType() const; private: - DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); + DISALLOW_COPY_AND_ASSIGN(MediaResource); }; } // namespace media -#endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ +#endif // MEDIA_BASE_MEDIA_RESOURCE_H_
diff --git a/media/base/media_url_demuxer.cc b/media/base/media_url_demuxer.cc index 755e910..5e092fe 100644 --- a/media/base/media_url_demuxer.cc +++ b/media/base/media_url_demuxer.cc
@@ -17,7 +17,7 @@ MediaUrlDemuxer::~MediaUrlDemuxer() {} -// Should never be called since DemuxerStreamProvider::Type is URL. +// Should never be called since MediaResource::Type is URL. DemuxerStream* MediaUrlDemuxer::GetStream(DemuxerStream::Type type) { NOTREACHED(); return nullptr; @@ -27,8 +27,8 @@ return params_; } -DemuxerStreamProvider::Type MediaUrlDemuxer::GetType() const { - return DemuxerStreamProvider::Type::URL; +MediaResource::Type MediaUrlDemuxer::GetType() const { + return MediaResource::Type::URL; } std::string MediaUrlDemuxer::GetDisplayName() const {
diff --git a/media/base/media_url_demuxer.h b/media/base/media_url_demuxer.h index bbcbc8a..ae092c6 100644 --- a/media/base/media_url_demuxer.h +++ b/media/base/media_url_demuxer.h
@@ -27,9 +27,9 @@ // its implementation of the Demuxer are NOPs that return the default values and // fire any provided callbacks immediately. // -// If Pipeline where to be refactored to use a DemuxerStreamProvider instead of +// If Pipeline where to be refactored to use a MediaResource instead of // a Demuxer, MediaUrlDemuxer should be refactored to inherit directly from -// DemuxerStreamProvider. +// MediaResource. class MEDIA_EXPORT MediaUrlDemuxer : public Demuxer { public: MediaUrlDemuxer( @@ -38,10 +38,10 @@ const GURL& first_party_for_cookies); ~MediaUrlDemuxer() override; - // DemuxerStreamProvider interface. + // MediaResource interface. DemuxerStream* GetStream(DemuxerStream::Type type) override; MediaUrlParams GetMediaUrlParams() const override; - DemuxerStreamProvider::Type GetType() const override; + MediaResource::Type GetType() const override; // Demuxer interface. std::string GetDisplayName() const override;
diff --git a/media/base/media_url_demuxer_unittest.cc b/media/base/media_url_demuxer_unittest.cc index 1660b943..4717e7d4 100644 --- a/media/base/media_url_demuxer_unittest.cc +++ b/media/base/media_url_demuxer_unittest.cc
@@ -47,7 +47,7 @@ TEST_F(MediaUrlDemuxerTest, BaseCase) { InitializeTest(); - EXPECT_EQ(DemuxerStreamProvider::Type::URL, demuxer_->GetType()); + EXPECT_EQ(MediaResource::Type::URL, demuxer_->GetType()); MediaUrlParams params = demuxer_->GetMediaUrlParams(); EXPECT_EQ(default_media_url_, params.media_url);
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index 42345e5..aaf6c6a5 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h
@@ -285,7 +285,7 @@ // Renderer implementation. MOCK_METHOD3(Initialize, - void(DemuxerStreamProvider* demuxer_stream_provider, + void(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb)); MOCK_METHOD1(Flush, void(const base::Closure& flush_cb));
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc index ef8ac15..0ec81f9 100644 --- a/media/base/pipeline_impl.cc +++ b/media/base/pipeline_impl.cc
@@ -859,7 +859,7 @@ DCHECK(media_task_runner_->BelongsToCurrentThread()); switch (demuxer_->GetType()) { - case DemuxerStreamProvider::Type::STREAM: + case MediaResource::Type::STREAM: if (!demuxer_->GetStream(DemuxerStream::AUDIO) && !demuxer_->GetStream(DemuxerStream::VIDEO)) { DVLOG(1) << "Error: demuxer does not have an audio or a video stream."; @@ -868,7 +868,7 @@ } break; - case DemuxerStreamProvider::Type::URL: + case MediaResource::Type::URL: // NOTE: Empty GURL are not valid. if (!demuxer_->GetMediaUrlParams().media_url.is_valid()) { DVLOG(1) << "Error: demuxer does not have a valid URL."; @@ -904,7 +904,7 @@ DemuxerStream* stream; switch (demuxer_->GetType()) { - case DemuxerStreamProvider::Type::STREAM: + case MediaResource::Type::STREAM: metadata.timeline_offset = demuxer_->GetTimelineOffset(); stream = demuxer_->GetStream(DemuxerStream::VIDEO); if (stream) { @@ -922,7 +922,7 @@ } break; - case DemuxerStreamProvider::Type::URL: + case MediaResource::Type::URL: // We don't know if the MediaPlayerRender has Audio/Video until we start // playing. Conservatively assume that they do. metadata.has_video = true;
diff --git a/media/base/renderer.h b/media/base/renderer.h index fe3a49a..7b460d9 100644 --- a/media/base/renderer.h +++ b/media/base/renderer.h
@@ -16,7 +16,7 @@ namespace media { -class DemuxerStreamProvider; +class MediaResource; class RendererClient; class MEDIA_EXPORT Renderer { @@ -26,12 +26,12 @@ // Stops rendering and fires any pending callbacks. virtual ~Renderer(); - // Initializes the Renderer with |demuxer_stream_provider|, executing - // |init_cb| upon completion. |demuxer_stream_provider| must be valid for - // the lifetime of the Renderer object. |init_cb| must only be run after this - // method has returned. Firing |init_cb| may result in the immediate - // destruction of the caller, so it must be run only prior to returning. - virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider, + // Initializes the Renderer with |media_resource|, executing |init_cb| upon + // completion. |media_resource| must be valid for the lifetime of the Renderer + // object. |init_cb| must only be run after this method has returned. Firing + // |init_cb| may result in the immediate destruction of the caller, so it must + // be run only prior to returning. + virtual void Initialize(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb) = 0;
diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc index a6a1b95..7b16001f 100644 --- a/media/gpu/android_video_decode_accelerator.cc +++ b/media/gpu/android_video_decode_accelerator.cc
@@ -228,7 +228,7 @@ : client_(NULL), make_context_current_cb_(make_context_current_cb), get_gles2_decoder_cb_(get_gles2_decoder_cb), - state_(NO_ERROR), + state_(BEFORE_SURFACE_ALLOC), picturebuffers_requested_(false), picture_buffer_manager_(this), media_drm_bridge_cdm_context_(nullptr), @@ -324,10 +324,6 @@ // We signaled that we support deferred initialization, so see if the client // does also. deferred_initialization_pending_ = config.is_deferred_initialization_allowed; - if (config_.is_encrypted() && !deferred_initialization_pending_) { - DLOG(ERROR) << "Deferred initialization must be used for encrypted streams"; - return false; - } // If we're low on resources, we may decide to defer creation of the surface // until the codec is actually used. @@ -335,31 +331,69 @@ // We should never be here if a SurfaceView is required. DCHECK_EQ(config_.surface_id, SurfaceManager::kNoSurfaceID); defer_surface_creation_ = true; + } + + if (!AVDACodecAllocator::Instance()->StartThread(this)) { + LOG(ERROR) << "Unable to start thread"; + return false; + } + + // For encrypted media, start by initializing the CDM. Otherwise, start with + // the surface. + if (config_.is_encrypted()) { + if (!deferred_initialization_pending_) { + DLOG(ERROR) + << "Deferred initialization must be used for encrypted streams"; + return false; + } + InitializeCdm(); + } else { + StartSurfaceCreation(); + } + + // Fail / complete / defer initialization. + return state_ != ERROR; +} + +void AndroidVideoDecodeAccelerator::StartSurfaceCreation() { + // We might be called during Initialize, during deferred initialization, or + // afterwards (::Decode, for deferred surface init). + DCHECK(state_ == BEFORE_SURFACE_ALLOC); + + // If surface creation is deferred, then do nothing except signal that init + // is complete, if needed. We might still fail to get a surface or codec, + // which would normally be an init error. Since we're deferring init until a + // decode to save resources, though, we're signaling success now. If we're + // wrong, then decoding might fail when we might have been able to use a + // fallback renderer in WMPI if we failed init. + if (defer_surface_creation_) { if (deferred_initialization_pending_) NotifyInitializationSucceeded(); - return true; + + return; } - if (AVDACodecAllocator::Instance()->AllocateSurface(this, - config_.surface_id)) { - // We now own the surface, so continue initialization. - InitializePictureBufferManager(); - return state_ != ERROR; + if (!AVDACodecAllocator::Instance()->AllocateSurface(this, + config_.surface_id)) { + // We have to wait for some other AVDA instance to free up the surface. + // OnSurfaceAvailable will be called when it's available. + // Note that if we aren't deferring init, then we'll signal success, and + // if we fail later then it will fail decoding instead. However, since + // nobody that provides a SurfaceView requires sync init, it doesn't matter. + return; } - // We have to wait for some other AVDA instance to free up the surface. - // OnSurfaceAvailable will be called when it's available. Note that if we're - // deferring initialization, then this will cause the client to wait for the - // result. If we're not, then the client will assume success even though - // we don't technically know if we will get a surface and codec yet. - DCHECK_EQ(state_, NO_ERROR); - return true; + // We now own the surface, so finish initialization. + InitializePictureBufferManager(); } void AndroidVideoDecodeAccelerator::OnSurfaceAvailable(bool success) { - DCHECK(deferred_initialization_pending_); DCHECK(!defer_surface_creation_); + // Note that we're not called during UpdateSurface; we fail if the surface + // isn't available imediately in that case. Otherwise, this wouldn't be true. + DCHECK(state_ == BEFORE_SURFACE_ALLOC); + if (!success) { NOTIFY_ERROR(PLATFORM_FAILURE, "Surface is not available"); return; @@ -369,6 +403,9 @@ } void AndroidVideoDecodeAccelerator::InitializePictureBufferManager() { + DCHECK(!defer_surface_creation_); + DCHECK(state_ == BEFORE_SURFACE_ALLOC); + if (!make_context_current_cb_.Run()) { NOTIFY_ERROR(PLATFORM_FAILURE, "Failed to make this decoder's GL context current"); @@ -383,37 +420,31 @@ return; } - if (!AVDACodecAllocator::Instance()->StartThread(this)) { - NOTIFY_ERROR(PLATFORM_FAILURE, "Unable to start thread"); - return; - } - - // If we are encrypted, then we aren't able to create the codec yet. - if (config_.is_encrypted()) { - InitializeCdm(); - return; - } - - if (deferred_initialization_pending_ || defer_surface_creation_) { - defer_surface_creation_ = false; - ConfigureMediaCodecAsynchronously(); - return; - } - // If the client doesn't support deferred initialization (WebRTC), then we // should complete it now and return a meaningful result. Note that it would // be nice if we didn't have to worry about starting codec configuration at // all (::Initialize or the wrapper can do it), but then they have to remember // not to start codec config if we have to wait for the cdm. It's somewhat // clearer for us to handle both cases. - ConfigureMediaCodecSynchronously(); + // For this to be a case for sync configuration, we must be called from + // Initialize(), and the client must not want deferred init. Note that having + // |deferred_initialization_pending_| false by itself isn't enough; if we're + // deferring surface creation, then we'll finish deferred init before asking + // for the surface. We'll be called via ::Decode. + if (during_initialize_ && !deferred_initialization_pending_) { + ConfigureMediaCodecSynchronously(); + return; + } + + // In all other cases, we don't have to wait for the codec. + ConfigureMediaCodecAsynchronously(); } void AndroidVideoDecodeAccelerator::DoIOTask(bool start_timer) { DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("media", "AVDA::DoIOTask"); if (state_ == ERROR || state_ == WAITING_FOR_CODEC || - state_ == SURFACE_DESTROYED) { + state_ == SURFACE_DESTROYED || state_ == BEFORE_SURFACE_ALLOC) { return; } @@ -433,7 +464,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("media", "AVDA::QueueInput"); if (state_ == ERROR || state_ == WAITING_FOR_CODEC || - state_ == WAITING_FOR_KEY) { + state_ == WAITING_FOR_KEY || state_ == BEFORE_SURFACE_ALLOC) { return false; } if (bitstreams_notified_in_advance_.size() > kMaxBitstreamsNotifiedInAdvance) @@ -563,8 +594,10 @@ bool AndroidVideoDecodeAccelerator::DequeueOutput() { DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("media", "AVDA::DequeueOutput"); - if (state_ == ERROR || state_ == WAITING_FOR_CODEC) + if (state_ == ERROR || state_ == WAITING_FOR_CODEC || + state_ == BEFORE_SURFACE_ALLOC) { return false; + } // If we're draining for reset or destroy, then we don't need picture buffers // since we won't send any decoded frames anyway. There might not be any, // since the pipeline might not be sending them back and / or they don't @@ -778,8 +811,11 @@ const BitstreamBuffer& bitstream_buffer) { DCHECK(thread_checker_.CalledOnValidThread()); + // If we deferred getting a surface, then start getting one now. if (defer_surface_creation_) { - InitializePictureBufferManager(); + DCHECK_EQ(state_, BEFORE_SURFACE_ALLOC); + defer_surface_creation_ = false; + StartSurfaceCreation(); if (state_ == ERROR) { DLOG(ERROR) << "Failed deferred surface and MediaCodec initialization."; return; @@ -945,6 +981,9 @@ // If |state_| changed to SURFACE_DESTROYED while we were configuring a codec, // then the codec is already invalid so we return early and drop it. + // TODO(liberato): We're going to drop the codec when |media_codec| goes out + // of scope, on this thread. We really should post it to the proper thread + // to avoid potentially hanging. if (state_ == SURFACE_DESTROYED) { if (deferred_initialization_pending_) { // Losing the output surface is not considered an error state, so notify @@ -1045,8 +1084,10 @@ // If there is already a reset in flight, then that counts. This can really // only happen if somebody calls Reset. // If the surface is destroyed there's nothing to do. + // Note that BEFORE_SURFACE_ALLOC implies that we have no codec, but it's + // included for completeness. if (state_ == WAITING_FOR_CODEC || state_ == SURFACE_DESTROYED || - !media_codec_) { + state_ == BEFORE_SURFACE_ALLOC || !media_codec_) { return; } @@ -1096,7 +1137,7 @@ if (defer_surface_creation_) { DCHECK(!media_codec_); DCHECK(pending_bitstream_records_.empty()); - DCHECK_EQ(state_, NO_ERROR); + DCHECK_EQ(state_, BEFORE_SURFACE_ALLOC); base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, weak_this_factory_.GetWeakPtr())); @@ -1201,6 +1242,13 @@ TRACE_EVENT0("media", "AVDA::OnSurfaceDestroyed"); DCHECK(thread_checker_.CalledOnValidThread()); + // We cannot get here if we're before surface allocation, since we transition + // to WAITING_FOR_CODEC (or NO_ERROR, if sync) when we get the surface without + // posting. If we do ever lose the surface before starting codec allocation, + // then we could just update the config to use a SurfaceTexture and return + // without changing state. + DCHECK_NE(state_, BEFORE_SURFACE_ALLOC); + // If the API is available avoid having to restart the decoder in order to // leave fullscreen. If we don't clear the surface immediately during this // callback, the MediaCodec will throw an error as the surface is destroyed. @@ -1288,17 +1336,21 @@ // We assume this is a part of the initialization process, thus MediaCodec // is not created yet. DCHECK(!media_codec_); + DCHECK(deferred_initialization_pending_); codec_config_->media_crypto = std::move(media_crypto); codec_config_->needs_protected_surface = needs_protected_surface; - // After receiving |media_crypto_| we can configure MediaCodec. - ConfigureMediaCodecAsynchronously(); + // After receiving |media_crypto_| we can start with surface creation. + StartSurfaceCreation(); } void AndroidVideoDecodeAccelerator::OnKeyAdded() { DVLOG(1) << __func__; + // This can also be called before initial surface allocation has completed, + // so we might not have a surface / codec yet. In that case, we'll never + // transition to WAITING_FOR_KEY, which is fine. if (state_ == WAITING_FOR_KEY) state_ = NO_ERROR;
diff --git a/media/gpu/android_video_decode_accelerator.h b/media/gpu/android_video_decode_accelerator.h index 4d903692..56dc165 100644 --- a/media/gpu/android_video_decode_accelerator.h +++ b/media/gpu/android_video_decode_accelerator.h
@@ -87,6 +87,10 @@ enum State { NO_ERROR, ERROR, + // Initial state, before we've initialized the CDM, allocated the surface, + // and started codec allocation. From here, we'll transition either to + // WAITING_FOR_CODEC or NO_ERROR (or, of course, ERROR). + BEFORE_SURFACE_ALLOC, // Set when we are asynchronously constructing the codec. Will transition // to NO_ERROR or ERROR depending on success. WAITING_FOR_CODEC, @@ -103,6 +107,11 @@ DRAIN_FOR_DESTROY, }; + // Start surface creation by trying to allocate the surface id. Will either + // InitializePictureBufferManager if the surface is available immediately, or + // will wait for OnSurfaceAvailable to do it. + void StartSurfaceCreation(); + // Initialize of the picture buffer manager. This is to be called when the // SurfaceView in |surface_id_|, if any, is no longer busy. On failure, it // will set |state_| to ERROR. On success, it will proceed to either sync or
diff --git a/media/media_options.gni b/media/media_options.gni index 3aab0a0..1ea82c3 100644 --- a/media/media_options.gni +++ b/media/media_options.gni
@@ -81,6 +81,16 @@ } } +# Use another declare_args() to pick up possible overrides of media_use_ffmpeg +# from --args command line flags. See "gn help declare_args". +declare_args() { + # On Android, FFMpeg is built without video decoders by default. + # This flag gives the option to override that decision in case there are no + # hardware decoders. To do so, you will also need to update ffmpeg build files + # in order to define which decoders to build in. + disable_ffmpeg_video_decoders = !media_use_ffmpeg || is_android +} + declare_args() { # Experiment to enable mojo media services (e.g. "renderer", "cdm", see # |mojo_media_services|). When enabled, selected mojo paths will be enabled in @@ -93,7 +103,7 @@ enable_test_mojo_media_client = false } -# Use a second declare_args() to pick up possible overrides of enable_mojo_media +# Use another declare_args() to pick up possible overrides of enable_mojo_media # from --args command line flags. See "gn help declare_args". declare_args() { # A list of mojo media services that should be used in the media pipeline.
diff --git a/media/mojo/clients/mojo_renderer.cc b/media/mojo/clients/mojo_renderer.cc index 6d284985..a8b1fd3 100644 --- a/media/mojo/clients/mojo_renderer.cc +++ b/media/mojo/clients/mojo_renderer.cc
@@ -10,7 +10,7 @@ #include "base/callback_helpers.h" #include "base/location.h" #include "base/single_thread_task_runner.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/pipeline_status.h" #include "media/base/renderer_client.h" #include "media/base/video_renderer_sink.h" @@ -40,12 +40,12 @@ CancelPendingCallbacks(); } -void MojoRenderer::Initialize(DemuxerStreamProvider* demuxer_stream_provider, +void MojoRenderer::Initialize(MediaResource* media_resource, media::RendererClient* client, const PipelineStatusCB& init_cb) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread()); - DCHECK(demuxer_stream_provider); + DCHECK(media_resource); if (encountered_error_) { task_runner_->PostTask( @@ -53,14 +53,14 @@ return; } - demuxer_stream_provider_ = demuxer_stream_provider; + media_resource_ = media_resource; init_cb_ = init_cb; - switch (demuxer_stream_provider_->GetType()) { - case DemuxerStreamProvider::Type::STREAM: + switch (media_resource_->GetType()) { + case MediaResource::Type::STREAM: InitializeRendererFromStreams(client); break; - case DemuxerStreamProvider::Type::URL: + case MediaResource::Type::URL: InitializeRendererFromUrl(client); break; } @@ -73,10 +73,8 @@ // Create audio and video mojom::DemuxerStream and bind its lifetime to // the pipe. - DemuxerStream* const audio = - demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); - DemuxerStream* const video = - demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); + DemuxerStream* const audio = media_resource_->GetStream(DemuxerStream::AUDIO); + DemuxerStream* const video = media_resource_->GetStream(DemuxerStream::VIDEO); std::vector<mojom::DemuxerStreamPtr> streams; if (audio) { @@ -130,7 +128,7 @@ mojom::RendererClientAssociatedPtrInfo client_ptr_info; client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group()); - MediaUrlParams url_params = demuxer_stream_provider_->GetMediaUrlParams(); + MediaUrlParams url_params = media_resource_->GetMediaUrlParams(); // Using base::Unretained(this) is safe because |this| owns // |remote_renderer_|, and the callback won't be dispatched if
diff --git a/media/mojo/clients/mojo_renderer.h b/media/mojo/clients/mojo_renderer.h index 6535321..dd7576c 100644 --- a/media/mojo/clients/mojo_renderer.h +++ b/media/mojo/clients/mojo_renderer.h
@@ -25,7 +25,7 @@ namespace media { -class DemuxerStreamProvider; +class MediaResource; class MojoDemuxerStreamImpl; class VideoOverlayFactory; class VideoRendererSink; @@ -49,7 +49,7 @@ ~MojoRenderer() override; // Renderer implementation. - void Initialize(DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(MediaResource* media_resource, media::RendererClient* client, const PipelineStatusCB& init_cb) override; void SetCdm(CdmContext* cdm_context, @@ -88,12 +88,12 @@ // called asynchronously. void BindRemoteRendererIfNeeded(); - // Initialize the remote renderer when |demuxer_stream_provider| is of type - // DemuxerSteamProvider::Type::STREAM. + // Initialize the remote renderer when |media_resource| is of type + // MediaResource::Type::STREAM. void InitializeRendererFromStreams(media::RendererClient* client); - // Initialize the remote renderer when |demuxer_stream_provider| is of type - // DemuxerSteamProvider::Type::URL. + // Initialize the remote renderer when |media_resource| is of type + // MediaResource::Type::URL. void InitializeRendererFromUrl(media::RendererClient* client); // Callback for connection error on |remote_renderer_|. @@ -124,7 +124,7 @@ // Provider of audio/video DemuxerStreams. Must be valid throughout the // lifetime of |this|. - DemuxerStreamProvider* demuxer_stream_provider_ = nullptr; + MediaResource* media_resource_ = nullptr; // Client of |this| renderer passed in Initialize. media::RendererClient* client_ = nullptr; @@ -132,8 +132,8 @@ // Mojo demuxer streams. // Owned by MojoRenderer instead of remote mojom::Renderer // becuase these demuxer streams need to be destroyed as soon as |this| is - // destroyed. The local demuxer streams returned by DemuxerStreamProvider - // cannot be used after |this| is destroyed. + // destroyed. The local demuxer streams returned by MediaResource cannot be + // used after |this| is destroyed. // TODO(alokp): Add tests for MojoDemuxerStreamImpl. std::vector<std::unique_ptr<MojoDemuxerStreamImpl>> streams_;
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn index 8b12761..ea9a5f6 100644 --- a/media/mojo/services/BUILD.gn +++ b/media/mojo/services/BUILD.gn
@@ -61,13 +61,13 @@ # See http://crbug.com/670094 source_set("lib") { sources = [ - "demuxer_stream_provider_shim.cc", - "demuxer_stream_provider_shim.h", "gpu_mojo_media_client.cc", "gpu_mojo_media_client.h", "interface_factory_impl.cc", "interface_factory_impl.h", "media_mojo_export.h", + "media_resource_shim.cc", + "media_resource_shim.h", "media_service.cc", "media_service.h", "media_service_factory.cc",
diff --git a/media/mojo/services/demuxer_stream_provider_shim.cc b/media/mojo/services/media_resource_shim.cc similarity index 74% rename from media/mojo/services/demuxer_stream_provider_shim.cc rename to media/mojo/services/media_resource_shim.cc index 1bb7e602..2d178922 100644 --- a/media/mojo/services/demuxer_stream_provider_shim.cc +++ b/media/mojo/services/media_resource_shim.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "media/mojo/services/demuxer_stream_provider_shim.h" +#include "media/mojo/services/media_resource_shim.h" #include <utility> @@ -12,7 +12,7 @@ namespace media { -DemuxerStreamProviderShim::DemuxerStreamProviderShim( +MediaResourceShim::MediaResourceShim( std::vector<mojom::DemuxerStreamPtr> streams, const base::Closure& demuxer_ready_cb) : demuxer_ready_cb_(demuxer_ready_cb), @@ -23,17 +23,16 @@ for (auto& s : streams) { streams_.emplace_back(new MojoDemuxerStreamAdapter( - std::move(s), base::Bind(&DemuxerStreamProviderShim::OnStreamReady, + std::move(s), base::Bind(&MediaResourceShim::OnStreamReady, weak_factory_.GetWeakPtr()))); } } -DemuxerStreamProviderShim::~DemuxerStreamProviderShim() { -} +MediaResourceShim::~MediaResourceShim() {} // This function returns only the first stream of the given |type| for now. // TODO(servolk): Make this work with multiple streams. -DemuxerStream* DemuxerStreamProviderShim::GetStream(DemuxerStream::Type type) { +DemuxerStream* MediaResourceShim::GetStream(DemuxerStream::Type type) { DCHECK(demuxer_ready_cb_.is_null()); for (auto& stream : streams_) { if (stream->type() == type) @@ -43,7 +42,7 @@ return nullptr; } -void DemuxerStreamProviderShim::OnStreamReady() { +void MediaResourceShim::OnStreamReady() { if (++streams_ready_ == streams_.size()) base::ResetAndReturn(&demuxer_ready_cb_).Run(); }
diff --git a/media/mojo/services/demuxer_stream_provider_shim.h b/media/mojo/services/media_resource_shim.h similarity index 66% rename from media/mojo/services/demuxer_stream_provider_shim.h rename to media/mojo/services/media_resource_shim.h index b1b6da9..ec7f47c 100644 --- a/media/mojo/services/demuxer_stream_provider_shim.h +++ b/media/mojo/services/media_resource_shim.h
@@ -2,30 +2,30 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_ -#define MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_ +#ifndef MEDIA_MOJO_SERVICES_MEDIA_RESOURCE_SHIM_H_ +#define MEDIA_MOJO_SERVICES_MEDIA_RESOURCE_SHIM_H_ #include <stddef.h> #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/mojo/services/mojo_demuxer_stream_adapter.h" namespace media { -// DemuxerStreamProvider shim for mojom::DemuxerStreams. -class DemuxerStreamProviderShim : public DemuxerStreamProvider { +// MediaResource shim for mojom::DemuxerStreams. +class MediaResourceShim : public MediaResource { public: // Constructs the shim; at least a single audio or video stream must be // provided. |demuxer_ready_cb| will be called once the streams have been // initialized. Calling any method before then is an error. - DemuxerStreamProviderShim(std::vector<mojom::DemuxerStreamPtr> streams, - const base::Closure& demuxer_ready_cb); - ~DemuxerStreamProviderShim() override; + MediaResourceShim(std::vector<mojom::DemuxerStreamPtr> streams, + const base::Closure& demuxer_ready_cb); + ~MediaResourceShim() override; - // DemuxerStreamProvider interface. + // MediaResource interface. DemuxerStream* GetStream(DemuxerStream::Type type) override; private: @@ -45,11 +45,11 @@ size_t streams_ready_; // WeakPtrFactorys must always be the last member variable. - base::WeakPtrFactory<DemuxerStreamProviderShim> weak_factory_; + base::WeakPtrFactory<MediaResourceShim> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProviderShim); + DISALLOW_COPY_AND_ASSIGN(MediaResourceShim); }; } // namespace media -#endif // MEDIA_MOJO_SERVICES_DEMUXER_STREAM_PROVIDER_SHIM_H_ +#endif // MEDIA_MOJO_SERVICES_MEDIA_RESOURCE_SHIM_H_
diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc index e81f546..81661f86 100644 --- a/media/mojo/services/mojo_renderer_service.cc +++ b/media/mojo/services/mojo_renderer_service.cc
@@ -14,7 +14,7 @@ #include "media/base/media_url_demuxer.h" #include "media/base/renderer.h" #include "media/base/video_renderer_sink.h" -#include "media/mojo/services/demuxer_stream_provider_shim.h" +#include "media/mojo/services/media_resource_shim.h" #include "media/mojo/services/mojo_cdm_service_context.h" namespace media { @@ -89,7 +89,7 @@ if (media_url == base::nullopt) { DCHECK(streams.has_value()); - stream_provider_.reset(new DemuxerStreamProviderShim( + media_resource_.reset(new MediaResourceShim( std::move(*streams), base::Bind(&MojoRendererService::OnStreamReady, weak_this_, callback))); return; @@ -97,10 +97,10 @@ DCHECK(!media_url.value().is_empty()); DCHECK(first_party_for_cookies); - stream_provider_.reset(new MediaUrlDemuxer(nullptr, media_url.value(), - first_party_for_cookies.value())); + media_resource_.reset(new MediaUrlDemuxer(nullptr, media_url.value(), + first_party_for_cookies.value())); renderer_->Initialize( - stream_provider_.get(), this, + media_resource_.get(), this, base::Bind(&MojoRendererService::OnRendererInitializeDone, weak_this_, callback)); } @@ -205,7 +205,7 @@ DCHECK_EQ(state_, STATE_INITIALIZING); renderer_->Initialize( - stream_provider_.get(), this, + media_resource_.get(), this, base::Bind(&MojoRendererService::OnRendererInitializeDone, weak_this_, callback)); }
diff --git a/media/mojo/services/mojo_renderer_service.h b/media/mojo/services/mojo_renderer_service.h index d9bd5b6..734af43 100644 --- a/media/mojo/services/mojo_renderer_service.h +++ b/media/mojo/services/mojo_renderer_service.h
@@ -16,7 +16,7 @@ #include "base/timer/timer.h" #include "base/unguessable_token.h" #include "media/base/buffering_state.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/pipeline_status.h" #include "media/base/renderer_client.h" #include "media/mojo/interfaces/renderer.mojom.h" @@ -26,7 +26,7 @@ namespace media { class AudioRendererSink; -class DemuxerStreamProviderShim; +class MediaResourceShim; class ContentDecryptionModule; class MojoCdmServiceContext; class Renderer; @@ -98,7 +98,7 @@ void OnVideoOpacityChange(bool opaque) final; void OnDurationChange(base::TimeDelta duration) final; - // Called when the DemuxerStreamProviderShim is ready to go (has a config, + // Called when the MediaResourceShim is ready to go (has a config, // pipe handle, etc) and can be handed off to a renderer for use. void OnStreamReady(const base::Callback<void(bool)>& callback); @@ -127,7 +127,7 @@ State state_; double playback_rate_; - std::unique_ptr<DemuxerStreamProvider> stream_provider_; + std::unique_ptr<MediaResource> media_resource_; base::RepeatingTimer time_update_timer_; base::TimeDelta last_media_time_; @@ -144,7 +144,7 @@ std::unique_ptr<VideoRendererSink> video_sink_; // Note: Destroy |renderer_| first to avoid access violation into other - // members, e.g. |stream_provider_|, |cdm_|, |audio_sink_|, and + // members, e.g. |media_resource_|, |cdm_|, |audio_sink_|, and // |video_sink_|. // Must use "media::" because "Renderer" is ambiguous. std::unique_ptr<media::Renderer> renderer_;
diff --git a/media/remoting/BUILD.gn b/media/remoting/BUILD.gn index d605e7c..5e305ef 100644 --- a/media/remoting/BUILD.gn +++ b/media/remoting/BUILD.gn
@@ -79,8 +79,8 @@ sources = [ "courier_renderer_unittest.cc", "demuxer_stream_adapter_unittest.cc", - "fake_demuxer_stream_provider.cc", - "fake_demuxer_stream_provider.h", + "fake_media_resource.cc", + "fake_media_resource.h", "fake_remoter.cc", "fake_remoter.h", "proto_utils_unittest.cc",
diff --git a/media/remoting/courier_renderer.cc b/media/remoting/courier_renderer.cc index b83c7f7..ca0f567 100644 --- a/media/remoting/courier_renderer.cc +++ b/media/remoting/courier_renderer.cc
@@ -19,7 +19,7 @@ #include "base/time/time.h" #include "media/base/bind_to_current_loop.h" #include "media/base/buffering_state.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/renderer_client.h" #include "media/remoting/demuxer_stream_adapter.h" #include "media/remoting/proto_enum_utils.h" @@ -65,7 +65,7 @@ : state_(STATE_UNINITIALIZED), main_task_runner_(base::ThreadTaskRunnerHandle::Get()), media_task_runner_(std::move(media_task_runner)), - demuxer_stream_provider_(nullptr), + media_resource_(nullptr), client_(nullptr), controller_(controller), rpc_broker_(controller_->GetRpcBroker()), @@ -106,12 +106,12 @@ rpc_broker_, rpc_handle_)); } -void CourierRenderer::Initialize(DemuxerStreamProvider* demuxer_stream_provider, +void CourierRenderer::Initialize(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb) { VLOG(2) << __func__; DCHECK(media_task_runner_->BelongsToCurrentThread()); - DCHECK(demuxer_stream_provider); + DCHECK(media_resource); DCHECK(client); if (state_ != STATE_UNINITIALIZED) { @@ -120,14 +120,15 @@ return; } - demuxer_stream_provider_ = demuxer_stream_provider; + media_resource_ = media_resource; client_ = client; init_workflow_done_callback_ = init_cb; state_ = STATE_CREATE_PIPE; + // Create audio mojo data pipe handles if audio is available. DemuxerStream* audio_demuxer_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); + media_resource_->GetStream(DemuxerStream::AUDIO); std::unique_ptr<mojo::DataPipe> audio_data_pipe; if (audio_demuxer_stream) { audio_data_pipe = base::WrapUnique(DemuxerStreamAdapter::CreateDataPipe()); @@ -135,7 +136,7 @@ // Create video mojo data pipe handles if video is available. DemuxerStream* video_demuxer_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); + media_resource_->GetStream(DemuxerStream::VIDEO); std::unique_ptr<mojo::DataPipe> video_data_pipe; if (video_demuxer_stream) { video_data_pipe = base::WrapUnique(DemuxerStreamAdapter::CreateDataPipe()); @@ -327,7 +328,7 @@ // Create audio demuxer stream adapter if audio is available. DemuxerStream* audio_demuxer_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); + media_resource_->GetStream(DemuxerStream::AUDIO); if (audio_demuxer_stream && audio.is_valid() && audio_handle.is_valid() && audio_rpc_handle != RpcBroker::kInvalidHandle) { VLOG(2) << "Initialize audio"; @@ -340,7 +341,7 @@ // Create video demuxer stream adapter if video is available. DemuxerStream* video_demuxer_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); + media_resource_->GetStream(DemuxerStream::VIDEO); if (video_demuxer_stream && video.is_valid() && video_handle.is_valid() && video_rpc_handle != RpcBroker::kInvalidHandle) { VLOG(2) << "Initialize video";
diff --git a/media/remoting/courier_renderer.h b/media/remoting/courier_renderer.h index 62a06ee..43f3d14 100644 --- a/media/remoting/courier_renderer.h +++ b/media/remoting/courier_renderer.h
@@ -83,7 +83,7 @@ public: // media::Renderer implementation. - void Initialize(DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb) final; void SetCdm(CdmContext* cdm_context, @@ -169,7 +169,7 @@ // lock because it can be accessed from both media and render main thread. base::Lock time_lock_; - DemuxerStreamProvider* demuxer_stream_provider_; + MediaResource* media_resource_; RendererClient* client_; std::unique_ptr<DemuxerStreamAdapter> audio_demuxer_stream_adapter_; std::unique_ptr<DemuxerStreamAdapter> video_demuxer_stream_adapter_;
diff --git a/media/remoting/courier_renderer_unittest.cc b/media/remoting/courier_renderer_unittest.cc index 062a1f5..57fb46c 100644 --- a/media/remoting/courier_renderer_unittest.cc +++ b/media/remoting/courier_renderer_unittest.cc
@@ -11,7 +11,7 @@ #include "media/base/pipeline_status.h" #include "media/base/renderer_client.h" #include "media/base/test_helpers.h" -#include "media/remoting/fake_demuxer_stream_provider.h" +#include "media/remoting/fake_media_resource.h" #include "media/remoting/fake_remoter.h" #include "media/remoting/renderer_controller.h" #include "testing/gmock/include/gmock/gmock.h" @@ -229,14 +229,14 @@ void InitializeRenderer() { // Register media::RendererClient implementation. render_client_.reset(new RendererClientImpl()); - demuxer_stream_provider_.reset(new FakeDemuxerStreamProvider()); + media_resource_.reset(new FakeMediaResource()); EXPECT_CALL(*render_client_, OnPipelineStatus(_)).Times(1); DCHECK(renderer_); // Redirect RPC message for simulate receiver scenario controller_->GetRpcBroker()->SetMessageCallbackForTesting(base::Bind( &CourierRendererTest::RpcMessageResponseBot, base::Unretained(this))); RunPendingTasks(); - renderer_->Initialize(demuxer_stream_provider_.get(), render_client_.get(), + renderer_->Initialize(media_resource_.get(), render_client_.get(), base::Bind(&RendererClientImpl::OnPipelineStatus, base::Unretained(render_client_.get()))); RunPendingTasks(); @@ -333,7 +333,7 @@ base::MessageLoop message_loop_; std::unique_ptr<RendererController> controller_; std::unique_ptr<RendererClientImpl> render_client_; - std::unique_ptr<FakeDemuxerStreamProvider> demuxer_stream_provider_; + std::unique_ptr<FakeMediaResource> media_resource_; std::unique_ptr<CourierRenderer> renderer_; base::SimpleTestTickClock* clock_; // Owned by |renderer_|;
diff --git a/media/remoting/demuxer_stream_adapter_unittest.cc b/media/remoting/demuxer_stream_adapter_unittest.cc index 22c60e4..38187eb 100644 --- a/media/remoting/demuxer_stream_adapter_unittest.cc +++ b/media/remoting/demuxer_stream_adapter_unittest.cc
@@ -11,7 +11,7 @@ #include "base/run_loop.h" #include "media/base/decoder_buffer.h" #include "media/base/demuxer_stream.h" -#include "media/remoting/fake_demuxer_stream_provider.h" +#include "media/remoting/fake_media_resource.h" #include "media/remoting/fake_remoter.h" #include "media/remoting/proto_utils.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/media/remoting/fake_demuxer_stream_provider.cc b/media/remoting/fake_media_resource.cc similarity index 92% rename from media/remoting/fake_demuxer_stream_provider.cc rename to media/remoting/fake_media_resource.cc index 1064e93..16d7403 100644 --- a/media/remoting/fake_demuxer_stream_provider.cc +++ b/media/remoting/fake_media_resource.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "media/remoting/fake_demuxer_stream_provider.h" +#include "media/remoting/fake_media_resource.h" #include <vector> @@ -101,12 +101,12 @@ } } -FakeDemuxerStreamProvider::FakeDemuxerStreamProvider() +FakeMediaResource::FakeMediaResource() : demuxer_stream_(new FakeDemuxerStream(true)) {} -FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() {} +FakeMediaResource::~FakeMediaResource() {} -DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { +DemuxerStream* FakeMediaResource::GetStream(DemuxerStream::Type type) { if (type == DemuxerStream::AUDIO) return reinterpret_cast<DemuxerStream*>(demuxer_stream_.get()); return nullptr;
diff --git a/media/remoting/fake_demuxer_stream_provider.h b/media/remoting/fake_media_resource.h similarity index 79% rename from media/remoting/fake_demuxer_stream_provider.h rename to media/remoting/fake_media_resource.h index dfebff9..1132b5b 100644 --- a/media/remoting/fake_demuxer_stream_provider.h +++ b/media/remoting/fake_media_resource.h
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef MEDIA_REMOTING_FAKE_DEMUXER_STREAM_PROVIDER_H_ -#define MEDIA_REMOTING_FAKE_DEMUXER_STREAM_PROVIDER_H_ +#ifndef MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ +#define MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_ #include <deque> #include "media/base/audio_decoder_config.h" #include "media/base/demuxer_stream.h" -#include "media/base/demuxer_stream_provider.h" +#include "media/base/media_resource.h" #include "media/base/video_decoder_config.h" #include "testing/gmock/include/gmock/gmock.h" @@ -49,21 +49,21 @@ }; // Audio only demuxer stream provider -class FakeDemuxerStreamProvider : public DemuxerStreamProvider { +class FakeMediaResource : public MediaResource { public: - FakeDemuxerStreamProvider(); - ~FakeDemuxerStreamProvider() final; + FakeMediaResource(); + ~FakeMediaResource() final; - // DemuxerStreamProvider implementation. + // MediaResource implementation. DemuxerStream* GetStream(DemuxerStream::Type type) override; private: std::unique_ptr<FakeDemuxerStream> demuxer_stream_; - DISALLOW_COPY_AND_ASSIGN(FakeDemuxerStreamProvider); + DISALLOW_COPY_AND_ASSIGN(FakeMediaResource); }; } // namespace remoting } // namespace media -#endif // MEDIA_REMOTING_FAKE_DEMUXER_STREAM_PROVIDER_H_ +#endif // MEDIA_REMOTING_FAKE_MEDIA_RESOURCE_H_
diff --git a/media/renderers/renderer_impl.cc b/media/renderers/renderer_impl.cc index 5e990611..b10dbd0 100644 --- a/media/renderers/renderer_impl.cc +++ b/media/renderers/renderer_impl.cc
@@ -17,8 +17,8 @@ #include "media/base/audio_decoder_config.h" #include "media/base/audio_renderer.h" #include "media/base/bind_to_current_loop.h" -#include "media/base/demuxer_stream_provider.h" #include "media/base/media_log.h" +#include "media/base/media_resource.h" #include "media/base/media_switches.h" #include "media/base/renderer_client.h" #include "media/base/time_source.h" @@ -129,7 +129,7 @@ } } -void RendererImpl::Initialize(DemuxerStreamProvider* demuxer_stream_provider, +void RendererImpl::Initialize(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb) { DVLOG(1) << __func__; @@ -139,7 +139,7 @@ DCHECK(client); client_ = client; - demuxer_stream_provider_ = demuxer_stream_provider; + media_resource_ = media_resource; init_cb_ = init_cb; if (HasEncryptedStream() && !cdm_context_) { @@ -351,12 +351,12 @@ bool RendererImpl::HasEncryptedStream() { DemuxerStream* audio_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); + media_resource_->GetStream(DemuxerStream::AUDIO); if (audio_stream && audio_stream->audio_decoder_config().is_encrypted()) return true; DemuxerStream* video_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); + media_resource_->GetStream(DemuxerStream::VIDEO); if (video_stream && video_stream->video_decoder_config().is_encrypted()) return true; @@ -382,7 +382,7 @@ base::Bind(&RendererImpl::OnAudioRendererInitializeDone, weak_this_); DemuxerStream* audio_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::AUDIO); + media_resource_->GetStream(DemuxerStream::AUDIO); if (!audio_stream) { audio_renderer_.reset(); task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK)); @@ -431,7 +431,7 @@ base::Bind(&RendererImpl::OnVideoRendererInitializeDone, weak_this_); DemuxerStream* video_stream = - demuxer_stream_provider_->GetStream(DemuxerStream::VIDEO); + media_resource_->GetStream(DemuxerStream::VIDEO); if (!video_stream) { video_renderer_.reset(); task_runner_->PostTask(FROM_HERE, base::Bind(done_cb, PIPELINE_OK));
diff --git a/media/renderers/renderer_impl.h b/media/renderers/renderer_impl.h index 46fb71c..f55a763 100644 --- a/media/renderers/renderer_impl.h +++ b/media/renderers/renderer_impl.h
@@ -32,7 +32,7 @@ namespace media { class AudioRenderer; -class DemuxerStreamProvider; +class MediaResource; class TimeSource; class VideoRenderer; class WallClockTimeSource; @@ -50,7 +50,7 @@ ~RendererImpl() final; // Renderer implementation. - void Initialize(DemuxerStreamProvider* demuxer_stream_provider, + void Initialize(MediaResource* media_resource, RendererClient* client, const PipelineStatusCB& init_cb) final; void SetCdm(CdmContext* cdm_context, @@ -154,7 +154,7 @@ // Task runner used to execute pipeline tasks. scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - DemuxerStreamProvider* demuxer_stream_provider_; + MediaResource* media_resource_; RendererClient* client_; // Temporary callback used for Initialize() and Flush().
diff --git a/media/renderers/renderer_impl_unittest.cc b/media/renderers/renderer_impl_unittest.cc index 3fc7430..80d8dc7 100644 --- a/media/renderers/renderer_impl_unittest.cc +++ b/media/renderers/renderer_impl_unittest.cc
@@ -162,13 +162,13 @@ CreateAudioStream(); SetAudioRendererInitializeExpectations(PIPELINE_OK); // There is a potential race between HTMLMediaElement/WMPI shutdown and - // renderers being initialized which might result in DemuxerStreamProvider - // GetStream suddenly returning NULL (see crbug.com/668604). So we are going - // to check here that GetStream will be invoked exactly 3 times during - // RendererImpl initialization to help catch potential issues. Currently the - // GetStream is invoked once directly from RendererImpl::Initialize, once - // indirectly from RendererImpl::Initialize via HasEncryptedStream and once - // from RendererImpl::InitializeAudioRenderer. + // renderers being initialized which might result in MediaResource GetStream + // suddenly returning NULL (see crbug.com/668604). So we are going to check + // here that GetStream will be invoked exactly 3 times during RendererImpl + // initialization to help catch potential issues. Currently the GetStream is + // invoked once directly from RendererImpl::Initialize, once indirectly from + // RendererImpl::Initialize via HasEncryptedStream and once from + // RendererImpl::InitializeAudioRenderer. EXPECT_CALL(*demuxer_, GetStream(DemuxerStream::AUDIO)) .Times(2) .WillRepeatedly(Return(audio_stream_.get())); @@ -179,13 +179,13 @@ CreateVideoStream(); SetVideoRendererInitializeExpectations(PIPELINE_OK); // There is a potential race between HTMLMediaElement/WMPI shutdown and - // renderers being initialized which might result in DemuxerStreamProvider - // GetStream suddenly returning NULL (see crbug.com/668604). So we are going - // to check here that GetStream will be invoked exactly 3 times during - // RendererImpl initialization to help catch potential issues. Currently the - // GetStream is invoked once directly from RendererImpl::Initialize, once - // indirectly from RendererImpl::Initialize via HasEncryptedStream and once - // from RendererImpl::InitializeVideoRenderer. + // renderers being initialized which might result in MediaResource GetStream + // suddenly returning NULL (see crbug.com/668604). So we are going to check + // here that GetStream will be invoked exactly 3 times during RendererImpl + // initialization to help catch potential issues. Currently the GetStream is + // invoked once directly from RendererImpl::Initialize, once indirectly from + // RendererImpl::Initialize via HasEncryptedStream and once from + // RendererImpl::InitializeVideoRenderer. EXPECT_CALL(*demuxer_, GetStream(DemuxerStream::VIDEO)) .Times(2) .WillRepeatedly(Return(video_stream_.get()));
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.cc b/mojo/public/cpp/bindings/lib/multiplex_router.cc index d8e67f7..2d8c53e 100644 --- a/mojo/public/cpp/bindings/lib/multiplex_router.cc +++ b/mojo/public/cpp/bindings/lib/multiplex_router.cc
@@ -274,69 +274,51 @@ DISALLOW_COPY_AND_ASSIGN(InterfaceEndpoint); }; -// Message objects cannot be destroyed under the router's lock, if they contain -// ScopedInterfaceEndpointHandle objects. -// IncomingMessageWrapper is used to wrap messages which haven't got the payload -// interface IDs deserialized into ScopedInterfaceEndpointHandles. Wrapper -// objects are always destroyed under the router's lock. When a wrapper is -// destroyed and the message hasn't been consumed, the wrapper is responsible -// to send endpoint closed notifications. -class MultiplexRouter::IncomingMessageWrapper { +// MessageWrapper objects are always destroyed under the router's lock. On +// destruction, if the message it wrappers contains +// ScopedInterfaceEndpointHandles (which cannot be destructed under the +// router's lock), the wrapper unlocks to clean them up. +class MultiplexRouter::MessageWrapper { public: - IncomingMessageWrapper() = default; + MessageWrapper() = default; - IncomingMessageWrapper(MultiplexRouter* router, Message* message) - : router_(router), value_(std::move(*message)) { - DCHECK(value_.associated_endpoint_handles()->empty()); - } + MessageWrapper(MultiplexRouter* router, Message message) + : router_(router), value_(std::move(message)) {} - IncomingMessageWrapper(IncomingMessageWrapper&& other) + MessageWrapper(MessageWrapper&& other) : router_(other.router_), value_(std::move(other.value_)) {} - ~IncomingMessageWrapper() { - if (value_.IsNull()) + ~MessageWrapper() { + if (value_.associated_endpoint_handles()->empty()) return; router_->AssertLockAcquired(); - - uint32_t num_ids = value_.payload_num_interface_ids(); - const uint32_t* ids = value_.payload_interface_ids(); - for (uint32_t i = 0; i < num_ids; ++i) { + { MayAutoUnlock unlocker(router_->lock_.get()); - router_->control_message_proxy_.NotifyPeerEndpointClosed(ids[i], - base::nullopt); + value_.mutable_associated_endpoint_handles()->clear(); } } - IncomingMessageWrapper& operator=(IncomingMessageWrapper&& other) { + MessageWrapper& operator=(MessageWrapper&& other) { router_ = other.router_; value_ = std::move(other.value_); return *this; } - // Must be called outside of the router's lock. - bool TakeMessage(Message* output) { - DCHECK(!value_.IsNull()); - - *output = std::move(value_); - return output->DeserializeAssociatedEndpointHandles(router_); - } - - const Message& value() const { return value_; } + Message& value() { return value_; } private: MultiplexRouter* router_ = nullptr; - // It must not hold any ScopedInterfaceEndpointHandle objects. Message value_; - DISALLOW_COPY_AND_ASSIGN(IncomingMessageWrapper); + DISALLOW_COPY_AND_ASSIGN(MessageWrapper); }; struct MultiplexRouter::Task { public: // Doesn't take ownership of |message| but takes its contents. static std::unique_ptr<Task> CreateMessageTask( - IncomingMessageWrapper message_wrapper) { + MessageWrapper message_wrapper) { Task* task = new Task(MESSAGE); task->message_wrapper = std::move(message_wrapper); return base::WrapUnique(task); @@ -353,7 +335,7 @@ bool IsMessageTask() const { return type == MESSAGE; } bool IsNotifyErrorTask() const { return type == NOTIFY_ERROR; } - IncomingMessageWrapper message_wrapper; + MessageWrapper message_wrapper; scoped_refptr<InterfaceEndpoint> endpoint_to_notify; enum Type { MESSAGE, NOTIFY_ERROR }; @@ -461,6 +443,7 @@ if (encountered_error_) UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED); + endpoint->set_handle_created(); *local_endpoint = CreateScopedInterfaceEndpointHandle(id, true); *remote_endpoint = CreateScopedInterfaceEndpointHandle(id, false); } @@ -629,34 +612,36 @@ bool MultiplexRouter::Accept(Message* message) { DCHECK(thread_checker_.CalledOnValidThread()); + if (!message->DeserializeAssociatedEndpointHandles(this)) + return false; + scoped_refptr<MultiplexRouter> protector(this); MayAutoLock locker(lock_.get()); DCHECK(!paused_); - IncomingMessageWrapper message_wrapper(this, message); - ClientCallBehavior client_call_behavior = connector_.during_sync_handle_watcher_callback() ? ALLOW_DIRECT_CLIENT_CALLS_FOR_SYNC_MESSAGES : ALLOW_DIRECT_CLIENT_CALLS; - bool processed = tasks_.empty() && ProcessIncomingMessage( - &message_wrapper, client_call_behavior, - connector_.task_runner()); + bool processed = + tasks_.empty() && ProcessIncomingMessage(message, client_call_behavior, + connector_.task_runner()); if (!processed) { // Either the task queue is not empty or we cannot process the message // directly. In both cases, there is no need to call ProcessTasks(). - tasks_.push_back(Task::CreateMessageTask(std::move(message_wrapper))); + tasks_.push_back( + Task::CreateMessageTask(MessageWrapper(this, std::move(*message)))); Task* task = tasks_.back().get(); if (task->message_wrapper.value().has_flag(Message::kFlagIsSync)) { InterfaceId id = task->message_wrapper.value().interface_id(); sync_message_tasks_[id].push_back(task); - auto iter = endpoints_.find(id); - if (iter != endpoints_.end()) - iter->second->SignalSyncMessageEvent(); + InterfaceEndpoint* endpoint = FindEndpoint(id); + if (endpoint) + endpoint->SignalSyncMessageEvent(); } } else if (!tasks_.empty()) { // Processing the message may result in new tasks (for error notification) @@ -767,7 +752,7 @@ task->IsNotifyErrorTask() ? ProcessNotifyErrorTask(task.get(), client_call_behavior, current_task_runner) - : ProcessIncomingMessage(&task->message_wrapper, + : ProcessIncomingMessage(&task->message_wrapper.value(), client_call_behavior, current_task_runner); if (!processed) { @@ -801,11 +786,12 @@ iter->second.pop_front(); DCHECK(task->IsMessageTask()); - IncomingMessageWrapper message_wrapper = std::move(task->message_wrapper); + MessageWrapper message_wrapper = std::move(task->message_wrapper); // Note: after this call, |task| and |iter| may be invalidated. bool processed = ProcessIncomingMessage( - &message_wrapper, ALLOW_DIRECT_CLIENT_CALLS_FOR_SYNC_MESSAGES, nullptr); + &message_wrapper.value(), ALLOW_DIRECT_CLIENT_CALLS_FOR_SYNC_MESSAGES, + nullptr); DCHECK(processed); iter = sync_message_tasks_.find(id); @@ -857,29 +843,26 @@ } bool MultiplexRouter::ProcessIncomingMessage( - IncomingMessageWrapper* message_wrapper, + Message* message, ClientCallBehavior client_call_behavior, base::SingleThreadTaskRunner* current_task_runner) { DCHECK(!current_task_runner || current_task_runner->BelongsToCurrentThread()); DCHECK(!paused_); - DCHECK(message_wrapper); + DCHECK(message); AssertLockAcquired(); - if (message_wrapper->value().IsNull()) { + if (message->IsNull()) { // This is a sync message and has been processed during sync handle // watching. return true; } - if (PipeControlMessageHandler::IsPipeControlMessage( - &message_wrapper->value())) { + if (PipeControlMessageHandler::IsPipeControlMessage(message)) { bool result = false; { MayAutoUnlock unlocker(lock_.get()); - Message message; - result = message_wrapper->TakeMessage(&message) && - control_message_handler_.Accept(&message); + result = control_message_handler_.Accept(message); } if (!result) @@ -888,34 +871,11 @@ return true; } - InterfaceId id = message_wrapper->value().interface_id(); + InterfaceId id = message->interface_id(); DCHECK(IsValidInterfaceId(id)); - bool inserted = false; - InterfaceEndpoint* endpoint = FindOrInsertEndpoint(id, &inserted); - if (inserted) { - // Currently, it is legitimate to receive messages for an endpoint - // that is not registered. For example, the endpoint is transferred in - // a message that is discarded. Once we add support to specify all - // enclosing endpoints in message header, we should be able to remove - // this. - UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED); - - // It is also possible that this newly-inserted endpoint is the master - // endpoint. When the master InterfacePtr/Binding goes away, the message - // pipe is closed and we explicitly trigger a pipe connection error. The - // error updates all the endpoints, including the master endpoint, with - // PEER_ENDPOINT_CLOSED and removes the master endpoint from the - // registration. We continue to process remaining tasks in the queue, as - // long as there are refs keeping the router alive. If there are remaining - // messages for the master endpoint, we will get here. - MayAutoUnlock unlocker(lock_.get()); - if (!IsMasterInterfaceId(id)) - control_message_proxy_.NotifyPeerEndpointClosed(id, base::nullopt); - return true; - } - - if (endpoint->closed()) + InterfaceEndpoint* endpoint = FindEndpoint(id); + if (!endpoint || endpoint->closed()) return true; if (!endpoint->client()) { @@ -925,7 +885,7 @@ } bool can_direct_call; - if (message_wrapper->value().has_flag(Message::kFlagIsSync)) { + if (message->has_flag(Message::kFlagIsSync)) { can_direct_call = client_call_behavior != NO_DIRECT_CLIENT_CALLS && endpoint->task_runner()->BelongsToCurrentThread(); } else { @@ -950,9 +910,7 @@ // It is safe to call into |client| without the lock. Because |client| is // always accessed on the same thread, including DetachEndpointClient(). MayAutoUnlock unlocker(lock_.get()); - Message message; - result = message_wrapper->TakeMessage(&message) && - client->HandleIncomingMessage(&message); + result = client->HandleIncomingMessage(message); } if (!result) RaiseErrorInNonTestingMode(); @@ -1014,20 +972,24 @@ // false. DCHECK(!inserted || !*inserted); - auto iter = endpoints_.find(id); - InterfaceEndpoint* endpoint; - if (iter == endpoints_.end()) { + InterfaceEndpoint* endpoint = FindEndpoint(id); + if (!endpoint) { endpoint = new InterfaceEndpoint(this, id); endpoints_[id] = endpoint; if (inserted) *inserted = true; - } else { - endpoint = iter->second.get(); } return endpoint; } +MultiplexRouter::InterfaceEndpoint* MultiplexRouter::FindEndpoint( + InterfaceId id) { + AssertLockAcquired(); + auto iter = endpoints_.find(id); + return iter != endpoints_.end() ? iter->second.get() : nullptr; +} + void MultiplexRouter::AssertLockAcquired() { #if DCHECK_IS_ON() if (lock_)
diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.h b/mojo/public/cpp/bindings/lib/multiplex_router.h index ac10f93..3d7806c 100644 --- a/mojo/public/cpp/bindings/lib/multiplex_router.h +++ b/mojo/public/cpp/bindings/lib/multiplex_router.h
@@ -154,7 +154,7 @@ private: class InterfaceEndpoint; - class IncomingMessageWrapper; + class MessageWrapper; struct Task; ~MultiplexRouter() override; @@ -209,7 +209,7 @@ ClientCallBehavior client_call_behavior, base::SingleThreadTaskRunner* current_task_runner); bool ProcessIncomingMessage( - IncomingMessageWrapper* message_wrapper, + Message* message, ClientCallBehavior client_call_behavior, base::SingleThreadTaskRunner* current_task_runner); @@ -226,6 +226,7 @@ void RaiseErrorInNonTestingMode(); InterfaceEndpoint* FindOrInsertEndpoint(InterfaceId id, bool* inserted); + InterfaceEndpoint* FindEndpoint(InterfaceId id); void AssertLockAcquired();
diff --git a/net/BUILD.gn b/net/BUILD.gn index 8a7ee89e..c550ba7 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -4689,8 +4689,8 @@ "tools/content_decoder_tool/content_decoder_tool.h", "tools/content_decoder_tool/content_decoder_tool_unittest.cc", "tools/quic/quic_simple_client_test.cc", - "tools/quic/test_tools/mock_quic_server_session_visitor.cc", - "tools/quic/test_tools/mock_quic_server_session_visitor.h", + "tools/quic/test_tools/mock_quic_session_visitor.cc", + "tools/quic/test_tools/mock_quic_session_visitor.h", "tools/tld_cleanup/tld_cleanup_util_unittest.cc", "url_request/report_sender_unittest.cc", "url_request/sdch_dictionary_fetcher_unittest.cc",
diff --git a/net/cert/test_root_certs.h b/net/cert/test_root_certs.h index 53dd5f5..c403dea 100644 --- a/net/cert/test_root_certs.h +++ b/net/cert/test_root_certs.h
@@ -48,8 +48,9 @@ // Returns true if an instance exists, without forcing an initialization. static bool HasInstance(); - // Marks |certificate| as trusted for X509Certificate::Verify(). Returns - // false if the certificate could not be marked trusted. + // Marks |certificate| as trusted in the effective trust store + // used by CertVerifier::Verify(). Returns false if the + // certificate could not be marked trusted. bool Add(X509Certificate* certificate); // Reads a single certificate from |file| and marks it as trusted. Returns @@ -150,7 +151,9 @@ class NET_EXPORT_PRIVATE ScopedTestRoot { public: ScopedTestRoot(); - // Creates a ScopedTestRoot that will add |cert| to the TestRootCerts store. + // Creates a ScopedTestRoot that sets |cert| as the single root in the + // TestRootCerts store (if there were existing roots they are + // cleared). explicit ScopedTestRoot(X509Certificate* cert); ~ScopedTestRoot();
diff --git a/net/http/disk_cache_based_quic_server_info_unittest.cc b/net/http/disk_cache_based_quic_server_info_unittest.cc index d4d338e..55f5835 100644 --- a/net/http/disk_cache_based_quic_server_info_unittest.cc +++ b/net/http/disk_cache_based_quic_server_info_unittest.cc
@@ -94,7 +94,7 @@ // Use the blocking mock backend factory to force asynchronous completion // of quic_server_info->WaitForDataReady(), so that the callback will run. MockBlockingBackendFactory* factory = new MockBlockingBackendFactory(); - MockHttpCache cache(base::WrapUnique(factory)); + MockHttpCache cache(base::WrapUnique(factory), true); QuicServerId server_id("www.verisign.com", 443, PRIVACY_MODE_DISABLED); std::unique_ptr<QuicServerInfo> quic_server_info( new DiskCacheBasedQuicServerInfo(server_id, cache.http_cache())); @@ -109,7 +109,7 @@ // Tests the basic logic of storing, retrieving and updating data. TEST(DiskCacheBasedQuicServerInfo, Update) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -180,7 +180,7 @@ // Test that demonstrates different info is returned when the ports differ. TEST(DiskCacheBasedQuicServerInfo, UpdateDifferentPorts) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); AddMockTransaction(&kHostInfoTransaction2); TestCompletionCallback callback; @@ -281,7 +281,7 @@ // Test IsReadyToPersist when there is a pending write. TEST(DiskCacheBasedQuicServerInfo, IsReadyToPersist) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -343,7 +343,7 @@ // Test multiple calls to Persist. TEST(DiskCacheBasedQuicServerInfo, MultiplePersist) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -433,7 +433,7 @@ TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReady) { MockBlockingBackendFactory* factory = new MockBlockingBackendFactory(); - MockHttpCache cache(base::WrapUnique(factory)); + MockHttpCache cache(base::WrapUnique(factory), true); TestCompletionCallback callback; QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED); std::unique_ptr<QuicServerInfo> quic_server_info( @@ -451,7 +451,7 @@ } TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyButDataIsReady) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -470,7 +470,7 @@ TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyAfterDeleteCache) { std::unique_ptr<QuicServerInfo> quic_server_info; { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -491,7 +491,7 @@ // Test Start() followed by Persist() without calling WaitForDataReady. TEST(DiskCacheBasedQuicServerInfo, StartAndPersist) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED); @@ -557,7 +557,7 @@ // persists the data when Start() finishes. TEST(DiskCacheBasedQuicServerInfo, PersistWhenNotReadyToPersist) { MockBlockingBackendFactory* factory = new MockBlockingBackendFactory(); - MockHttpCache cache(base::WrapUnique(factory)); + MockHttpCache cache(base::WrapUnique(factory), true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -618,7 +618,7 @@ // Test multiple calls to Persist without waiting for the data to be written. TEST(DiskCacheBasedQuicServerInfo, MultiplePersistsWithoutWaiting) { - MockHttpCache cache; + MockHttpCache cache(true); AddMockTransaction(&kHostInfoTransaction1); TestCompletionCallback callback; @@ -704,7 +704,7 @@ // Use the blocking mock backend factory to force asynchronous completion // of quic_server_info->WaitForDataReady(), so that the callback will run. MockBlockingBackendFactory* factory = new MockBlockingBackendFactory(); - MockHttpCache cache(base::WrapUnique(factory)); + MockHttpCache cache(base::WrapUnique(factory), true); QuicServerId server_id("www.verisign.com", 443, PRIVACY_MODE_DISABLED); QuicServerInfo* quic_server_info = new DiskCacheBasedQuicServerInfo(server_id, cache.http_cache());
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index effbf45f..c30a785a 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -16524,80 +16524,4 @@ } #endif // !defined(OS_IOS) -// Test a SPDY CONNECT through an HTTPS Proxy to plaintext WebSocket Server. -TEST_F(HttpNetworkTransactionTest, PlaintextWebsocketOverSpdyProxy) { - HttpRequestInfo request; - request.method = "GET"; - request.url = GURL("ws://www.example.org/"); - AddWebSocketHeaders(&request.extra_headers); - - // Configure against https proxy server "proxy:70". - session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); - BoundTestNetLog log; - session_deps_.net_log = log.bound().net_log(); - std::unique_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - - HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); - FakeWebSocketStreamCreateHelper websocket_stream_create_helper; - trans.SetWebSocketHandshakeStreamCreateHelper( - &websocket_stream_create_helper); - - // CONNECT to www.example.org:443 via SPDY - SpdySerializedFrame connect(spdy_util_.ConstructSpdyConnect( - nullptr, 0, 1, LOWEST, HostPortPair("www.example.org", 80))); - const char req[] = - "GET / HTTP/1.1\r\n" - "Host: www.example.org\r\n" - "Connection: Upgrade\r\n" - "Upgrade: websocket\r\n" - "Origin: http://www.example.org\r\n" - "Sec-WebSocket-Version: 13\r\n" - "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n\r\n"; - SpdySerializedFrame wrapped_ws_req( - spdy_util_.ConstructSpdyDataFrame(1, req, strlen(req), false)); - SpdySerializedFrame conn_resp( - spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); - const char resp[] = - "HTTP/1.1 101 Switching Protocols\r\n" - "Upgrade: websocket\r\n" - "Connection: Upgrade\r\n" - "Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n\r\n"; - SpdySerializedFrame wrapped_ws_resp( - spdy_util_.ConstructSpdyDataFrame(1, resp, strlen(resp), false)); - SpdySerializedFrame window_update( - spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_ws_resp.size())); - - MockWrite spdy_writes[] = { - CreateMockWrite(connect, 0), CreateMockWrite(wrapped_ws_req, 2), - CreateMockWrite(window_update, 4), - }; - - MockRead spdy_reads[] = { - CreateMockRead(conn_resp, 1, ASYNC), - CreateMockRead(wrapped_ws_resp, 3, ASYNC), MockRead(ASYNC, 0, 5), - }; - - SequencedSocketData spdy_data(spdy_reads, arraysize(spdy_reads), spdy_writes, - arraysize(spdy_writes)); - session_deps_.socket_factory->AddSocketDataProvider(&spdy_data); - - SSLSocketDataProvider ssl(ASYNC, OK); - ssl.next_proto = kProtoHTTP2; - session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); - - TestCompletionCallback callback; - - int rv = trans.Start(&request, callback.callback(), log.bound()); - EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - - rv = callback.WaitForResult(); - ASSERT_THAT(rv, IsOk()); - - const HttpResponseInfo* response = trans.GetResponseInfo(); - ASSERT_TRUE(response); - ASSERT_TRUE(response->headers); - EXPECT_EQ("HTTP/1.1 101 Switching Protocols", - response->headers->GetStatusLine()); -} - } // namespace net
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc index dfcd04e..e94c7ca 100644 --- a/net/http/http_server_properties_manager.cc +++ b/net/http/http_server_properties_manager.cc
@@ -16,6 +16,7 @@ #include "base/values.h" #include "net/base/ip_address.h" #include "net/base/port_util.h" +#include "net/quic/platform/api/quic_url_utils.h" #include "url/gurl.h" namespace net { @@ -714,7 +715,8 @@ it.Advance()) { // Get quic_server_id. const std::string& quic_server_id_str = it.key(); - QuicServerId quic_server_id = QuicServerId::FromString(quic_server_id_str); + QuicServerId quic_server_id; + QuicUrlUtils::StringToQuicServerId(quic_server_id_str, &quic_server_id); if (quic_server_id.host().empty()) { DVLOG(1) << "Malformed http_server_properties for quic server: " << quic_server_id_str;
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 7cff730..38497c1 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc
@@ -1195,16 +1195,8 @@ if (connection_->socket() && !connection_->is_reused()) SetSocketMotivation(); - if (!using_spdy_) + if (!using_spdy_) { DCHECK(!IsSpdyAlternative()); - - // While websockets over HTTP/2 are not supported, it is still valid to have - // websockets tunneled through HTTP/2 proxy (via CONNECT). If websockets are - // secure (wss://), ProxyClientSocket with established tunnel is wrapped with - // yet another socket (SSLClientSocket), and |using_spdy_| will be false, but - // for ws: scheme, ProxyClientSocket is not wrapped into anything. - if (!using_spdy_ || - (using_spdy_ && proxy_info_.is_https() && delegate_->for_websockets())) { // We may get ftp scheme when fetching ftp resources through proxy. bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) && (request_info_.url.SchemeIs(url::kHttpScheme) ||
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index 9fc8ced..d7c08bac 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc
@@ -540,14 +540,22 @@ //----------------------------------------------------------------------------- -MockHttpCache::MockHttpCache() - : MockHttpCache(base::MakeUnique<MockBackendFactory>()) {} +MockHttpCache::MockHttpCache() : MockHttpCache(false) {} MockHttpCache::MockHttpCache( std::unique_ptr<HttpCache::BackendFactory> disk_cache_factory) + : MockHttpCache(std::move(disk_cache_factory), false) {} + +MockHttpCache::MockHttpCache(bool set_up_quic_server_info) + : MockHttpCache(base::MakeUnique<MockBackendFactory>(), + set_up_quic_server_info) {} + +MockHttpCache::MockHttpCache( + std::unique_ptr<HttpCache::BackendFactory> disk_cache_factory, + bool set_up_quic_server_info) : http_cache_(base::MakeUnique<MockNetworkLayer>(), std::move(disk_cache_factory), - true) {} + set_up_quic_server_info) {} disk_cache::Backend* MockHttpCache::backend() { TestCompletionCallback cb;
diff --git a/net/http/mock_http_cache.h b/net/http/mock_http_cache.h index 7cf03db4..ebf67fe 100644 --- a/net/http/mock_http_cache.h +++ b/net/http/mock_http_cache.h
@@ -182,6 +182,12 @@ MockHttpCache(); explicit MockHttpCache( std::unique_ptr<HttpCache::BackendFactory> disk_cache_factory); + // |set_up_quic_server_info| if set, will set a quic server info factory + // adptor. + explicit MockHttpCache(bool set_up_quic_server_info); + + MockHttpCache(std::unique_ptr<HttpCache::BackendFactory> disk_cache_factory, + bool set_up_quic_server_info); HttpCache* http_cache() { return &http_cache_; }
diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h index 7948240c..bfdc094 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h
@@ -670,6 +670,18 @@ // } EVENT_TYPE(EV_CERT_CT_COMPLIANCE_CHECKED) +// A Certificate Transparency log entry was audited for inclusion in the +// log. +// +// The following parameters are attached to the event: +// { +// "log_entry": <hex-encoded hash of the log entry> +// "log_id": <hex-encoded hash of the CT log> +// "success": <boolean> +// } + +EVENT_TYPE(CT_LOG_ENTRY_AUDITED) + // ------------------------------------------------------------------------ // DatagramSocket // ------------------------------------------------------------------------
diff --git a/net/log/net_log_source_type_list.h b/net/log/net_log_source_type_list.h index 91a4786..878cda9 100644 --- a/net/log/net_log_source_type_list.h +++ b/net/log/net_log_source_type_list.h
@@ -38,3 +38,4 @@ SOURCE_TYPE(BIDIRECTIONAL_STREAM) SOURCE_TYPE(NETWORK_QUALITY_ESTIMATOR) SOURCE_TYPE(HTTP_STREAM_JOB_CONTROLLER) +SOURCE_TYPE(CT_TREE_STATE_TRACKER)
diff --git a/net/quic/core/quic_blocked_writer_interface.h b/net/quic/core/quic_blocked_writer_interface.h index 3a85b80..2da2eb4 100644 --- a/net/quic/core/quic_blocked_writer_interface.h +++ b/net/quic/core/quic_blocked_writer_interface.h
@@ -9,8 +9,6 @@ #ifndef NET_QUIC_CORE_QUIC_BLOCKED_WRITER_INTERFACE_H_ #define NET_QUIC_CORE_QUIC_BLOCKED_WRITER_INTERFACE_H_ -#include <cstddef> - #include "net/quic/platform/api/quic_export.h" namespace net {
diff --git a/net/quic/core/quic_client_promised_info.cc b/net/quic/core/quic_client_promised_info.cc index a08ff45..ebc6d18 100644 --- a/net/quic/core/quic_client_promised_info.cc +++ b/net/quic/core/quic_client_promised_info.cc
@@ -7,8 +7,6 @@ #include "net/quic/core/spdy_utils.h" #include "net/quic/platform/api/quic_logging.h" -using net::SpdyHeaderBlock; -using net::kPushPromiseTimeoutSecs; using std::string; namespace net {
diff --git a/net/quic/core/quic_client_session_base.h b/net/quic/core/quic_client_session_base.h index 76aa4374..7cb6610 100644 --- a/net/quic/core/quic_client_session_base.h +++ b/net/quic/core/quic_client_session_base.h
@@ -65,15 +65,15 @@ // Called by |QuicSpdyClientStream| on receipt of PUSH_PROMISE, does // some session level validation and creates the // |QuicClientPromisedInfo| inserting into maps by (promised) id and - // url. Returns true if a new push promise is accepted. Reset the promised - // stream and returns false otherwiese. + // url. Returns true if a new push promise is accepted. Resets the promised + // stream and returns false otherwise. virtual bool HandlePromised(QuicStreamId associated_id, QuicStreamId promised_id, const SpdyHeaderBlock& headers); // For cross-origin server push, this should verify the server is // authoritative per [RFC2818], Section 3. Roughly, subjectAltName - // std::list in the certificate should contain a matching DNS name, or IP + // list in the certificate should contain a matching DNS name, or IP // address. |hostname| is derived from the ":authority" header field of // the PUSH_PROMISE frame, port if present there will be dropped. virtual bool IsAuthorized(const std::string& hostname) = 0;
diff --git a/net/quic/core/quic_config.h b/net/quic/core/quic_config.h index e2388108..286ba1c 100644 --- a/net/quic/core/quic_config.h +++ b/net/quic/core/quic_config.h
@@ -5,9 +5,8 @@ #ifndef NET_QUIC_CORE_QUIC_CONFIG_H_ #define NET_QUIC_CORE_QUIC_CONFIG_H_ -#include <stddef.h> -#include <stdint.h> - +#include <cstddef> +#include <cstdint> #include <string> #include "net/quic/core/quic_packets.h"
diff --git a/net/quic/core/quic_config_test.cc b/net/quic/core/quic_config_test.cc index 9cf0f33..4445e00 100644 --- a/net/quic/core/quic_config_test.cc +++ b/net/quic/core/quic_config_test.cc
@@ -6,7 +6,6 @@ #include "net/quic/core/crypto/crypto_handshake_message.h" #include "net/quic/core/crypto/crypto_protocol.h" -#include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_packets.h" #include "net/quic/core/quic_time.h" #include "net/quic/core/quic_utils.h"
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc index 1f867c9d..3bc93ab 100644 --- a/net/quic/core/quic_connection.cc +++ b/net/quic/core/quic_connection.cc
@@ -1305,7 +1305,7 @@ if (!Near(header.packet_number, last_header_.packet_number)) { QUIC_DLOG(INFO) << ENDPOINT << "Packet " << header.packet_number << " out of bounds. Discarding"; - CloseConnection(QUIC_INVALID_PACKET_HEADER, "packet number out of bounds.", + CloseConnection(QUIC_INVALID_PACKET_HEADER, "Packet number out of bounds.", ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); return false; } @@ -1641,7 +1641,6 @@ const string error_details = QuicStrCat( "Write failed with error: ", error_code, " (", strerror(error_code), ")"); QUIC_LOG_FIRST_N(ERROR, 2) << ENDPOINT << error_details; - // We can't send an error as the socket is presumably borked. switch (error_code) { case kMessageTooBigErrorCode: CloseConnection( @@ -1690,8 +1689,9 @@ sent_packet_manager_.GetRttStats()->initial_rtt_us()); } - if (debug_visitor_) + if (debug_visitor_ != nullptr) { debug_visitor_->OnRttChanged(rtt); + } } void QuicConnection::OnPathDegrading() {
diff --git a/net/quic/core/quic_connection.h b/net/quic/core/quic_connection.h index 37182bd..6604c77 100644 --- a/net/quic/core/quic_connection.h +++ b/net/quic/core/quic_connection.h
@@ -16,9 +16,8 @@ #ifndef NET_QUIC_CORE_QUIC_CONNECTION_H_ #define NET_QUIC_CORE_QUIC_CONNECTION_H_ -#include <stddef.h> -#include <stdint.h> - +#include <cstddef> +#include <cstdint> #include <deque> #include <list> #include <map> @@ -52,6 +51,7 @@ class QuicClock; class QuicConfig; class QuicConnection; +class QuicDecrypter; class QuicEncrypter; class QuicRandom; @@ -170,7 +170,7 @@ TransmissionType transmission_type, QuicTime sent_time) {} - // Called when an PING frame has been sent. + // Called when a PING frame has been sent. virtual void OnPingSent() {} // Called when a packet has been received, but before it is @@ -483,7 +483,10 @@ debug_visitor_ = debug_visitor; sent_packet_manager_.SetDebugDelegate(debug_visitor); } + // Used in Chromium, but not internally. + // Must only be called before ping_alarm_ is set. void set_ping_timeout(QuicTime::Delta ping_timeout) { + DCHECK(!ping_alarm_->IsSet()); ping_timeout_ = ping_timeout; } const QuicTime::Delta ping_timeout() { return ping_timeout_; } @@ -760,12 +763,11 @@ bool WritePacket(SerializedPacket* packet); // Make sure an ack we got from our peer is sane. - // Returns nullptr for valid acks or an error std::string if it was invalid. + // Returns nullptr for valid acks or an error string if it was invalid. const char* ValidateAckFrame(const QuicAckFrame& incoming_ack); // Make sure a stop waiting we got from our peer is sane. - // Returns nullptr if the frame is valid or an error std::string if it was - // invalid. + // Returns nullptr if the frame is valid or an error string if it was invalid. const char* ValidateStopWaitingFrame( const QuicStopWaitingFrame& stop_waiting); @@ -914,7 +916,7 @@ bool pending_version_negotiation_packet_; // When packets could not be sent because the socket was not writable, - // they are added to this std::list. All corresponding frames are in + // they are added to this list. All corresponding frames are in // unacked_packets_ if they are to be retransmitted. Packets encrypted_buffer // fields are owned by the QueuedPacketList, in order to ensure they outlast // the original scope of the SerializedPacket. @@ -981,7 +983,7 @@ // An alarm that is scheduled when the connection can still write and there // may be more data to send. // TODO(ianswett): Remove resume_writes_alarm when deprecating - // FLAGS_quic_only_one_sending_alarm + // FLAGS_quic_reloadable_flag_quic_only_one_sending_alarm QuicArenaScopedPtr<QuicAlarm> resume_writes_alarm_; // An alarm that fires when the connection may have timed out. QuicArenaScopedPtr<QuicAlarm> timeout_alarm_;
diff --git a/net/quic/core/quic_constants.h b/net/quic/core/quic_constants.h index 9783db06..8560e90 100644 --- a/net/quic/core/quic_constants.h +++ b/net/quic/core/quic_constants.h
@@ -27,6 +27,7 @@ // Default initial maximum size in bytes of a QUIC packet. const QuicByteCount kDefaultMaxPacketSize = 1350; +// Default initial maximum size in bytes of a QUIC packet for servers. const QuicByteCount kDefaultServerMaxPacketSize = 1000; // The maximum packet size of any QUIC packet, based on ethernet's max size, // minus the IP and UDP headers. IPv6 has a 40 byte header, UDP adds an
diff --git a/net/quic/core/quic_crypto_client_stream.cc b/net/quic/core/quic_crypto_client_stream.cc index 7db937c..f7fba760 100644 --- a/net/quic/core/quic_crypto_client_stream.cc +++ b/net/quic/core/quic_crypto_client_stream.cc
@@ -5,7 +5,6 @@ #include "net/quic/core/quic_crypto_client_stream.h" #include <memory> -#include <vector> #include "base/metrics/histogram_macros.h" #include "base/metrics/sparse_histogram.h" @@ -235,7 +234,7 @@ DoInitializeServerConfigUpdate(cached); break; case STATE_NONE: - NOTREACHED(); + QUIC_NOTREACHED(); return; // We are done. } } while (rv != QUIC_PENDING && next_state_ != STATE_NONE); @@ -319,7 +318,7 @@ return; } // TODO(rch): Remove this when we remove: - // FLAGS_quic_use_chlo_packet_size + // FLAGS_quic_reloadable_flag_quic_use_chlo_packet_size out.set_minimum_size( static_cast<size_t>(max_packet_size - kFramingOverhead)); next_state_ = STATE_RECV_REJ;
diff --git a/net/quic/core/quic_crypto_client_stream.h b/net/quic/core/quic_crypto_client_stream.h index cc937f0..6cbdad52 100644 --- a/net/quic/core/quic_crypto_client_stream.h +++ b/net/quic/core/quic_crypto_client_stream.h
@@ -267,6 +267,7 @@ // STATE_VERIFY_PROOF*, and subsequent STATE_SEND_CHLO state. bool stateless_reject_received_; + // Only used in chromium, not internally. base::TimeTicks proof_verify_start_time_; int num_scup_messages_received_;
diff --git a/net/quic/core/quic_crypto_server_stream_test.cc b/net/quic/core/quic_crypto_server_stream_test.cc index bba6bda..0c693262 100644 --- a/net/quic/core/quic_crypto_server_stream_test.cc +++ b/net/quic/core/quic_crypto_server_stream_test.cc
@@ -228,7 +228,6 @@ TEST_P(QuicCryptoServerStreamTest, StatelessRejectAfterCHLO) { FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support = true; - Initialize(); EXPECT_CALL(*server_connection_, @@ -262,7 +261,6 @@ TEST_P(QuicCryptoServerStreamTest, ConnectedAfterStatelessHandshake) { FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support = true; - Initialize(); InitializeFakeClient(/* supports_stateless_rejects= */ true); @@ -306,7 +304,6 @@ TEST_P(QuicCryptoServerStreamTest, NoStatelessRejectIfNoClientSupport) { FLAGS_quic_reloadable_flag_enable_quic_stateless_reject_support = true; - Initialize(); // The server is configured to use stateless rejects, but the client does not @@ -508,6 +505,5 @@ } } // namespace - } // namespace test } // namespace net
diff --git a/net/quic/core/quic_crypto_stream.cc b/net/quic/core/quic_crypto_stream.cc index 814b2683..3b3ec36 100644 --- a/net/quic/core/quic_crypto_stream.cc +++ b/net/quic/core/quic_crypto_stream.cc
@@ -17,7 +17,6 @@ using std::string; using base::StringPiece; -using net::SpdyPriority; namespace net {
diff --git a/net/quic/core/quic_crypto_stream.h b/net/quic/core/quic_crypto_stream.h index 05aa23c..32ed81a9 100644 --- a/net/quic/core/quic_crypto_stream.h +++ b/net/quic/core/quic_crypto_stream.h
@@ -5,7 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ #define NET_QUIC_CORE_QUIC_CRYPTO_STREAM_H_ -#include <stddef.h> +#include <cstddef> #include "base/macros.h" #include "net/quic/core/crypto/crypto_framer.h"
diff --git a/net/quic/core/quic_flow_controller_test.cc b/net/quic/core/quic_flow_controller_test.cc index 4b4bd76..9e8eb45 100644 --- a/net/quic/core/quic_flow_controller_test.cc +++ b/net/quic/core/quic_flow_controller_test.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/format_macros.h" #include "net/quic/platform/api/quic_str_cat.h" #include "net/quic/test_tools/quic_connection_peer.h" #include "net/quic/test_tools/quic_flow_controller_peer.h"
diff --git a/net/quic/core/quic_headers_stream_test.cc b/net/quic/core/quic_headers_stream_test.cc index 33dcaeaa..2c413d9 100644 --- a/net/quic/core/quic_headers_stream_test.cc +++ b/net/quic/core/quic_headers_stream_test.cc
@@ -942,8 +942,7 @@ // This test will issue a write that will require fragmenting into // multiple HTTP/2 DATA frames. const int kMinDataFrames = 4; - const size_t data_len = - kSpdyInitialFrameSizeLimit * kMinDataFrames + 1024; + const size_t data_len = kSpdyInitialFrameSizeLimit * kMinDataFrames + 1024; // Set headers stream send window large enough for data written below. headers_stream_->flow_controller()->UpdateSendWindowOffset(data_len * 2 * 4); string data(data_len, 'a');
diff --git a/net/quic/core/quic_iovector.h b/net/quic/core/quic_iovector.h index 6e893e9..b163fee5 100644 --- a/net/quic/core/quic_iovector.h +++ b/net/quic/core/quic_iovector.h
@@ -5,7 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_IOVECTOR_H_ #define NET_QUIC_CORE_QUIC_IOVECTOR_H_ -#include <stddef.h> +#include <cstddef> #include "net/base/iovec.h" #include "net/quic/platform/api/quic_export.h"
diff --git a/net/quic/core/quic_one_block_arena.h b/net/quic/core/quic_one_block_arena.h index a3f13fa8..bf9cef4 100644 --- a/net/quic/core/quic_one_block_arena.h +++ b/net/quic/core/quic_one_block_arena.h
@@ -12,6 +12,7 @@ #include <cstdint> +#include "base/macros.h" #include "net/quic/core/quic_arena_scoped_ptr.h" #include "net/quic/core/quic_types.h" #include "net/quic/platform/api/quic_bug_tracker.h"
diff --git a/net/quic/core/quic_packet_creator_test.cc b/net/quic/core/quic_packet_creator_test.cc index 1815978..a4dafc76 100644 --- a/net/quic/core/quic_packet_creator_test.cc +++ b/net/quic/core/quic_packet_creator_test.cc
@@ -10,7 +10,6 @@ #include <string> #include "base/macros.h" -#include "base/stl_util.h" #include "net/quic/core/crypto/null_encrypter.h" #include "net/quic/core/crypto/quic_decrypter.h" #include "net/quic/core/crypto/quic_encrypter.h"
diff --git a/net/quic/core/quic_packet_generator_test.cc b/net/quic/core/quic_packet_generator_test.cc index 4486fc5..f846dbc 100644 --- a/net/quic/core/quic_packet_generator_test.cc +++ b/net/quic/core/quic_packet_generator_test.cc
@@ -9,7 +9,6 @@ #include <string> #include "base/macros.h" -#include "base/stl_util.h" #include "net/quic/core/crypto/crypto_protocol.h" #include "net/quic/core/crypto/null_encrypter.h" #include "net/quic/core/crypto/quic_decrypter.h"
diff --git a/net/quic/core/quic_received_packet_manager.cc b/net/quic/core/quic_received_packet_manager.cc index e78c2fb..2415307 100644 --- a/net/quic/core/quic_received_packet_manager.cc +++ b/net/quic/core/quic_received_packet_manager.cc
@@ -7,7 +7,6 @@ #include <limits> #include <utility> -#include "net/base/linked_hash_map.h" #include "net/quic/core/crypto/crypto_protocol.h" #include "net/quic/core/quic_connection_stats.h" #include "net/quic/platform/api/quic_bug_tracker.h" @@ -72,8 +71,8 @@ bool QuicReceivedPacketManager::IsAwaitingPacket( QuicPacketNumber packet_number) { - return ::net::IsAwaitingPacket(ack_frame_, packet_number, - peer_least_packet_awaiting_ack_); + return net::IsAwaitingPacket(ack_frame_, packet_number, + peer_least_packet_awaiting_ack_); } const QuicFrame QuicReceivedPacketManager::GetUpdatedAckFrame(
diff --git a/net/quic/core/quic_server_id.cc b/net/quic/core/quic_server_id.cc index 280530a..62397061 100644 --- a/net/quic/core/quic_server_id.cc +++ b/net/quic/core/quic_server_id.cc
@@ -6,10 +6,7 @@ #include <tuple> -#include "net/base/host_port_pair.h" -#include "net/base/port_util.h" #include "net/quic/platform/api/quic_str_cat.h" -#include "url/gurl.h" using std::string; @@ -41,16 +38,6 @@ host_port_pair_.Equals(other.host_port_pair_); } -// static -QuicServerId QuicServerId::FromString(const std::string& str) { - GURL url(str); - if (!url.is_valid()) - return QuicServerId(); - return QuicServerId(HostPortPair::FromURL(url), url.path_piece() == "/private" - ? PRIVACY_MODE_ENABLED - : PRIVACY_MODE_DISABLED); -} - string QuicServerId::ToString() const { return QuicStrCat("https://", host_port_pair_.ToString(), (privacy_mode_ == PRIVACY_MODE_ENABLED ? "/private" : ""));
diff --git a/net/quic/core/quic_server_id.h b/net/quic/core/quic_server_id.h index 906529d..580789c 100644 --- a/net/quic/core/quic_server_id.h +++ b/net/quic/core/quic_server_id.h
@@ -31,15 +31,11 @@ bool operator<(const QuicServerId& other) const; bool operator==(const QuicServerId& other) const; - // Creates a QuicServerId from a string formatted in same manner as - // ToString(). - static QuicServerId FromString(const std::string& str); - // ToString() will convert the QuicServerId to "scheme:hostname:port" or // "scheme:hostname:port/private". "scheme" will be "https". std::string ToString() const; - // Used in Chromium, but not in the server. + // Used in Chromium, but not internally. const HostPortPair& host_port_pair() const { return host_port_pair_; } const std::string& host() const { return host_port_pair_.host(); }
diff --git a/net/quic/core/quic_server_session_base.cc b/net/quic/core/quic_server_session_base.cc index 3f00b27..9b13dba 100644 --- a/net/quic/core/quic_server_session_base.cc +++ b/net/quic/core/quic_server_session_base.cc
@@ -7,7 +7,6 @@ #include "net/quic/core/proto/cached_network_parameters.pb.h" #include "net/quic/core/quic_connection.h" #include "net/quic/core/quic_flags.h" -#include "net/quic/core/quic_spdy_session.h" #include "net/quic/core/quic_stream.h" #include "net/quic/platform/api/quic_bug_tracker.h" #include "net/quic/platform/api/quic_logging.h"
diff --git a/net/quic/core/quic_server_session_base.h b/net/quic/core/quic_server_session_base.h index 5ad9a84..6b41e657 100644 --- a/net/quic/core/quic_server_session_base.h +++ b/net/quic/core/quic_server_session_base.h
@@ -7,8 +7,6 @@ #ifndef NET_QUIC_CORE_QUIC_SERVER_SESSION_BASE_H_ #define NET_QUIC_CORE_QUIC_SERVER_SESSION_BASE_H_ -#include <stdint.h> - #include <cstdint> #include <memory> #include <set>
diff --git a/net/quic/core/quic_server_session_base_test.cc b/net/quic/core/quic_server_session_base_test.cc index fdbb61b..09c9c28 100644 --- a/net/quic/core/quic_server_session_base_test.cc +++ b/net/quic/core/quic_server_session_base_test.cc
@@ -31,7 +31,7 @@ #include "net/test/gtest_util.h" #include "net/tools/quic/quic_epoll_connection_helper.h" #include "net/tools/quic/quic_simple_server_stream.h" -#include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" +#include "net/tools/quic/test_tools/mock_quic_session_visitor.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/quic/core/quic_session.cc b/net/quic/core/quic_session.cc index 6161ad4..36e41c4 100644 --- a/net/quic/core/quic_session.cc +++ b/net/quic/core/quic_session.cc
@@ -4,7 +4,9 @@ #include "net/quic/core/quic_session.h" -#include "net/quic/core/crypto/proof_verifier.h" +#include <cstdint> +#include <utility> + #include "net/quic/core/quic_connection.h" #include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_flow_controller.h"
diff --git a/net/quic/core/quic_session.h b/net/quic/core/quic_session.h index 77fc237..283f55f 100644 --- a/net/quic/core/quic_session.h +++ b/net/quic/core/quic_session.h
@@ -7,8 +7,7 @@ #ifndef NET_QUIC_CORE_QUIC_SESSION_H_ #define NET_QUIC_CORE_QUIC_SESSION_H_ -#include <stddef.h> - +#include <cstddef> #include <map> #include <memory> #include <string> @@ -26,6 +25,7 @@ #include "net/quic/core/quic_write_blocked_list.h" #include "net/quic/platform/api/quic_containers.h" #include "net/quic/platform/api/quic_export.h" +#include "net/quic/platform/api/quic_socket_address.h" namespace net { @@ -41,7 +41,7 @@ public: // An interface from the session to the entity owning the session. // This lets the session notify its owner (the Dispatcher) when the connection - // is closed, blocked, or added/removed from the time-wait std::list. + // is closed, blocked, or added/removed from the time-wait list. class Visitor { public: virtual ~Visitor() {}
diff --git a/net/quic/core/quic_session_test.cc b/net/quic/core/quic_session_test.cc index e04a331..84c8db3e 100644 --- a/net/quic/core/quic_session_test.cc +++ b/net/quic/core/quic_session_test.cc
@@ -4,6 +4,7 @@ #include "net/quic/core/quic_session.h" +#include <cstdint> #include <set> #include <utility> @@ -33,8 +34,6 @@ #include "testing/gmock_mutant.h" #include "testing/gtest/include/gtest/gtest.h" -using net::SpdyHeaderBlock; -using net::SpdyPriority; using std::string; using testing::CreateFunctor; using testing::AtLeast;
diff --git a/net/quic/core/quic_socket_address_coder.cc b/net/quic/core/quic_socket_address_coder.cc index ae1dd6d6..dc20f807 100644 --- a/net/quic/core/quic_socket_address_coder.cc +++ b/net/quic/core/quic_socket_address_coder.cc
@@ -4,8 +4,6 @@ #include "net/quic/core/quic_socket_address_coder.h" -#include "net/base/sys_addrinfo.h" - using std::string; namespace net { @@ -59,10 +57,10 @@ size_t ip_length; switch (address_family) { case kIPv4: - ip_length = IPAddress::kIPv4AddressSize; + ip_length = QuicIpAddress::kIPv4AddressSize; break; case kIPv6: - ip_length = IPAddress::kIPv6AddressSize; + ip_length = QuicIpAddress::kIPv6AddressSize; break; default: return false;
diff --git a/net/quic/core/quic_socket_address_coder.h b/net/quic/core/quic_socket_address_coder.h index 1038c28..0a98cfe 100644 --- a/net/quic/core/quic_socket_address_coder.h +++ b/net/quic/core/quic_socket_address_coder.h
@@ -5,9 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_SOCKET_ADDRESS_CODER_H_ #define NET_QUIC_CORE_QUIC_SOCKET_ADDRESS_CODER_H_ -#include <stddef.h> -#include <stdint.h> - +#include <cstdint> #include <string> #include "base/macros.h"
diff --git a/net/quic/core/quic_socket_address_coder_test.cc b/net/quic/core/quic_socket_address_coder_test.cc index 703cc430..548fde2e 100644 --- a/net/quic/core/quic_socket_address_coder_test.cc +++ b/net/quic/core/quic_socket_address_coder_test.cc
@@ -4,7 +4,6 @@ #include "net/quic/core/quic_socket_address_coder.h" -#include "net/base/sys_addrinfo.h" #include "testing/gtest/include/gtest/gtest.h" using std::string;
diff --git a/net/quic/core/quic_spdy_session.cc b/net/quic/core/quic_spdy_session.cc index d6481612..84274e7 100644 --- a/net/quic/core/quic_spdy_session.cc +++ b/net/quic/core/quic_spdy_session.cc
@@ -4,7 +4,6 @@ #include "net/quic/core/quic_spdy_session.h" -#include <algorithm> #include <cstdint> #include <string> #include <utility>
diff --git a/net/quic/core/quic_spdy_session.h b/net/quic/core/quic_spdy_session.h index d0066b59..a4ce4236 100644 --- a/net/quic/core/quic_spdy_session.h +++ b/net/quic/core/quic_spdy_session.h
@@ -5,8 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_SPDY_SESSION_H_ #define NET_QUIC_CORE_QUIC_SPDY_SESSION_H_ -#include <stddef.h> - +#include <cstddef> #include <memory> #include "base/macros.h"
diff --git a/net/quic/core/quic_spdy_stream.cc b/net/quic/core/quic_spdy_stream.cc index 2f39ea4..8a6cf48 100644 --- a/net/quic/core/quic_spdy_stream.cc +++ b/net/quic/core/quic_spdy_stream.cc
@@ -19,7 +19,6 @@ using std::string; namespace net { - #define ENDPOINT \ (session()->perspective() == Perspective::IS_SERVER ? "Server: " : "Client:" \ " ")
diff --git a/net/quic/core/quic_spdy_stream.h b/net/quic/core/quic_spdy_stream.h index d470e80..6c6c332 100644 --- a/net/quic/core/quic_spdy_stream.h +++ b/net/quic/core/quic_spdy_stream.h
@@ -9,9 +9,9 @@ #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ -#include <stddef.h> #include <sys/types.h> +#include <cstddef> #include <list> #include <string> @@ -221,8 +221,7 @@ bool headers_decompressed_; // The priority of the stream, once parsed. SpdyPriority priority_; - // Contains a copy of the decompressed header (name, value) std::pairs until - // they + // Contains a copy of the decompressed header (name, value) pairs until they // are consumed via Readv. QuicHeaderList header_list_;
diff --git a/net/quic/core/quic_spdy_stream_test.cc b/net/quic/core/quic_spdy_stream_test.cc index 0e45dea..04d32fc 100644 --- a/net/quic/core/quic_spdy_stream_test.cc +++ b/net/quic/core/quic_spdy_stream_test.cc
@@ -440,7 +440,6 @@ // Stream receives enough data to fill a fraction of the receive window. string body(kWindow / 3, 'a'); - auto headers = AsHeaderList(headers_); ProcessHeaders(false, headers_); QuicStreamFrame frame1(kClientDataStreamId1, false, 0, StringPiece(body)); @@ -679,14 +678,51 @@ EXPECT_TRUE(stream_->IsDoneReading()); } +TEST_P(QuicSpdyStreamTest, ReceivingTrailersWithOffset) { + // Test that when receiving trailing headers with an offset before response + // body, stream is closed at the right offset. + Initialize(kShouldProcessData); + + // Receive initial headers. + QuicHeaderList headers = ProcessHeaders(false, headers_); + stream_->ConsumeHeaderList(); + + const string body = "this is the body"; + // Receive trailing headers. + SpdyHeaderBlock trailers_block; + trailers_block["key1"] = "value1"; + trailers_block["key2"] = "value2"; + trailers_block["key3"] = "value3"; + trailers_block[kFinalOffsetHeaderKey] = + QuicTextUtils::Uint64ToString(body.size()); + + QuicHeaderList trailers = ProcessHeaders(true, trailers_block); + + // The trailers should be decompressed, and readable from the stream. + EXPECT_TRUE(stream_->trailers_decompressed()); + + // The final offset trailer will be consumed by QUIC. + trailers_block.erase(kFinalOffsetHeaderKey); + EXPECT_EQ(trailers_block, stream_->received_trailers()); + + // Consuming the trailers erases them from the stream. + stream_->MarkTrailersConsumed(); + EXPECT_TRUE(stream_->FinishedReadingTrailers()); + + EXPECT_FALSE(stream_->IsDoneReading()); + // Receive and consume body. + QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body); + stream_->OnStreamFrame(frame); + EXPECT_EQ(body, stream_->data()); + EXPECT_TRUE(stream_->IsDoneReading()); +} + TEST_P(QuicSpdyStreamTest, ReceivingTrailersWithoutOffset) { // Test that receiving trailers without a final offset field is an error. Initialize(kShouldProcessData); // Receive initial headers. - auto headers = AsHeaderList(headers_); - stream_->OnStreamHeaderList(false, headers.uncompressed_header_bytes(), - headers); + ProcessHeaders(false, headers_); stream_->ConsumeHeaderList(); const string body = "this is the body"; @@ -728,12 +764,13 @@ trailers.uncompressed_header_bytes(), trailers); } -TEST_P(QuicSpdyStreamTest, ReceivingTrailersAfterFin) { - // If Trailers are sent, neither Headers nor Body should contain a FIN. +TEST_P(QuicSpdyStreamTest, ReceivingTrailersAfterHeadersWithFin) { + // If headers are received with a FIN, no trailers should then arrive. Initialize(kShouldProcessData); // Receive initial headers with FIN set. ProcessHeaders(true, headers_); + stream_->ConsumeHeaderList(); // Receive trailing headers after FIN already received. SpdyHeaderBlock trailers_block; @@ -749,6 +786,7 @@ // Receive initial headers without FIN set. ProcessHeaders(false, headers_); + stream_->ConsumeHeaderList(); // Receive body data, with FIN. QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/true, 0, "body"); @@ -762,45 +800,6 @@ ProcessHeaders(false, trailers_block); } -TEST_P(QuicSpdyStreamTest, ReceivingTrailersWithOffset) { - // Test that when receiving trailing headers with an offset before response - // body, stream is closed at the right offset. - Initialize(kShouldProcessData); - - // Receive initial headers. - QuicHeaderList headers = ProcessHeaders(false, headers_); - stream_->ConsumeHeaderList(); - - const string body = "this is the body"; - // Receive trailing headers. - SpdyHeaderBlock trailers_block; - trailers_block["key1"] = "value1"; - trailers_block["key2"] = "value2"; - trailers_block["key3"] = "value3"; - trailers_block[kFinalOffsetHeaderKey] = - QuicTextUtils::Uint64ToString(body.size()); - - QuicHeaderList trailers = ProcessHeaders(true, trailers_block); - - // The trailers should be decompressed, and readable from the stream. - EXPECT_TRUE(stream_->trailers_decompressed()); - - // The final offset trailer will be consumed by QUIC. - trailers_block.erase(kFinalOffsetHeaderKey); - EXPECT_EQ(trailers_block, stream_->received_trailers()); - - // Consuming the trailers erases them from the stream. - stream_->MarkTrailersConsumed(); - EXPECT_TRUE(stream_->FinishedReadingTrailers()); - - EXPECT_FALSE(stream_->IsDoneReading()); - // Receive and consume body. - QuicStreamFrame frame(kClientDataStreamId1, /*fin=*/false, 0, body); - stream_->OnStreamFrame(frame); - EXPECT_EQ(body, stream_->data()); - EXPECT_TRUE(stream_->IsDoneReading()); -} - TEST_P(QuicSpdyStreamTest, ClosingStreamWithNoTrailers) { // Verify that a stream receiving headers, body, and no trailers is correctly // marked as done reading on consumption of headers and body.
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc index 9ae75a7..d79d29c1 100644 --- a/net/quic/core/quic_stream.cc +++ b/net/quic/core/quic_stream.cc
@@ -4,10 +4,8 @@ #include "net/quic/core/quic_stream.h" -#include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_flow_controller.h" #include "net/quic/core/quic_session.h" -#include "net/quic/core/quic_write_blocked_list.h" #include "net/quic/platform/api/quic_bug_tracker.h" #include "net/quic/platform/api/quic_logging.h"
diff --git a/net/quic/core/quic_stream.h b/net/quic/core/quic_stream.h index 8adfd57b..553f6ba 100644 --- a/net/quic/core/quic_stream.h +++ b/net/quic/core/quic_stream.h
@@ -17,10 +17,8 @@ #ifndef NET_QUIC_CORE_QUIC_STREAM_H_ #define NET_QUIC_CORE_QUIC_STREAM_H_ -#include <stddef.h> -#include <stdint.h> -#include <sys/types.h> - +#include <cstddef> +#include <cstdint> #include <list> #include <string>
diff --git a/net/quic/core/quic_stream_sequencer.cc b/net/quic/core/quic_stream_sequencer.cc index 941a670e..1196424b 100644 --- a/net/quic/core/quic_stream_sequencer.cc +++ b/net/quic/core/quic_stream_sequencer.cc
@@ -9,8 +9,6 @@ #include <string> #include <utility> -#include "base/format_macros.h" -#include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_packets.h" #include "net/quic/core/quic_stream.h" #include "net/quic/core/quic_stream_sequencer_buffer.h"
diff --git a/net/quic/core/quic_stream_sequencer.h b/net/quic/core/quic_stream_sequencer.h index e19da1b..9770bcc 100644 --- a/net/quic/core/quic_stream_sequencer.h +++ b/net/quic/core/quic_stream_sequencer.h
@@ -5,8 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_STREAM_SEQUENCER_H_ #define NET_QUIC_CORE_QUIC_STREAM_SEQUENCER_H_ -#include <stddef.h> - +#include <cstddef> #include <map> #include "base/macros.h"
diff --git a/net/quic/core/quic_stream_sequencer_buffer.cc b/net/quic/core/quic_stream_sequencer_buffer.cc index 4e9aaf1..210bf56bd 100644 --- a/net/quic/core/quic_stream_sequencer_buffer.cc +++ b/net/quic/core/quic_stream_sequencer_buffer.cc
@@ -508,8 +508,7 @@ bool QuicStreamSequencerBuffer::RetireBlockIfEmpty(size_t block_index) { DCHECK(ReadableBytes() == 0 || GetInBlockOffset(total_bytes_read_) == 0) << "RetireBlockIfEmpty() should only be called when advancing to next " - "block" - " or a gap has been reached."; + << "block or a gap has been reached."; // If the whole buffer becomes empty, the last piece of data has been read. if (Empty()) { return RetireBlock(block_index);
diff --git a/net/quic/core/quic_stream_sequencer_buffer.h b/net/quic/core/quic_stream_sequencer_buffer.h index 22d2beb..14d1014 100644 --- a/net/quic/core/quic_stream_sequencer_buffer.h +++ b/net/quic/core/quic_stream_sequencer_buffer.h
@@ -5,8 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_STREAM_SEQUENCER_BUFFER_H_ #define NET_QUIC_CORE_QUIC_STREAM_SEQUENCER_BUFFER_H_ -// QuicStreamSequencerBuffer implements QuicStreamSequencerBufferInterface. -// It is a circular stream buffer with random write and +// QuicStreamSequencerBuffer is a circular stream buffer with random write and // in-sequence read. It consists of a vector of pointers pointing // to memory blocks created as needed and a list of Gaps to indicate // the missing data between the data already written into the buffer. @@ -60,8 +59,7 @@ // size_t consumed = consume_iovs(iovs, iov_count); // buffer.MarkConsumed(consumed); -#include <stddef.h> - +#include <cstddef> #include <functional> #include <list> #include <memory> @@ -221,12 +219,10 @@ // should be removed from the map. void UpdateFrameArrivalMap(QuicStreamOffset offset); - // Return |gaps_| as a std::string: [1024, 1500) [1800, 2048)... for - // debugging. + // Return |gaps_| as a string: [1024, 1500) [1800, 2048)... for debugging. std::string GapsDebugString(); - // Return all received frames as a std::string in same format as - // GapsDebugString(); + // Return all received frames as a string in same format as GapsDebugString(); std::string ReceivedFramesDebugString(); // The maximum total capacity of this buffer in byte, as constructed.
diff --git a/net/quic/core/quic_stream_sequencer_buffer_test.cc b/net/quic/core/quic_stream_sequencer_buffer_test.cc index 25de41f..fa71edf 100644 --- a/net/quic/core/quic_stream_sequencer_buffer_test.cc +++ b/net/quic/core/quic_stream_sequencer_buffer_test.cc
@@ -1,6 +1,7 @@ // Copyright (c) 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. + #include "net/quic/core/quic_stream_sequencer_buffer.h" #include <algorithm> @@ -127,7 +128,7 @@ std::list<Gap> gaps = helper_->GetGaps(); EXPECT_EQ(800u, gaps.front().end_offset); EXPECT_EQ(1824u, gaps.back().begin_offset); - auto* frame_map = helper_->frame_arrival_time_map(); + auto frame_map = helper_->frame_arrival_time_map(); EXPECT_EQ(1u, frame_map->size()); EXPECT_EQ(800u, frame_map->begin()->first); EXPECT_EQ(t, (*frame_map)[800].timestamp); @@ -166,7 +167,7 @@ buffer_->OnStreamData(0, source, t2, &written, &error_details_)); EXPECT_EQ(QUIC_OVERLAPPING_STREAM_DATA, buffer_->OnStreamData(1024, source, t2, &written, &error_details_)); - auto* frame_map = helper_->frame_arrival_time_map(); + auto frame_map = helper_->frame_arrival_time_map(); EXPECT_EQ(1u, frame_map->size()); EXPECT_EQ(t1, (*frame_map)[800].timestamp); } @@ -197,7 +198,7 @@ EXPECT_EQ(QUIC_NO_ERROR, buffer_->OnStreamData(1824, one_byte, clock_.ApproximateNow(), &written, &error_details_)); - auto* frame_map = helper_->frame_arrival_time_map(); + auto frame_map = helper_->frame_arrival_time_map(); EXPECT_EQ(3u, frame_map->size()); EXPECT_TRUE(helper_->CheckBufferInvariants()); }
diff --git a/net/quic/core/quic_stream_sequencer_test.cc b/net/quic/core/quic_stream_sequencer_test.cc index 7111d8e..a7b64b5 100644 --- a/net/quic/core/quic_stream_sequencer_test.cc +++ b/net/quic/core/quic_stream_sequencer_test.cc
@@ -10,8 +10,6 @@ #include <utility> #include <vector> -#include "net/base/ip_endpoint.h" -#include "net/quic/core/quic_flags.h" #include "net/quic/core/quic_stream.h" #include "net/quic/core/quic_utils.h" #include "net/quic/platform/api/quic_logging.h"
diff --git a/net/quic/core/quic_sustained_bandwidth_recorder.h b/net/quic/core/quic_sustained_bandwidth_recorder.h index 63bf458..4af85ed 100644 --- a/net/quic/core/quic_sustained_bandwidth_recorder.h +++ b/net/quic/core/quic_sustained_bandwidth_recorder.h
@@ -5,7 +5,7 @@ #ifndef NET_QUIC_CORE_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ #define NET_QUIC_CORE_QUIC_SUSTAINED_BANDWIDTH_RECORDER_H_ -#include <stdint.h> +#include <cstdint> #include "base/macros.h" #include "net/quic/core/quic_bandwidth.h"
diff --git a/net/quic/core/quic_time.h b/net/quic/core/quic_time.h index ee883bf..ee4a38c 100644 --- a/net/quic/core/quic_time.h +++ b/net/quic/core/quic_time.h
@@ -11,9 +11,9 @@ #ifndef NET_QUIC_CORE_QUIC_TIME_H_ #define NET_QUIC_CORE_QUIC_TIME_H_ -#include <stdint.h> - #include <cmath> +#include <cstdint> +#include <limits> #include <ostream> #include "base/compiler_specific.h"
diff --git a/net/quic/core/quic_utils.cc b/net/quic/core/quic_utils.cc index cf51612..861ee3d6 100644 --- a/net/quic/core/quic_utils.cc +++ b/net/quic/core/quic_utils.cc
@@ -4,10 +4,8 @@ #include "net/quic/core/quic_utils.h" -#include <ctype.h> -#include <stdint.h> - #include <algorithm> +#include <cstdint> #include <vector> #include "base/containers/adapters.h"
diff --git a/net/quic/platform/api/quic_ip_address.h b/net/quic/platform/api/quic_ip_address.h index 9b10e8ef..75b9f0c7 100644 --- a/net/quic/platform/api/quic_ip_address.h +++ b/net/quic/platform/api/quic_ip_address.h
@@ -17,6 +17,10 @@ // implementation (platform dependent) of an IP address is in // QuicIpAddressImpl. public: + enum : size_t { + kIPv4AddressSize = QuicIpAddressImpl::kIPv4AddressSize, + kIPv6AddressSize = QuicIpAddressImpl::kIPv6AddressSize + }; static QuicIpAddress Loopback4(); static QuicIpAddress Loopback6(); static QuicIpAddress Any4();
diff --git a/net/quic/platform/api/quic_logging.h b/net/quic/platform/api/quic_logging.h index 3bc5f48..5031e9f 100644 --- a/net/quic/platform/api/quic_logging.h +++ b/net/quic/platform/api/quic_logging.h
@@ -23,4 +23,6 @@ #define QUIC_PREDICT_FALSE(x) QUIC_PREDICT_FALSE_IMPL(x) +#define QUIC_NOTREACHED() QUIC_NOTREACHED_IMPL() + #endif // NET_QUIC_PLATFORM_API_QUIC_LOGGING_H_
diff --git a/net/quic/platform/api/quic_url_utils.cc b/net/quic/platform/api/quic_url_utils.cc index 73b8fcd..a15fdeb2 100644 --- a/net/quic/platform/api/quic_url_utils.cc +++ b/net/quic/platform/api/quic_url_utils.cc
@@ -29,4 +29,9 @@ return QuicUrlUtilsImpl::NormalizeHostname(hostname); } +// static +void QuicUrlUtils::StringToQuicServerId(const string& str, QuicServerId* out) { + QuicUrlUtilsImpl::StringToQuicServerId(str, out); +} + } // namespace net
diff --git a/net/quic/platform/api/quic_url_utils.h b/net/quic/platform/api/quic_url_utils.h index 53564f10e..0ff77f2 100644 --- a/net/quic/platform/api/quic_url_utils.h +++ b/net/quic/platform/api/quic_url_utils.h
@@ -31,6 +31,10 @@ // WARNING: mutates |hostname| in place and returns |hostname|. static char* NormalizeHostname(char* hostname); + // Creates a QuicServerId from a string formatted in same manner as + // QuicServerId::ToString(). + static void StringToQuicServerId(const std::string& str, QuicServerId* out); + private: DISALLOW_COPY_AND_ASSIGN(QuicUrlUtils); };
diff --git a/net/quic/platform/impl/quic_ip_address_impl.h b/net/quic/platform/impl/quic_ip_address_impl.h index c2b0d89..c9c2998f 100644 --- a/net/quic/platform/impl/quic_ip_address_impl.h +++ b/net/quic/platform/impl/quic_ip_address_impl.h
@@ -15,6 +15,10 @@ class QUIC_EXPORT_PRIVATE QuicIpAddressImpl { public: + enum : size_t { + kIPv4AddressSize = IPAddress::kIPv4AddressSize, + kIPv6AddressSize = IPAddress::kIPv6AddressSize + }; static QuicIpAddressImpl Loopback4(); static QuicIpAddressImpl Loopback6(); static QuicIpAddressImpl Any4();
diff --git a/net/quic/platform/impl/quic_logging_impl.h b/net/quic/platform/impl/quic_logging_impl.h index 6daa47f..d6e6cdc 100644 --- a/net/quic/platform/impl/quic_logging_impl.h +++ b/net/quic/platform/impl/quic_logging_impl.h
@@ -55,4 +55,6 @@ #define QUIC_PREDICT_FALSE_IMPL(x) x +#define QUIC_NOTREACHED_IMPL() NOTREACHED() + #endif // NET_QUIC_PLATFORM_IMPL_QUIC_LOGGING_IMPL_H_
diff --git a/net/quic/platform/impl/quic_url_utils_impl.cc b/net/quic/platform/impl/quic_url_utils_impl.cc index f9c7600..323e326 100644 --- a/net/quic/platform/impl/quic_url_utils_impl.cc +++ b/net/quic/platform/impl/quic_url_utils_impl.cc
@@ -59,4 +59,17 @@ return hostname; } +// static +void QuicUrlUtilsImpl::StringToQuicServerId(const string& str, + QuicServerId* out) { + GURL url(str); + if (!url.is_valid()) { + *out = QuicServerId(); + return; + } + *out = QuicServerId(HostPortPair::FromURL(url), url.path_piece() == "/private" + ? PRIVACY_MODE_ENABLED + : PRIVACY_MODE_DISABLED); +} + } // namespace net
diff --git a/net/quic/platform/impl/quic_url_utils_impl.h b/net/quic/platform/impl/quic_url_utils_impl.h index 070f516..d8b945b 100644 --- a/net/quic/platform/impl/quic_url_utils_impl.h +++ b/net/quic/platform/impl/quic_url_utils_impl.h
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/strings/string_piece.h" +#include "net/quic/core/quic_server_id.h" #include "net/quic/platform/api/quic_export.h" namespace net { @@ -31,6 +32,10 @@ // WARNING: mutates |hostname| in place and returns |hostname|. static char* NormalizeHostname(char* hostname); + // Creates a QuicServerId from a string formatted in same manner as + // QuicServerId::ToString(). + static void StringToQuicServerId(const std::string& str, QuicServerId* out); + private: DISALLOW_COPY_AND_ASSIGN(QuicUrlUtilsImpl); };
diff --git a/net/quic/test_tools/quic_stream_factory_peer.cc b/net/quic/test_tools/quic_stream_factory_peer.cc index 03dbff8..d7ea3105 100644 --- a/net/quic/test_tools/quic_stream_factory_peer.cc +++ b/net/quic/test_tools/quic_stream_factory_peer.cc
@@ -174,7 +174,9 @@ ImportCertFromFile(GetTestCertsDirectory(), "wildcard.pem")); DCHECK(cert); std::string der_bytes; - DCHECK(X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes)); + bool success = + X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_bytes); + DCHECK(success); certs.push_back(der_bytes); QuicCryptoClientConfig* crypto_config = &factory->crypto_config_;
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index a1fad40..082c5e32 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -37,7 +37,7 @@ #include "net/test/gtest_util.h" #include "net/tools/quic/quic_dispatcher.h" #include "net/tools/quic/quic_per_connection_packet_writer.h" -#include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" +#include "net/tools/quic/test_tools/mock_quic_session_visitor.h" #include "testing/gmock/include/gmock/gmock.h" using base::StringPiece;
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index b7c09324..54c99a2 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc
@@ -143,11 +143,9 @@ compression_option_(option), probable_http_response_(false), end_stream_when_done_(false) { - // TODO(bnc): The way kMaxControlFrameSize is currently interpreted, it - // includes the frame header, whereas kSpdyInitialFrameSizeLimit does not. - // Therefore this assertion is unnecessarily strict. - static_assert(kMaxControlFrameSize <= kSpdyInitialFrameSizeLimit, - "Our send limit should be at most our receive limit"); + static_assert( + kMaxControlFrameSize <= kSpdyInitialFrameSizeLimit + kFrameHeaderSize, + "Our send limit should be at most our receive limit"); Reset(); if (adapter_factory != nullptr) { @@ -410,70 +408,6 @@ return "UNKNOWN_ERROR"; } -const char* SpdyFramer::StatusCodeToString(int status_code) { - switch (status_code) { - case RST_STREAM_NO_ERROR: - return "NO_ERROR"; - case RST_STREAM_PROTOCOL_ERROR: - return "PROTOCOL_ERROR"; - case RST_STREAM_INTERNAL_ERROR: - return "INTERNAL_ERROR"; - case RST_STREAM_FLOW_CONTROL_ERROR: - return "FLOW_CONTROL_ERROR"; - case RST_STREAM_SETTINGS_TIMEOUT: - return "SETTINGS_TIMEOUT"; - case RST_STREAM_STREAM_CLOSED: - return "STREAM_CLOSED"; - case RST_STREAM_FRAME_SIZE_ERROR: - return "FRAME_SIZE_ERROR"; - case RST_STREAM_REFUSED_STREAM: - return "REFUSED_STREAM"; - case RST_STREAM_CANCEL: - return "CANCEL"; - case RST_STREAM_COMPRESSION_ERROR: - return "COMPRESSION_ERROR"; - case RST_STREAM_CONNECT_ERROR: - return "CONNECT_ERROR"; - case RST_STREAM_ENHANCE_YOUR_CALM: - return "ENHANCE_YOUR_CALM"; - case RST_STREAM_INADEQUATE_SECURITY: - return "INADEQUATE_SECURITY"; - case RST_STREAM_HTTP_1_1_REQUIRED: - return "HTTP_1_1_REQUIRED"; - } - return "UNKNOWN_STATUS"; -} - -const char* SpdyFramer::FrameTypeToString(SpdyFrameType type) { - switch (type) { - case DATA: - return "DATA"; - case RST_STREAM: - return "RST_STREAM"; - case SETTINGS: - return "SETTINGS"; - case PING: - return "PING"; - case GOAWAY: - return "GOAWAY"; - case HEADERS: - return "HEADERS"; - case WINDOW_UPDATE: - return "WINDOW_UPDATE"; - case PUSH_PROMISE: - return "PUSH_PROMISE"; - case CONTINUATION: - return "CONTINUATION"; - case PRIORITY: - return "PRIORITY"; - case ALTSVC: - return "ALTSVC"; - case BLOCKED: - return "BLOCKED"; - } - return "UNKNOWN_CONTROL_TYPE"; -} - size_t SpdyFramer::ProcessInput(const char* data, size_t len) { DCHECK(visitor_); DCHECK(data);
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 37238af..6dcf4e6 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h
@@ -483,8 +483,6 @@ // For debugging. static const char* StateToString(int state); static const char* SpdyFramerErrorToString(SpdyFramerError spdy_framer_error); - static const char* StatusCodeToString(int status_code); - static const char* FrameTypeToString(SpdyFrameType type); // Did the most recent frame header appear to be an HTTP/1.x (or earlier) // response (i.e. start with "HTTP/")?
diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index fae17fe6..7a7cdd8 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc
@@ -3496,47 +3496,6 @@ SpdyFramer::LAST_ERROR + 1))); } -TEST_P(SpdyFramerTest, StatusCodeToStringTest) { - EXPECT_STREQ("NO_ERROR", SpdyFramer::StatusCodeToString(RST_STREAM_NO_ERROR)); - EXPECT_STREQ("PROTOCOL_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_PROTOCOL_ERROR)); - EXPECT_STREQ("INTERNAL_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_INTERNAL_ERROR)); - EXPECT_STREQ("FLOW_CONTROL_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_FLOW_CONTROL_ERROR)); - EXPECT_STREQ("SETTINGS_TIMEOUT", - SpdyFramer::StatusCodeToString(RST_STREAM_SETTINGS_TIMEOUT)); - EXPECT_STREQ("STREAM_CLOSED", - SpdyFramer::StatusCodeToString(RST_STREAM_STREAM_CLOSED)); - EXPECT_STREQ("FRAME_SIZE_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_FRAME_SIZE_ERROR)); - EXPECT_STREQ("REFUSED_STREAM", - SpdyFramer::StatusCodeToString(RST_STREAM_REFUSED_STREAM)); - EXPECT_STREQ("CANCEL", SpdyFramer::StatusCodeToString(RST_STREAM_CANCEL)); - EXPECT_STREQ("COMPRESSION_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_COMPRESSION_ERROR)); - EXPECT_STREQ("CONNECT_ERROR", - SpdyFramer::StatusCodeToString(RST_STREAM_CONNECT_ERROR)); - EXPECT_STREQ("ENHANCE_YOUR_CALM", - SpdyFramer::StatusCodeToString(RST_STREAM_ENHANCE_YOUR_CALM)); - EXPECT_STREQ("INADEQUATE_SECURITY", - SpdyFramer::StatusCodeToString(RST_STREAM_INADEQUATE_SECURITY)); - EXPECT_STREQ("HTTP_1_1_REQUIRED", - SpdyFramer::StatusCodeToString(RST_STREAM_HTTP_1_1_REQUIRED)); -} - -TEST_P(SpdyFramerTest, FrameTypeToStringTest) { - EXPECT_STREQ("DATA", SpdyFramer::FrameTypeToString(DATA)); - EXPECT_STREQ("RST_STREAM", SpdyFramer::FrameTypeToString(RST_STREAM)); - EXPECT_STREQ("SETTINGS", SpdyFramer::FrameTypeToString(SETTINGS)); - EXPECT_STREQ("PING", SpdyFramer::FrameTypeToString(PING)); - EXPECT_STREQ("GOAWAY", SpdyFramer::FrameTypeToString(GOAWAY)); - EXPECT_STREQ("HEADERS", SpdyFramer::FrameTypeToString(HEADERS)); - EXPECT_STREQ("WINDOW_UPDATE", SpdyFramer::FrameTypeToString(WINDOW_UPDATE)); - EXPECT_STREQ("PUSH_PROMISE", SpdyFramer::FrameTypeToString(PUSH_PROMISE)); - EXPECT_STREQ("CONTINUATION", SpdyFramer::FrameTypeToString(CONTINUATION)); -} - TEST_P(SpdyFramerTest, DataFrameFlagsV4) { uint8_t valid_data_flags = DATA_FLAG_FIN | DATA_FLAG_PADDED;
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc index 3537917e..3faca6d 100644 --- a/net/spdy/spdy_protocol.cc +++ b/net/spdy/spdy_protocol.cc
@@ -87,6 +87,36 @@ } } +const char* FrameTypeToString(SpdyFrameType frame_type) { + switch (frame_type) { + case DATA: + return "DATA"; + case RST_STREAM: + return "RST_STREAM"; + case SETTINGS: + return "SETTINGS"; + case PING: + return "PING"; + case GOAWAY: + return "GOAWAY"; + case HEADERS: + return "HEADERS"; + case WINDOW_UPDATE: + return "WINDOW_UPDATE"; + case PUSH_PROMISE: + return "PUSH_PROMISE"; + case CONTINUATION: + return "CONTINUATION"; + case PRIORITY: + return "PRIORITY"; + case ALTSVC: + return "ALTSVC"; + case BLOCKED: + return "BLOCKED"; + } + return "UNKNOWN_FRAME_TYPE"; +} + bool ParseSettingsId(int wire_setting_id, SpdySettingsIds* setting_id) { // HEADER_TABLE_SIZE is the first defined setting id. if (wire_setting_id < SETTINGS_MIN) { @@ -145,6 +175,40 @@ return static_cast<SpdyGoAwayStatus>(goaway_status_field); } +const char* ErrorCodeToString(uint32_t error_code) { + switch (error_code) { + case RST_STREAM_NO_ERROR: + return "NO_ERROR"; + case RST_STREAM_PROTOCOL_ERROR: + return "PROTOCOL_ERROR"; + case RST_STREAM_INTERNAL_ERROR: + return "INTERNAL_ERROR"; + case RST_STREAM_FLOW_CONTROL_ERROR: + return "FLOW_CONTROL_ERROR"; + case RST_STREAM_SETTINGS_TIMEOUT: + return "SETTINGS_TIMEOUT"; + case RST_STREAM_STREAM_CLOSED: + return "STREAM_CLOSED"; + case RST_STREAM_FRAME_SIZE_ERROR: + return "FRAME_SIZE_ERROR"; + case RST_STREAM_REFUSED_STREAM: + return "REFUSED_STREAM"; + case RST_STREAM_CANCEL: + return "CANCEL"; + case RST_STREAM_COMPRESSION_ERROR: + return "COMPRESSION_ERROR"; + case RST_STREAM_CONNECT_ERROR: + return "CONNECT_ERROR"; + case RST_STREAM_ENHANCE_YOUR_CALM: + return "ENHANCE_YOUR_CALM"; + case RST_STREAM_INADEQUATE_SECURITY: + return "INADEQUATE_SECURITY"; + case RST_STREAM_HTTP_1_1_REQUIRED: + return "HTTP_1_1_REQUIRED"; + } + return "UNKNOWN_ERROR_CODE"; +} + const char* const kHttp2Npn = "h2"; SpdyFrameWithHeaderBlockIR::SpdyFrameWithHeaderBlockIR(
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index 642efb4..94c1ac0 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h
@@ -240,6 +240,9 @@ SpdyStreamId current_frame_stream_id, SpdyFrameType frame_type_field); +// Serialize |frame_type| to string for logging/debugging. +const char* FrameTypeToString(SpdyFrameType frame_type); + // If |wire_setting_id| is the on-the-wire representation of a defined SETTINGS // parameter, parse it to |*setting_id| and return true. NET_EXPORT_PRIVATE bool ParseSettingsId(int wire_setting_id, @@ -261,6 +264,10 @@ // as recommended by the HTTP/2 specification. NET_EXPORT_PRIVATE SpdyGoAwayStatus ParseGoAwayStatus(int goaway_status_field); +// Serialize RST_STREAM or GOAWAY frame error code to string +// for logging/debugging. +const char* ErrorCodeToString(uint32_t error_code); + // Frame type for non-control (i.e. data) frames. const int kDataFrameType = 0; // Number of octets in the frame header.
diff --git a/net/tools/quic/quic_simple_server_session_test.cc b/net/tools/quic/quic_simple_server_session_test.cc index a808d23..2ee35bb 100644 --- a/net/tools/quic/quic_simple_server_session_test.cc +++ b/net/tools/quic/quic_simple_server_session_test.cc
@@ -29,7 +29,7 @@ #include "net/quic/test_tools/quic_test_utils.h" #include "net/test/gtest_util.h" #include "net/tools/quic/quic_simple_server_stream.h" -#include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" +#include "net/tools/quic/test_tools/mock_quic_session_visitor.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc index a409ead..a870e30 100644 --- a/net/tools/quic/quic_time_wait_list_manager_test.cc +++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -23,7 +23,7 @@ #include "net/tools/quic/quic_epoll_alarm_factory.h" #include "net/tools/quic/quic_epoll_connection_helper.h" #include "net/tools/quic/test_tools/mock_epoll_server.h" -#include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" +#include "net/tools/quic/test_tools/mock_quic_session_visitor.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/net/tools/quic/test_tools/mock_quic_server_session_visitor.cc b/net/tools/quic/test_tools/mock_quic_session_visitor.cc similarity index 87% rename from net/tools/quic/test_tools/mock_quic_server_session_visitor.cc rename to net/tools/quic/test_tools/mock_quic_session_visitor.cc index 46aac8d8..ea52f14e 100644 --- a/net/tools/quic/test_tools/mock_quic_server_session_visitor.cc +++ b/net/tools/quic/test_tools/mock_quic_session_visitor.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" +#include "net/tools/quic/test_tools/mock_quic_session_visitor.h" namespace net { namespace test {
diff --git a/net/tools/quic/test_tools/mock_quic_server_session_visitor.h b/net/tools/quic/test_tools/mock_quic_session_visitor.h similarity index 100% rename from net/tools/quic/test_tools/mock_quic_server_session_visitor.h rename to net/tools/quic/test_tools/mock_quic_session_visitor.h
diff --git a/remoting/client/ios/app_runtime.cc b/remoting/client/ios/app_runtime.cc index f03b9067..5e0ad6b82 100644 --- a/remoting/client/ios/app_runtime.cc +++ b/remoting/client/ios/app_runtime.cc
@@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/synchronization/waitable_event.h" +#include "base/task_scheduler/task_scheduler.h" #include "jingle/glue/thread_wrapper.h" #include "net/socket/client_socket_factory.h" #include "remoting/base/chromium_url_request.h" @@ -28,6 +29,17 @@ namespace ios { AppRuntime::AppRuntime() { + // TODO(sergeyu): Consider adding separate pools for different task classes. + const int kMaxBackgroundThreads = 5; + if (TaskScheduler::GetInstance()) { + // Make sure TaskScheduler is initialized. + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); + } + + // TODO(sergeyu): AppRuntime is not singleton, but it owns MessageLoop for the + // current thread. This means that it's not safe to create multiple AppRuntime + // instances on the same thread. AppRuntime should be a singleton, or this + // code needs to be moved somewhere else. if (!base::MessageLoop::current()) { ui_loop_.reset(new base::MessageLoopForUI()); base::MessageLoopForUI::current()->Attach();
diff --git a/remoting/client/jni/chromoting_jni_runtime.cc b/remoting/client/jni/chromoting_jni_runtime.cc index 1505e44..c581653 100644 --- a/remoting/client/jni/chromoting_jni_runtime.cc +++ b/remoting/client/jni/chromoting_jni_runtime.cc
@@ -14,6 +14,7 @@ #include "base/memory/singleton.h" #include "base/stl_util.h" #include "base/synchronization/waitable_event.h" +#include "base/task_scheduler/task_scheduler.h" #include "jni/JniInterface_jni.h" #include "remoting/base/chromium_url_request.h" #include "remoting/base/url_request_context_getter.h" @@ -42,6 +43,10 @@ static void LoadNative(JNIEnv* env, const JavaParamRef<jclass>& clazz) { base::CommandLine::Init(0, nullptr); + // TODO(sergeyu): Consider adding separate pools for different task classes. + const int kMaxBackgroundThreads = 5; + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); + // Create the singleton now so that the Chromoting threads will be set up. remoting::ChromotingJniRuntime::GetInstance(); }
diff --git a/remoting/host/it2me/it2me_native_messaging_host_main.cc b/remoting/host/it2me/it2me_native_messaging_host_main.cc index 44d319e4..b6451df 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_main.cc +++ b/remoting/host/it2me/it2me_native_messaging_host_main.cc
@@ -11,6 +11,7 @@ #include "base/i18n/icu_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/task_scheduler/task_scheduler.h" #include "build/build_config.h" #include "remoting/base/auto_thread_task_runner.h" #include "remoting/base/breakpad.h" @@ -45,7 +46,13 @@ // Creates a It2MeNativeMessagingHost instance, attaches it to stdin/stdout and // runs the message loop until It2MeNativeMessagingHost signals shutdown. -int StartIt2MeNativeMessagingHost() { +int It2MeNativeMessagingHostMain(int argc, char** argv) { + // This object instance is required by Chrome code (such as MessageLoop). + base::AtExitManager exit_manager; + + base::CommandLine::Init(argc, argv); + remoting::InitHostLogging(); + #if defined(OS_MACOSX) // Needed so we don't leak objects when threads are created. base::mac::ScopedNSAutoreleasePool pool; @@ -72,6 +79,10 @@ // Required to find the ICU data file, used by some file_util routines. base::i18n::InitializeICU(); + // TODO(sergeyu): Consider adding separate pools for different task classes. + const int kMaxBackgroundThreads = 5; + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); + remoting::LoadResources(""); #if defined(OS_LINUX) @@ -192,14 +203,4 @@ return kSuccessExitCode; } -int It2MeNativeMessagingHostMain(int argc, char** argv) { - // This object instance is required by Chrome code (such as MessageLoop). - base::AtExitManager exit_manager; - - base::CommandLine::Init(argc, argv); - remoting::InitHostLogging(); - - return StartIt2MeNativeMessagingHost(); -} - } // namespace remoting
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index aaae9db..73c87aa 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc
@@ -26,6 +26,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringize_macros.h" #include "base/strings/utf_string_conversions.h" +#include "base/task_scheduler/task_scheduler.h" #include "build/build_config.h" #include "components/policy/policy_constants.h" #include "ipc/ipc_channel.h" @@ -1641,6 +1642,10 @@ base::GetLinuxDistro(); #endif + // TODO(sergeyu): Consider adding separate pools for different task classes. + const int kMaxBackgroundThreads = 5; + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); + // Create the main message loop and start helper threads. base::MessageLoopForUI message_loop; std::unique_ptr<ChromotingHostContext> context =
diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/me2me_native_messaging_host_main.cc index b7a8140..d91e348 100644 --- a/remoting/host/setup/me2me_native_messaging_host_main.cc +++ b/remoting/host/setup/me2me_native_messaging_host_main.cc
@@ -16,6 +16,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" +#include "base/task_scheduler/task_scheduler.h" #include "base/threading/thread.h" #include "build/build_config.h" #include "net/url_request/url_fetcher.h" @@ -51,7 +52,13 @@ namespace remoting { -int StartMe2MeNativeMessagingHost() { +int Me2MeNativeMessagingHostMain(int argc, char** argv) { + // This object instance is required by Chrome code (such as MessageLoop). + base::AtExitManager exit_manager; + + base::CommandLine::Init(argc, argv); + remoting::InitHostLogging(); + #if defined(OS_MACOSX) // Needed so we don't leak objects when threads are created. base::mac::ScopedNSAutoreleasePool pool; @@ -79,6 +86,10 @@ // } #endif // defined(REMOTING_ENABLE_BREAKPAD) + // TODO(sergeyu): Consider adding separate pools for different task classes. + const int kMaxBackgroundThreads = 5; + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxBackgroundThreads); + // Mac OS X requires that the main thread be a UI message loop in order to // receive distributed notifications from the System Preferences pane. An // IO thread is needed for the pairing registry and URL context getter. @@ -261,14 +272,4 @@ return kSuccessExitCode; } -int Me2MeNativeMessagingHostMain(int argc, char** argv) { - // This object instance is required by Chrome code (such as MessageLoop). - base::AtExitManager exit_manager; - - base::CommandLine::Init(argc, argv); - remoting::InitHostLogging(); - - return StartMe2MeNativeMessagingHost(); -} - } // namespace remoting
diff --git a/services/README.md b/services/README.md index 810535bf..b8e1540 100644 --- a/services/README.md +++ b/services/README.md
@@ -37,8 +37,10 @@ for each service, products consuming these services may package them differently, e.g. by combining them into a single package. -### High-level Design Doc -https://docs.google.com/document/d/15I7sQyQo6zsqXVNAlVd520tdGaS8FCicZHrN0yRu-oU/edit#heading=h.p37l9e7o0io5 +### Documentation + +[High-level Design Doc](https://docs.google.com/document/d/15I7sQyQo6zsqXVNAlVd520tdGaS8FCicZHrN0yRu-oU) +[Homepage](https://sites.google.com/a/chromium.org/dev/servicification) ### Relationship to other top-level directories in // @@ -51,3 +53,8 @@ Think of //components as sort of like a //lib. Individual //components can define, implement and use mojom interfaces, but only //services have unique identities with the Service Manager. + +### Adding a new service + +Please start a thread on [services-dev](https://groups.google.com/a/chromium.org/forum/#!forum/services-dev) +
diff --git a/services/navigation/view_impl.cc b/services/navigation/view_impl.cc index 578cb90..655ccaa 100644 --- a/services/navigation/view_impl.cc +++ b/services/navigation/view_impl.cc
@@ -300,11 +300,6 @@ void ViewImpl::OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) {} -aura::client::CaptureClient* ViewImpl::GetCaptureClient() { - // TODO: wire this up. This typically comes from WMState. - return nullptr; -} - aura::PropertyConverter* ViewImpl::GetPropertyConverter() { // TODO: wire this up. return nullptr;
diff --git a/services/navigation/view_impl.h b/services/navigation/view_impl.h index 233c9e3..bf34ffc 100644 --- a/services/navigation/view_impl.h +++ b/services/navigation/view_impl.h
@@ -85,7 +85,6 @@ void OnLostConnection(aura::WindowTreeClient* client) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // views::WidgetDelegate:
diff --git a/services/ui/demo/mus_demo.cc b/services/ui/demo/mus_demo.cc index 0ae145c..0fbcd356 100644 --- a/services/ui/demo/mus_demo.cc +++ b/services/ui/demo/mus_demo.cc
@@ -118,10 +118,6 @@ void MusDemo::OnPointerEventObserved(const PointerEvent& event, aura::Window* target) {} -aura::client::CaptureClient* MusDemo::GetCaptureClient() { - return capture_client_.get(); -} - aura::PropertyConverter* MusDemo::GetPropertyConverter() { return property_converter_.get(); }
diff --git a/services/ui/demo/mus_demo.h b/services/ui/demo/mus_demo.h index f78e948..c4e490b 100644 --- a/services/ui/demo/mus_demo.h +++ b/services/ui/demo/mus_demo.h
@@ -64,7 +64,6 @@ void OnLostConnection(aura::WindowTreeClient* client) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // aura::WindowManagerDelegate:
diff --git a/services/ui/public/interfaces/window_tree.mojom b/services/ui/public/interfaces/window_tree.mojom index d2343db..e606490 100644 --- a/services/ui/public/interfaces/window_tree.mojom +++ b/services/ui/public/interfaces/window_tree.mojom
@@ -253,9 +253,8 @@ // Otherwise the existing state is used. SetImeVisibility(uint32 window_id, bool visible, mojo.TextInputState? state); - // Set whether the specified window can accept events. If a window does not - // accept events, none of its descendant windows accept events either. - SetCanAcceptEvents(uint32 window_id, bool accept_events); + // Sets the EventTargetingPolicy. See EventTargetingPolicy for details. + SetEventTargetingPolicy(uint32 window_id, EventTargetingPolicy policy); // See documentation for WindowTreeClient::OnWindowInputEvent(). OnWindowInputEventAck(uint32 event_id, EventResult result);
diff --git a/services/ui/public/interfaces/window_tree_constants.mojom b/services/ui/public/interfaces/window_tree_constants.mojom index c23d42d..19a5fdf 100644 --- a/services/ui/public/interfaces/window_tree_constants.mojom +++ b/services/ui/public/interfaces/window_tree_constants.mojom
@@ -35,6 +35,21 @@ UNHANDLED, }; +enum EventTargetingPolicy { + // The target is a valid target for events, but none of its descendants are + // considered. + TARGET_ONLY, + + // The target and its descendants are possible targets. This is the default. + TARGET_AND_DESCENDANTS, + + // The target is not a valid target, but its descendants are possible targets. + DESCENDANTS_ONLY, + + // Neither the target nor its descendants are valid targets. + NONE +}; + // A bitfield of what drag operations are possible. const uint32 kDropEffectNone = 0; const uint32 kDropEffectMove = 1;
diff --git a/services/ui/service.cc b/services/ui/service.cc index 2e789c89..95d1791 100644 --- a/services/ui/service.cc +++ b/services/ui/service.cc
@@ -188,7 +188,6 @@ // so keep this line below both of those. input_device_server_.RegisterAsObserver(); - // Gpu must be running before the ScreenManager can be initialized. window_server_.reset(new ws::WindowServer(this)); ime_server_.Init(context()->connector(), test_config_);
diff --git a/services/ui/test_wm/test_wm.cc b/services/ui/test_wm/test_wm.cc index 743db07..8d2463a 100644 --- a/services/ui/test_wm/test_wm.cc +++ b/services/ui/test_wm/test_wm.cc
@@ -87,9 +87,6 @@ aura::Window* target) override { // Don't care. } - aura::client::CaptureClient* GetCaptureClient() override { - return wm_state_.capture_controller(); - } aura::PropertyConverter* GetPropertyConverter() override { return &property_converter_; }
diff --git a/services/ui/ws/access_policy.h b/services/ui/ws/access_policy.h index fa5b236..c29e3988 100644 --- a/services/ui/ws/access_policy.h +++ b/services/ui/ws/access_policy.h
@@ -59,7 +59,7 @@ virtual bool CanSetClientArea(const ServerWindow* window) const = 0; virtual bool CanSetHitTestMask(const ServerWindow* window) const = 0; virtual bool CanSetAcceptDrops(const ServerWindow* window) const = 0; - virtual bool CanSetAcceptEvents(const ServerWindow* window) const = 0; + virtual bool CanSetEventTargetingPolicy(const ServerWindow* window) const = 0; virtual bool CanStackAbove(const ServerWindow* above, const ServerWindow* below) const = 0; virtual bool CanStackAtTop(const ServerWindow* window) const = 0;
diff --git a/services/ui/ws/default_access_policy.cc b/services/ui/ws/default_access_policy.cc index 689108d..b9c8658 100644 --- a/services/ui/ws/default_access_policy.cc +++ b/services/ui/ws/default_access_policy.cc
@@ -151,7 +151,8 @@ delegate_->HasRootForAccessPolicy(window); } -bool DefaultAccessPolicy::CanSetAcceptEvents(const ServerWindow* window) const { +bool DefaultAccessPolicy::CanSetEventTargetingPolicy( + const ServerWindow* window) const { return WasCreatedByThisClient(window) || delegate_->HasRootForAccessPolicy(window); }
diff --git a/services/ui/ws/default_access_policy.h b/services/ui/ws/default_access_policy.h index 92f13765f..74cbde7 100644 --- a/services/ui/ws/default_access_policy.h +++ b/services/ui/ws/default_access_policy.h
@@ -52,7 +52,7 @@ bool CanSetClientArea(const ServerWindow* window) const override; bool CanSetHitTestMask(const ServerWindow* window) const override; bool CanSetAcceptDrops(const ServerWindow* window) const override; - bool CanSetAcceptEvents(const ServerWindow* window) const override; + bool CanSetEventTargetingPolicy(const ServerWindow* window) const override; bool CanStackAbove(const ServerWindow* above, const ServerWindow* below) const override; bool CanStackAtTop(const ServerWindow* window) const override;
diff --git a/services/ui/ws/display.cc b/services/ui/ws/display.cc index e93c880..68e8657 100644 --- a/services/ui/ws/display.cc +++ b/services/ui/ws/display.cc
@@ -256,6 +256,8 @@ root_.reset(window_server_->CreateServerWindow( display_manager()->GetAndAdvanceNextRootId(), ServerWindow::Properties())); + root_->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); root_->SetBounds(gfx::Rect(size)); root_->SetVisible(true); focus_controller_ = base::MakeUnique<FocusController>(this, root_.get());
diff --git a/services/ui/ws/event_dispatcher.cc b/services/ui/ws/event_dispatcher.cc index 80a0ed6..f045ac6 100644 --- a/services/ui/ws/event_dispatcher.cc +++ b/services/ui/ws/event_dispatcher.cc
@@ -86,19 +86,16 @@ delegate_->OnMouseCursorLocationChanged(screen_location); } -bool EventDispatcher::GetCurrentMouseCursor(ui::mojom::Cursor* cursor_out) { - if (drag_controller_) { - *cursor_out = drag_controller_->current_cursor(); - return true; - } +ui::mojom::Cursor EventDispatcher::GetCurrentMouseCursor() const { + if (drag_controller_) + return drag_controller_->current_cursor(); if (!mouse_cursor_source_window_) - return false; + return ui::mojom::Cursor::POINTER; - *cursor_out = mouse_cursor_in_non_client_area_ - ? mouse_cursor_source_window_->non_client_cursor() - : mouse_cursor_source_window_->cursor(); - return true; + return mouse_cursor_in_non_client_area_ + ? mouse_cursor_source_window_->non_client_cursor() + : mouse_cursor_source_window_->cursor(); } bool EventDispatcher::SetCaptureWindow(ServerWindow* window,
diff --git a/services/ui/ws/event_dispatcher.h b/services/ui/ws/event_dispatcher.h index 6e146ab..cd05854c 100644 --- a/services/ui/ws/event_dispatcher.h +++ b/services/ui/ws/event_dispatcher.h
@@ -63,9 +63,9 @@ return mouse_pointer_last_location_; } - // If we still have the window of the last mouse move, returns true and sets - // the current cursor to use to |cursor_out|. - bool GetCurrentMouseCursor(ui::mojom::Cursor* cursor_out); + // Returns the cursor for the current target, or POINTER if the mouse is not + // over a valid target. + ui::mojom::Cursor GetCurrentMouseCursor() const; // |capture_window_| will receive all input. See window_tree.mojom for // details.
diff --git a/services/ui/ws/event_dispatcher_unittest.cc b/services/ui/ws/event_dispatcher_unittest.cc index 5e059270..fee43f4b 100644 --- a/services/ui/ws/event_dispatcher_unittest.cc +++ b/services/ui/ws/event_dispatcher_unittest.cc
@@ -286,7 +286,6 @@ new ServerWindow(window_delegate_.get(), id)); parent->Add(child.get()); child->SetVisible(true); - EnableHitTest(child.get()); return child; } @@ -323,7 +322,6 @@ window_delegate_ = base::MakeUnique<TestServerWindowDelegate>(); root_window_ = base::MakeUnique<ServerWindow>(window_delegate_.get(), WindowId(1, 2)); - EnableHitTest(root_window_.get()); window_delegate_->set_root_window(root_window_.get()); root_window_->SetVisible(true); @@ -1663,11 +1661,11 @@ TEST_F(EventDispatcherTest, CaptureNotResetOnParentChange) { std::unique_ptr<ServerWindow> w1 = CreateChildWindow(WindowId(1, 3)); - DisableHitTest(w1.get()); + w1->set_event_targeting_policy(mojom::EventTargetingPolicy::DESCENDANTS_ONLY); std::unique_ptr<ServerWindow> w11 = CreateChildWindowWithParent(WindowId(1, 4), w1.get()); std::unique_ptr<ServerWindow> w2 = CreateChildWindow(WindowId(1, 5)); - DisableHitTest(w2.get()); + w2->set_event_targeting_policy(mojom::EventTargetingPolicy::DESCENDANTS_ONLY); root_window()->SetBounds(gfx::Rect(0, 0, 100, 100)); w1->SetBounds(gfx::Rect(0, 0, 100, 100)); @@ -1713,7 +1711,8 @@ TEST_F(EventDispatcherTest, MoveMouseFromNoTargetToValidTarget) { ServerWindow* root = root_window(); - DisableHitTest(root); + root->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); std::unique_ptr<ServerWindow> child = CreateChildWindow(WindowId(1, 3)); root->SetBounds(gfx::Rect(0, 0, 100, 100)); @@ -1738,7 +1737,8 @@ TEST_F(EventDispatcherTest, NoTargetToTargetWithMouseDown) { ServerWindow* root = root_window(); - DisableHitTest(root); + root->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); std::unique_ptr<ServerWindow> child = CreateChildWindow(WindowId(1, 3)); root->SetBounds(gfx::Rect(0, 0, 100, 100)); @@ -1770,7 +1770,8 @@ TEST_F(EventDispatcherTest, DontSendExitToSameClientWhenCaptureChanges) { ServerWindow* root = root_window(); - DisableHitTest(root); + root->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); std::unique_ptr<ServerWindow> c1 = CreateChildWindow(WindowId(1, 3)); std::unique_ptr<ServerWindow> c2 = CreateChildWindow(WindowId(1, 4));
diff --git a/services/ui/ws/frame_generator.cc b/services/ui/ws/frame_generator.cc index 73965d2..524a497 100644 --- a/services/ui/ws/frame_generator.cc +++ b/services/ui/ws/frame_generator.cc
@@ -71,6 +71,11 @@ } } +void FrameGenerator::OnWindowDamaged() { + if (window_manager_surface_info_.id().is_valid()) + compositor_frame_sink_->SetNeedsBeginFrame(true); +} + void FrameGenerator::DidReceiveCompositorFrameAck() {} void FrameGenerator::OnBeginFrame(const cc::BeginFrameArgs& begin_frame_arags) {
diff --git a/services/ui/ws/frame_generator.h b/services/ui/ws/frame_generator.h index cfa9536..6b4afe5 100644 --- a/services/ui/ws/frame_generator.h +++ b/services/ui/ws/frame_generator.h
@@ -50,6 +50,8 @@ // Updates the WindowManager's SurfaceInfo. void OnSurfaceCreated(const cc::SurfaceInfo& surface_info); + void OnWindowDamaged(); + private: friend class ui::ws::test::FrameGeneratorTest;
diff --git a/services/ui/ws/platform_display_default.cc b/services/ui/ws/platform_display_default.cc index e47e1f4..6f8c8d6 100644 --- a/services/ui/ws/platform_display_default.cc +++ b/services/ui/ws/platform_display_default.cc
@@ -177,7 +177,9 @@ // something but that isn't fully flushed out. } -void PlatformDisplayDefault::OnDamageRect(const gfx::Rect& damaged_region) {} +void PlatformDisplayDefault::OnDamageRect(const gfx::Rect& damaged_region) { + frame_generator_->OnWindowDamaged(); +} void PlatformDisplayDefault::DispatchEvent(ui::Event* event) { if (event->IsLocatedEvent())
diff --git a/services/ui/ws/server_window.cc b/services/ui/ws/server_window.cc index ea3cbfc6..d52bf66e 100644 --- a/services/ui/ws/server_window.cc +++ b/services/ui/ws/server_window.cc
@@ -35,7 +35,6 @@ non_client_cursor_id_(mojom::Cursor::CURSOR_NULL), opacity_(1), can_focus_(true), - can_accept_events_(true), properties_(properties), // Don't notify newly added observers during notification. This causes // problems for code that adds an observer as part of an observer
diff --git a/services/ui/ws/server_window.h b/services/ui/ws/server_window.h index 6ae3f21..cdd5034 100644 --- a/services/ui/ws/server_window.h +++ b/services/ui/ws/server_window.h
@@ -164,8 +164,12 @@ void set_can_focus(bool can_focus) { can_focus_ = can_focus; } bool can_focus() const { return can_focus_; } - void set_can_accept_events(bool value) { can_accept_events_ = value; } - bool can_accept_events() const { return can_accept_events_; } + void set_event_targeting_policy(mojom::EventTargetingPolicy policy) { + event_targeting_policy_ = policy; + } + mojom::EventTargetingPolicy event_targeting_policy() const { + return event_targeting_policy_; + } // Returns true if this window is attached to a root and all ancestors are // visible. @@ -245,7 +249,8 @@ mojom::Cursor non_client_cursor_id_; float opacity_; bool can_focus_; - bool can_accept_events_; + mojom::EventTargetingPolicy event_targeting_policy_ = + mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS; gfx::Transform transform_; ui::TextInputState text_input_state_;
diff --git a/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.cc b/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.cc index 70bfe18..acb08193 100644 --- a/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.cc +++ b/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.cc
@@ -27,17 +27,5 @@ manager_->frame_sink_data_.reset(); } -void EnableHitTest(ServerWindow* window) { - ServerWindowCompositorFrameSinkManagerTestApi test_api( - window->GetOrCreateCompositorFrameSinkManager()); - test_api.CreateEmptyDefaultCompositorFrameSink(); -} - -void DisableHitTest(ServerWindow* window) { - ServerWindowCompositorFrameSinkManagerTestApi test_api( - window->GetOrCreateCompositorFrameSinkManager()); - test_api.DestroyDefaultCompositorFrameSink(); -} - } // namespace ws } // namespace ui
diff --git a/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h b/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h index 7b0271f..c70319415 100644 --- a/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h +++ b/services/ui/ws/server_window_compositor_frame_sink_manager_test_api.h
@@ -11,8 +11,6 @@ namespace ui { namespace ws { -class ServerWindow; - // Use to poke at the internals of ServerWindowCompositorFrameSinkManager. class ServerWindowCompositorFrameSinkManagerTestApi { public: @@ -29,10 +27,6 @@ DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManagerTestApi); }; -// Use to make |window| a target for events. -void EnableHitTest(ServerWindow* window); -void DisableHitTest(ServerWindow* window); - } // namespace ws } // namespace ui
diff --git a/services/ui/ws/test_utils.cc b/services/ui/ws/test_utils.cc index 5d87a75..acfbae9 100644 --- a/services/ui/ws/test_utils.cc +++ b/services/ui/ws/test_utils.cc
@@ -525,6 +525,8 @@ const uint32_t embed_flags = 0; wm_tree->Embed(embed_window_id, std::move(client), embed_flags); ServerWindow* embed_window = wm_tree->GetWindowByClientId(embed_window_id); + embed_window->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); WindowTree* tree1 = window_server()->GetTreeWithRoot(embed_window); EXPECT_NE(nullptr, tree1); EXPECT_NE(tree1, wm_tree); @@ -554,7 +556,6 @@ child1->SetVisible(true); child1->SetBounds(window_bounds); - EnableHitTest(child1); TestWindowTreeClient* embed_client = ws_test_helper_.window_server_delegate()->last_client();
diff --git a/services/ui/ws/test_utils.h b/services/ui/ws/test_utils.h index 9469b95..b928869ed 100644 --- a/services/ui/ws/test_utils.h +++ b/services/ui/ws/test_utils.h
@@ -106,8 +106,9 @@ void set_window_manager_internal(mojom::WindowManager* wm_internal) { tree_->window_manager_internal_ = wm_internal; } - void SetCanAcceptEvents(Id transport_window_id, bool can_accept_events) { - tree_->SetCanAcceptEvents(transport_window_id, can_accept_events); + void SetEventTargetingPolicy(Id transport_window_id, + mojom::EventTargetingPolicy policy) { + tree_->SetEventTargetingPolicy(transport_window_id, policy); } void AckOldestEvent( mojom::EventResult result = mojom::EventResult::UNHANDLED) { @@ -139,6 +140,8 @@ void OnEvent(const ui::Event& event) { display_->OnEvent(event); } + mojom::Cursor last_cursor() const { return display_->last_cursor_; } + private: Display* display_;
diff --git a/services/ui/ws/window_finder.cc b/services/ui/ws/window_finder.cc index c687378d..4a75999a 100644 --- a/services/ui/ws/window_finder.cc +++ b/services/ui/ws/window_finder.cc
@@ -6,7 +6,6 @@ #include "base/containers/adapters.h" #include "services/ui/ws/server_window.h" -#include "services/ui/ws/server_window_compositor_frame_sink_manager.h" #include "services/ui/ws/server_window_delegate.h" #include "services/ui/ws/window_coordinate_conversions.h" #include "ui/gfx/geometry/point.h" @@ -17,19 +16,9 @@ namespace ws { namespace { -bool IsValidWindowForEvents(ServerWindow* window) { - ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager = - window->compositor_frame_sink_manager(); - // Valid windows have at least one of the two surface types. Only an underlay - // is valid as we assume the window manager will likely get the event in this - // case. - return compositor_frame_sink_manager && - compositor_frame_sink_manager->HasCompositorFrameSink(); -} - bool IsLocationInNonclientArea(const ServerWindow* target, const gfx::Point& location) { - if (!target->parent()) + if (!target->parent() || target->bounds().size().IsEmpty()) return false; gfx::Rect client_area(target->bounds().size()); @@ -48,47 +37,54 @@ bool FindDeepestVisibleWindowForEventsImpl(ServerWindow* window, const gfx::Point& location, DeepestWindow* deepest_window) { - if (!window->can_accept_events()) { - if (!IsLocationInNonclientArea(window, location) || - !IsValidWindowForEvents(window)) { - return false; - } + // The non-client area takes precedence over descendants, as otherwise the + // user would likely not be able to hit the non-client area as it's common + // for descendants to go into the non-client area. + if (IsLocationInNonclientArea(window, location)) { deepest_window->window = window; deepest_window->in_non_client_area = true; return true; } + const mojom::EventTargetingPolicy event_targeting_policy = + window->event_targeting_policy(); - const ServerWindow::Windows& children = window->children(); - for (ServerWindow* child : base::Reversed(children)) { - if (!child->visible()) - continue; + if (event_targeting_policy == ui::mojom::EventTargetingPolicy::NONE) + return false; - // TODO(sky): support transform. - gfx::Point location_in_child(location.x() - child->bounds().x(), - location.y() - child->bounds().y()); - gfx::Rect child_bounds(child->bounds().size()); - child_bounds.Inset(-child->extended_hit_test_region().left(), - -child->extended_hit_test_region().top(), - -child->extended_hit_test_region().right(), - -child->extended_hit_test_region().bottom()); - if (!child_bounds.Contains(location_in_child) || - (child->hit_test_mask() && - !child->hit_test_mask()->Contains(location_in_child))) { - continue; - } + if (event_targeting_policy == + mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS || + event_targeting_policy == mojom::EventTargetingPolicy::DESCENDANTS_ONLY) { + const ServerWindow::Windows& children = window->children(); + for (ServerWindow* child : base::Reversed(children)) { + if (!child->visible()) + continue; - if (FindDeepestVisibleWindowForEventsImpl(child, location_in_child, - deepest_window)) { - return true; + // TODO(sky): support transform. + gfx::Point location_in_child(location.x() - child->bounds().x(), + location.y() - child->bounds().y()); + gfx::Rect child_bounds(child->bounds().size()); + child_bounds.Inset(-child->extended_hit_test_region().left(), + -child->extended_hit_test_region().top(), + -child->extended_hit_test_region().right(), + -child->extended_hit_test_region().bottom()); + if (!child_bounds.Contains(location_in_child) || + (child->hit_test_mask() && + !child->hit_test_mask()->Contains(location_in_child))) { + continue; + } + + if (FindDeepestVisibleWindowForEventsImpl(child, location_in_child, + deepest_window)) { + return true; + } } } - if (!IsValidWindowForEvents(window)) + if (event_targeting_policy == mojom::EventTargetingPolicy::DESCENDANTS_ONLY) return false; deepest_window->window = window; - deepest_window->in_non_client_area = - IsLocationInNonclientArea(window, location); + deepest_window->in_non_client_area = false; return true; }
diff --git a/services/ui/ws/window_finder_unittest.cc b/services/ui/ws/window_finder_unittest.cc index 71b6c94..1663033 100644 --- a/services/ui/ws/window_finder_unittest.cc +++ b/services/ui/ws/window_finder_unittest.cc
@@ -17,19 +17,19 @@ TEST(WindowFinderTest, FindDeepestVisibleWindow) { TestServerWindowDelegate window_delegate; ServerWindow root(&window_delegate, WindowId(1, 2)); + root.set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); window_delegate.set_root_window(&root); root.SetVisible(true); root.SetBounds(gfx::Rect(0, 0, 100, 100)); ServerWindow child1(&window_delegate, WindowId(1, 3)); root.Add(&child1); - EnableHitTest(&child1); child1.SetVisible(true); child1.SetBounds(gfx::Rect(10, 10, 20, 20)); ServerWindow child2(&window_delegate, WindowId(1, 4)); root.Add(&child2); - EnableHitTest(&child2); child2.SetVisible(true); child2.SetBounds(gfx::Rect(15, 15, 20, 20)); @@ -41,7 +41,7 @@ &child1, FindDeepestVisibleWindowForEvents(&root, gfx::Point(13, 14)).window); - child1.set_can_accept_events(false); + child1.set_event_targeting_policy(mojom::EventTargetingPolicy::NONE); EXPECT_EQ( nullptr, FindDeepestVisibleWindowForEvents(&root, gfx::Point(13, 14)).window); @@ -55,14 +55,12 @@ TEST(WindowFinderTest, FindDeepestVisibleWindowNonClientArea) { TestServerWindowDelegate window_delegate; ServerWindow root(&window_delegate, WindowId(1, 2)); - EnableHitTest(&root); window_delegate.set_root_window(&root); root.SetVisible(true); root.SetBounds(gfx::Rect(0, 0, 100, 100)); ServerWindow child1(&window_delegate, WindowId(1, 3)); root.Add(&child1); - EnableHitTest(&child1); child1.SetVisible(true); child1.SetBounds(gfx::Rect(10, 10, 20, 20)); @@ -86,15 +84,15 @@ EXPECT_EQ(&child1, result.window); EXPECT_FALSE(result.in_non_client_area); - // set_can_accept_events(false) should not impact the result for the + // EventTargetingPolicy::NONE should not impact the result for the // non-client area. - child1.set_can_accept_events(false); + child1.set_event_targeting_policy(mojom::EventTargetingPolicy::NONE); result = FindDeepestVisibleWindowForEvents(&root, gfx::Point(11, 11)); child1.SetClientArea(gfx::Insets(2, 3, 4, 5), std::vector<gfx::Rect>()); EXPECT_EQ(&child1, result.window); EXPECT_TRUE(result.in_non_client_area); - // set_can_accept_events(false) means the client area won't be matched though. + // EventTargetingPolicy::NONE means the client area won't be matched though. result = FindDeepestVisibleWindowForEvents(&root, gfx::Point(15, 15)); EXPECT_EQ(&root, result.window); EXPECT_FALSE(result.in_non_client_area); @@ -104,13 +102,11 @@ TestServerWindowDelegate window_delegate; ServerWindow root(&window_delegate, WindowId(1, 2)); window_delegate.set_root_window(&root); - EnableHitTest(&root); root.SetVisible(true); root.SetBounds(gfx::Rect(0, 0, 100, 100)); ServerWindow child_with_mask(&window_delegate, WindowId(1, 4)); root.Add(&child_with_mask); - EnableHitTest(&child_with_mask); child_with_mask.SetVisible(true); child_with_mask.SetBounds(gfx::Rect(10, 10, 20, 20)); child_with_mask.SetHitTestMask(gfx::Rect(2, 2, 16, 16)); @@ -137,12 +133,12 @@ // not a valid event target. ServerWindow child1(&window_delegate, WindowId(1, 3)); root.Add(&child1); - EnableHitTest(&child1); child1.SetVisible(true); child1.SetBounds(gfx::Rect(10, 10, 20, 20)); ServerWindow child2(&window_delegate, WindowId(1, 4)); root.Add(&child2); + child2.set_event_targeting_policy(mojom::EventTargetingPolicy::NONE); child2.SetVisible(true); child2.SetBounds(gfx::Rect(15, 15, 20, 20)); @@ -153,5 +149,31 @@ FindDeepestVisibleWindowForEvents(&root, gfx::Point(16, 16)).window); } +TEST(WindowFinderTest, NonClientPreferredOverChild) { + TestServerWindowDelegate window_delegate; + ServerWindow root(&window_delegate, WindowId(1, 2)); + window_delegate.set_root_window(&root); + root.SetVisible(true); + root.SetBounds(gfx::Rect(0, 0, 100, 100)); + + // Create two windows, |child| and |child_child|; |child| is a child of the + // root and |child_child| and child of |child|. All share the same size with + // |child| having a non-client area. + ServerWindow child(&window_delegate, WindowId(1, 3)); + root.Add(&child); + child.SetVisible(true); + child.SetBounds(gfx::Rect(0, 0, 100, 100)); + child.SetClientArea(gfx::Insets(2, 3, 4, 5), std::vector<gfx::Rect>()); + + ServerWindow child_child(&window_delegate, WindowId(1, 4)); + child.Add(&child_child); + child_child.SetVisible(true); + child_child.SetBounds(gfx::Rect(0, 0, 100, 100)); + + // |child| was should be returned as the event is over the non-client area. + EXPECT_EQ(&child, + FindDeepestVisibleWindowForEvents(&root, gfx::Point(1, 1)).window); +} + } // namespace ws } // namespace ui
diff --git a/services/ui/ws/window_manager_access_policy.cc b/services/ui/ws/window_manager_access_policy.cc index 451fd98..32d9cae1 100644 --- a/services/ui/ws/window_manager_access_policy.cc +++ b/services/ui/ws/window_manager_access_policy.cc
@@ -136,7 +136,7 @@ return true; } -bool WindowManagerAccessPolicy::CanSetAcceptEvents( +bool WindowManagerAccessPolicy::CanSetEventTargetingPolicy( const ServerWindow* window) const { return WasCreatedByThisClient(window) || delegate_->HasRootForAccessPolicy(window);
diff --git a/services/ui/ws/window_manager_access_policy.h b/services/ui/ws/window_manager_access_policy.h index f15b36a5..1eebe33 100644 --- a/services/ui/ws/window_manager_access_policy.h +++ b/services/ui/ws/window_manager_access_policy.h
@@ -51,7 +51,7 @@ bool CanSetClientArea(const ServerWindow* window) const override; bool CanSetHitTestMask(const ServerWindow* window) const override; bool CanSetAcceptDrops(const ServerWindow* window) const override; - bool CanSetAcceptEvents(const ServerWindow* window) const override; + bool CanSetEventTargetingPolicy(const ServerWindow* window) const override; bool CanStackAbove(const ServerWindow* above, const ServerWindow* below) const override; bool CanStackAtTop(const ServerWindow* window) const override;
diff --git a/services/ui/ws/window_manager_display_root.cc b/services/ui/ws/window_manager_display_root.cc index f8ff144..03c69f8 100644 --- a/services/ui/ws/window_manager_display_root.cc +++ b/services/ui/ws/window_manager_display_root.cc
@@ -16,6 +16,8 @@ root_.reset(window_server()->CreateServerWindow( window_server()->display_manager()->GetAndAdvanceNextRootId(), ServerWindow::Properties())); + root_->set_event_targeting_policy( + mojom::EventTargetingPolicy::DESCENDANTS_ONLY); // Our root is always a child of the Display's root. Do this // before the WindowTree has been created so that the client doesn't get // notified of the add, bounds change and visibility change.
diff --git a/services/ui/ws/window_manager_state.cc b/services/ui/ws/window_manager_state.cc index ef09226..028e06c 100644 --- a/services/ui/ws/window_manager_state.cc +++ b/services/ui/ws/window_manager_state.cc
@@ -528,11 +528,9 @@ } void WindowManagerState::UpdateNativeCursorFromDispatcher() { - ui::mojom::Cursor cursor_id = mojom::Cursor::CURSOR_NULL; - if (event_dispatcher_.GetCurrentMouseCursor(&cursor_id)) { - for (Display* display : display_manager()->displays()) - display->UpdateNativeCursor(cursor_id); - } + const ui::mojom::Cursor cursor_id = event_dispatcher_.GetCurrentMouseCursor(); + for (Display* display : display_manager()->displays()) + display->UpdateNativeCursor(cursor_id); } void WindowManagerState::OnCaptureChanged(ServerWindow* new_capture, @@ -627,6 +625,8 @@ void WindowManagerState::OnEventTargetNotFound(const ui::Event& event) { window_server()->SendToPointerWatchers(event, user_id(), nullptr, /* window */ nullptr /* ignore_tree */); + if (event.IsMousePointerEvent()) + UpdateNativeCursorFromDispatcher(); } void WindowManagerState::OnWindowEmbeddedAppDisconnected(ServerWindow* window) {
diff --git a/services/ui/ws/window_manager_state_unittest.cc b/services/ui/ws/window_manager_state_unittest.cc index 6a03c5d..1de0f60 100644 --- a/services/ui/ws/window_manager_state_unittest.cc +++ b/services/ui/ws/window_manager_state_unittest.cc
@@ -72,6 +72,9 @@ return window_event_targeting_helper_.last_binding()->tree(); } WindowManagerState* window_manager_state() { return window_manager_state_; } + WindowServer* window_server() { + return window_event_targeting_helper_.window_server(); + } void EmbedAt(WindowTree* tree, const ClientWindowId& embed_window_id, @@ -567,6 +570,25 @@ window_server->DestroyTree(tree); } +TEST_F(WindowManagerStateTest, CursorResetOverNoTarget) { + TestChangeTracker* tracker = window_tree_client()->tracker(); + ASSERT_EQ(1u, window_server()->display_manager()->displays().size()); + Display* display = *(window_server()->display_manager()->displays().begin()); + DisplayTestApi display_test_api(display); + // This test assumes the default is not a pointer, otherwise it can't detect + // the change. + EXPECT_NE(ui::mojom::Cursor::POINTER, display_test_api.last_cursor()); + ui::PointerEvent move( + ui::ET_POINTER_MOVED, gfx::Point(), gfx::Point(), 0, 0, 0, + ui::PointerDetails(EventPointerType::POINTER_TYPE_MOUSE), + base::TimeTicks()); + window_manager_state()->ProcessEvent(move); + // The event isn't over a valid target, which should trigger resetting the + // cursor to POINTER. + EXPECT_EQ(ui::mojom::Cursor::POINTER, display_test_api.last_cursor()); + EXPECT_TRUE(tracker->changes()->empty()); +} + } // namespace test } // namespace ws } // namespace ui
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc index c4758a5..4a2cb7d6 100644 --- a/services/ui/ws/window_server.cc +++ b/services/ui/ws/window_server.cc
@@ -583,9 +583,8 @@ EventDispatcher* event_dispatcher = display_root->window_manager_state()->event_dispatcher(); event_dispatcher->UpdateCursorProviderByLastKnownLocation(); - mojom::Cursor cursor_id = mojom::Cursor::CURSOR_NULL; - if (event_dispatcher->GetCurrentMouseCursor(&cursor_id)) - display_root->display()->UpdateNativeCursor(cursor_id); + display_root->display()->UpdateNativeCursor( + event_dispatcher->GetCurrentMouseCursor()); } } @@ -601,9 +600,8 @@ return; event_dispatcher->UpdateNonClientAreaForCurrentWindow(); - mojom::Cursor cursor_id = mojom::Cursor::CURSOR_NULL; - if (event_dispatcher->GetCurrentMouseCursor(&cursor_id)) - display_root->display()->UpdateNativeCursor(cursor_id); + display_root->display()->UpdateNativeCursor( + event_dispatcher->GetCurrentMouseCursor()); } bool WindowServer::IsUserInHighContrastMode(const UserId& user) const {
diff --git a/services/ui/ws/window_server_test_base.cc b/services/ui/ws/window_server_test_base.cc index c6d4ee1bf..492bad0 100644 --- a/services/ui/ws/window_server_test_base.cc +++ b/services/ui/ws/window_server_test_base.cc
@@ -143,10 +143,6 @@ void WindowServerTestBase::OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) {} -aura::client::CaptureClient* WindowServerTestBase::GetCaptureClient() { - return wm_state_.capture_controller(); -} - aura::PropertyConverter* WindowServerTestBase::GetPropertyConverter() { return &property_converter_; }
diff --git a/services/ui/ws/window_server_test_base.h b/services/ui/ws/window_server_test_base.h index e4a6e65..c983761 100644 --- a/services/ui/ws/window_server_test_base.h +++ b/services/ui/ws/window_server_test_base.h
@@ -84,7 +84,6 @@ void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // WindowManagerDelegate:
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc index 55838d3..5322466 100644 --- a/services/ui/ws/window_tree.cc +++ b/services/ui/ws/window_tree.cc
@@ -1564,13 +1564,13 @@ } } -void WindowTree::SetCanAcceptEvents(Id transport_window_id, - bool can_accept_events) { +void WindowTree::SetEventTargetingPolicy(Id transport_window_id, + mojom::EventTargetingPolicy policy) { ServerWindow* window = GetWindowByClientId(ClientWindowId(transport_window_id)); // TODO(riajiang): check |event_queue_| is empty for |window|. - if (window && access_policy_->CanSetAcceptEvents(window)) - window->set_can_accept_events(can_accept_events); + if (window && access_policy_->CanSetEventTargetingPolicy(window)) + window->set_event_targeting_policy(policy); } void WindowTree::SetPredefinedCursor(uint32_t change_id,
diff --git a/services/ui/ws/window_tree.h b/services/ui/ws/window_tree.h index 7ccf7d01..ea6dd8b 100644 --- a/services/ui/ws/window_tree.h +++ b/services/ui/ws/window_tree.h
@@ -425,8 +425,8 @@ const EmbedCallback& callback) override; void SetFocus(uint32_t change_id, Id transport_window_id) override; void SetCanFocus(Id transport_window_id, bool can_focus) override; - void SetCanAcceptEvents(Id transport_window_id, - bool can_accept_events) override; + void SetEventTargetingPolicy(Id transport_window_id, + mojom::EventTargetingPolicy policy) override; void SetPredefinedCursor(uint32_t change_id, Id transport_window_id, ui::mojom::Cursor cursor_id) override;
diff --git a/services/ui/ws/window_tree_unittest.cc b/services/ui/ws/window_tree_unittest.cc index c82e7d0..356e40d 100644 --- a/services/ui/ws/window_tree_unittest.cc +++ b/services/ui/ws/window_tree_unittest.cc
@@ -223,7 +223,9 @@ ServerWindow* wm_root = FirstRoot(wm_tree()); ASSERT_TRUE(wm_root); wm_root->SetBounds(gfx::Rect(0, 0, 100, 100)); - EnableHitTest(wm_root); + // This tests expects |wm_root| to be a possible target. + wm_root->set_event_targeting_policy( + mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS); display()->root_window()->SetBounds(gfx::Rect(0, 0, 100, 100)); mojom::WindowTreeClientPtr client; mojom::WindowTreeClientRequest client_request(&client); @@ -244,7 +246,6 @@ ASSERT_TRUE(child1); child1->SetVisible(true); child1->SetBounds(gfx::Rect(20, 20, 20, 20)); - EnableHitTest(child1); TestWindowTreeClient* tree1_client = last_window_tree_client(); tree1_client->tracker()->changes()->clear(); @@ -492,7 +493,7 @@ // inside. DispatchEventAndAckImmediately(CreateMouseMoveEvent(5, 5)); window->SetPredefinedCursor(mojom::Cursor::IBEAM); - EXPECT_EQ(mojom::Cursor::CURSOR_NULL, cursor_id()); + EXPECT_EQ(mojom::Cursor::POINTER, cursor_id()); DispatchEventAndAckImmediately(CreateMouseMoveEvent(21, 22)); EXPECT_EQ(mojom::Cursor::IBEAM, cursor_id()); @@ -508,11 +509,11 @@ // inside. DispatchEventAndAckImmediately(CreateMouseMoveEvent(5, 5)); window->SetPredefinedCursor(mojom::Cursor::IBEAM); - EXPECT_EQ(mojom::Cursor::CURSOR_NULL, cursor_id()); + EXPECT_EQ(mojom::Cursor::POINTER, cursor_id()); // With a touch event, we shouldn't update the cursor. DispatchEventAndAckImmediately(CreatePointerDownEvent(21, 22)); - EXPECT_EQ(mojom::Cursor::CURSOR_NULL, cursor_id()); + EXPECT_EQ(mojom::Cursor::POINTER, cursor_id()); } TEST_F(WindowTreeTest, DragOutsideWindow) { @@ -525,7 +526,7 @@ // change the cursor. DispatchEventAndAckImmediately(CreateMouseMoveEvent(5, 5)); window->SetPredefinedCursor(mojom::Cursor::IBEAM); - EXPECT_EQ(mojom::Cursor::CURSOR_NULL, cursor_id()); + EXPECT_EQ(mojom::Cursor::POINTER, cursor_id()); // Move the pointer to the inside of the window DispatchEventAndAckImmediately(CreateMouseMoveEvent(21, 22)); @@ -554,7 +555,7 @@ // Put the cursor just outside the bounds of the window. DispatchEventAndAckImmediately(CreateMouseMoveEvent(41, 41)); window->SetPredefinedCursor(mojom::Cursor::IBEAM); - EXPECT_EQ(mojom::Cursor::CURSOR_NULL, cursor_id()); + EXPECT_EQ(mojom::Cursor::POINTER, cursor_id()); // Expand the bounds of the window so they now include where the cursor now // is. @@ -581,7 +582,6 @@ EXPECT_TRUE(tree->AddWindow(embed_window_id, child2_id)); child2->SetVisible(true); child2->SetBounds(gfx::Rect(20, 20, 20, 20)); - EnableHitTest(child2); // Give each window a different cursor. window1->SetPredefinedCursor(mojom::Cursor::IBEAM); @@ -607,7 +607,9 @@ ServerWindow* wm_root = FirstRoot(wm_tree()); ASSERT_TRUE(wm_root); wm_root->SetBounds(gfx::Rect(0, 0, 100, 100)); - EnableHitTest(wm_root); + // This tests expects |wm_root| to be a possible target. + wm_root->set_event_targeting_policy( + mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS); wm_client()->tracker()->changes()->clear(); DispatchEventWithoutAck(CreateMouseMoveEvent(21, 22)); @@ -1305,10 +1307,13 @@ ServerWindow* window = nullptr; EXPECT_NO_FATAL_FAILURE(SetupEventTargeting(&embed_client, &tree, &window)); - EXPECT_TRUE(window->can_accept_events()); - WindowTreeTestApi(tree).SetCanAcceptEvents( - ClientWindowIdForWindow(tree, window).id, false); - EXPECT_FALSE(window->can_accept_events()); + EXPECT_EQ(mojom::EventTargetingPolicy::TARGET_AND_DESCENDANTS, + window->event_targeting_policy()); + WindowTreeTestApi(tree).SetEventTargetingPolicy( + ClientWindowIdForWindow(tree, window).id, + mojom::EventTargetingPolicy::NONE); + EXPECT_EQ(mojom::EventTargetingPolicy::NONE, + window->event_targeting_policy()); } // Verifies wm observers capture changes in client.
diff --git a/testing/android/OWNERS b/testing/android/OWNERS index 0156372..f1cabca 100644 --- a/testing/android/OWNERS +++ b/testing/android/OWNERS
@@ -6,3 +6,5 @@ tedchoc@chromium.org torne@chromium.org yfriedman@chromium.org + +# COMPONENT: Test>Android
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 3285752..f470f94 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -37,33 +37,27 @@ "test": "app_shell_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ash_content_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ash_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "aura_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -71,6 +65,7 @@ }, { "args": [ + "--ozone-platform=headless", "--override-use-gl-with-osmesa-for-tests", "--run-in-mash", "--service-overrides=src/chrome/app/mash/mash_service_overrides.json", @@ -85,18 +80,12 @@ "test": "browser_tests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "cacheinvalidation_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -109,6 +98,9 @@ "test": "chromeos_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, @@ -134,18 +126,12 @@ "test": "content_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "crypto_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -158,18 +144,12 @@ "test": "display_service_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "display_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -188,18 +168,12 @@ "test": "extensions_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "gcm_unit_tests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -209,15 +183,6 @@ "swarming": { "can_use_on_swarming_builders": true }, - "test": "gl_unittests" - }, - { - "args": [ - "--ozone-platform=x11" - ], - "swarming": { - "can_use_on_swarming_builders": true - }, "test": "gl_unittests_ozone" }, { @@ -227,21 +192,24 @@ "test": "google_apis_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, "test": "gpu_ipc_service_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, "test": "gpu_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -261,27 +229,18 @@ "test": "ipc_tests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "jingle_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "mash_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -294,9 +253,6 @@ "test": "media_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -309,15 +265,15 @@ "test": "midi_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "mus_demo_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, @@ -336,9 +292,6 @@ "test": "nacl_loader_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -351,24 +304,21 @@ "test": "net_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ozone_gl_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ozone_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -393,45 +343,30 @@ "test": "remoting_unittests" }, { - "args": [ - "--test-launcher-print-test-stdio=always" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "sandbox_linux_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "service_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "skia_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "sql_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -444,9 +379,6 @@ "test": "ui_arc_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, @@ -459,24 +391,21 @@ "test": "ui_chromeos_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ui_struct_traits_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true }, "test": "ui_touch_selection_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": true }, @@ -489,9 +418,6 @@ "test": "url_unittests" }, { - "args": [ - "--override-use-gl-with-osmesa-for-tests" - ], "swarming": { "can_use_on_swarming_builders": false }, @@ -504,9 +430,6 @@ "test": "views_mus_unittests" }, { - "args": [ - "--ozone-platform=x11" - ], "swarming": { "can_use_on_swarming_builders": true },
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index bb834d1..c1ad2480 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -11357,6 +11357,7 @@ "gtest_tests": [ { "args": [ + "--ozone-platform=headless", "--override-use-gl-with-osmesa-for-tests", "--run-in-mash", "--service-overrides=src/chrome/app/mash/mash_service_overrides.json", @@ -11375,6 +11376,9 @@ "test": "media_service_unittests" }, { + "args": [ + "--ozone-platform=headless" + ], "swarming": { "can_use_on_swarming_builders": false },
diff --git a/testing/buildbot/chromium.perf.fyi.json b/testing/buildbot/chromium.perf.fyi.json index e1c7d81..0436519 100644 --- a/testing/buildbot/chromium.perf.fyi.json +++ b/testing/buildbot/chromium.perf.fyi.json
@@ -10493,6 +10493,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=android-chromium" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "android_devices": "1", + "id": "build248-m4--device6", + "os": "Android", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -21726,6 +21783,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:22b1", + "id": "build148-b1", + "os": "Windows-10-10586", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:22b1", + "id": "build148-b1", + "os": "Windows-10-10586", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -32845,6 +32959,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:9874", + "id": "build212-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:9874", + "id": "build212-b4", + "os": "Windows-10-10586", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results",
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index a1626b57..f2d49cf 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -10675,6 +10675,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build149-m1", + "os": "Ubuntu-14.04", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build149-m1", + "os": "Ubuntu-14.04", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -21813,6 +21870,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0166", + "id": "build103-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0166", + "id": "build103-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -32932,6 +33046,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "id": "build159-m1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a2e", + "id": "build159-m1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -44051,6 +44222,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1626", + "id": "build124-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1626", + "id": "build124-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -55170,6 +55398,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a26", + "id": "build25-b1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0a26", + "id": "build25-b1", + "os": "Mac-10.12", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -66289,6 +66574,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "id": "build129-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6821", + "id": "build129-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -77408,6 +77750,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build5-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:0d26", + "id": "build5-b1", + "os": "Mac-10.11", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -88527,6 +88926,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1616", + "id": "build118-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:1616", + "id": "build118-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -99665,6 +100121,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build133-m1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0534", + "id": "build133-m1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -110860,6 +111373,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6779", + "id": "build102-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "1002:6779", + "id": "build102-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -122036,6 +122606,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:041a", + "id": "build165-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:041a", + "id": "build165-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -133231,6 +133858,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "id": "build93-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "10de:104a", + "id": "build93-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -144407,6 +145091,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build186-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build186-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -155564,6 +156305,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build139-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build139-m1", + "os": "Windows-2008ServerR2-SP1", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -166740,6 +167538,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build144-m1", + "os": "Windows-2012ServerR2-SP0", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "102b:0532", + "id": "build144-m1", + "os": "Windows-2012ServerR2-SP0", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results", @@ -177859,6 +178714,63 @@ }, { "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=release_x64" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:161e", + "id": "build31-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ + "v8.mobile_infinite_scroll-turbo_tbmv2", + "-v", + "--upload-results", + "--output-format=chartjson", + "--browser=reference", + "--output-trace-tag=_ref" + ], + "isolate_name": "telemetry_perf_tests", + "name": "v8.mobile_infinite_scroll-turbo_tbmv2.reference", + "override_compile_targets": [ + "telemetry_perf_tests" + ], + "swarming": { + "can_use_on_swarming_builders": true, + "dimension_sets": [ + { + "gpu": "8086:161e", + "id": "build31-b1", + "os": "Windows-10-10240", + "pool": "Chrome-perf" + } + ], + "expiration": 21600, + "hard_timeout": 7200, + "io_timeout": 3600 + } + }, + { + "args": [ "v8.mobile_infinite_scroll_tbmv2", "-v", "--upload-results",
diff --git a/testing/scripts/kasko_integration_tests.py b/testing/scripts/kasko_integration_tests.py deleted file mode 100755 index 1be0474..0000000 --- a/testing/scripts/kasko_integration_tests.py +++ /dev/null
@@ -1,49 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Wrapper for the Kasko integration tests.""" - - -import json -import os -import sys - - -import common - - -# Bring in the Kasko test modules. -KASKO_TEST_DIR = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, - 'chrome', 'test', 'kasko') -KASKO_INTEGRATION_TEST = os.path.join(KASKO_TEST_DIR, - 'kasko_integration_test.py') - - -def main_run(args): - if not sys.platform.startswith('win'): - json.dump({ - 'valid': False, - 'failures': ['This script should only be called on win32.'], - }, args.output) - - with common.temporary_file() as tempfile_path: - kasko_integration_test_res = common.run_integration_test( - KASKO_INTEGRATION_TEST, - ['--log-to-json', tempfile_path], - tempfile_path, args.output) - - return kasko_integration_test_res - - -def main_compile_targets(args): - json.dump(['chrome', 'chromedriver'], args.output) - - -if __name__ == '__main__': - funcs = { - 'run': main_run, - 'compile_targets': main_compile_targets, - } - sys.exit(common.run_script(sys.argv[1:], funcs))
diff --git a/testing/scripts/syzyasan_integration_tests.py b/testing/scripts/syzyasan_integration_tests.py deleted file mode 100755 index 5d6d847..0000000 --- a/testing/scripts/syzyasan_integration_tests.py +++ /dev/null
@@ -1,49 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Wrapper for the SyzyAsan integration tests.""" - - -import json -import os -import sys - - -import common - - -# Bring in the SyzyAsan test modules. -SYZYASAN_TEST_DIR = os.path.join(os.path.dirname(__file__), os.pardir, - os.pardir, 'chrome', 'test', 'kasko') -SYZYASAN_INTEGRATION_TEST = os.path.join(SYZYASAN_TEST_DIR, - 'syzyasan_integration_test.py') - - -def main_run(args): - if not sys.platform.startswith('win'): - json.dump({ - 'valid': False, - 'failures': ['This script should only be called on win32.'], - }, args.output) - - with common.temporary_file() as tempfile_path: - syzyasan_integration_test_res = common.run_integration_test( - SYZYASAN_INTEGRATION_TEST, - ['--log-to-json', tempfile_path], - tempfile_path, args.output) - - return syzyasan_integration_test_res - - -def main_compile_targets(args): - json.dump(['chrome', 'chromedriver'], args.output) - - -if __name__ == '__main__': - funcs = { - 'run': main_run, - 'compile_targets': main_compile_targets, - } - sys.exit(common.run_script(sys.argv[1:], funcs))
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index e73dca25..de7d584 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -19,7 +19,6 @@ Bug(none) cssom/ [ Skip ] Bug(none) csspaint/ [ Skip ] Bug(none) custom-elements/ [ Skip ] -Bug(none) dialog/ [ Skip ] Bug(none) dom/ [ Skip ] Bug(none) editing/ [ Skip ] Bug(none) fonts/ [ Skip ] @@ -28,6 +27,7 @@ Bug(none) gamepad/ [ Skip ] Bug(none) harness-tests/ [ Skip ] Bug(none) hittesting/ [ Skip ] +Bug(none) html/dialog/ [ Skip ] Bug(none) html5lib/ [ Skip ] Bug(none) http/ [ Skip ] Bug(none) idle-callback/ [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls index df2d5a1..c23a960 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls +++ b/third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls
@@ -289,9 +289,6 @@ Bug(none) fast/dom/horizontal-scrollbar-in-rtl.html [ Crash ] Bug(none) fast/dom/horizontal-scrollbar-when-dir-change.html [ Failure ] Bug(none) fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe.html [ Failure ] -Bug(none) fast/dom/HTMLDialogElement/abspos-dialog-layout.html [ Failure ] -Bug(none) fast/dom/HTMLDialogElement/form-method-dialog.html [ Failure ] -Bug(none) fast/dom/HTMLDialogElement/multiple-centered-dialogs.html [ Failure ] Bug(none) fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Failure ] Bug(none) fast/dom/scroll-reveal-left-overflow.html [ Failure ] Bug(none) fast/dom/scroll-reveal-top-overflow.html [ Failure ] @@ -410,6 +407,9 @@ Bug(none) fonts/cursive.html [ Failure ] Bug(none) fonts/fantasy.html [ Failure ] Bug(none) fonts/sans-serif.html [ Failure ] +Bug(none) html/dialog/abspos-dialog-layout.html [ Failure ] +Bug(none) html/dialog/form-method-dialog.html [ Failure ] +Bug(none) html/dialog/multiple-centered-dialogs.html [ Failure ] Bug(none) http/tests/misc/acid3.html [ Failure ] Bug(none) http/tests/navigation/anchor-frames-same-origin.html [ Failure ] Bug(none) http/tests/navigation/anchor-frames-shifting-focus.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 7f807f2..5bd5568 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1845,6 +1845,8 @@ crbug.com/613661 external/wpt/quirks-mode/table-cell-nowrap-minimum-width-calculation.html [ Failure ] crbug.com/613663 external/wpt/quirks-mode/table-cell-width-calculation.html [ Failure ] +crbug.com/646133 external/wpt/quirks-mode/unitless-length.html [ Pass Timeout ] + # Note: this test was previously marked as slow on Debug builds. Skipping until crash is fixed crbug.com/619978 fast/css/giant-stylesheet-crash.html [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-modal.html b/third_party/WebKit/LayoutTests/accessibility/aria-modal.html new file mode 100644 index 0000000..7efdbb3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/accessibility/aria-modal.html
@@ -0,0 +1,66 @@ +<!DOCTYPE HTML> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> + +<dialog id="modal-1"> + <div id="aria-modal-1" role="button" aria-modal="true"> + </div> + <div id="aria-modal-2" role="dialog" aria-modal="false"> + </div> + <div id="aria-modal-3" role="dialog" aria-modal="true"> + </div> + <div id="aria-modal-4" role="alertdialog" aria-modal="true"> + </div> + <dialog id="modal-2">Closed Dialog</dialog> + <dialog open id="modal-3">Open Dialog</dialog> + <dialog open id="modal-4" aria-modal="true">Open with aria-modal</dialog> +</dialog> + +<script> +document.getElementById('modal-1').showModal(); + +function axElementById(id) { + return accessibilityController.accessibleElementById(id); +} + +test(function(t) { + var axAriaModal1 = axElementById("aria-modal-1"); + assert_equals(axAriaModal1.isModal, false); +}, "A button can't be modal"); + +test(function(t) { + var axAriaModal2 = axElementById("aria-modal-2"); + assert_equals(axAriaModal2.isModal, false); +}, "An ARIA dialog with aria-modal false is not modal"); + +test(function(t) { + var axAriaModal3 = axElementById("aria-modal-3"); + assert_equals(axAriaModal3.isModal, true); +}, "An ARIA dialog with aria-modal true is modal"); + +test(function(t) { + var axAriaModal4 = axElementById("aria-modal-4"); + assert_equals(axAriaModal4.isModal, true); +}, "An ARIA alertdialog with aria-modal true is modal"); + +test(function(t) { + var axModal1 = axElementById("modal-1"); + assert_equals(axModal1.isModal, true); +}, "An HTML dialog is modal after calling showModal() on it"); + +test(function(t) { + var axModal2 = axElementById("modal-2"); + assert_equals(axModal2, undefined); +}, "A closed HTML dialog has no accessibility node"); + +test(function(t) { + var axModal3 = axElementById("modal-3"); + assert_equals(axModal3.isModal, false); +}, "An open HTML dialog is not modal"); + +test(function(t) { + var axModal4 = axElementById("modal-4"); + assert_equals(axModal4.isModal, true); +}, "An open HTML dialog with aria-modal=true is modal"); + +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/add-listener-expected.txt b/third_party/WebKit/LayoutTests/ambient-light/add-listener-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/add-listener-expected.txt rename to third_party/WebKit/LayoutTests/ambient-light/add-listener-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/add-listener.html b/third_party/WebKit/LayoutTests/ambient-light/add-listener.html similarity index 91% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/add-listener.html rename to third_party/WebKit/LayoutTests/ambient-light/add-listener.html index 15a26c1..9da9978 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/add-listener.html +++ b/third_party/WebKit/LayoutTests/ambient-light/add-listener.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../resources/js-test.js"></script> <script> description('Tests that adding a new devicelight event listener invokes a callback.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/create-event-expected.txt b/third_party/WebKit/LayoutTests/ambient-light/create-event-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/create-event-expected.txt rename to third_party/WebKit/LayoutTests/ambient-light/create-event-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/create-event.html b/third_party/WebKit/LayoutTests/ambient-light/create-event.html similarity index 93% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/create-event.html rename to third_party/WebKit/LayoutTests/ambient-light/create-event.html index 55c6cc8..ecefce5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/create-event.html +++ b/third_party/WebKit/LayoutTests/ambient-light/create-event.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../resources/js-test.js"></script> <script> description("Tests the DeviceLightEvent constructor.");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/multiple-event-listeners-expected.txt b/third_party/WebKit/LayoutTests/ambient-light/multiple-event-listeners-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/multiple-event-listeners-expected.txt rename to third_party/WebKit/LayoutTests/ambient-light/multiple-event-listeners-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/multiple-event-listeners.html b/third_party/WebKit/LayoutTests/ambient-light/multiple-event-listeners.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/multiple-event-listeners.html rename to third_party/WebKit/LayoutTests/ambient-light/multiple-event-listeners.html index 9092fc2b..71c24ae 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/multiple-event-listeners.html +++ b/third_party/WebKit/LayoutTests/ambient-light/multiple-event-listeners.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../resources/js-test.js"></script> <script> description('Tests using multiple event handlers for the Device Light API.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/page-visibility-expected.txt b/third_party/WebKit/LayoutTests/ambient-light/page-visibility-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/page-visibility-expected.txt rename to third_party/WebKit/LayoutTests/ambient-light/page-visibility-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/page-visibility.html b/third_party/WebKit/LayoutTests/ambient-light/page-visibility.html similarity index 95% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/page-visibility.html rename to third_party/WebKit/LayoutTests/ambient-light/page-visibility.html index 073ab4b..1737384 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/page-visibility.html +++ b/third_party/WebKit/LayoutTests/ambient-light/page-visibility.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../resources/js-test.js"></script> <script> description('Tests to check that devicelight events are not fired when the page is not visible.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/window-property-expected.txt b/third_party/WebKit/LayoutTests/ambient-light/window-property-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/window-property-expected.txt rename to third_party/WebKit/LayoutTests/ambient-light/window-property-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/window-property.html b/third_party/WebKit/LayoutTests/ambient-light/window-property.html similarity index 87% rename from third_party/WebKit/LayoutTests/fast/dom/DeviceLight/window-property.html rename to third_party/WebKit/LayoutTests/ambient-light/window-property.html index a7e6342..99f4a92a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DeviceLight/window-property.html +++ b/third_party/WebKit/LayoutTests/ambient-light/window-property.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../resources/js-test.js"></script> <script> description("Tests that the window.DeviceLightEvent and window.ondevicelight properties are present.");
diff --git a/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/README.md b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/README.md new file mode 100644 index 0000000..3207e8e1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/README.md
@@ -0,0 +1,5 @@ +This direcotry contains tests imported from +[Document Object Model Conformance Test Suites](https://www.w3.org/DOM/Test/). + +Many tests must be overlapped with [web-platform-tests](https://github.com/w3c/web-platform-tests/). +We should verify it, and remove this directory entirely.
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentgetdoctypenodtd.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild2.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild4.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrappendchild5.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrclonenode1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrcreatetextnode2.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attreffectivevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrgetvalue2.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore5.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore6.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrinsertbefore7.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrname.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrnextsiblingnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrparentnodenull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrremovechild2.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrsetvalue1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddata.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataend.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetdata.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatagetlength.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdataend.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataend.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_commentgetcomment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatecomment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelement.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentcreatetextnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetdoctype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetimplementation.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentgetrootnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementaddnewattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementassociatedattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementchangeattributevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementcreatenewattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetattributenodenull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementempty.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementgettagname.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinuseattributeerr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnormalize.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementnotfounderr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementremoveattributenode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveallattributes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementretrievetagname.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementsetattributenodenull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapreturnnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeattributenodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodechildnodesempty.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecloneattributescopied.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodefalse.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonenodetrue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodecommentnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeelementnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetlastchildnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsibling.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocument.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussibling.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodes.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbefore.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexequalzero.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlength.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistindexnotzero.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodelisttraverselist.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodeparentnodenull.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildnode.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechild.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodeattribute.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodename.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodetype.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodetextnodevalue.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue02.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue03.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue04.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue05.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_nodevalue06.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textparseintolistofelements.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextfour.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextone.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittextthree.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textsplittexttwo.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/hc_textwithnomarkup.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/resources/COPYRIGHT.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/resources/COPYRIGHT.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/selfxhtml.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/selfxhtml.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/selfxhtml.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/selfxhtml.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/staff.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/staff.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/staff.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/staff.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-lat1.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-lat1.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-special.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-special.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-special.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-special.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-symbol.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml-symbol.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-frameset.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-frameset.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-strict.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-strict.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-transitional.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level1/core/xhtml1-transitional.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createAttributeNS06.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createAttributeNS06.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocument08.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocument08.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createDocumentType04.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createDocumentType04.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createElementNS06.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createElementNS06.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/createElementNS06.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/createElementNS06.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_namednodemapinvalidtype1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize1.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/hc_nodedocumentfragmentnormalize2.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/resources/COPYRIGHT.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/resources/COPYRIGHT.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/resources/COPYRIGHT.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/resources/COPYRIGHT.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/selfxhtml.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/selfxhtml.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/selfxhtml.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/selfxhtml.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/setAttributeNS10.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/setAttributeNS10.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staff.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staff.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staff.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staff.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staff2.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staff2.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staff2.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staff2.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staffNS.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staffNS.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/staffNS.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/staffNS.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-lat1.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-lat1.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-lat1.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-lat1.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-special.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-special.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-special.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-special.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-symbol.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-symbol.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml-symbol.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml-symbol.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-frameset.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-frameset.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-frameset.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-frameset.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-strict.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-strict.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-strict.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-strict.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-transitional.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-transitional.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/core/xhtml1-transitional.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/core/xhtml1-transitional.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/DocumentEventCast01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/DocumentEventCast01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/EventTargetCast01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/EventTargetCast01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent02.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent02.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent03.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent03.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent04.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent04.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/createEvent05.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/createEvent05.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent02.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent02.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent03.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent03.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent04.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent04.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent05.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent05.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent06.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent06.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent07.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent07.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent08.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent08.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent09.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent09.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent10.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent10.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent11.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent11.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent12.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent12.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/dispatchEvent13.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/dispatchEvent13.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent01.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent01.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent02.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent02.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent03.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent03.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent04.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent04.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent05.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent05.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06-expected.txt b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06-expected.txt rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/initEvent06.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/initEvent06.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/resources/COPYRIGHT.xhtml b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/resources/COPYRIGHT.xhtml similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/resources/COPYRIGHT.xhtml rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/resources/COPYRIGHT.xhtml
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/selfxhtml.js b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/selfxhtml.js similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/selfxhtml.js rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/selfxhtml.js
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/staff.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/staff.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/staff.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/staff.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-lat1.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-lat1.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-lat1.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-lat1.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-special.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-special.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-special.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-special.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-symbol.ent b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-symbol.ent similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml-symbol.ent rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml-symbol.ent
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-frameset.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-frameset.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-frameset.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-frameset.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-strict.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-strict.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-strict.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-strict.dtd
diff --git a/third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-transitional.dtd b/third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-transitional.dtd similarity index 100% rename from third_party/WebKit/LayoutTests/dom/xhtml/level2/events/xhtml1-transitional.dtd rename to third_party/WebKit/LayoutTests/dom/legacy_dom_conformance/xhtml/level2/events/xhtml1-transitional.dtd
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html new file mode 100644 index 0000000..8696e38 --- /dev/null +++ b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-remove-markers.html
@@ -0,0 +1,99 @@ +<!DOCTYPE html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../assert_selection.js"></script> +<script src="spellcheck_test.js"></script> + +<script> + spellcheck_test( + '<div contenteditable>|zz. I have a issue.</div>', + '', + '<div contenteditable>#zz#. I have ~a~ issue.</div>', + { + title: '1) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.querySelector('div').removeAttribute('contenteditable'), + '<div>zz. I have a issue.</div>', + 'Removing "contenteditable" attribute removes spelling markers.') + }); + + spellcheck_test( + '<div contenteditable>|zz. I have a issue.</div>', + '', + '<div contenteditable>#zz#. I have ~a~ issue.</div>', + { + title: '2) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.querySelector('div').setAttribute('contenteditable', 'false'), + '<div contenteditable="false">zz. I have a issue.</div>', + 'Setting "contenteditable" attribute to "false" removes spelling markers.') + }); + + spellcheck_test( + '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>', + '', + '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>', + { + title: '3) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.getElementById('parent').removeAttribute('contenteditable'), + '<div id="parent">zz.<div>zz.</div>zz.</div>', + 'Removing "contenteditable" attribute from parent removes spelling markers.') + }); + + spellcheck_test( + '<div contenteditable id="parent">zz.<div>|zz.</div>zz.</div>', + '', + '<div contenteditable id="parent">#zz#.<div>#zz#.</div>#zz#.</div>', + { + title: '4) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.getElementById('parent').setAttribute('contenteditable', 'false'), + '<div contenteditable="false" id="parent">zz.<div>zz.</div>zz.</div>', + 'Setting "contenteditable" attribute to "false" on parent removes spelling markers.') + }); + + spellcheck_test( + '<div contenteditable>zz.<div id="child">|zz.</div>zz.</div>', + '', + '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>', + { + title: '5) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.getElementById('child').setAttribute('contenteditable', 'false'), + '<div contenteditable>#zz#.<div contenteditable="false" id="child">zz.</div>#zz#.</div>', + 'Setting "contenteditable" attribute to "false" on child removes spelling markers.') + }); + + spellcheck_test( + '<div contenteditable id="parent">zz.<div contenteditable>|zz.</div>zz.</div>', + '', + '<div contenteditable id="parent">#zz#.<div contenteditable>#zz#.</div>#zz#.</div>', + { + title: '6) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.getElementById('parent').removeAttribute('contenteditable'), + '<div id="parent">zz.<div contenteditable>#zz#.</div>zz.</div>', + 'Removing "contenteditable" attribute on parent still keeps the spelling markers on child.') + }); + + spellcheck_test( + '<div contenteditable>zz.<div contenteditable id="child">|zz.</div>zz.</div>', + '', + '<div contenteditable>#zz#.<div contenteditable id="child">#zz#.</div>#zz#.</div>', + { + title: '7) Setup for the initial markers.', + callback: sample => spellcheck_test( + sample, + document => document.getElementById('child').removeAttribute('contenteditable'), + '<div contenteditable>#zz#.<div id="child">#zz#.</div>#zz#.</div>', + 'Removing "contenteditable" attribute on child still keeps the spelling markers.') + }); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/historical.html b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/historical.html index a9ae674..faefa7e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/historical.html +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/historical.html
@@ -36,6 +36,10 @@ assert_false(prefixes[i]+'BlobBuilder' in window, prefixes[i]+'BlobBuilder'); } }, 'BlobBuilder should not be supported.'); + + test(function() { + assert_false('createFor' in URL); + }, 'createFor method should not be supported'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness-expected.txt index 74fd882..43946fe 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness-expected.txt
@@ -1,7 +1,6 @@ CONSOLE MESSAGE: line 251: callback not yet supported This is a testharness.js-based test. PASS URL interface: operation createObjectURL(Blob) -FAIL URL interface: operation createFor(Blob) assert_own_property: interface object missing static operation expected property "createFor" missing PASS URL interface: operation revokeObjectURL(DOMString) PASS Blob interface: existence and properties of interface object PASS Blob interface object length
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.idl b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.idl index d8f31b4..61704b2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/idlharness.idl
@@ -89,6 +89,5 @@ [Exposed=(Window,DedicatedWorker,SharedWorker)] partial interface URL { static DOMString createObjectURL(Blob blob); - static DOMString createFor(Blob blob); static void revokeObjectURL(DOMString url); };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob-expected.txt deleted file mode 100644 index f0147f7..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -PASS Check if the Blob URI starts with 'blob' using createObjectURL() -FAIL Check if the Blob URI starts with 'blob' using createFor() window.URL.createFor is not a function -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob.html b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob.html index db6b441..798df08d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob.html +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/url/url_createobjecturl_blob.html
@@ -16,11 +16,5 @@ assert_equals(typeof testBlob, "string", "Blob URI is typeof string"); assert_equals(testBlob.indexOf("blob"), 0, "Blob URI starts with 'blob'"); }, "Check if the Blob URI starts with 'blob' using createObjectURL()"); - - test(function() { - var testBlob = window.URL.createFor(blob); - assert_equals(typeof testBlob, "string", "Blob URI is typeof string"); - assert_equals(testBlob.indexOf("blob"), 0, "Blob URI starts with 'blob'"); - }, "Check if the Blob URI starts with 'blob' using createFor()"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json index ebe5863..b7e0079 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json
@@ -3906,11 +3906,6 @@ {} ] ], - "FileAPI/url/url_createobjecturl_blob-expected.txt": [ - [ - {} - ] - ], "FileAPI/url/url_xmlhttprequest_img-ref.html": [ [ {} @@ -34251,11 +34246,11 @@ "support" ], "FileAPI/historical.html": [ - "6f411640cdbd67dfa11c8d04067ddbbfd24a1f79", + "d810a76f4209a5a580652988a355863c2b807e59", "testharness" ], "FileAPI/idlharness-expected.txt": [ - "e57737f937070ac349c5a4d9932c487e62018def", + "9f32f6f1d0687255b179a4077fcd05c75448801b", "support" ], "FileAPI/idlharness.html": [ @@ -34263,7 +34258,7 @@ "testharness" ], "FileAPI/idlharness.idl": [ - "10a36a1d69430ba6c958f58643ab70440702c796", + "061ce6ec6d0e7b8ceebeee53e7d49ff083fdd778", "support" ], "FileAPI/idlharness.worker.js": [ @@ -34322,12 +34317,8 @@ "f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0", "support" ], - "FileAPI/url/url_createobjecturl_blob-expected.txt": [ - "dc7768766da215a8ed6a95cf30610f1271738134", - "support" - ], "FileAPI/url/url_createobjecturl_blob.html": [ - "636d9016655cfbdec08cc02ddbf0ca7f35b6e539", + "bfd9cbe17c74e7b181156c47228beb694d8375af", "testharness" ], "FileAPI/url/url_xmlhttprequest.html": [ @@ -36275,7 +36266,7 @@ "support" ], "dom/lists/DOMTokenList-iteration.html": [ - "e108a00aeb545f3e912f662047fc5ccb94d90cd9", + "9f57e9de064ac0ed809eaac749c5f2f167bebe65", "testharness" ], "dom/lists/DOMTokenList-stringifier.html": [ @@ -41571,7 +41562,7 @@ "support" ], "html/dom/elements-misc.js": [ - "84dcfeb32d9063daadd8cf4092b502130fd9a7da", + "c0d89d2884a9d27f2417f10f2ebc9c40192d1a5f", "support" ], "html/dom/elements-obsolete.js": [ @@ -42387,7 +42378,7 @@ "testharness" ], "html/dom/reflection-misc-expected.txt": [ - "340cbaa02e34e42a9727114eb86302bd80681cc8", + "f8fff36bb417bfdecde9d2d31fbf1f383a0a3618", "support" ], "html/dom/reflection-misc.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration-expected.txt index a519bda..92b6b0a5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration-expected.txt
@@ -1,4 +1,4 @@ This is a testharness.js-based test. -FAIL DOMTokenList iteration: keys, values, etc. assert_equals: expected function "function keys() { [native code] }" but got function "function keys() { [native code] }" +FAIL DOMTokenList iteration: keys, values, etc. assert_array_equals: lengths differ, expected 2 got 3 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration.html b/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration.html index 321bbe0..921f97cb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/lists/DOMTokenList-iteration.html
@@ -7,17 +7,17 @@ <script> test(function() { var list = document.querySelector("span").classList; - assert_array_equals([...list], ["a", "a", "b"]); + assert_array_equals([...list], ["a", "b"]); var keys = list.keys(); assert_false(keys instanceof Array); keys = [...keys]; - assert_array_equals(keys, [0, 1, 2]); + assert_array_equals(keys, [0, 1]); var values = list.values(); assert_false(values instanceof Array); values = [...values]; - assert_array_equals(values, ["a", "a", "b"]); + assert_array_equals(values, ["a", "b"]); var entries = list.entries(); assert_false(entries instanceof Array);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements-misc.js b/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements-misc.js index e0d5399b..de71116 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements-misc.js +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/elements-misc.js
@@ -10,12 +10,17 @@ script: { src: "url", type: "string", + noModule: "boolean", charset: "string", // TODO: async attribute (complicated). defer: "boolean", crossOrigin: {type: "enum", keywords: ["anonymous", "use-credentials"], nonCanon:{"": "anonymous"}, isNullable: true, defaultVal: null, invalidVal: "anonymous"}, nonce: "string", integrity: "string", + + // Obsolete + event: "string", + htmlFor: {type: "string", domAttrName: "for"}, }, noscript: {},
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt index b5dee57..81e595bf 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-misc-expected.txt
@@ -16,6 +16,39 @@ PASS script.tabIndex: 24 tests PASS script.src: 38 tests PASS script.type: 32 tests +FAIL script.noModule: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL script.noModule: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL script.noModule: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: setAttribute() to "noModule" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL script.noModule: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL script.noModule: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL script.noModule: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL script.noModule: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL script.noModule: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL script.noModule: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS script.noModule: IDL set to true +FAIL script.noModule: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL script.noModule: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL script.noModule: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL script.noModule: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL script.noModule: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL script.noModule: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL script.noModule: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL script.noModule: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" PASS script.charset: 32 tests PASS script.defer: 33 tests PASS script.crossOrigin: 52 tests @@ -51,6 +84,8 @@ FAIL script.nonce: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "[Replaced]" FAIL script.nonce: IDL set to object "test-valueOf" assert_equals: getAttribute() expected "test-valueOf" but got "[Replaced]" PASS script.integrity: 32 tests +PASS script.event: 32 tests +PASS script.htmlFor (<script for>): 32 tests PASS noscript.title: 32 tests PASS noscript.lang: 32 tests PASS noscript.dir: 62 tests
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html b/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html index cdd70265..c25f5976 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Attr/access-after-element-destruction.html
@@ -4,6 +4,52 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/access-after-element-destruction.js"></script> +<script> +description("Tests that accessing Attr after its Element has been destroyed works without crashing."); + +jsTestIsAsync = true; + +var element = document.createElement("p"); +element.setAttribute("a", "b"); +var attributes = element.attributes; +element = null; +var attr = null; + +asyncGC(function() { + shouldBe("attributes.length", "1"); + shouldBe("attributes[0]", "attributes.item(0)"); + shouldBe("attributes.getNamedItem('a')", "attributes.item(0)"); + + shouldBe("attributes.item(0).name", "'a'"); + shouldBe("attributes.item(0).value", "'b'"); + shouldBe("attributes.item(0).ownerElement.tagName", "'P'"); + + attributes.item(0).value = 'c'; + + shouldBe("attributes.item(0).value", "'c'"); + + attributes.removeNamedItem('a'); + + shouldBe("attributes.length", "0"); + + element = document.createElement("p"); + element.setAttribute("a", "b"); + attr = element.attributes.item(0); + element = null; + + asyncGC(function() { + + shouldBe("attr.name", "'a'"); + shouldBe("attr.value", "'b'"); + shouldBe("attr.ownerElement.tagName", "'P'"); + + attr.value = 'c'; + + shouldBe("attr.value", "'c'"); + + finishJSTest(); + }); +}); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js b/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js deleted file mode 100644 index dd14eedf..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Attr/script-tests/access-after-element-destruction.js +++ /dev/null
@@ -1,45 +0,0 @@ -description("Tests that accessing Attr after its Element has been destroyed works without crashing."); - -jsTestIsAsync = true; - -var element = document.createElement("p"); -element.setAttribute("a", "b"); -var attributes = element.attributes; -element = null; -var attr = null; - -asyncGC(function() { - shouldBe("attributes.length", "1"); - shouldBe("attributes[0]", "attributes.item(0)"); - shouldBe("attributes.getNamedItem('a')", "attributes.item(0)"); - - shouldBe("attributes.item(0).name", "'a'"); - shouldBe("attributes.item(0).value", "'b'"); - shouldBe("attributes.item(0).ownerElement.tagName", "'P'"); - - attributes.item(0).value = 'c'; - - shouldBe("attributes.item(0).value", "'c'"); - - attributes.removeNamedItem('a'); - - shouldBe("attributes.length", "0"); - - element = document.createElement("p"); - element.setAttribute("a", "b"); - attr = element.attributes.item(0); - element = null; - - asyncGC(function() { - - shouldBe("attr.name", "'a'"); - shouldBe("attr.value", "'b'"); - shouldBe("attr.ownerElement.tagName", "'P'"); - - attr.value = 'c'; - - shouldBe("attr.value", "'c'"); - - finishJSTest(); - }); -});
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html index 59ed56d..c557ac82 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html +++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html
@@ -4,6 +4,19 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/css-computed-style-item.js"></script> +<script> +description("This tests indexing outside the range of the computed style object."); + +var element = document.createElement('div'); +element.style.color = 'rgb(120, 120, 120)'; +document.documentElement.appendChild(element); +var computedStyle = window.getComputedStyle(element, null); + +shouldBeEqualToString('typeof computedStyle.length', 'number'); +shouldBeUndefined('computedStyle[computedStyle.length]', ''); +shouldBeUndefined('computedStyle[-1]') + +document.documentElement.removeChild(element); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html index 022ec891..a1d4cf8 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html +++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html
@@ -4,6 +4,28 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/css-properties-case-sensitive.js"></script> +<script> +description( +'This test checks that access to the CSS float property via JavaScript properties on DOM elements is case sensitive.' +); + +var element = document.createElement('a'); +element.style.float = 'left'; + +debug('normal cases'); +debug(''); + +shouldBe("element.style.float", "'left'"); +shouldBeUndefined("element.style.Float"); + +debug(''); +debug('"css" prefix'); +debug(''); + +shouldBe("element.style.cssFloat", "'left'"); +shouldBeUndefined("element.style.CssFloat"); +shouldBeUndefined("element.style.Cssfloat"); +shouldBeUndefined("element.style.cssfloat"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html index 93b2143..593e2ce 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html +++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html
@@ -4,6 +4,20 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/css-style-item.js"></script> +<script> +description("This tests indexing outside the range of the style object."); + +var element = document.createElement('div'); +element.style.color = 'red'; +document.documentElement.appendChild(element); +var style = element.style; + +shouldEvaluateTo('style.length', 1); +shouldBeEqualToString('style[0]', 'color'); +shouldBeUndefined('style[1]'); +shouldBeUndefined('style[-1]') + +document.documentElement.removeChild(element); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js deleted file mode 100644 index 6f3e759..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js +++ /dev/null
@@ -1,12 +0,0 @@ -description("This tests indexing outside the range of the computed style object."); - -var element = document.createElement('div'); -element.style.color = 'rgb(120, 120, 120)'; -document.documentElement.appendChild(element); -var computedStyle = window.getComputedStyle(element, null); - -shouldBeEqualToString('typeof computedStyle.length', 'number'); -shouldBeUndefined('computedStyle[computedStyle.length]', ''); -shouldBeUndefined('computedStyle[-1]') - -document.documentElement.removeChild(element);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js deleted file mode 100644 index 9c24193..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js +++ /dev/null
@@ -1,21 +0,0 @@ -description( -'This test checks that access to the CSS float property via JavaScript properties on DOM elements is case sensitive.' -); - -var element = document.createElement('a'); -element.style.float = 'left'; - -debug('normal cases'); -debug(''); - -shouldBe("element.style.float", "'left'"); -shouldBeUndefined("element.style.Float"); - -debug(''); -debug('"css" prefix'); -debug(''); - -shouldBe("element.style.cssFloat", "'left'"); -shouldBeUndefined("element.style.CssFloat"); -shouldBeUndefined("element.style.Cssfloat"); -shouldBeUndefined("element.style.cssfloat");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js deleted file mode 100644 index 34267a2..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js +++ /dev/null
@@ -1,13 +0,0 @@ -description("This tests indexing outside the range of the style object."); - -var element = document.createElement('div'); -element.style.color = 'red'; -document.documentElement.appendChild(element); -var style = element.style; - -shouldEvaluateTo('style.length', 1); -shouldBeEqualToString('style[0]', 'color'); -shouldBeUndefined('style[1]'); -shouldBeUndefined('style[-1]') - -document.documentElement.removeChild(element);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js deleted file mode 100644 index 27e619aa..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js +++ /dev/null
@@ -1,11 +0,0 @@ -description( -'This test checks that CSS property names work round trip in the transition property.' -); - -var element = document.createElement('a'); - -element.style.webkitTransitionProperty = "height"; -shouldBe("element.style.webkitTransitionProperty", "'height'"); - -element.style.webkitTransitionProperty = "opacity"; -shouldBe("element.style.webkitTransitionProperty", "'opacity'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html index 9c37a2f3..ba6cc5e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html +++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html
@@ -4,6 +4,18 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/transition-property-names.js"></script> +<script> +description( +'This test checks that CSS property names work round trip in the transition property.' +); + +var element = document.createElement('a'); + +element.style.webkitTransitionProperty = "height"; +shouldBe("element.style.webkitTransitionProperty", "'height'"); + +element.style.webkitTransitionProperty = "opacity"; +shouldBe("element.style.webkitTransitionProperty", "'opacity'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html index 3de19d5..01d1b85 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html +++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html
@@ -4,6 +4,150 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/createDocument-namespace-err.js"></script> +<script> +description("createDocument tests modelled after createElementNS tests from mozilla which were attached to webkit bug 16833"); + +// document.implementation.createDocument() should throw the same set of errors +// as document.createElementNS() +// http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument +// Thus we copied these test cases from: +// LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js + +function assert(c, m) +{ + if (!c) + testFailed(m); + else + testPassed(m); +} + +function stringForExceptionCode(c) +{ + var exceptionName; + switch(c) { + case DOMException.INVALID_CHARACTER_ERR: + exceptionName = "INVALID_CHARACTER_ERR"; + break; + case DOMException.NAMESPACE_ERR: + exceptionName = "NAMESPACE_ERR"; + } + if (exceptionName) + return exceptionName; // + "(" + c + ")"; + return c; +} + +function assertEquals(actual, expect, m) +{ + if (actual !== expect) { + m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); + testFailed(m); + } else { + m += "; threw " + stringForExceptionCode(actual);; + testPassed(m); + } +} + +var allNSTests = [ + { args: [undefined, undefined] }, + { args: [null, undefined] }, + { args: [undefined, null], code: 5 }, + { args: [null, null], code: 5 }, + { args: [null, ""], code: 5 }, + { args: ["", null], code: 5 }, + { args: ["", ""], code: 5 }, + { args: [null, "<div>"], code: 5 }, + { args: [null, "0div"], code: 5 }, + { args: [null, "di v"], code: 5 }, + { args: [null, "di<v"], code: 5 }, + { args: [null, "-div"], code: 5 }, + { args: [null, ".div"], code: 5 }, + { args: ["http://example.com/", "<div>"], code: 5 }, + { args: ["http://example.com/", "0div"], code: 5 }, + { args: ["http://example.com/", "di<v"], code: 5 }, + { args: ["http://example.com/", "-div"], code: 5 }, + { args: ["http://example.com/", ".div"], code: 5 }, + { args: [null, ":div"], code: 14 }, + { args: [null, "div:"], code: 14 }, + { args: ["http://example.com/", ":div"], code: 14 }, + { args: ["http://example.com/", "div:"], code: 14 }, + { args: [null, "d:iv"], code: 14 }, + { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, + { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, + { args: ["http://example.com/", "a:_"] }, + { args: ["http://example.com/", "a:\u0BC6"], code: 14, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, + { args: ["http://example.com/", "\u0BC6:a"], code: 5, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + + "as this is both an invalid XML name and an invalid QName)" }, + { args: ["http://example.com/", "a:a\u0BC6"] }, + { args: ["http://example.com/", "a\u0BC6:a"] }, + { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, + { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, + { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, +]; + +function sourceify(v) +{ + switch (typeof v) { + case "undefined": + return v; + case "string": + return '"' + v.replace('"', '\\"') + '"'; + default: + return String(v); + } +} + +function sourceifyArgs(args) +{ + var copy = new Array(args.length); + for (var i = 0, sz = args.length; i < sz; i++) + copy[i] = sourceify(args[i]); + + return copy.join(", "); +} + +function runNSTests(tests, doc, createFunctionName) +{ + for (var i = 0, sz = tests.length; i < sz; i++) { + var test = tests[i]; + + // Gecko throws "undefined" if createDocument isn't + // called with 3 arguments. Instead of modifying all + // of the values in the arrays above (which were taken from createElementNS tests) + // we will instead just hack the args list here. + var argsWithExtraLastNull = test.args.slice(); // copy the args arary + argsWithExtraLastNull.push(null); + + var code = -1; + var argStr = sourceifyArgs(argsWithExtraLastNull); + var msg = createFunctionName + "(" + argStr + ")"; + if ("message" in test) + msg += "; " + test.message; + try { + doc[createFunctionName].apply(doc, argsWithExtraLastNull); + assert(!("code" in test), msg); + } catch (e) { + assertEquals(e.code, test.code || "expected no exception", msg); + } + } +} + +shouldThrow("document.implementation.createDocument()", '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but only 0 present."'); +shouldThrow("document.implementation.createDocument(\"http://www.example.com\")", '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but only 1 present."'); + +runNSTests(allNSTests, document.implementation, "createDocument"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html index e078460..9fdaea6 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html +++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html
@@ -4,6 +4,35 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/createDocumentType-err.js"></script> +<script> +description("createDocument tests modelled after mozilla's testing"); + +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only " + num + " present.\""; +} + +shouldThrow("document.implementation.createDocumentType('foo')", ExpectedNotEnoughArgumentsMessage(1)); +shouldThrow("document.implementation.createDocumentType('foo', null)", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType(undefined, undefined)", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType(null, undefined)", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType(undefined, null)", ExpectedNotEnoughArgumentsMessage(2)); +shouldNotThrow("document.implementation.createDocumentType(undefined, undefined, null)"); +shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEnoughArgumentsMessage(2)); +shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:\') has an empty local name."'); +shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':foo\') has an empty namespace prefix."'); +shouldThrow("document.implementation.createDocumentType(':', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':\') has an empty namespace prefix."'); +shouldNotThrow("document.implementation.createDocumentType('foo', null, null)"); +shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null)"); +shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo::bar\') contains multiple colons."'); +shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'\t:bar\') contains the invalid name-start character \'\t\'."'); +shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo:\t\') contains the invalid name-start character \'\t\'."'); +shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo :bar\') contains the invalid character \' \'."'); +shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo: bar\') contains the invalid name-start character \' \'."'); +shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:b:c\') contains multiple colons."'); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js deleted file mode 100644 index 59bb5b70..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js +++ /dev/null
@@ -1,143 +0,0 @@ -description("createDocument tests modelled after createElementNS tests from mozilla which were attached to webkit bug 16833"); - -// document.implementation.createDocument() should throw the same set of errors -// as document.createElementNS() -// http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument -// Thus we copied these test cases from: -// LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js - -function assert(c, m) -{ - if (!c) - testFailed(m); - else - testPassed(m); -} - -function stringForExceptionCode(c) -{ - var exceptionName; - switch(c) { - case DOMException.INVALID_CHARACTER_ERR: - exceptionName = "INVALID_CHARACTER_ERR"; - break; - case DOMException.NAMESPACE_ERR: - exceptionName = "NAMESPACE_ERR"; - } - if (exceptionName) - return exceptionName; // + "(" + c + ")"; - return c; -} - -function assertEquals(actual, expect, m) -{ - if (actual !== expect) { - m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); - testFailed(m); - } else { - m += "; threw " + stringForExceptionCode(actual);; - testPassed(m); - } -} - -var allNSTests = [ - { args: [undefined, undefined] }, - { args: [null, undefined] }, - { args: [undefined, null], code: 5 }, - { args: [null, null], code: 5 }, - { args: [null, ""], code: 5 }, - { args: ["", null], code: 5 }, - { args: ["", ""], code: 5 }, - { args: [null, "<div>"], code: 5 }, - { args: [null, "0div"], code: 5 }, - { args: [null, "di v"], code: 5 }, - { args: [null, "di<v"], code: 5 }, - { args: [null, "-div"], code: 5 }, - { args: [null, ".div"], code: 5 }, - { args: ["http://example.com/", "<div>"], code: 5 }, - { args: ["http://example.com/", "0div"], code: 5 }, - { args: ["http://example.com/", "di<v"], code: 5 }, - { args: ["http://example.com/", "-div"], code: 5 }, - { args: ["http://example.com/", ".div"], code: 5 }, - { args: [null, ":div"], code: 14 }, - { args: [null, "div:"], code: 14 }, - { args: ["http://example.com/", ":div"], code: 14 }, - { args: ["http://example.com/", "div:"], code: 14 }, - { args: [null, "d:iv"], code: 14 }, - { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, - { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, - { args: ["http://example.com/", "a:_"] }, - { args: ["http://example.com/", "a:\u0BC6"], code: 14, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, - { args: ["http://example.com/", "\u0BC6:a"], code: 5, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + - "as this is both an invalid XML name and an invalid QName)" }, - { args: ["http://example.com/", "a:a\u0BC6"] }, - { args: ["http://example.com/", "a\u0BC6:a"] }, - { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, - { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, - { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, -]; - -function sourceify(v) -{ - switch (typeof v) { - case "undefined": - return v; - case "string": - return '"' + v.replace('"', '\\"') + '"'; - default: - return String(v); - } -} - -function sourceifyArgs(args) -{ - var copy = new Array(args.length); - for (var i = 0, sz = args.length; i < sz; i++) - copy[i] = sourceify(args[i]); - - return copy.join(", "); -} - -function runNSTests(tests, doc, createFunctionName) -{ - for (var i = 0, sz = tests.length; i < sz; i++) { - var test = tests[i]; - - // Gecko throws "undefined" if createDocument isn't - // called with 3 arguments. Instead of modifying all - // of the values in the arrays above (which were taken from createElementNS tests) - // we will instead just hack the args list here. - var argsWithExtraLastNull = test.args.slice(); // copy the args arary - argsWithExtraLastNull.push(null); - - var code = -1; - var argStr = sourceifyArgs(argsWithExtraLastNull); - var msg = createFunctionName + "(" + argStr + ")"; - if ("message" in test) - msg += "; " + test.message; - try { - doc[createFunctionName].apply(doc, argsWithExtraLastNull); - assert(!("code" in test), msg); - } catch (e) { - assertEquals(e.code, test.code || "expected no exception", msg); - } - } -} - -shouldThrow("document.implementation.createDocument()", '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but only 0 present."'); -shouldThrow("document.implementation.createDocument(\"http://www.example.com\")", '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but only 1 present."'); - -runNSTests(allNSTests, document.implementation, "createDocument");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js deleted file mode 100644 index 72643836..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/script-tests/createDocumentType-err.js +++ /dev/null
@@ -1,28 +0,0 @@ -description("createDocument tests modelled after mozilla's testing"); - -function ExpectedNotEnoughArgumentsMessage(num) { - return "\"TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only " + num + " present.\""; -} - -shouldThrow("document.implementation.createDocumentType('foo')", ExpectedNotEnoughArgumentsMessage(1)); -shouldThrow("document.implementation.createDocumentType('foo', null)", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType(undefined, undefined)", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType(null, undefined)", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType(undefined, null)", ExpectedNotEnoughArgumentsMessage(2)); -shouldNotThrow("document.implementation.createDocumentType(undefined, undefined, null)"); -shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEnoughArgumentsMessage(2)); -shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:\') has an empty local name."'); -shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':foo\') has an empty namespace prefix."'); -shouldThrow("document.implementation.createDocumentType(':', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':\') has an empty namespace prefix."'); -shouldNotThrow("document.implementation.createDocumentType('foo', null, null)"); -shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null)"); -shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo::bar\') contains multiple colons."'); -shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'\t:bar\') contains the invalid name-start character \'\t\'."'); -shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo:\t\') contains the invalid name-start character \'\t\'."'); -shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo :bar\') contains the invalid character \' \'."'); -shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo: bar\') contains the invalid name-start character \' \'."'); -shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:b:c\') contains multiple colons."'); -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html index c6a9ee6..9f51024 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html
@@ -4,6 +4,134 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/createAttributeNS-namespace-err.js"></script> +<script> +description("createAttirbuteNS tests adapted from createElementNS tests attached to webkit bug 16833"); + +function assert(c, m) +{ + if (!c) + testFailed(m); + else + testPassed(m); +} + +function stringForExceptionCode(c) +{ + var exceptionName; + switch(c) { + case DOMException.INVALID_CHARACTER_ERR: + exceptionName = "INVALID_CHARACTER_ERR"; + break; + case DOMException.NAMESPACE_ERR: + exceptionName = "NAMESPACE_ERR"; + } + if (exceptionName) + return exceptionName; // + "(" + c + ")"; + return c; +} + +function assertExceptionCode(exception, expect, m) +{ + var actual = exception.code; + if (actual !== expect) { + m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); + testFailed(m); + } else { + m += "; threw " + exception.toString(); + testPassed(m); + } +} + +var allNSTests = [ + { args: [undefined, undefined] }, + { args: [null, undefined] }, + { args: [undefined, null] }, + { args: [null, null] }, + { args: [null, ""], code: 5 }, + { args: ["", null] }, + { args: ["", ""], code: 5 }, + { args: [null, "<div>"], code: 5 }, + { args: [null, "0div"], code: 5 }, + { args: [null, "di v"], code: 5 }, + { args: [null, "di<v"], code: 5 }, + { args: [null, "-div"], code: 5 }, + { args: [null, ".div"], code: 5 }, + { args: ["http://example.com/", "<div>"], code: 5 }, + { args: ["http://example.com/", "0div"], code: 5 }, + { args: ["http://example.com/", "di<v"], code: 5 }, + { args: ["http://example.com/", "-div"], code: 5 }, + { args: ["http://example.com/", ".div"], code: 5 }, + { args: [null, ":div"], code: 14 }, + { args: [null, "div:"], code: 14 }, + { args: ["http://example.com/", ":div"], code: 14 }, + { args: ["http://example.com/", "div:"], code: 14 }, + { args: [null, "d:iv"], code: 14 }, + { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, + { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, + { args: ["http://example.com/", "a:_"] }, + { args: ["http://example.com/", "a:\u0BC6"], code: 14, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, + { args: ["http://example.com/", "\u0BC6:a"], code: 5, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + + "as this is both an invalid XML name and an invalid QName)" }, + { args: ["http://example.com/", "a:a\u0BC6"] }, + { args: ["http://example.com/", "a\u0BC6:a"] }, + { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, + { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, + { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns"] }, // See http://www.w3.org/2000/xmlns/ + { args: ["http://example.com/", "xmlns"], code: 14 }, // from the createAttributeNS section +]; + +function sourceify(v) +{ + switch (typeof v) { + case "undefined": + return v; + + case "string": + return '"' + v.replace('"', '\\"') + '"'; + + default: + return String(v); + } +} + +function runNSTests() +{ + var createFunction = document.createAttributeNS; + var createFunctionName = "createAttributeNS"; + var doc = document; + + for (var i = 0, sz = allNSTests.length; i < sz; i++) { + var test = allNSTests[i]; + + var code = -1; + var argStr = sourceify(test.args[0]) + ", " + sourceify(test.args[1]); + var msg = createFunctionName + "(" + argStr + ")"; + if ("message" in test) + msg += "; " + test.message; + try { + createFunction.apply(doc, test.args); + assert(!("code" in test), msg); + } catch (e) { + assertExceptionCode(e, test.code || "expected no exception", msg); + } + } +} + +runNSTests(); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html index 78d571e7..c5388b6 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html
@@ -4,6 +4,178 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/createElementNS-namespace-err.js"></script> +<script> +description("createElementNS tests from mozilla, attached to webkit bug 16833"); + +function assert(c, m) +{ + if (!c) + testFailed(m); + else + testPassed(m); +} + +function stringForExceptionCode(c) +{ + var exceptionName; + switch(c) { + case DOMException.INVALID_CHARACTER_ERR: + exceptionName = "INVALID_CHARACTER_ERR"; + break; + case DOMException.NAMESPACE_ERR: + exceptionName = "NAMESPACE_ERR"; + } + if (exceptionName) + return exceptionName; // + "(" + c + ")"; + return c; +} + +function assertExceptionCode(exception, expect, m) +{ + var actual = exception.code; + if (actual !== expect) { + m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); + testFailed(m); + } else { + m += "; threw " + exception.toString(); + testPassed(m); + } +} + +var allNSTests = [ + { args: [undefined, undefined] }, + { args: [null, undefined] }, + { args: [undefined, null] }, + { args: [null, null] }, + { args: [null, ""], code: 5 }, + { args: ["", null] }, + { args: ["", ""], code: 5 }, + { args: [null, "<div>"], code: 5 }, + { args: [null, "0div"], code: 5 }, + { args: [null, "di v"], code: 5 }, + { args: [null, "di<v"], code: 5 }, + { args: [null, "-div"], code: 5 }, + { args: [null, ".div"], code: 5 }, + { args: ["http://example.com/", "<div>"], code: 5 }, + { args: ["http://example.com/", "0div"], code: 5 }, + { args: ["http://example.com/", "di<v"], code: 5 }, + { args: ["http://example.com/", "-div"], code: 5 }, + { args: ["http://example.com/", ".div"], code: 5 }, + { args: [null, ":div"], code: 14 }, + { args: [null, "div:"], code: 14 }, + { args: ["http://example.com/", ":div"], code: 14 }, + { args: ["http://example.com/", "div:"], code: 14 }, + { args: [null, "d:iv"], code: 14 }, + { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, + { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, + { args: ["http://example.com/", "a:_"] }, + { args: ["http://example.com/", "a:\u0BC6"], code: 14, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, + { args: ["http://example.com/", "\u0BC6:a"], code: 5, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + + "as this is both an invalid XML name and an invalid QName)" }, + { args: ["http://example.com/", "a:a\u0BC6"] }, + { args: ["http://example.com/", "a\u0BC6:a"] }, + { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, + { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, + { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, +]; + +var allNoNSTests = [ + { args: [undefined] }, + { args: [null] }, + { args: [""], code: 5 }, + { args: ["<div>"], code: 5 }, + { args: ["0div"], code: 5 }, + { args: ["di v"], code: 5 }, + { args: ["di<v"], code: 5 }, + { args: ["-div"], code: 5 }, + { args: [".div"], code: 5 }, + { args: [":"], message: "valid XML name, invalid QName" }, + { args: [":div"], message: "valid XML name, invalid QName" }, + { args: ["div:"], message: "valid XML name, invalid QName" }, + { args: ["d:iv"] }, + { args: ["a:b:c"], message: "valid XML name, invalid QName" }, + { args: ["a::c"], message: "valid XML name, invalid QName" }, + { args: ["a::c:"], message: "valid XML name, invalid QName" }, + { args: ["a:0"], message: "valid XML name, not a valid QName" }, + { args: ["0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, + { args: ["a:_"] }, + { args: ["a:\u0BC6"], + message: "non-ASCII character after colon is CombiningChar, which is " + + "valid in pre-namespace XML" }, + { args: ["\u0BC6:a"], code: 5, message: "not a valid start character" }, + { args: ["a:a\u0BC6"] }, + { args: ["a\u0BC6:a"] }, + { args: ["xml:test"] }, + { args: ["xmlns:test"] }, + { args: ["x:test"] }, + { args: ["xmlns:test"] }, + { args: ["SOAP-ENV:Body"] }, // From Yahoo Mail Beta +]; + +function sourceify(v) +{ + switch (typeof v) { + case "undefined": + return v; + case "string": + return '"' + v.replace('"', '\\"') + '"'; + default: + return String(v); + } +} + +function sourceifyArgs(args) +{ + var copy = new Array(args.length); + for (var i = 0, sz = args.length; i < sz; i++) + copy[i] = sourceify(args[i]); + + return copy.join(", "); +} + +function runNSTests(tests, doc, createFunctionName) +{ + for (var i = 0, sz = tests.length; i < sz; i++) { + var test = tests[i]; + + var code = -1; + var argStr = sourceifyArgs(test.args); + var msg = createFunctionName + "(" + argStr + ")"; + if ("message" in test) + msg += "; " + test.message; + try { + doc[createFunctionName].apply(doc, test.args); + assert(!("code" in test), msg); + } catch (e) { + assertExceptionCode(e, test.code || "expected no exception", msg); + } + } +} + +debug("HTML tests:") +runNSTests(allNSTests, document, "createElementNS"); +runNSTests(allNoNSTests, document, "createElement"); + +debug("XHTML createElement tests:") +var xhtmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); +runNSTests(allNoNSTests, xhtmlDoc, "createElement"); + +debug("XML createElement tests:") +var xmlDoc = document.implementation.createDocument("http://www.example.com/foo", "example", null); +runNSTests(allNoNSTests, xmlDoc, "createElement"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get.html b/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get.html index 4eabdd6e..9e5cb68 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get.html
@@ -4,6 +4,33 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/document-title-get.js"></script> +<script> +description("This test checks the implementation of getting the document.title attribute."); + +debug('Test with no title set'); +shouldBeEqualToString("document.title", ""); + +debug('Test with empty title'); +document.title = ""; +shouldBeEqualToString("document.title",""); + +debug('Test with only whitespace'); +document.title = "\t\n\r \r \t\n\n"; +shouldBeEqualToString("document.title",""); + +debug('Test with no whitespace'); +document.title = "nowhitespacetitle"; +shouldBeEqualToString("document.title","nowhitespacetitle"); + +debug('Test with whitespace'); +document.title = "\u0009\u000aone\u000b\u000cspace\u000d\u0020"; +shouldBeEqualToString("document.title","one\u000b space"); + +debug('Test with various whitespace lengths and fields'); +document.title = " lots of \r whitespace and \n\n\n \t newlines \t"; +shouldBeEqualToString("document.title", "lots of whitespace and newlines"); + +debug('Test with various length strings'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype.html b/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype.html index 6452999..db0aff2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype.html
@@ -4,6 +4,82 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/document-write-doctype.js"></script> +<script> +description("Test that iframe.contentWindow.document.write() can convert a document to strict mode -- https://bugs.webkit.org/show_bug.cgi?id=24336"); + +// Simple recurisve "give me a string to represent this tree" function +function treeAsString(node) { + var string = node.nodeName; + if (node.childNodes.length) { + string += " ["; + } + for (var x = 0; x < node.childNodes.length; x++) { + if (x != 0) { + string += ", "; + } + string += treeAsString(node.childNodes[x]); + } + + if (node.childNodes.length) { + string += "]"; + } + return string; +} + +function doctypeNodeName(iframeDocument) { + // WebKit returns "html" (matching the specified name of the doctype source) + // Gecko returns "HTML" and IE "#comment" + // We don't care for this test, so we use this hack. + return iframeDocument.firstChild.nodeName; +} + +var iframe = document.createElement("iframe"); +document.body.appendChild(iframe); +var iframeDocument = iframe.contentWindow.document; + +debug("about:blank is quirksmode by default") +shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); +debug("ensure that about:blank's DOM has an html and body element") +shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML [HEAD, BODY]]"); + +iframeDocument.write("<!DocType html><html><body>test</body></html>"); +debug("writing a doctype as the first document.write can change the document to standards") +shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); +debug("ensure the written DOM has an html and body element") +shouldBeEqualToString("treeAsString(iframeDocument)", "#document [" + doctypeNodeName(iframeDocument) + ", HTML [HEAD, BODY [#text]]]"); + +// document.open() doesn't seem to clear the document as expected in Gecko +// https://bugzilla.mozilla.org/show_bug.cgi?id=483908 +// All tests after this points are likely to fail in Firefox +iframe.contentWindow.document.open(); +debug("ensure that document.open clears the document but does not change the document pointer") +shouldBe("iframeDocument", "iframe.contentWindow.document"); +debug("document.open should also clear the document and reset the doctype)") +shouldBeEqualToString("treeAsString(iframeDocument)", "#document"); +shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); + +debug("document.write of \"\" should leave the document in no-quirks mode and add no content to the document") +iframeDocument.write(""); +shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); +shouldBeEqualToString("treeAsString(iframeDocument)", "#document"); + +debug("document.write calls can change the doctype until an <html> is created") +iframeDocument.write("<!DocType html><html><body>test</body></html>"); +shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); + +debug("reset the document again"); +iframe.contentWindow.document.open(); + +debug("document.write of \"<html>\" should leave the document in quirksmode and add only an HTML element, no body") +iframeDocument.write("<html>"); +shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); +shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML]"); + +debug("any document.write calls after <html> has been encountered cannot change the doctype") +iframeDocument.write("<!DocType html><html><body>test</body></html>"); +shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); + +document.body.removeChild(iframe); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception.html b/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception.html index f9f4577..8f585f80 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception.html
@@ -4,6 +4,10 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/invalid-domain-change-throws-exception.js"></script> +<script> +description("This test checks that a SECURITY_ERR exception is raised if an attempt is made to change document.domain to an invalid value."); + +shouldThrow('document.domain = "apple.com"', '"SecurityError: Failed to set the \'domain\' property on \'Document\': \'apple.com\' is not a suffix of \'\'."'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild.html b/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild.html index d9ab5cf..2c72dde 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild.html
@@ -4,6 +4,10 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/replaceChild-null-oldChild.js"></script> +<script> +description('Test behavior of Document.replaceChild() when oldChild is null.'); + +shouldThrow('document.replaceChild(document.firstChild, null)', '"TypeError: Failed to execute \'replaceChild\' on \'Node\': parameter 2 is not of type \'Node\'."'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js deleted file mode 100644 index 7f25d8a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js +++ /dev/null
@@ -1,127 +0,0 @@ -description("createAttirbuteNS tests adapted from createElementNS tests attached to webkit bug 16833"); - -function assert(c, m) -{ - if (!c) - testFailed(m); - else - testPassed(m); -} - -function stringForExceptionCode(c) -{ - var exceptionName; - switch(c) { - case DOMException.INVALID_CHARACTER_ERR: - exceptionName = "INVALID_CHARACTER_ERR"; - break; - case DOMException.NAMESPACE_ERR: - exceptionName = "NAMESPACE_ERR"; - } - if (exceptionName) - return exceptionName; // + "(" + c + ")"; - return c; -} - -function assertExceptionCode(exception, expect, m) -{ - var actual = exception.code; - if (actual !== expect) { - m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); - testFailed(m); - } else { - m += "; threw " + exception.toString(); - testPassed(m); - } -} - -var allNSTests = [ - { args: [undefined, undefined] }, - { args: [null, undefined] }, - { args: [undefined, null] }, - { args: [null, null] }, - { args: [null, ""], code: 5 }, - { args: ["", null] }, - { args: ["", ""], code: 5 }, - { args: [null, "<div>"], code: 5 }, - { args: [null, "0div"], code: 5 }, - { args: [null, "di v"], code: 5 }, - { args: [null, "di<v"], code: 5 }, - { args: [null, "-div"], code: 5 }, - { args: [null, ".div"], code: 5 }, - { args: ["http://example.com/", "<div>"], code: 5 }, - { args: ["http://example.com/", "0div"], code: 5 }, - { args: ["http://example.com/", "di<v"], code: 5 }, - { args: ["http://example.com/", "-div"], code: 5 }, - { args: ["http://example.com/", ".div"], code: 5 }, - { args: [null, ":div"], code: 14 }, - { args: [null, "div:"], code: 14 }, - { args: ["http://example.com/", ":div"], code: 14 }, - { args: ["http://example.com/", "div:"], code: 14 }, - { args: [null, "d:iv"], code: 14 }, - { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, - { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, - { args: ["http://example.com/", "a:_"] }, - { args: ["http://example.com/", "a:\u0BC6"], code: 14, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, - { args: ["http://example.com/", "\u0BC6:a"], code: 5, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + - "as this is both an invalid XML name and an invalid QName)" }, - { args: ["http://example.com/", "a:a\u0BC6"] }, - { args: ["http://example.com/", "a\u0BC6:a"] }, - { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, - { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, - { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns"] }, // See http://www.w3.org/2000/xmlns/ - { args: ["http://example.com/", "xmlns"], code: 14 }, // from the createAttributeNS section -]; - -function sourceify(v) -{ - switch (typeof v) { - case "undefined": - return v; - - case "string": - return '"' + v.replace('"', '\\"') + '"'; - - default: - return String(v); - } -} - -function runNSTests() -{ - var createFunction = document.createAttributeNS; - var createFunctionName = "createAttributeNS"; - var doc = document; - - for (var i = 0, sz = allNSTests.length; i < sz; i++) { - var test = allNSTests[i]; - - var code = -1; - var argStr = sourceify(test.args[0]) + ", " + sourceify(test.args[1]); - var msg = createFunctionName + "(" + argStr + ")"; - if ("message" in test) - msg += "; " + test.message; - try { - createFunction.apply(doc, test.args); - assert(!("code" in test), msg); - } catch (e) { - assertExceptionCode(e, test.code || "expected no exception", msg); - } - } -} - -runNSTests();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js deleted file mode 100644 index f73ed4c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js +++ /dev/null
@@ -1,171 +0,0 @@ -description("createElementNS tests from mozilla, attached to webkit bug 16833"); - -function assert(c, m) -{ - if (!c) - testFailed(m); - else - testPassed(m); -} - -function stringForExceptionCode(c) -{ - var exceptionName; - switch(c) { - case DOMException.INVALID_CHARACTER_ERR: - exceptionName = "INVALID_CHARACTER_ERR"; - break; - case DOMException.NAMESPACE_ERR: - exceptionName = "NAMESPACE_ERR"; - } - if (exceptionName) - return exceptionName; // + "(" + c + ")"; - return c; -} - -function assertExceptionCode(exception, expect, m) -{ - var actual = exception.code; - if (actual !== expect) { - m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); - testFailed(m); - } else { - m += "; threw " + exception.toString(); - testPassed(m); - } -} - -var allNSTests = [ - { args: [undefined, undefined] }, - { args: [null, undefined] }, - { args: [undefined, null] }, - { args: [null, null] }, - { args: [null, ""], code: 5 }, - { args: ["", null] }, - { args: ["", ""], code: 5 }, - { args: [null, "<div>"], code: 5 }, - { args: [null, "0div"], code: 5 }, - { args: [null, "di v"], code: 5 }, - { args: [null, "di<v"], code: 5 }, - { args: [null, "-div"], code: 5 }, - { args: [null, ".div"], code: 5 }, - { args: ["http://example.com/", "<div>"], code: 5 }, - { args: ["http://example.com/", "0div"], code: 5 }, - { args: ["http://example.com/", "di<v"], code: 5 }, - { args: ["http://example.com/", "-div"], code: 5 }, - { args: ["http://example.com/", ".div"], code: 5 }, - { args: [null, ":div"], code: 14 }, - { args: [null, "div:"], code: 14 }, - { args: ["http://example.com/", ":div"], code: 14 }, - { args: ["http://example.com/", "div:"], code: 14 }, - { args: [null, "d:iv"], code: 14 }, - { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, - { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, - { args: ["http://example.com/", "a:_"] }, - { args: ["http://example.com/", "a:\u0BC6"], code: 14, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, - { args: ["http://example.com/", "\u0BC6:a"], code: 5, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + - "as this is both an invalid XML name and an invalid QName)" }, - { args: ["http://example.com/", "a:a\u0BC6"] }, - { args: ["http://example.com/", "a\u0BC6:a"] }, - { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, - { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, - { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, -]; - -var allNoNSTests = [ - { args: [undefined] }, - { args: [null] }, - { args: [""], code: 5 }, - { args: ["<div>"], code: 5 }, - { args: ["0div"], code: 5 }, - { args: ["di v"], code: 5 }, - { args: ["di<v"], code: 5 }, - { args: ["-div"], code: 5 }, - { args: [".div"], code: 5 }, - { args: [":"], message: "valid XML name, invalid QName" }, - { args: [":div"], message: "valid XML name, invalid QName" }, - { args: ["div:"], message: "valid XML name, invalid QName" }, - { args: ["d:iv"] }, - { args: ["a:b:c"], message: "valid XML name, invalid QName" }, - { args: ["a::c"], message: "valid XML name, invalid QName" }, - { args: ["a::c:"], message: "valid XML name, invalid QName" }, - { args: ["a:0"], message: "valid XML name, not a valid QName" }, - { args: ["0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, - { args: ["a:_"] }, - { args: ["a:\u0BC6"], - message: "non-ASCII character after colon is CombiningChar, which is " + - "valid in pre-namespace XML" }, - { args: ["\u0BC6:a"], code: 5, message: "not a valid start character" }, - { args: ["a:a\u0BC6"] }, - { args: ["a\u0BC6:a"] }, - { args: ["xml:test"] }, - { args: ["xmlns:test"] }, - { args: ["x:test"] }, - { args: ["xmlns:test"] }, - { args: ["SOAP-ENV:Body"] }, // From Yahoo Mail Beta -]; - -function sourceify(v) -{ - switch (typeof v) { - case "undefined": - return v; - case "string": - return '"' + v.replace('"', '\\"') + '"'; - default: - return String(v); - } -} - -function sourceifyArgs(args) -{ - var copy = new Array(args.length); - for (var i = 0, sz = args.length; i < sz; i++) - copy[i] = sourceify(args[i]); - - return copy.join(", "); -} - -function runNSTests(tests, doc, createFunctionName) -{ - for (var i = 0, sz = tests.length; i < sz; i++) { - var test = tests[i]; - - var code = -1; - var argStr = sourceifyArgs(test.args); - var msg = createFunctionName + "(" + argStr + ")"; - if ("message" in test) - msg += "; " + test.message; - try { - doc[createFunctionName].apply(doc, test.args); - assert(!("code" in test), msg); - } catch (e) { - assertExceptionCode(e, test.code || "expected no exception", msg); - } - } -} - -debug("HTML tests:") -runNSTests(allNSTests, document, "createElementNS"); -runNSTests(allNoNSTests, document, "createElement"); - -debug("XHTML createElement tests:") -var xhtmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); -runNSTests(allNoNSTests, xhtmlDoc, "createElement"); - -debug("XML createElement tests:") -var xmlDoc = document.implementation.createDocument("http://www.example.com/foo", "example", null); -runNSTests(allNoNSTests, xmlDoc, "createElement");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-title-get.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-title-get.js deleted file mode 100644 index fbfa382..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-title-get.js +++ /dev/null
@@ -1,26 +0,0 @@ -description("This test checks the implementation of getting the document.title attribute."); - -debug('Test with no title set'); -shouldBeEqualToString("document.title", ""); - -debug('Test with empty title'); -document.title = ""; -shouldBeEqualToString("document.title",""); - -debug('Test with only whitespace'); -document.title = "\t\n\r \r \t\n\n"; -shouldBeEqualToString("document.title",""); - -debug('Test with no whitespace'); -document.title = "nowhitespacetitle"; -shouldBeEqualToString("document.title","nowhitespacetitle"); - -debug('Test with whitespace'); -document.title = "\u0009\u000aone\u000b\u000cspace\u000d\u0020"; -shouldBeEqualToString("document.title","one\u000b space"); - -debug('Test with various whitespace lengths and fields'); -document.title = " lots of \r whitespace and \n\n\n \t newlines \t"; -shouldBeEqualToString("document.title", "lots of whitespace and newlines"); - -debug('Test with various length strings');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js deleted file mode 100644 index 11db3e6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/document-write-doctype.js +++ /dev/null
@@ -1,75 +0,0 @@ -description("Test that iframe.contentWindow.document.write() can convert a document to strict mode -- https://bugs.webkit.org/show_bug.cgi?id=24336"); - -// Simple recurisve "give me a string to represent this tree" function -function treeAsString(node) { - var string = node.nodeName; - if (node.childNodes.length) { - string += " ["; - } - for (var x = 0; x < node.childNodes.length; x++) { - if (x != 0) { - string += ", "; - } - string += treeAsString(node.childNodes[x]); - } - - if (node.childNodes.length) { - string += "]"; - } - return string; -} - -function doctypeNodeName(iframeDocument) { - // WebKit returns "html" (matching the specified name of the doctype source) - // Gecko returns "HTML" and IE "#comment" - // We don't care for this test, so we use this hack. - return iframeDocument.firstChild.nodeName; -} - -var iframe = document.createElement("iframe"); -document.body.appendChild(iframe); -var iframeDocument = iframe.contentWindow.document; - -debug("about:blank is quirksmode by default") -shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); -debug("ensure that about:blank's DOM has an html and body element") -shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML [HEAD, BODY]]"); - -iframeDocument.write("<!DocType html><html><body>test</body></html>"); -debug("writing a doctype as the first document.write can change the document to standards") -shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); -debug("ensure the written DOM has an html and body element") -shouldBeEqualToString("treeAsString(iframeDocument)", "#document [" + doctypeNodeName(iframeDocument) + ", HTML [HEAD, BODY [#text]]]"); - -// document.open() doesn't seem to clear the document as expected in Gecko -// https://bugzilla.mozilla.org/show_bug.cgi?id=483908 -// All tests after this points are likely to fail in Firefox -iframe.contentWindow.document.open(); -debug("ensure that document.open clears the document but does not change the document pointer") -shouldBe("iframeDocument", "iframe.contentWindow.document"); -debug("document.open should also clear the document and reset the doctype)") -shouldBeEqualToString("treeAsString(iframeDocument)", "#document"); -shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); - -debug("document.write of \"\" should leave the document in no-quirks mode and add no content to the document") -iframeDocument.write(""); -shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); -shouldBeEqualToString("treeAsString(iframeDocument)", "#document"); - -debug("document.write calls can change the doctype until an <html> is created") -iframeDocument.write("<!DocType html><html><body>test</body></html>"); -shouldBeEqualToString("iframeDocument.compatMode", "CSS1Compat"); - -debug("reset the document again"); -iframe.contentWindow.document.open(); - -debug("document.write of \"<html>\" should leave the document in quirksmode and add only an HTML element, no body") -iframeDocument.write("<html>"); -shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); -shouldBeEqualToString("treeAsString(iframeDocument)", "#document [HTML]"); - -debug("any document.write calls after <html> has been encountered cannot change the doctype") -iframeDocument.write("<!DocType html><html><body>test</body></html>"); -shouldBeEqualToString("iframeDocument.compatMode", "BackCompat"); - -document.body.removeChild(iframe);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/invalid-domain-change-throws-exception.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/invalid-domain-change-throws-exception.js deleted file mode 100644 index 188e707e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/invalid-domain-change-throws-exception.js +++ /dev/null
@@ -1,3 +0,0 @@ -description("This test checks that a SECURITY_ERR exception is raised if an attempt is made to change document.domain to an invalid value."); - -shouldThrow('document.domain = "apple.com"', '"SecurityError: Failed to set the \'domain\' property on \'Document\': \'apple.com\' is not a suffix of \'\'."');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/replaceChild-null-oldChild.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/replaceChild-null-oldChild.js deleted file mode 100644 index 9813699b..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/replaceChild-null-oldChild.js +++ /dev/null
@@ -1,3 +0,0 @@ -description('Test behavior of Document.replaceChild() when oldChild is null.'); - -shouldThrow('document.replaceChild(document.firstChild, null)', '"TypeError: Failed to execute \'replaceChild\' on \'Node\': parameter 2 is not of type \'Node\'."');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/title-with-multiple-children.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/title-with-multiple-children.js deleted file mode 100644 index b1764a0..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/title-with-multiple-children.js +++ /dev/null
@@ -1,28 +0,0 @@ -description("This test checks to see if setting document.title works even if the title element has multiple children."); - -// Setup - create title element. -shouldBe("document.getElementsByTagName('title').length", "0"); -var titleElement = document.createElement("title"); -document.body.appendChild(titleElement); - -// For case with no children. -shouldBe("document.title", "''"); -shouldBe("titleElement.text", "''"); - -// For case with single children. -var firstText = "First"; -titleElement.appendChild(document.createTextNode(firstText)); -shouldBe("document.title", "firstText"); -shouldBe("titleElement.text", "firstText"); - -// For case with 2 children. -var secondText = "Second"; -titleElement.appendChild(document.createTextNode(secondText)); -shouldBe("document.title", "firstText + secondText"); -shouldBe("titleElement.text", "firstText + secondText"); - -// override title with setting document.title with multiple title children. -var expected = "This title is set by property"; -document.title = expected; -shouldBe("document.title", "expected"); -shouldBe("titleElement.text", "expected");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html index 427f72ee..e7e4450 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children.html
@@ -4,6 +4,35 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/title-with-multiple-children.js"></script> +<script> +description("This test checks to see if setting document.title works even if the title element has multiple children."); + +// Setup - create title element. +shouldBe("document.getElementsByTagName('title').length", "0"); +var titleElement = document.createElement("title"); +document.body.appendChild(titleElement); + +// For case with no children. +shouldBe("document.title", "''"); +shouldBe("titleElement.text", "''"); + +// For case with single children. +var firstText = "First"; +titleElement.appendChild(document.createTextNode(firstText)); +shouldBe("document.title", "firstText"); +shouldBe("titleElement.text", "firstText"); + +// For case with 2 children. +var secondText = "Second"; +titleElement.appendChild(document.createTextNode(secondText)); +shouldBe("document.title", "firstText + secondText"); +shouldBe("titleElement.text", "firstText + secondText"); + +// override title with setting document.title with multiple title children. +var expected = "This title is set by property"; +document.title = expected; +shouldBe("document.title", "expected"); +shouldBe("titleElement.text", "expected"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking.html b/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking.html index 75b268a..8034125 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking.html
@@ -4,6 +4,25 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/attr-param-typechecking.js"></script> +<script> +description( +'This test checks whether passing wrong types to setAttributeNode causes a crash.' +); + +var element = document.createElement("input"); + +shouldThrow('element.setAttributeNode("style");'); +shouldThrow('element.setAttributeNode(null);'); +shouldThrow('element.setAttributeNode(undefined);'); +shouldThrow('element.setAttributeNode(new Object);'); +shouldThrow('element.removeAttributeNode("style");'); +shouldThrow('element.removeAttributeNode(null);'); +shouldThrow('element.removeAttributeNode(undefined);'); +shouldThrow('element.removeAttributeNode(new Object);'); +shouldThrow('element.setAttributeNodeNS("style");'); +shouldThrow('element.setAttributeNodeNS(null);'); +shouldThrow('element.setAttributeNodeNS(undefined);'); +shouldThrow('element.setAttributeNodeNS(new Object);'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered.html b/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered.html index 499e1bf..1e85861 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered.html
@@ -4,6 +4,22 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/dimension-properties-unrendered.js"></script> +<script> +description( +'This test checks the scroll, client and offset dimension properties return "0" instead of undefined for an unrendered element. <div id="testDiv" style="display: none">x</div>' +); + +var testDiv = document.getElementById("testDiv"); +shouldBe("testDiv.offsetLeft", "0"); +shouldBe("testDiv.offsetTop", "0"); +shouldBe("testDiv.offsetWidth", "0"); +shouldBe("testDiv.offsetHeight", "0"); +shouldBe("testDiv.clientWidth", "0"); +shouldBe("testDiv.clientHeight", "0"); +shouldBe("testDiv.scrollLeft", "0"); +shouldBe("testDiv.scrollTop", "0"); +shouldBe("testDiv.scrollWidth", "0"); +shouldBe("testDiv.scrollHeight", "0"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal.html b/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal.html index 8384a1e..180d422 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal.html
@@ -4,6 +4,46 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/element-traversal.js"></script> +<script> +description("This test checks the implementation of the ElementTraversal API."); + +debug('Test with no children'); +var noChildren = document.createElement('div'); + +shouldBe("noChildren.firstElementChild", "null"); +shouldBe("noChildren.lastElementChild", "null"); +shouldBe("noChildren.previousElementSibling", "null"); +shouldBe("noChildren.nextElementSibling", "null"); +shouldBe("noChildren.childElementCount", "0"); + +debug('Test with no element children'); +var noElementChildren = document.createElement('div'); +noElementChildren.appendChild(document.createComment("comment but not an element")); +noElementChildren.appendChild(document.createTextNode("no elements here")); + +shouldBe("noElementChildren.firstElementChild", "null"); +shouldBe("noElementChildren.lastElementChild", "null"); +shouldBe("noElementChildren.previousElementSibling", "null"); +shouldBe("noElementChildren.nextElementSibling", "null"); +shouldBe("noElementChildren.childElementCount", "0"); + +debug('Test with elements'); +var children = document.createElement('div'); +children.appendChild(document.createComment("first comment")); +var first = document.createElement('p'); +children.appendChild(first); +children.appendChild(document.createComment("a comment")); +var last = document.createElement('p'); +children.appendChild(last); +children.appendChild(document.createComment("last comment")); + +shouldBe("children.firstElementChild", "first"); +shouldBe("children.lastElementChild", "last"); +shouldBe("first.nextElementSibling", "last"); +shouldBe("first.nextElementSibling.nextElementSibling", "null"); +shouldBe("last.previousElementSibling", "first"); +shouldBe("last.previousElementSibling.previousElementSibling", "null"); +shouldBe("children.childElementCount", "2"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity.html b/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity.html index 0e5270c..7f161b5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity.html
@@ -4,6 +4,148 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/getAttribute-check-case-sensitivity.js"></script> +<script> +description( +"<p>This file test the behaviour of getAttribute with regard to case.</p><p>See Bug 20247: setAttributeNode() does not work when attribute name has a capital letter in it</p>" +); + +function testGetAttributeCaseInsensitive() +{ + var div = document.createElement('div'); + div.setAttribute("mixedCaseAttrib", "x"); + + // Do original case lookup, and lowercase lookup. + return div.getAttribute("mixedcaseattrib"); +} + +shouldBe("testGetAttributeCaseInsensitive()", '"x"'); + +function testGetAttributeNodeMixedCase() +{ + var div = document.createElement('div'); + var a = div.ownerDocument.createAttribute("mixedCaseAttrib"); + a.value = "x"; + div.setAttributeNode(a); + return div.getAttribute("mixedCaseAttrib"); +} + +shouldBe("testGetAttributeNodeMixedCase()", '"x"'); + +function testGetAttributeNodeLowerCase(div) +{ + var div = document.createElement('div'); + var a = div.ownerDocument.createAttribute("lowercaseattrib"); + a.value = "x"; + div.setAttributeNode(a); + return div.getAttribute("lowerCaseAttrib"); +} + +shouldBe("testGetAttributeNodeLowerCase()", '"x"'); + +function testSetAttributeNodeKeepsRef(div) +{ + var div = document.createElement('div'); + var a = div.ownerDocument.createAttribute("attrib_name"); + a.value = "0"; + div.setAttributeNode(a); + + // Mutate the attribute node. + a.value = "1"; + + return div.getAttribute("attrib_name"); +} + +shouldBe("testSetAttributeNodeKeepsRef()", '"1"'); + +function testAttribNodeNamePreservesCase() +{ + var div = document.createElement('div'); + var a = div.ownerDocument.createAttribute("A"); + a.value = "x"; + div.setAttributeNode(a); + + var result = [ a.name, a.nodeName ]; + return result.join(","); +} + +shouldBe("testAttribNodeNamePreservesCase()", '"a,a"'); + + +function testAttribNodeNamePreservesCaseGetNode() +{ + // getAttributeNode doesn't work on DIVs, use body element + var body = document.body; + + var a = body.ownerDocument.createAttribute("A"); + a.value = "x"; + + body.setAttributeNode(a); + + a = document.body.getAttributeNode("A"); + if (!a) + return "FAIL"; + + var result = [ a.name, a.nodeName ]; + return result.join(","); +} + +shouldBe("testAttribNodeNamePreservesCaseGetNode()", '"a,a"'); + +function testAttribNodeNamePreservesCaseGetNode2() +{ + // getAttributeNode doesn't work on DIVs, use body element + var body = document.body; + + var a = body.ownerDocument.createAttribute("B"); + a.value = "x"; + + body.setAttributeNode(a); + + a = document.body.getAttributeNode("B"); + if (!a) + return "FAIL"; + + // Now create node second time -- this time case is preserved in FF! + a = body.ownerDocument.createAttribute("B"); + a.value = "x"; + body.setAttributeNode(a); + + a = document.body.getAttributeNode("B"); + + var result = [ a.name, a.nodeName ]; + return result.join(","); +} + +shouldBe("testAttribNodeNamePreservesCaseGetNode2()", '"b,b"'); + +function testAttribNodeNameGetMutate() +{ + // getAttributeNode doesn't work on DIVs, use body element. + var body = document.body; + + var a = body.ownerDocument.createAttribute("c"); + a.value = "0"; + body.setAttributeNode(a); + + a = document.body.getAttributeNode("c"); + a.value = "1"; + + a = document.body.getAttributeNode("c"); + + return a.value; +} + +shouldBe("testAttribNodeNameGetMutate()", '"1"'); + +var node = document.createElement("div"); +var attrib = document.createAttribute("myAttrib"); +attrib.value = "XXX"; +node.setAttributeNode(attrib); + +shouldBe("(new XMLSerializer).serializeToString(node)", '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\" myattrib=\\"XXX\\"></div>"'); +shouldBe("node.getAttributeNode('myAttrib').name", '"myattrib"'); +shouldBe("node.getAttributeNode('myattrib').name", '"myattrib"'); +shouldBe("attrib.name", '"myattrib"'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/attr-param-typechecking.js b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/attr-param-typechecking.js deleted file mode 100644 index 88061fa..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/attr-param-typechecking.js +++ /dev/null
@@ -1,18 +0,0 @@ -description( -'This test checks whether passing wrong types to setAttributeNode causes a crash.' -); - -var element = document.createElement("input"); - -shouldThrow('element.setAttributeNode("style");'); -shouldThrow('element.setAttributeNode(null);'); -shouldThrow('element.setAttributeNode(undefined);'); -shouldThrow('element.setAttributeNode(new Object);'); -shouldThrow('element.removeAttributeNode("style");'); -shouldThrow('element.removeAttributeNode(null);'); -shouldThrow('element.removeAttributeNode(undefined);'); -shouldThrow('element.removeAttributeNode(new Object);'); -shouldThrow('element.setAttributeNodeNS("style");'); -shouldThrow('element.setAttributeNodeNS(null);'); -shouldThrow('element.setAttributeNodeNS(undefined);'); -shouldThrow('element.setAttributeNodeNS(new Object);');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/dimension-properties-unrendered.js b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/dimension-properties-unrendered.js deleted file mode 100644 index 1e2b957..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/dimension-properties-unrendered.js +++ /dev/null
@@ -1,15 +0,0 @@ -description( -'This test checks the scroll, client and offset dimension properties return "0" instead of undefined for an unrendered element. <div id="testDiv" style="display: none">x</div>' -); - -var testDiv = document.getElementById("testDiv"); -shouldBe("testDiv.offsetLeft", "0"); -shouldBe("testDiv.offsetTop", "0"); -shouldBe("testDiv.offsetWidth", "0"); -shouldBe("testDiv.offsetHeight", "0"); -shouldBe("testDiv.clientWidth", "0"); -shouldBe("testDiv.clientHeight", "0"); -shouldBe("testDiv.scrollLeft", "0"); -shouldBe("testDiv.scrollTop", "0"); -shouldBe("testDiv.scrollWidth", "0"); -shouldBe("testDiv.scrollHeight", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/element-traversal.js b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/element-traversal.js deleted file mode 100644 index 462de603..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/element-traversal.js +++ /dev/null
@@ -1,39 +0,0 @@ -description("This test checks the implementation of the ElementTraversal API."); - -debug('Test with no children'); -var noChildren = document.createElement('div'); - -shouldBe("noChildren.firstElementChild", "null"); -shouldBe("noChildren.lastElementChild", "null"); -shouldBe("noChildren.previousElementSibling", "null"); -shouldBe("noChildren.nextElementSibling", "null"); -shouldBe("noChildren.childElementCount", "0"); - -debug('Test with no element children'); -var noElementChildren = document.createElement('div'); -noElementChildren.appendChild(document.createComment("comment but not an element")); -noElementChildren.appendChild(document.createTextNode("no elements here")); - -shouldBe("noElementChildren.firstElementChild", "null"); -shouldBe("noElementChildren.lastElementChild", "null"); -shouldBe("noElementChildren.previousElementSibling", "null"); -shouldBe("noElementChildren.nextElementSibling", "null"); -shouldBe("noElementChildren.childElementCount", "0"); - -debug('Test with elements'); -var children = document.createElement('div'); -children.appendChild(document.createComment("first comment")); -var first = document.createElement('p'); -children.appendChild(first); -children.appendChild(document.createComment("a comment")); -var last = document.createElement('p'); -children.appendChild(last); -children.appendChild(document.createComment("last comment")); - -shouldBe("children.firstElementChild", "first"); -shouldBe("children.lastElementChild", "last"); -shouldBe("first.nextElementSibling", "last"); -shouldBe("first.nextElementSibling.nextElementSibling", "null"); -shouldBe("last.previousElementSibling", "first"); -shouldBe("last.previousElementSibling.previousElementSibling", "null"); -shouldBe("children.childElementCount", "2");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js deleted file mode 100644 index a02a1bd..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js +++ /dev/null
@@ -1,141 +0,0 @@ -description( -"<p>This file test the behaviour of getAttribute with regard to case.</p><p>See Bug 20247: setAttributeNode() does not work when attribute name has a capital letter in it</p>" -); - -function testGetAttributeCaseInsensitive() -{ - var div = document.createElement('div'); - div.setAttribute("mixedCaseAttrib", "x"); - - // Do original case lookup, and lowercase lookup. - return div.getAttribute("mixedcaseattrib"); -} - -shouldBe("testGetAttributeCaseInsensitive()", '"x"'); - -function testGetAttributeNodeMixedCase() -{ - var div = document.createElement('div'); - var a = div.ownerDocument.createAttribute("mixedCaseAttrib"); - a.value = "x"; - div.setAttributeNode(a); - return div.getAttribute("mixedCaseAttrib"); -} - -shouldBe("testGetAttributeNodeMixedCase()", '"x"'); - -function testGetAttributeNodeLowerCase(div) -{ - var div = document.createElement('div'); - var a = div.ownerDocument.createAttribute("lowercaseattrib"); - a.value = "x"; - div.setAttributeNode(a); - return div.getAttribute("lowerCaseAttrib"); -} - -shouldBe("testGetAttributeNodeLowerCase()", '"x"'); - -function testSetAttributeNodeKeepsRef(div) -{ - var div = document.createElement('div'); - var a = div.ownerDocument.createAttribute("attrib_name"); - a.value = "0"; - div.setAttributeNode(a); - - // Mutate the attribute node. - a.value = "1"; - - return div.getAttribute("attrib_name"); -} - -shouldBe("testSetAttributeNodeKeepsRef()", '"1"'); - -function testAttribNodeNamePreservesCase() -{ - var div = document.createElement('div'); - var a = div.ownerDocument.createAttribute("A"); - a.value = "x"; - div.setAttributeNode(a); - - var result = [ a.name, a.nodeName ]; - return result.join(","); -} - -shouldBe("testAttribNodeNamePreservesCase()", '"a,a"'); - - -function testAttribNodeNamePreservesCaseGetNode() -{ - // getAttributeNode doesn't work on DIVs, use body element - var body = document.body; - - var a = body.ownerDocument.createAttribute("A"); - a.value = "x"; - - body.setAttributeNode(a); - - a = document.body.getAttributeNode("A"); - if (!a) - return "FAIL"; - - var result = [ a.name, a.nodeName ]; - return result.join(","); -} - -shouldBe("testAttribNodeNamePreservesCaseGetNode()", '"a,a"'); - -function testAttribNodeNamePreservesCaseGetNode2() -{ - // getAttributeNode doesn't work on DIVs, use body element - var body = document.body; - - var a = body.ownerDocument.createAttribute("B"); - a.value = "x"; - - body.setAttributeNode(a); - - a = document.body.getAttributeNode("B"); - if (!a) - return "FAIL"; - - // Now create node second time -- this time case is preserved in FF! - a = body.ownerDocument.createAttribute("B"); - a.value = "x"; - body.setAttributeNode(a); - - a = document.body.getAttributeNode("B"); - - var result = [ a.name, a.nodeName ]; - return result.join(","); -} - -shouldBe("testAttribNodeNamePreservesCaseGetNode2()", '"b,b"'); - -function testAttribNodeNameGetMutate() -{ - // getAttributeNode doesn't work on DIVs, use body element. - var body = document.body; - - var a = body.ownerDocument.createAttribute("c"); - a.value = "0"; - body.setAttributeNode(a); - - a = document.body.getAttributeNode("c"); - a.value = "1"; - - a = document.body.getAttributeNode("c"); - - return a.value; -} - -shouldBe("testAttribNodeNameGetMutate()", '"1"'); - -var node = document.createElement("div"); -var attrib = document.createAttribute("myAttrib"); -attrib.value = "XXX"; -node.setAttributeNode(attrib); - -shouldBe("(new XMLSerializer).serializeToString(node)", '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\" myattrib=\\"XXX\\"></div>"'); -shouldBe("node.getAttributeNode('myAttrib').name", '"myattrib"'); -shouldBe("node.getAttributeNode('myattrib').name", '"myattrib"'); -shouldBe("attrib.name", '"myattrib"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/setAttributeNS-namespace-err.js b/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/setAttributeNS-namespace-err.js deleted file mode 100644 index dbe8f561..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/script-tests/setAttributeNS-namespace-err.js +++ /dev/null
@@ -1,127 +0,0 @@ -description("setAttributeNS tests adapted from createAttributeNS which in turn were adapted from createElementNS tests attached to webkit bug 16833"); - -function assert(c, m) -{ - if (!c) - testFailed(m); - else - testPassed(m); -} - -function stringForExceptionCode(c) -{ - var exceptionName; - switch(c) { - case DOMException.INVALID_CHARACTER_ERR: - exceptionName = "INVALID_CHARACTER_ERR"; - break; - case DOMException.NAMESPACE_ERR: - exceptionName = "NAMESPACE_ERR"; - } - if (exceptionName) - return exceptionName; // + "(" + c + ")"; - return c; -} - -function assertEquals(actual, expect, m) -{ - if (actual !== expect) { - m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); - testFailed(m); - } else { - m += "; threw " + stringForExceptionCode(actual);; - testPassed(m); - } -} - -var allNSTests = [ - { args: [undefined, undefined] }, - { args: [null, undefined] }, - { args: [undefined, null], code: 5 }, - { args: [null, null], code: 5 }, - { args: [null, ""], code: 5 }, - { args: ["", null], code: 5 }, - { args: ["", ""], code: 5 }, - { args: [null, "<div>"], code: 5 }, - { args: [null, "0div"], code: 5 }, - { args: [null, "di v"], code: 5 }, - { args: [null, "di<v"], code: 5 }, - { args: [null, "-div"], code: 5 }, - { args: [null, ".div"], code: 5 }, - { args: ["http://example.com/", "<div>"], code: 5 }, - { args: ["http://example.com/", "0div"], code: 5 }, - { args: ["http://example.com/", "di<v"], code: 5 }, - { args: ["http://example.com/", "-div"], code: 5 }, - { args: ["http://example.com/", ".div"], code: 5 }, - { args: [null, ":div"], code: 14 }, - { args: [null, "div:"], code: 14 }, - { args: ["http://example.com/", ":div"], code: 14 }, - { args: ["http://example.com/", "div:"], code: 14 }, - { args: [null, "d:iv"], code: 14 }, - { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, - { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, - { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, - { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, - { args: ["http://example.com/", "a:_"] }, - { args: ["http://example.com/", "a:\u0BC6"], code: 14, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, - { args: ["http://example.com/", "\u0BC6:a"], code: 5, - message: "non-ASCII character after colon is CombiningChar, which is " + - "NCNameChar but not (Letter | \"_\") so invalid at start of " + - "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + - "as this is both an invalid XML name and an invalid QName)" }, - { args: ["http://example.com/", "a:a\u0BC6"] }, - { args: ["http://example.com/", "a\u0BC6:a"] }, - { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, - { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, - { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, - { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, - { args: ["http://www.w3.org/2000/xmlns/", "xmlns"] }, // See http://www.w3.org/2000/xmlns/ - { args: ["http://example.com/", "xmlns"], code: 14 }, // from the createAttributeNS section -]; - -function sourceify(v) -{ - switch (typeof v) { - case "undefined": - return v; - - case "string": - return '"' + v.replace('"', '\\"') + '"'; - - default: - return String(v); - } -} - -function runNSTests() -{ - var element = document.createElement("div"); - var setFunction = element.setAttributeNS; - var setFunctionName = "element.setAttributeNS"; - var value = "'value'"; - - for (var i = 0, sz = allNSTests.length; i < sz; i++) { - var test = allNSTests[i]; - - var code = -1; - var argStr = sourceify(test.args[0]) + ", " + sourceify(test.args[1]) + ", " + value; - var msg = setFunctionName + "(" + argStr + ")"; - if ("message" in test) - msg += "; " + test.message; - try { - setFunction.apply(element, test.args.concat([value])); - assert(!("code" in test), msg); - } catch (e) { - assertEquals(e.code, test.code || "expected no exception", msg); - } - } -} - -runNSTests();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html index 03a2f7c..5a6d9e62 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html
@@ -4,6 +4,134 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/setAttributeNS-namespace-err.js"></script> +<script> +description("setAttributeNS tests adapted from createAttributeNS which in turn were adapted from createElementNS tests attached to webkit bug 16833"); + +function assert(c, m) +{ + if (!c) + testFailed(m); + else + testPassed(m); +} + +function stringForExceptionCode(c) +{ + var exceptionName; + switch(c) { + case DOMException.INVALID_CHARACTER_ERR: + exceptionName = "INVALID_CHARACTER_ERR"; + break; + case DOMException.NAMESPACE_ERR: + exceptionName = "NAMESPACE_ERR"; + } + if (exceptionName) + return exceptionName; // + "(" + c + ")"; + return c; +} + +function assertEquals(actual, expect, m) +{ + if (actual !== expect) { + m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); + testFailed(m); + } else { + m += "; threw " + stringForExceptionCode(actual);; + testPassed(m); + } +} + +var allNSTests = [ + { args: [undefined, undefined] }, + { args: [null, undefined] }, + { args: [undefined, null], code: 5 }, + { args: [null, null], code: 5 }, + { args: [null, ""], code: 5 }, + { args: ["", null], code: 5 }, + { args: ["", ""], code: 5 }, + { args: [null, "<div>"], code: 5 }, + { args: [null, "0div"], code: 5 }, + { args: [null, "di v"], code: 5 }, + { args: [null, "di<v"], code: 5 }, + { args: [null, "-div"], code: 5 }, + { args: [null, ".div"], code: 5 }, + { args: ["http://example.com/", "<div>"], code: 5 }, + { args: ["http://example.com/", "0div"], code: 5 }, + { args: ["http://example.com/", "di<v"], code: 5 }, + { args: ["http://example.com/", "-div"], code: 5 }, + { args: ["http://example.com/", ".div"], code: 5 }, + { args: [null, ":div"], code: 14 }, + { args: [null, "div:"], code: 14 }, + { args: ["http://example.com/", ":div"], code: 14 }, + { args: ["http://example.com/", "div:"], code: 14 }, + { args: [null, "d:iv"], code: 14 }, + { args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, + { args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, + { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, + { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, + { args: ["http://example.com/", "a:_"] }, + { args: ["http://example.com/", "a:\u0BC6"], code: 14, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR)" }, + { args: ["http://example.com/", "\u0BC6:a"], code: 5, + message: "non-ASCII character after colon is CombiningChar, which is " + + "NCNameChar but not (Letter | \"_\") so invalid at start of " + + "NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid " + + "as this is both an invalid XML name and an invalid QName)" }, + { args: ["http://example.com/", "a:a\u0BC6"] }, + { args: ["http://example.com/", "a\u0BC6:a"] }, + { args: ["http://example.com/", "xml:test"], code: 14, message: "binding xml prefix wrong" }, + { args: ["http://example.com/", "xmlns:test"], code: 14, message: "binding xmlns prefix wrong" }, + { args: ["http://www.w3.org/2000/xmlns/", "x:test"], code: 14, message: "binding namespace namespace to wrong prefix" }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "xml:test"] }, + { args: ["http://www.w3.org/XML/1998/namespace", "x:test"] }, + { args: ["http://www.w3.org/2000/xmlns/", "xmlns"] }, // See http://www.w3.org/2000/xmlns/ + { args: ["http://example.com/", "xmlns"], code: 14 }, // from the createAttributeNS section +]; + +function sourceify(v) +{ + switch (typeof v) { + case "undefined": + return v; + + case "string": + return '"' + v.replace('"', '\\"') + '"'; + + default: + return String(v); + } +} + +function runNSTests() +{ + var element = document.createElement("div"); + var setFunction = element.setAttributeNS; + var setFunctionName = "element.setAttributeNS"; + var value = "'value'"; + + for (var i = 0, sz = allNSTests.length; i < sz; i++) { + var test = allNSTests[i]; + + var code = -1; + var argStr = sourceify(test.args[0]) + ", " + sourceify(test.args[1]) + ", " + value; + var msg = setFunctionName + "(" + argStr + ")"; + if ("message" in test) + msg += "; " + test.message; + try { + setFunction.apply(element, test.args.concat([value])); + assert(!("code" in test), msg); + } catch (e) { + assertEquals(e.code, test.code || "expected no exception", msg); + } + } +} + +runNSTests(); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/argument-types.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/argument-types.html index 5436383..113b732 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/argument-types.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/argument-types.html
@@ -4,6 +4,125 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/argument-types.js"></script> +<script> +description("Tests the acceptable types for arguments to Geolocation methods."); + +function shouldNotThrow(expression) +{ + try { + eval(expression); + testPassed(expression + " did not throw exception."); + } catch(e) { + testFailed(expression + " should not throw exception. Threw exception " + e); + } +} + +function test(expression, expressionShouldThrow, expectedException) { + if (expressionShouldThrow) { + if (expectedException) + shouldThrow(expression, '(function() { return "' + expectedException + '"; })();'); + else + shouldThrow(expression); + } else { + shouldNotThrow(expression); + } +} + +var emptyFunction = function() {}; + +function ObjectThrowingException() {}; +ObjectThrowingException.prototype.valueOf = function() { + throw new Error('valueOf threw exception'); +} +ObjectThrowingException.prototype.__defineGetter__("enableHighAccuracy", function() { + throw new Error('enableHighAccuracy getter exception'); +}); +var objectThrowingException = new ObjectThrowingException(); + + +test('navigator.geolocation.getCurrentPosition()', true); + +test('navigator.geolocation.getCurrentPosition(undefined)', true); +test('navigator.geolocation.getCurrentPosition(null)', true); +test('navigator.geolocation.getCurrentPosition({})', true); +test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction)', false); +test('navigator.geolocation.getCurrentPosition(Math.abs)', false); +test('navigator.geolocation.getCurrentPosition(true)', true); +test('navigator.geolocation.getCurrentPosition(42)', true); +test('navigator.geolocation.getCurrentPosition(Infinity)', true); +test('navigator.geolocation.getCurrentPosition(-Infinity)', true); +test('navigator.geolocation.getCurrentPosition("string")', true); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, null)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, -Infinity)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, "string")', true); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, undefined)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, null)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, objectThrowingException)', true, 'Error: enableHighAccuracy getter exception'); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, emptyFunction)', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, true)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, 42)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, Infinity)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, -Infinity)', true); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, "string")', true); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:undefined})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:null})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:{}})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:objectThrowingException})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:emptyFunction})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:true})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:42})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:-Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:"string"})', false); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:undefined})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:null})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:{}})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:objectThrowingException})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:emptyFunction})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:true})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:42})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:-Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:"string"})', false); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:undefined})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:null})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:{}})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:objectThrowingException})', true, 'Error: valueOf threw exception'); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:emptyFunction})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:true})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:42})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:-Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:"string"})', false); + +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:undefined})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:null})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:{}})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:objectThrowingException})', true, 'Error: valueOf threw exception'); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:emptyFunction})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:true})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:42})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:-Infinity})', false); +test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:"string"})', false); + +window.jsTestIsAsync = false; + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html index 7a54965d..56022d00 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/cached-position-called-once.html
@@ -6,6 +6,57 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/cached-position-called-once.js"></script> +<script> +description('Tests that when a cached position is available the callback for getCurrentPosition is called only once. This is a regression test for http://crbug.com/311876 .'); + +// Only one success callback should be reported per call to getCurrentPosition. +var reportCount = 0; +var isSuccess; + +function reportCallback(success, id) { + isSuccess = success; + shouldBeTrue('isSuccess'); + getCurrentPositionCallId = id; + shouldBe('getCurrentPositionCallId', 'reportCount'); + if (++reportCount >= 3) + finishJSTest(); +} + +var getCurrentPositionCall = 0; +function getPosition(milliseconds) { + var id = getCurrentPositionCall++; + var fn = function() { + navigator.geolocation.getCurrentPosition( + function(position) { + reportCallback(true, id); + }, + function(error) { + reportCallback(false, id); + }, + { maximumAge:600000, timeout:0 }); + }; + setTimeout(fn, milliseconds); +} + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(31.478, -0.166, 100); + mock.setGeolocationPermission(true); + + // Make a geolocation request to populate the cached value so requests with a + // timeout of 0 can succeed. + navigator.geolocation.getCurrentPosition(function(position) { + // The test terminates at the 3rd reported callback. If the bug still exists + // this happens after the 2nd call to getCurrentPosition, one of them is a + // repeat of the first. + getPosition(0); + getPosition(100); + getPosition(200); + }, function(error) { + testFailed('Error callback invoked unexpectedly'); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt index dccb8b7..6aab36a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 25: Uncaught Error: Exception in success callback +CONSOLE ERROR: line 34: Uncaught Error: Exception in success callback Tests that when an exception is thrown in the success callback, the error callback is not invoked. Note that this test throws an exception which is not caught. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception.html index 9df309a3..33ca6245 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-exception.html
@@ -6,6 +6,45 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/callback-exception.js"></script> +<script> +description("Tests that when an exception is thrown in the success callback, the error callback is not invoked. Note that this test throws an exception which is not caught."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100; + +var position; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); + navigator.geolocation.getCurrentPosition(function(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + + // Yield to allow for the error callback to be invoked. The timer + // must be started before the exception is thrown. + window.setTimeout(assertWeGotException, 0); + expectError(); + + throw new Error('Exception in success callback'); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); +}); + +function assertWeGotException() +{ + shouldHaveHadError(); + finishJSTest(); +} + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html index e2fc956..dcf37ed 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html
@@ -6,6 +6,29 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/callback-to-deleted-context.js"></script> +<script> +description("Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is made as usual."); + +function onFirstIframeLoaded() { + iframe.src = 'resources/callback-to-deleted-context-inner2.html'; +} + +function onSecondIframeLoaded() { + window.setTimeout(function() { + testFailed('No callbacks invoked'); + finishJSTest(); + }, 500); +} + +var iframe = document.createElement('iframe'); +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(51.478, -0.166, 100); + iframe.src = 'resources/callback-to-deleted-context-inner1.html'; + document.body.appendChild(iframe); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html index 0286b89..ea71a23 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context.html
@@ -6,6 +6,25 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/callback-to-remote-context.js"></script> +<script> +description("Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual."); + +function onIframeReady() { + // Make request from remote frame + iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { + testPassed('Success callback invoked'); + finishJSTest(); + }, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); +} + +var iframe = document.createElement('iframe'); +iframe.src = 'resources/callback-to-remote-context-inner.html'; +document.body.appendChild(iframe); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html index 872f10ef..dfb22ac 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/callback-to-remote-context2.html
@@ -6,6 +6,27 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/callback-to-remote-context2.js"></script> +<script> +description("Tests that when a Geolocation request is made from a remote frame, and the JavaScript call chain starts from that remote frame, callbacks are made as usual."); + +function onIframeReady() { + // Make request from remote frame, with call chain starting here + window.setTimeout(function() { + iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { + testPassed('Success callback invoked'); + finishJSTest(); + }, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + }, 0); +} + +var iframe = document.createElement('iframe'); +iframe.src = 'resources/callback-to-remote-context-inner.html'; +document.body.appendChild(iframe); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html index e218872..da513cd 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/clear-watch-invalid-id-crash.html
@@ -6,6 +6,24 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/clear-watch-invalid-id-crash.js"></script> +<script> +description("Tests for a crash when clearWatch() is called with a zero ID.<br><br>We call clearWatch() with a request in progress then navigate the page. This accesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes."); + +if (!window.testRunner) + debug('This test can not run without testRunner'); + +document.body.onload = function() { + geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(51.478, -0.166, 100); + + navigator.geolocation.watchPosition(function() {}); + navigator.geolocation.clearWatch(0); + location = "data:text/html,TEST COMPLETE<script>if(window.testRunner) testRunner.notifyDone();</" + "script>"; + }); +} + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html index e37525a..7c0afd9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed-for-multiple-requests.html
@@ -6,6 +6,59 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/delayed-permission-allowed-for-multiple-requests.js"></script> +<script> +description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is allowed."); + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100); + + var permissionSet = false; + + function allowPermission() { + permissionSet = true; + mock.setGeolocationPermission(true); + } + + var watchCallbackInvoked = false; + var oneShotCallbackInvoked = false; + + navigator.geolocation.watchPosition(function() { + if (permissionSet) { + testPassed('Success callback invoked'); + watchCallbackInvoked = true; + maybeFinishTest(); + return; + } + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(err) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + navigator.geolocation.getCurrentPosition(function() { + if (permissionSet) { + testPassed('Success callback invoked'); + oneShotCallbackInvoked = true; + maybeFinishTest(); + return; + } + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(err) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + window.setTimeout(allowPermission, 100); + + function maybeFinishTest() { + if (watchCallbackInvoked && oneShotCallbackInvoked) + finishJSTest(); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html index e408ce2..8ecfd74 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-allowed.html
@@ -6,6 +6,35 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/delayed-permission-allowed.js"></script> +<script> +description("Tests that when a position is available, no callbacks are invoked until permission is allowed."); + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100); + + var permissionSet = false; + + function allowPermission() { + permissionSet = true; + mock.setGeolocationPermission(true); + } + + navigator.geolocation.getCurrentPosition(function() { + if (permissionSet) { + testPassed('Success callback invoked'); + finishJSTest(); + return; + } + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + window.setTimeout(allowPermission, 100); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html index 68fa269..e9d9a17 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied-for-multiple-requests.html
@@ -6,6 +6,64 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/delayed-permission-denied-for-multiple-requests.js"></script> +<script> +description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is denied."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100); + + var permissionSet = false; + + function denyPermission() { + permissionSet = true; + mock.setGeolocationPermission(false); + } + + var watchCallbackInvoked = false; + var oneShotCallbackInvoked = false; + + navigator.geolocation.watchPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (permissionSet) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + watchCallbackInvoked = true; + maybeFinishTest(); + return; + } + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + navigator.geolocation.getCurrentPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (permissionSet) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + oneShotCallbackInvoked = true; + maybeFinishTest(); + return; + } + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + window.setTimeout(denyPermission, 100); + + function maybeFinishTest() { + if (watchCallbackInvoked && oneShotCallbackInvoked) + finishJSTest(); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html index 41af688..210bcfdc 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/delayed-permission-denied.html
@@ -6,6 +6,39 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/delayed-permission-denied.js"></script> +<script> +description("Tests that when a position is available, no callbacks are invoked until permission is denied."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100); + + var permissionSet = false; + + function denyPermission() { + permissionSet = true; + mock.setGeolocationPermission(false); + } + + navigator.geolocation.getCurrentPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (permissionSet) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + return; + } + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + window.setTimeout(denyPermission, 100); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html index f3c5a809..a4d7e3d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-already.html
@@ -6,6 +6,41 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/disconnected-frame-already.js"></script> +<script> +description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs."); + +var iframe = document.createElement('iframe'); + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(51.478, -0.166, 100); + + iframe.src = 'resources/disconnected-frame-already-inner1.html'; + document.body.appendChild(iframe); +}); + +function onFirstIframeLoaded() { + iframeGeolocation = iframe.contentWindow.navigator.geolocation; + iframe.src = 'resources/disconnected-frame-already-inner2.html'; +} + +function onSecondIframeLoaded() { + iframeGeolocation.getCurrentPosition(function () { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + setTimeout(finishTest, 1000); +} + +function finishTest() { + debug('Method called on Geolocation object with disconnected Frame.'); + finishJSTest(); +} + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html index 478a094f..ff328b39 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame-permission-denied.html
@@ -6,6 +6,53 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/disconnected-frame-permission-denied.js"></script> +<script> +description("Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, no callbacks are made."); + +var error; +var iframe = document.createElement('iframe'); + +function onIframeLoaded() { + iframeGeolocation = iframe.contentWindow.navigator.geolocation; + iframeGeolocation.getCurrentPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + debug(''); + iframe.src = 'data:text/html,This frame should be visible when the test completes'; + }); +} + +function onIframeUnloaded() { + // Make another request, with permission already denied. + iframeGeolocation.getCurrentPosition(function () { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + setTimeout(function() { + testPassed('No callbacks invoked'); + finishJSTest(); + }, 100); +} + + +geolocationServiceMock.then(mock => { + // Prime the Geolocation instance by denying permission. This makes sure that we execute the + // same code path for both preemptive and non-preemptive permissions policies. + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100); + + iframe.src = 'resources/disconnected-frame-inner.html'; + document.body.appendChild(iframe); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame.html index a3c8b9d..4045f33 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/disconnected-frame.html
@@ -6,6 +6,40 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/disconnected-frame.js"></script> +<script> +description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, no callbacks are made."); + +var error; +var iframe = document.createElement('iframe'); + +function onIframeLoaded() { + iframeGeolocation = iframe.contentWindow.navigator.geolocation; + iframe.src = 'data:text/html,This frame should be visible when the test completes'; +} + +function onIframeUnloaded() { + iframeGeolocation.getCurrentPosition(function () { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + setTimeout(function() { + testPassed('No callbacks invoked'); + finishJSTest(); + }, 100); +} + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(51.478, -0.166, 100); + + iframe.src = 'resources/disconnected-frame-inner.html'; + document.body.appendChild(iframe); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/enabled.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/enabled.html index b6330e1..da45a254 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/enabled.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/enabled.html
@@ -4,6 +4,23 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/enabled.js"></script> +<script> +description("Tests that the navigator.geolocation object is present."); + +function hasGeolocationProperty() +{ + for (var property in navigator) { + if (property == "geolocation") + return true; + } + return false; +} + +shouldBeTrue("typeof navigator.geolocation == 'object'"); +shouldBeTrue("hasGeolocationProperty()"); +shouldBeTrue("'geolocation' in navigator"); + +window.jsTestIsAsync = false; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error-service-connection-error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error-service-connection-error.html index 35d65c56..7c242b68 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error-service-connection-error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error-service-connection-error.html
@@ -4,8 +4,29 @@ <script src="../../../resources/js-test.js"></script> <script src="../../../resources/mojo-helpers.js"></script> <script src="resources/geolocation-mock.js"></script> -<script src="script-tests/error-service-connection-error.js"></script> </head> <body> +<script> +description("Tests Geolocation when the geolocation service connection fails."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.rejectGeolocationConnections(); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', '"Failed to start Geolocation service"'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html index f7f63ea..d748623 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/error.html
@@ -4,8 +4,35 @@ <script src="../../../resources/js-test.js"></script> <script src="../../../resources/mojo-helpers.js"></script> <script src="resources/geolocation-mock.js"></script> -<script src="script-tests/error.js"></script> </head> <body> +<script> +description("Tests Geolocation error callback using the mock service."); + +var mockMessage = "debug"; + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPositionUnavailableError(mockMessage); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', 'mockMessage'); + shouldBe('error.UNKNOWN_ERROR', 'undefined'); + shouldBe('error.PERMISSION_DENIED', '1'); + shouldBe('error.POSITION_UNAVAILABLE', '2'); + shouldBe('error.TIMEOUT', '3'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/maximum-age.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/maximum-age.html index 569d0590..186dc073 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/maximum-age.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/maximum-age.html
@@ -6,6 +6,124 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/maximum-age.js"></script> +<script> +description("Tests that the PositionOptions.maximumAge parameter is correctly applied."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var mockMessage = 'test'; + +var position; +var error; + +function checkPosition(p) { + debug(''); + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); +} + +function checkError(e) { + debug(''); + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', 'mockMessage'); +} + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); + + // Initialize the cached Position + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testZeroMaximumAge(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + function testZeroMaximumAge() { + // Update the position provided by the mock service. + mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); + // The default maximumAge is zero, so we expect the updated position from the service. + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testNonZeroMaximumAge(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + } + + function testNonZeroMaximumAge() { + // Update the mock service to report an error. + mock.setGeolocationPositionUnavailableError(mockMessage); + // The maximumAge is non-zero, so we expect the cached position, not the error from the service. + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testNegativeValueMaximumAge(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }, {maximumAge: 1000}); + } + + function testNegativeValueMaximumAge() { + // Update the position provided by the mock service. + mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); + // The maximumAge is same as zero, so we expect the updated position from the service. + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testOverSignedIntMaximumAge(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }, {maximumAge: -1000}); + } + + function testOverSignedIntMaximumAge() { + // Update the mock service to report an error. + mock.setGeolocationPositionUnavailableError(mockMessage); + // The maximumAge is non-zero, so we expect the cached position, not the error from the service. + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testOverUnsignedIntMaximumAge(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }, {maximumAge: 2147483648}); + } + + function testOverUnsignedIntMaximumAge() { + // Update the mock service to report an error. + mock.setGeolocationPositionUnavailableError(mockMessage); + // The maximumAge is max-value of unsigned, so we expect the cached position, not the error from the service. + navigator.geolocation.getCurrentPosition(function(p) { + checkPosition(p); + testZeroMaximumAgeError(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }, {maximumAge: 4294967296}); + } + + function testZeroMaximumAgeError() { + // The default maximumAge is zero, so we expect the error from the service. + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + checkError(e); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/multiple-requests.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/multiple-requests.html index 0b4a27b..e9d3af7 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/multiple-requests.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/multiple-requests.html
@@ -6,6 +6,50 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/multiple-requests.js"></script> +<script> +description("Tests that Geolocation correctly handles multiple concurrent requests."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100; + +var position; +var watchCallbackInvoked = false; +var oneShotCallbackInvoked = false; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); + + navigator.geolocation.watchPosition(function(p) { + shouldBeFalse('watchCallbackInvoked'); + watchCallbackInvoked = true; + maybeFinishTest(p); + }, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + navigator.geolocation.getCurrentPosition(function(p) { + shouldBeFalse('oneShotCallbackInvoked'); + oneShotCallbackInvoked = true; + maybeFinishTest(p); + }, function() { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + function maybeFinishTest(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + if (watchCallbackInvoked && oneShotCallbackInvoked) + finishJSTest(); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/notimer-after-unload.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/notimer-after-unload.html index 5c18e449..fdd4491c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/notimer-after-unload.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/notimer-after-unload.html
@@ -6,6 +6,28 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/notimer-after-unload.js"></script> +<script> +description("Tests that no timers will trigger for navigator.geolocation object after onunload."); + +if (!window.testRunner) + debug('This test can not run without testRunner'); + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + + location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.testRunner) testRunner.notifyDone();', 100);</" + "script>"; +}); + +document.body.onunload = function() { + navigator.geolocation.getCurrentPosition( + function(p) {alert('FAIL: Unexpected Geolocation success callback.');}, + function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.code + e.message);}, + {timeout: 0, maximumAge:0} + ); + alert("unload-called"); +} + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-clear-watch.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-clear-watch.html index 228415e..a7f6bda 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-clear-watch.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-clear-watch.html
@@ -6,6 +6,45 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-denied-already-clear-watch.js"></script> +<script> +description("Tests that when Geolocation permission has been denied prior to a call to watchPosition, and the watch is cleared in the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); + +var error; + +geolocationServiceMock.then(mock => { + + // Prime the Geolocation instance by denying permission. + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + debug(''); + continueTest(); + }); + + function continueTest() + { + // Make another request, with permission already denied. + var watchId = navigator.geolocation.watchPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + navigator.geolocation.clearWatch(watchId); + window.setTimeout(finishJSTest, 0); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-error.html index ab9255a..26ab562 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-error.html
@@ -6,6 +6,44 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-denied-already-error.js"></script> +<script> +description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service encounters an error."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + debug(''); + continueTest(); + }); + + function continueTest() + { + // Make another request, with permission already denied. + mock.setGeolocationPositionUnavailableError('test'); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-success.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-success.html index b34b6302..af8fccf 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-success.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-already-success.html
@@ -6,6 +6,44 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-denied-already-success.js"></script> +<script> +description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service has a good position."); + +var error; + +geolocationServiceMock.then(mock => { + + // Prime the Geolocation instance by denying permission. + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + debug(''); + continueTest(); + }); + + function continueTest() + { + // Make another request, with permission already denied. + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-stops-watches.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-stops-watches.html index b2e39c3..394a97c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-stops-watches.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied-stops-watches.html
@@ -6,6 +6,41 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-denied-stops-watches.js"></script> +<script> +description("Tests that when Geolocation permission is denied, watches are stopped, as well as one-shots."); + +var error; + +geolocationServiceMock.then(mock => { + + // Configure the mock Geolocation service to report a position to cause permission + // to be requested, then deny it. + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + var errorCallbackInvoked = false; + navigator.geolocation.watchPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (errorCallbackInvoked) { + testFailed('Error callback invoked unexpectedly : ' + error.message); + finishJSTest(); + } + errorCallbackInvoked = true; + + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + + // Update the mock Geolocation service to report a new position, then + // yield to allow a chance for the success callback to be invoked. + mock.setGeolocationPosition(55.478, -0.166, 100); + window.setTimeout(finishJSTest, 0); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied.html index a19592004d..6f61b9cd 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-denied.html
@@ -6,6 +6,28 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-denied.js"></script> +<script> +description("Tests Geolocation when permission is denied, using the mock service."); + +var error; + +geolocationServiceMock.then(mock => { + + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-service-connection-error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-service-connection-error.html index 76d2716..d4f7a3d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-service-connection-error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/permission-service-connection-error.html
@@ -6,6 +6,27 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/permission-service-connection-error.js"></script> +<script> +description("Tests Geolocation when the permission service connection fails."); + +var error; + +geolocationServiceMock.then(mock => { + + mock.rejectPermissionConnections(); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/position-string.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/position-string.html index 6e43abb..804c1534 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/position-string.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/position-string.html
@@ -6,6 +6,37 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/position-string.js"></script> +<script> +description("Tests formatting of position.toString()."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var position; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); + + navigator.geolocation.getCurrentPosition(function(p) { + // shouldBe can't use local variables yet. + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + shouldBe('position.toString()', '"[object Geoposition]"'); + shouldBe('position.coords.toString()', '"[object Coordinates]"'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html index b735a76..8492a6eb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-error.html
@@ -6,6 +6,53 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/reentrant-error.js"></script> +<script> +description("Tests that reentrant calls to Geolocation methods from the error callback are OK."); + +var mockMessage = 'test'; + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPositionUnavailableError(mockMessage); + + var errorCallbackInvoked = false; + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (errorCallbackInvoked) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + } + errorCallbackInvoked = true; + + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', 'mockMessage'); + debug(''); + continueTest(); + }); + + function continueTest() { + mockMessage += ' repeat'; + + mock.setGeolocationPositionUnavailableError(mockMessage); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', 'mockMessage'); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html index 4f4c84b..33a2770 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-permission-denied.html
@@ -6,6 +6,47 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/reentrant-permission-denied.js"></script> +<script> +description("Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(false); + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + function checkPermissionError(e) { + error = e; + shouldBe('error.code', 'error.PERMISSION_DENIED'); + shouldBe('error.message', '"User denied Geolocation"'); + } + + var errorCallbackInvoked = false; + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + if (errorCallbackInvoked) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + } + errorCallbackInvoked = true; + checkPermissionError(e); + continueTest(); + }); + + function continueTest() { + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + checkPermissionError(e); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-success.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-success.html index 2147c80..a9f105b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-success.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/reentrant-success.html
@@ -6,6 +6,59 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/reentrant-success.js"></script> +<script> +description("Tests that reentrant calls to Geolocation methods from the success callback are OK."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var position; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); + + var successCallbackInvoked = false; + navigator.geolocation.getCurrentPosition(function(p) { + if (successCallbackInvoked) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + } + successCallbackInvoked = true; + + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + debug(''); + continueTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + + function continueTest() { + mock.setGeolocationPosition(++mockLatitude, + ++mockLongitude, + ++mockAccuracy); + + navigator.geolocation.getCurrentPosition(function(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); + } +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/remove-remote-context-in-error-callback-crash.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/remove-remote-context-in-error-callback-crash.html index 00db7bb..b6599d3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/remove-remote-context-in-error-callback-crash.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/remove-remote-context-in-error-callback-crash.html
@@ -6,6 +6,37 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/remove-remote-context-in-error-callback-crash.js"></script> +<script> +description("Tests that we do not crash when a Geolocation request is made from a remote frame, which is then removed from the DOM in the error callback."); + +function gc() { + if (window.GCController) { + GCController.collect(); + return; + } + + for (var i = 0; i < 10000; i++) + new String(i); +} + +function onIframeReady() { + // Make request from remote frame + iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function() { + testPassed('Error callback invoked.'); + document.body.removeChild(iframe); + gc(); + finishJSTest(); + }); +} + +var iframe = document.createElement('iframe'); +iframe.src = 'resources/remove-remote-context-in-error-callback-crash-inner.html'; +document.body.appendChild(iframe); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js deleted file mode 100644 index 6c007e9..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/argument-types.js +++ /dev/null
@@ -1,118 +0,0 @@ -description("Tests the acceptable types for arguments to Geolocation methods."); - -function shouldNotThrow(expression) -{ - try { - eval(expression); - testPassed(expression + " did not throw exception."); - } catch(e) { - testFailed(expression + " should not throw exception. Threw exception " + e); - } -} - -function test(expression, expressionShouldThrow, expectedException) { - if (expressionShouldThrow) { - if (expectedException) - shouldThrow(expression, '(function() { return "' + expectedException + '"; })();'); - else - shouldThrow(expression); - } else { - shouldNotThrow(expression); - } -} - -var emptyFunction = function() {}; - -function ObjectThrowingException() {}; -ObjectThrowingException.prototype.valueOf = function() { - throw new Error('valueOf threw exception'); -} -ObjectThrowingException.prototype.__defineGetter__("enableHighAccuracy", function() { - throw new Error('enableHighAccuracy getter exception'); -}); -var objectThrowingException = new ObjectThrowingException(); - - -test('navigator.geolocation.getCurrentPosition()', true); - -test('navigator.geolocation.getCurrentPosition(undefined)', true); -test('navigator.geolocation.getCurrentPosition(null)', true); -test('navigator.geolocation.getCurrentPosition({})', true); -test('navigator.geolocation.getCurrentPosition(objectThrowingException)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(Math.abs)', false); -test('navigator.geolocation.getCurrentPosition(true)', true); -test('navigator.geolocation.getCurrentPosition(42)', true); -test('navigator.geolocation.getCurrentPosition(Infinity)', true); -test('navigator.geolocation.getCurrentPosition(-Infinity)', true); -test('navigator.geolocation.getCurrentPosition("string")', true); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, null)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, {})', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, true)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, 42)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, -Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, "string")', true); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, undefined)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, null)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, objectThrowingException)', true, 'Error: enableHighAccuracy getter exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, emptyFunction)', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, true)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, 42)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, -Infinity)', true); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, "string")', true); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:objectThrowingException})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:objectThrowingException})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {enableHighAccuracy:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:objectThrowingException})', true, 'Error: valueOf threw exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {maximumAge:"string"})', false); - -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:undefined})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:null})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:{}})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:objectThrowingException})', true, 'Error: valueOf threw exception'); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:emptyFunction})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:true})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:42})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:-Infinity})', false); -test('navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {timeout:"string"})', false); - -window.jsTestIsAsync = false; -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js deleted file mode 100644 index 1b81789..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/cached-position-called-once.js +++ /dev/null
@@ -1,50 +0,0 @@ -description('Tests that when a cached position is available the callback for getCurrentPosition is called only once. This is a regression test for http://crbug.com/311876 .'); - -// Only one success callback should be reported per call to getCurrentPosition. -var reportCount = 0; -var isSuccess; - -function reportCallback(success, id) { - isSuccess = success; - shouldBeTrue('isSuccess'); - getCurrentPositionCallId = id; - shouldBe('getCurrentPositionCallId', 'reportCount'); - if (++reportCount >= 3) - finishJSTest(); -} - -var getCurrentPositionCall = 0; -function getPosition(milliseconds) { - var id = getCurrentPositionCall++; - var fn = function() { - navigator.geolocation.getCurrentPosition( - function(position) { - reportCallback(true, id); - }, - function(error) { - reportCallback(false, id); - }, - { maximumAge:600000, timeout:0 }); - }; - setTimeout(fn, milliseconds); -} - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(31.478, -0.166, 100); - mock.setGeolocationPermission(true); - - // Make a geolocation request to populate the cached value so requests with a - // timeout of 0 can succeed. - navigator.geolocation.getCurrentPosition(function(position) { - // The test terminates at the 3rd reported callback. If the bug still exists - // this happens after the 2nd call to getCurrentPosition, one of them is a - // repeat of the first. - getPosition(0); - getPosition(100); - getPosition(200); - }, function(error) { - testFailed('Error callback invoked unexpectedly'); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js deleted file mode 100644 index 20b29647..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-exception.js +++ /dev/null
@@ -1,38 +0,0 @@ -description("Tests that when an exception is thrown in the success callback, the error callback is not invoked. Note that this test throws an exception which is not caught."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100; - -var position; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - - // Yield to allow for the error callback to be invoked. The timer - // must be started before the exception is thrown. - window.setTimeout(assertWeGotException, 0); - expectError(); - - throw new Error('Exception in success callback'); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); -}); - -function assertWeGotException() -{ - shouldHaveHadError(); - finishJSTest(); -} - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js deleted file mode 100644 index 533b34a6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-deleted-context.js +++ /dev/null
@@ -1,22 +0,0 @@ -description("Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is made as usual."); - -function onFirstIframeLoaded() { - iframe.src = 'resources/callback-to-deleted-context-inner2.html'; -} - -function onSecondIframeLoaded() { - window.setTimeout(function() { - testFailed('No callbacks invoked'); - finishJSTest(); - }, 500); -} - -var iframe = document.createElement('iframe'); -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(51.478, -0.166, 100); - iframe.src = 'resources/callback-to-deleted-context-inner1.html'; - document.body.appendChild(iframe); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js deleted file mode 100644 index 9ac34c3a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context.js +++ /dev/null
@@ -1,18 +0,0 @@ -description("Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual."); - -function onIframeReady() { - // Make request from remote frame - iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { - testPassed('Success callback invoked'); - finishJSTest(); - }, function() { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); -} - -var iframe = document.createElement('iframe'); -iframe.src = 'resources/callback-to-remote-context-inner.html'; -document.body.appendChild(iframe); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js deleted file mode 100644 index 7b9188d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/callback-to-remote-context2.js +++ /dev/null
@@ -1,20 +0,0 @@ -description("Tests that when a Geolocation request is made from a remote frame, and the JavaScript call chain starts from that remote frame, callbacks are made as usual."); - -function onIframeReady() { - // Make request from remote frame, with call chain starting here - window.setTimeout(function() { - iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { - testPassed('Success callback invoked'); - finishJSTest(); - }, function() { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - }, 0); -} - -var iframe = document.createElement('iframe'); -iframe.src = 'resources/callback-to-remote-context-inner.html'; -document.body.appendChild(iframe); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js deleted file mode 100644 index 62c3c37..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/clear-watch-invalid-id-crash.js +++ /dev/null
@@ -1,17 +0,0 @@ -description("Tests for a crash when clearWatch() is called with a zero ID.<br><br>We call clearWatch() with a request in progress then navigate the page. This accesses the watchers map during cleanup and triggers the crash. This page should not be visible when the test completes."); - -if (!window.testRunner) - debug('This test can not run without testRunner'); - -document.body.onload = function() { - geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(51.478, -0.166, 100); - - navigator.geolocation.watchPosition(function() {}); - navigator.geolocation.clearWatch(0); - location = "data:text/html,TEST COMPLETE<script>if(window.testRunner) testRunner.notifyDone();</script>"; - }); -} - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js deleted file mode 100644 index add7f40..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed-for-multiple-requests.js +++ /dev/null
@@ -1,52 +0,0 @@ -description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is allowed."); - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100); - - var permissionSet = false; - - function allowPermission() { - permissionSet = true; - mock.setGeolocationPermission(true); - } - - var watchCallbackInvoked = false; - var oneShotCallbackInvoked = false; - - navigator.geolocation.watchPosition(function() { - if (permissionSet) { - testPassed('Success callback invoked'); - watchCallbackInvoked = true; - maybeFinishTest(); - return; - } - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(err) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - navigator.geolocation.getCurrentPosition(function() { - if (permissionSet) { - testPassed('Success callback invoked'); - oneShotCallbackInvoked = true; - maybeFinishTest(); - return; - } - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(err) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - window.setTimeout(allowPermission, 100); - - function maybeFinishTest() { - if (watchCallbackInvoked && oneShotCallbackInvoked) - finishJSTest(); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js deleted file mode 100644 index 22393ee..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-allowed.js +++ /dev/null
@@ -1,28 +0,0 @@ -description("Tests that when a position is available, no callbacks are invoked until permission is allowed."); - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100); - - var permissionSet = false; - - function allowPermission() { - permissionSet = true; - mock.setGeolocationPermission(true); - } - - navigator.geolocation.getCurrentPosition(function() { - if (permissionSet) { - testPassed('Success callback invoked'); - finishJSTest(); - return; - } - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function() { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - window.setTimeout(allowPermission, 100); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js deleted file mode 100644 index 351c6948..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied-for-multiple-requests.js +++ /dev/null
@@ -1,57 +0,0 @@ -description("Tests that when multiple requests are waiting for permission, no callbacks are invoked until permission is denied."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100); - - var permissionSet = false; - - function denyPermission() { - permissionSet = true; - mock.setGeolocationPermission(false); - } - - var watchCallbackInvoked = false; - var oneShotCallbackInvoked = false; - - navigator.geolocation.watchPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (permissionSet) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - watchCallbackInvoked = true; - maybeFinishTest(); - return; - } - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - navigator.geolocation.getCurrentPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (permissionSet) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - oneShotCallbackInvoked = true; - maybeFinishTest(); - return; - } - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - window.setTimeout(denyPermission, 100); - - function maybeFinishTest() { - if (watchCallbackInvoked && oneShotCallbackInvoked) - finishJSTest(); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js deleted file mode 100644 index 4eb9317..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/delayed-permission-denied.js +++ /dev/null
@@ -1,32 +0,0 @@ -description("Tests that when a position is available, no callbacks are invoked until permission is denied."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100); - - var permissionSet = false; - - function denyPermission() { - permissionSet = true; - mock.setGeolocationPermission(false); - } - - navigator.geolocation.getCurrentPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (permissionSet) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - finishJSTest(); - return; - } - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - window.setTimeout(denyPermission, 100); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js deleted file mode 100644 index 4ff78d3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-already.js +++ /dev/null
@@ -1,34 +0,0 @@ -description("Tests that when a request is made on a Geolocation object after its frame has been disconnected, no callbacks are made and no crash occurs."); - -var iframe = document.createElement('iframe'); - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(51.478, -0.166, 100); - - iframe.src = 'resources/disconnected-frame-already-inner1.html'; - document.body.appendChild(iframe); -}); - -function onFirstIframeLoaded() { - iframeGeolocation = iframe.contentWindow.navigator.geolocation; - iframe.src = 'resources/disconnected-frame-already-inner2.html'; -} - -function onSecondIframeLoaded() { - iframeGeolocation.getCurrentPosition(function () { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - setTimeout(finishTest, 1000); -} - -function finishTest() { - debug('Method called on Geolocation object with disconnected Frame.'); - finishJSTest(); -} - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js deleted file mode 100644 index e5a1f84..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame-permission-denied.js +++ /dev/null
@@ -1,46 +0,0 @@ -description("Tests that when a request is made on a Geolocation object, permission is denied and its Frame is disconnected before a callback is made, no callbacks are made."); - -var error; -var iframe = document.createElement('iframe'); - -function onIframeLoaded() { - iframeGeolocation = iframe.contentWindow.navigator.geolocation; - iframeGeolocation.getCurrentPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - iframe.src = 'data:text/html,This frame should be visible when the test completes'; - }); -} - -function onIframeUnloaded() { - // Make another request, with permission already denied. - iframeGeolocation.getCurrentPosition(function () { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - setTimeout(function() { - testPassed('No callbacks invoked'); - finishJSTest(); - }, 100); -} - - -geolocationServiceMock.then(mock => { - // Prime the Geolocation instance by denying permission. This makes sure that we execute the - // same code path for both preemptive and non-preemptive permissions policies. - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100); - - iframe.src = 'resources/disconnected-frame-inner.html'; - document.body.appendChild(iframe); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js deleted file mode 100644 index c992c8eb..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/disconnected-frame.js +++ /dev/null
@@ -1,33 +0,0 @@ -description("Tests that when a request is made on a Geolocation object and its Frame is disconnected before a callback is made, no callbacks are made."); - -var error; -var iframe = document.createElement('iframe'); - -function onIframeLoaded() { - iframeGeolocation = iframe.contentWindow.navigator.geolocation; - iframe.src = 'data:text/html,This frame should be visible when the test completes'; -} - -function onIframeUnloaded() { - iframeGeolocation.getCurrentPosition(function () { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - setTimeout(function() { - testPassed('No callbacks invoked'); - finishJSTest(); - }, 100); -} - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(51.478, -0.166, 100); - - iframe.src = 'resources/disconnected-frame-inner.html'; - document.body.appendChild(iframe); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js deleted file mode 100644 index 6e3ec6c1..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js +++ /dev/null
@@ -1,16 +0,0 @@ -description("Tests that the navigator.geolocation object is present."); - -function hasGeolocationProperty() -{ - for (var property in navigator) { - if (property == "geolocation") - return true; - } - return false; -} - -shouldBeTrue("typeof navigator.geolocation == 'object'"); -shouldBeTrue("hasGeolocationProperty()"); -shouldBeTrue("'geolocation' in navigator"); - -window.jsTestIsAsync = false;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error-service-connection-error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error-service-connection-error.js deleted file mode 100644 index 24bd4db..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error-service-connection-error.js +++ /dev/null
@@ -1,20 +0,0 @@ -description("Tests Geolocation when the geolocation service connection fails."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.rejectGeolocationConnections(); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', '"Failed to start Geolocation service"'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error.js deleted file mode 100644 index 0d43ec3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/error.js +++ /dev/null
@@ -1,26 +0,0 @@ -description("Tests Geolocation error callback using the mock service."); - -var mockMessage = "debug"; - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPositionUnavailableError(mockMessage); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', 'mockMessage'); - shouldBe('error.UNKNOWN_ERROR', 'undefined'); - shouldBe('error.PERMISSION_DENIED', '1'); - shouldBe('error.POSITION_UNAVAILABLE', '2'); - shouldBe('error.TIMEOUT', '3'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js deleted file mode 100644 index 1dde306..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/maximum-age.js +++ /dev/null
@@ -1,117 +0,0 @@ -description("Tests that the PositionOptions.maximumAge parameter is correctly applied."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var mockMessage = 'test'; - -var position; -var error; - -function checkPosition(p) { - debug(''); - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); -} - -function checkError(e) { - debug(''); - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', 'mockMessage'); -} - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - - // Initialize the cached Position - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testZeroMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - function testZeroMaximumAge() { - // Update the position provided by the mock service. - mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - // The default maximumAge is zero, so we expect the updated position from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testNonZeroMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - } - - function testNonZeroMaximumAge() { - // Update the mock service to report an error. - mock.setGeolocationPositionUnavailableError(mockMessage); - // The maximumAge is non-zero, so we expect the cached position, not the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testNegativeValueMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }, {maximumAge: 1000}); - } - - function testNegativeValueMaximumAge() { - // Update the position provided by the mock service. - mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - // The maximumAge is same as zero, so we expect the updated position from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testOverSignedIntMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }, {maximumAge: -1000}); - } - - function testOverSignedIntMaximumAge() { - // Update the mock service to report an error. - mock.setGeolocationPositionUnavailableError(mockMessage); - // The maximumAge is non-zero, so we expect the cached position, not the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testOverUnsignedIntMaximumAge(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }, {maximumAge: 2147483648}); - } - - function testOverUnsignedIntMaximumAge() { - // Update the mock service to report an error. - mock.setGeolocationPositionUnavailableError(mockMessage); - // The maximumAge is max-value of unsigned, so we expect the cached position, not the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - checkPosition(p); - testZeroMaximumAgeError(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }, {maximumAge: 4294967296}); - } - - function testZeroMaximumAgeError() { - // The default maximumAge is zero, so we expect the error from the service. - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - checkError(e); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js deleted file mode 100644 index ca73f266..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/multiple-requests.js +++ /dev/null
@@ -1,43 +0,0 @@ -description("Tests that Geolocation correctly handles multiple concurrent requests."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100; - -var position; -var watchCallbackInvoked = false; -var oneShotCallbackInvoked = false; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - - navigator.geolocation.watchPosition(function(p) { - shouldBeFalse('watchCallbackInvoked'); - watchCallbackInvoked = true; - maybeFinishTest(p); - }, function() { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - navigator.geolocation.getCurrentPosition(function(p) { - shouldBeFalse('oneShotCallbackInvoked'); - oneShotCallbackInvoked = true; - maybeFinishTest(p); - }, function() { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - function maybeFinishTest(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - if (watchCallbackInvoked && oneShotCallbackInvoked) - finishJSTest(); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js deleted file mode 100644 index 41380e2d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/notimer-after-unload.js +++ /dev/null
@@ -1,21 +0,0 @@ -description("Tests that no timers will trigger for navigator.geolocation object after onunload."); - -if (!window.testRunner) - debug('This test can not run without testRunner'); - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - - location = "data:text/html,You should have seen one unload alert appear.<script>window.setTimeout('if (window.testRunner) testRunner.notifyDone();', 100);</script>"; -}); - -document.body.onunload = function() { - navigator.geolocation.getCurrentPosition( - function(p) {alert('FAIL: Unexpected Geolocation success callback.');}, - function(e) {alert('FAIL: Unexpected Geolocation error callback.' + e.code + e.message);}, - {timeout: 0, maximumAge:0} - ); - alert("unload-called"); -} - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js deleted file mode 100644 index b6aca703..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-clear-watch.js +++ /dev/null
@@ -1,38 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to watchPosition, and the watch is cleared in the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); - -var error; - -geolocationServiceMock.then(mock => { - - // Prime the Geolocation instance by denying permission. - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); - }); - - function continueTest() - { - // Make another request, with permission already denied. - var watchId = navigator.geolocation.watchPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - navigator.geolocation.clearWatch(watchId); - window.setTimeout(finishJSTest, 0); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js deleted file mode 100644 index f8877cb8..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-error.js +++ /dev/null
@@ -1,37 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service encounters an error."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); - }); - - function continueTest() - { - // Make another request, with permission already denied. - mock.setGeolocationPositionUnavailableError('test'); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js deleted file mode 100644 index d5ad0f95..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-already-success.js +++ /dev/null
@@ -1,37 +0,0 @@ -description("Tests that when Geolocation permission has been denied prior to a call to a Geolocation method, the error callback is invoked with code PERMISSION_DENIED, when the Geolocation service has a good position."); - -var error; - -geolocationServiceMock.then(mock => { - - // Prime the Geolocation instance by denying permission. - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - debug(''); - continueTest(); - }); - - function continueTest() - { - // Make another request, with permission already denied. - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js deleted file mode 100644 index 778fc83..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied-stops-watches.js +++ /dev/null
@@ -1,34 +0,0 @@ -description("Tests that when Geolocation permission is denied, watches are stopped, as well as one-shots."); - -var error; - -geolocationServiceMock.then(mock => { - - // Configure the mock Geolocation service to report a position to cause permission - // to be requested, then deny it. - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - var errorCallbackInvoked = false; - navigator.geolocation.watchPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (errorCallbackInvoked) { - testFailed('Error callback invoked unexpectedly : ' + error.message); - finishJSTest(); - } - errorCallbackInvoked = true; - - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - - // Update the mock Geolocation service to report a new position, then - // yield to allow a chance for the success callback to be invoked. - mock.setGeolocationPosition(55.478, -0.166, 100); - window.setTimeout(finishJSTest, 0); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js deleted file mode 100644 index 4615390..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-denied.js +++ /dev/null
@@ -1,21 +0,0 @@ -description("Tests Geolocation when permission is denied, using the mock service."); - -var error; - -geolocationServiceMock.then(mock => { - - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js deleted file mode 100644 index c052c34..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/permission-service-connection-error.js +++ /dev/null
@@ -1,20 +0,0 @@ -description("Tests Geolocation when the permission service connection fails."); - -var error; - -geolocationServiceMock.then(mock => { - - mock.rejectPermissionConnections(); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js deleted file mode 100644 index 56f6e33..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/position-string.js +++ /dev/null
@@ -1,30 +0,0 @@ -description("Tests formatting of position.toString()."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var position; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - - navigator.geolocation.getCurrentPosition(function(p) { - // shouldBe can't use local variables yet. - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - shouldBe('position.toString()', '"[object Geoposition]"'); - shouldBe('position.coords.toString()', '"[object Coordinates]"'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js deleted file mode 100644 index c2c3c9b..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-error.js +++ /dev/null
@@ -1,46 +0,0 @@ -description("Tests that reentrant calls to Geolocation methods from the error callback are OK."); - -var mockMessage = 'test'; - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPositionUnavailableError(mockMessage); - - var errorCallbackInvoked = false; - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (errorCallbackInvoked) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - } - errorCallbackInvoked = true; - - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', 'mockMessage'); - debug(''); - continueTest(); - }); - - function continueTest() { - mockMessage += ' repeat'; - - mock.setGeolocationPositionUnavailableError(mockMessage); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', 'mockMessage'); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js deleted file mode 100644 index 688f67b3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-permission-denied.js +++ /dev/null
@@ -1,40 +0,0 @@ -description("Tests that reentrant calls to Geolocation methods from the error callback due to a PERMISSION_DENIED error are OK."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(false); - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - function checkPermissionError(e) { - error = e; - shouldBe('error.code', 'error.PERMISSION_DENIED'); - shouldBe('error.message', '"User denied Geolocation"'); - } - - var errorCallbackInvoked = false; - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - if (errorCallbackInvoked) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - } - errorCallbackInvoked = true; - checkPermissionError(e); - continueTest(); - }); - - function continueTest() { - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - checkPermissionError(e); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js deleted file mode 100644 index 091e5a6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/reentrant-success.js +++ /dev/null
@@ -1,52 +0,0 @@ -description("Tests that reentrant calls to Geolocation methods from the success callback are OK."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var position; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - - var successCallbackInvoked = false; - navigator.geolocation.getCurrentPosition(function(p) { - if (successCallbackInvoked) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - } - successCallbackInvoked = true; - - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug(''); - continueTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - - function continueTest() { - mock.setGeolocationPosition(++mockLatitude, - ++mockLongitude, - ++mockAccuracy); - - navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); - } -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/remove-remote-context-in-error-callback-crash.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/remove-remote-context-in-error-callback-crash.js deleted file mode 100644 index 8743941..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/remove-remote-context-in-error-callback-crash.js +++ /dev/null
@@ -1,30 +0,0 @@ -description("Tests that we do not crash when a Geolocation request is made from a remote frame, which is then removed from the DOM in the error callback."); - -function gc() { - if (window.GCController) { - GCController.collect(); - return; - } - - for (var i = 0; i < 10000; i++) - new String(i); -} - -function onIframeReady() { - // Make request from remote frame - iframe.contentWindow.navigator.geolocation.getCurrentPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function() { - testPassed('Error callback invoked.'); - document.body.removeChild(iframe); - gc(); - finishJSTest(); - }); -} - -var iframe = document.createElement('iframe'); -iframe.src = 'resources/remove-remote-context-in-error-callback-crash-inner.html'; -document.body.appendChild(iframe); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js deleted file mode 100644 index 818ba6b..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/success.js +++ /dev/null
@@ -1,27 +0,0 @@ -description("Tests Geolocation success callback using the mock service."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100; - -var position; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - - navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js deleted file mode 100644 index 632aead..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-clear-watch.js +++ /dev/null
@@ -1,22 +0,0 @@ -description("Tests that when a watch times out and is cleared from the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - var watchId = navigator.geolocation.watchPosition(function() { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.TIMEOUT'); - shouldBe('error.message', '"Timeout expired"'); - navigator.geolocation.clearWatch(watchId); - window.setTimeout(finishJSTest, 0); - }, { - timeout: 0 - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-negative.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-negative.js deleted file mode 100644 index cd12abc..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-negative.js +++ /dev/null
@@ -1,22 +0,0 @@ -description("Tests that when timeout is negative (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.TIMEOUT'); - shouldBe('error.message', '"Timeout expired"'); - finishJSTest(); - }, { - timeout: -1000 - }); -}); - -window.jsTestIsAsync = true; -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js deleted file mode 100644 index a4c25f0..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-zero.js +++ /dev/null
@@ -1,21 +0,0 @@ -description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); - -var error; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPosition(51.478, -0.166, 100.0); - - navigator.geolocation.getCurrentPosition(function(p) { - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - }, function(e) { - error = e; - shouldBe('error.code', 'error.TIMEOUT'); - shouldBe('error.message', '"Timeout expired"'); - finishJSTest(); - }, { - timeout: 0 - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js deleted file mode 100644 index cc64090..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout.js +++ /dev/null
@@ -1,29 +0,0 @@ -description("Tests that when timeout is non-zero, the success callback is called as expected."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var position; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, - mockLongitude, - mockAccuracy); - - navigator.geolocation.getCurrentPosition(function(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - finishJSTest(); - }, function(e) { - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - }, { - timeout: 1000 - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js deleted file mode 100644 index 6306e3e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timestamp.js +++ /dev/null
@@ -1,33 +0,0 @@ -description("Tests that Geoposition timestamps are well-formed (non-zero and in the same units as Date.getTime)."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var now = new Date().getTime(); -shouldBeTrue('now != 0'); -var t = null; -var then = null; - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - - function checkPosition(p) { - t = p.timestamp; - var d = new Date(); - then = d.getTime(); - shouldBeTrue('t != 0'); - shouldBeTrue('then != 0'); - shouldBeTrue('now - 1 <= t'); // Avoid rounding errors - if (now - 1 > t) { - debug(" now - 1 = " + (now-1)); - debug(" t = " + t); - } - shouldBeTrue('t <= then + 1'); // Avoid rounding errors - finishJSTest(); - } - - navigator.geolocation.getCurrentPosition(checkPosition); -}); -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/watch.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/watch.js deleted file mode 100644 index f76d86ca..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/watch.js +++ /dev/null
@@ -1,63 +0,0 @@ -description("Tests that watchPosition correctly reports position updates and errors from the Geolocation service."); - -var mockLatitude = 51.478; -var mockLongitude = -0.166; -var mockAccuracy = 100.0; - -var mockMessage = 'test'; - -var position; -var error; - -function checkPosition(p) { - position = p; - shouldBe('position.coords.latitude', 'mockLatitude'); - shouldBe('position.coords.longitude', 'mockLongitude'); - shouldBe('position.coords.accuracy', 'mockAccuracy'); - debug(''); -} - -function checkError(e) { - error = e; - shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); - shouldBe('error.message', 'mockMessage'); - debug(''); -} - -geolocationServiceMock.then(mock => { - mock.setGeolocationPermission(true); - mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); - - var state = 0; - navigator.geolocation.watchPosition(function(p) { - switch (state++) { - case 0: - checkPosition(p); - mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - break; - case 1: - checkPosition(p); - mock.setGeolocationPositionUnavailableError(mockMessage); - break; - case 3: - checkPosition(p); - finishJSTest(); - break; - default: - testFailed('Success callback invoked unexpectedly'); - finishJSTest(); - } - }, function(e) { - switch (state++) { - case 2: - checkError(e); - mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); - break; - default: - testFailed('Error callback invoked unexpectedly'); - finishJSTest(); - } - }); -}); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js deleted file mode 100644 index 3899456f..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/window-close-crash.js +++ /dev/null
@@ -1,34 +0,0 @@ -description("Tests the assertion that the GeolocationClient should not be updating<br>" + - "when the GeolocationController is destroyed.<br>" + - "See https://bugs.webkit.org/show_bug.cgi?id=52216"); - -if (!window.testRunner) - debug('This test can not run without testRunner'); - -testRunner.waitUntilDone(); -testRunner.setCanOpenWindows(); -testRunner.setCloseRemainingWindowsWhenComplete(true); - -var otherWindow; - -function gotPosition(p) -{ - testPassed("Received Geoposition."); - otherWindow.close(); - window.setTimeout(waitForWindowToClose, 0); -} - -function waitForWindowToClose() -{ - if (!otherWindow.closed) { - window.setTimeout(waitForWindowToClose, 0); - return; - } - testPassed("Success - no crash!"); - finishJSTest(); -} - -debug("Main page opening resources/window-close-popup.html"); -otherWindow = window.open("resources/window-close-popup.html"); - -window.jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html index d65f5cc8..2f3f8547 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/success.html
@@ -6,6 +6,34 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/success.js"></script> +<script> +description("Tests Geolocation success callback using the mock service."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100; + +var position; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); + + navigator.geolocation.getCurrentPosition(function(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-clear-watch.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-clear-watch.html index 6b3d6e3..fe0d97f3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-clear-watch.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-clear-watch.html
@@ -6,6 +6,29 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/timeout-clear-watch.js"></script> +<script> +description("Tests that when a watch times out and is cleared from the error callback, there is no crash. This a regression test for https://bugs.webkit.org/show_bug.cgi?id=32111."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + var watchId = navigator.geolocation.watchPosition(function() { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.TIMEOUT'); + shouldBe('error.message', '"Timeout expired"'); + navigator.geolocation.clearWatch(watchId); + window.setTimeout(finishJSTest, 0); + }, { + timeout: 0 + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-negative.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-negative.html index 77b531e..aa89d2c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-negative.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-negative.html
@@ -6,6 +6,29 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/timeout-negative.js"></script> +<script> +description("Tests that when timeout is negative (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.TIMEOUT'); + shouldBe('error.message', '"Timeout expired"'); + finishJSTest(); + }, { + timeout: -1000 + }); +}); + +window.jsTestIsAsync = true; + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unisgned.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unisgned.html deleted file mode 100644 index 2d92665..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unisgned.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="../../../resources/mojo-helpers.js"></script> -<script src="resources/geolocation-mock.js"></script> -</head> -<body> -<script src="script-tests/timeout-over-max-of-unsigned.js"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unisgned-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unsigned-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unisgned-expected.txt rename to third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unsigned-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-over-max-of-unsigned.js b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unsigned.html similarity index 76% rename from third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-over-max-of-unsigned.js rename to third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unsigned.html index 8de1fa62..2f5a724f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/script-tests/timeout-over-max-of-unsigned.js +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-over-max-of-unsigned.html
@@ -1,3 +1,12 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<script src="../../../resources/js-test.js"></script> +<script src="../../../resources/mojo-helpers.js"></script> +<script src="resources/geolocation-mock.js"></script> +</head> +<body> +<script> description("Tests that when timeout value is over maximum of unsigned, the success callback is called as expected."); var mockLatitude = 51.478; @@ -27,3 +36,6 @@ }); window.jsTestIsAsync = true; +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-zero.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-zero.html index 2384d42..373904d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-zero.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout-zero.html
@@ -6,6 +6,28 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/timeout-zero.js"></script> +<script> +description("Tests that when timeout is zero (and maximumAge is too), the error callback is called immediately with code TIMEOUT."); + +var error; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPosition(51.478, -0.166, 100.0); + + navigator.geolocation.getCurrentPosition(function(p) { + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + }, function(e) { + error = e; + shouldBe('error.code', 'error.TIMEOUT'); + shouldBe('error.message', '"Timeout expired"'); + finishJSTest(); + }, { + timeout: 0 + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout.html index 6429bca..53c28a3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timeout.html
@@ -6,6 +6,36 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/timeout.js"></script> +<script> +description("Tests that when timeout is non-zero, the success callback is called as expected."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var position; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, + mockLongitude, + mockAccuracy); + + navigator.geolocation.getCurrentPosition(function(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + finishJSTest(); + }, function(e) { + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + }, { + timeout: 1000 + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timestamp.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timestamp.html index ea0a388..ea25aa5d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timestamp.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/timestamp.html
@@ -6,6 +6,40 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/timestamp.js"></script> +<script> +description("Tests that Geoposition timestamps are well-formed (non-zero and in the same units as Date.getTime)."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var now = new Date().getTime(); +shouldBeTrue('now != 0'); +var t = null; +var then = null; + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); + + function checkPosition(p) { + t = p.timestamp; + var d = new Date(); + then = d.getTime(); + shouldBeTrue('t != 0'); + shouldBeTrue('then != 0'); + shouldBeTrue('now - 1 <= t'); // Avoid rounding errors + if (now - 1 > t) { + debug(" now - 1 = " + (now-1)); + debug(" t = " + t); + } + shouldBeTrue('t <= then + 1'); // Avoid rounding errors + finishJSTest(); + } + + navigator.geolocation.getCurrentPosition(checkPosition); +}); +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watch.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watch.html index eaee2d4..b78305d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watch.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/watch.html
@@ -6,6 +6,70 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/watch.js"></script> +<script> +description("Tests that watchPosition correctly reports position updates and errors from the Geolocation service."); + +var mockLatitude = 51.478; +var mockLongitude = -0.166; +var mockAccuracy = 100.0; + +var mockMessage = 'test'; + +var position; +var error; + +function checkPosition(p) { + position = p; + shouldBe('position.coords.latitude', 'mockLatitude'); + shouldBe('position.coords.longitude', 'mockLongitude'); + shouldBe('position.coords.accuracy', 'mockAccuracy'); + debug(''); +} + +function checkError(e) { + error = e; + shouldBe('error.code', 'error.POSITION_UNAVAILABLE'); + shouldBe('error.message', 'mockMessage'); + debug(''); +} + +geolocationServiceMock.then(mock => { + mock.setGeolocationPermission(true); + mock.setGeolocationPosition(mockLatitude, mockLongitude, mockAccuracy); + + var state = 0; + navigator.geolocation.watchPosition(function(p) { + switch (state++) { + case 0: + checkPosition(p); + mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); + break; + case 1: + checkPosition(p); + mock.setGeolocationPositionUnavailableError(mockMessage); + break; + case 3: + checkPosition(p); + finishJSTest(); + break; + default: + testFailed('Success callback invoked unexpectedly'); + finishJSTest(); + } + }, function(e) { + switch (state++) { + case 2: + checkError(e); + mock.setGeolocationPosition(++mockLatitude, ++mockLongitude, ++mockAccuracy); + break; + default: + testFailed('Error callback invoked unexpectedly'); + finishJSTest(); + } + }); +}); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/window-close-crash.html b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/window-close-crash.html index 6436e34..68f1e54 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Geolocation/window-close-crash.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Geolocation/window-close-crash.html
@@ -6,6 +6,41 @@ <script src="resources/geolocation-mock.js"></script> </head> <body> -<script src="script-tests/window-close-crash.js"></script> +<script> +description("Tests the assertion that the GeolocationClient should not be updating<br>" + + "when the GeolocationController is destroyed.<br>" + + "See https://bugs.webkit.org/show_bug.cgi?id=52216"); + +if (!window.testRunner) + debug('This test can not run without testRunner'); + +testRunner.waitUntilDone(); +testRunner.setCanOpenWindows(); +testRunner.setCloseRemainingWindowsWhenComplete(true); + +var otherWindow; + +function gotPosition(p) +{ + testPassed("Received Geoposition."); + otherWindow.close(); + window.setTimeout(waitForWindowToClose, 0); +} + +function waitForWindowToClose() +{ + if (!otherWindow.closed) { + window.setTimeout(waitForWindowToClose, 0); + return; + } + testPassed("Success - no crash!"); + finishJSTest(); +} + +debug("Main page opening resources/window-close-popup.html"); +otherWindow = window.open("resources/window-close-popup.html"); + +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port.html index e7059ca..aabcf0c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port.html
@@ -4,6 +4,21 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/get-href-attribute-port.js"></script> +<script> +description('Test getting the port attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Default port is empty"); +shouldBe("a.port", "''"); + +debug("Unspecified port should return empty string"); +a.href = "http://example.com/"; +shouldBe("a.port", "''"); + +debug("Empty port should be empty"); +a.href = "http://example.com:/"; +shouldBe("a.port", "''"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/get-href-attribute-port.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/get-href-attribute-port.js deleted file mode 100644 index 9afcda6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/get-href-attribute-port.js +++ /dev/null
@@ -1,14 +0,0 @@ -description('Test getting the port attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Default port is empty"); -shouldBe("a.port", "''"); - -debug("Unspecified port should return empty string"); -a.href = "http://example.com/"; -shouldBe("a.port", "''"); - -debug("Empty port should be empty"); -a.href = "http://example.com:/"; -shouldBe("a.port", "''");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js deleted file mode 100644 index 4cd3ed9..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js +++ /dev/null
@@ -1,65 +0,0 @@ -description('Test setting the hash attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Hash value does not start with '#'"); -a.href = "https://www.mydomain.com:8080/path/testurl.html#middle"; -a.hash = "hash-value"; -shouldBe("a.href", "'https://www.mydomain.com:8080/path/testurl.html#hash-value'"); - -debug("Hash value starts with '#'"); -a.href = "file:///path/testurl.html#middle"; -a.hash = "#hash_value"; -shouldBe("a.href", "'file:///path/testurl.html#hash_value'"); - -debug("'?' in hash value"); -a.href = "http://www.mydomain.com/path/testurl.html#middle"; -a.hash = "#hash?value"; -shouldBe("a.href", "'http://www.mydomain.com/path/testurl.html#hash?value'"); - -// The expected behavior should change when character table is updated. -// IE8 and Firefox3.5.2 don't consider these characters as illegal. -debug("'#' in hash value, and illegal characters in hostname"); -a.href = "https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle"; -a.hash = "#hash#value"; -shouldBe("a.href", "'https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle'"); - -debug("Set hash to null"); -a.href = "https://www.mydomain.com/path/testurl.html#middle"; -a.hash = null; -shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html#null'"); - -// Firefox 3.5.2 removes the '#' at the end, and it should per -// http://url.spec.whatwg.org/#dom-url-hash -debug("Set hash to empty string"); -a.href = "https://www.mydomain.com/path/testurl.html#middle"; -a.hash = ""; -shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html'"); - -// Firefox 3.5.2 does not allow setting hash to mailto: scheme, and it should. -debug("Add hash to mailto: protocol"); -a.href = "mailto:e-mail_address@goes_here"; -a.hash = "hash-value"; -shouldBe("a.href", "'mailto:e-mail_address@goes_here#hash-value'"); - -// IE8 does not percent-encode spaces in the hash component, but it does that -// in the path component. -debug("Add hash to file: protocol"); -a.href = "file:///some path"; -a.hash = "hash value"; -shouldBe("a.href", "'file:///some%20path#hash value'"); - -debug("Set hash to '#'"); -a.href = "http://mydomain.com#middle"; -a.hash = "#"; -shouldBe("a.href", "'http://mydomain.com/'"); - -// Firefox 3.5.2 does not allow setting hash to foo: scheme, and it should. -debug("Add hash to non-standard protocol"); -try { -a.href = "foo:bar"; -a.hash = "#hash"; -shouldBe("a.href", "'foo:bar#hash'"); -} catch(e) { -debug("Exception: " + e.description); -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js deleted file mode 100644 index b9ab87c2..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js +++ /dev/null
@@ -1,121 +0,0 @@ -description('Test setting the host attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Basic test"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:0"; -shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); - -debug("Set host without port"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com"; -shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); - -// IE8 throws "The URL is invalid" exception. -debug("Set host with '?' in it"); -try { -a.href = "https://www.mydomain.com:8080/path/?key=value"; -a.host = "www.other?domain.com:8080"; -shouldBe("a.href", "'https://www.other/?domain.com:8080/path/?key=value'"); -} catch(e) { -debug("Exception: " + e.description); -} - -debug("Set default port for another protocol"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:80"; -shouldBe("a.href", "'https://www.otherdomain.com:80/path/'"); - -debug("Set default port"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:443"; -shouldBe("a.href", "'https://www.otherdomain.com/path/'"); - -debug("Set host with invalid port"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:invalid"; -shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); - -// Firefox 3.5.2 rejects a port that contains non-digits. -debug("Set host with letters in port number"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:44a5"; -shouldBe("a.href", "'https://www.otherdomain.com:44/path/'"); - -// Firefox 3.5.2 ignores the leading space in the port, but errs on reparsing the port. -debug("Leading space in port number"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com: 443"; -shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); - -// Firefox 3.5.2 removed the port, clearly against the spec . -debug("Colon without port number"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.otherdomain.com:"; -shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); - -debug("Set host to null"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = null; -shouldBe("a.href", "'https://null:8080/path/'"); - -// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, which they shouldn't, per -// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . -// Since both do that in a buggy way, WebKit does not follow either one of them. -debug("Set host to empty string"); -a.href = "https://www.mydomain.com:8080/path/"; -a.host = ""; -shouldBe("a.href", "'https://www.mydomain.com:8080/path/'"); - -// Firefox 3.5.2 does not `set the host for file: . -debug("Set host to URL with file: protocol"); -a.href = "file:///path/"; -a.host = "mydomain.com"; -shouldBe("a.href", "'file://mydomain.com/path/'"); - -// IE8 throws if the host contains '/' -debug("Set host containing slashes in it"); -try { -a.href = "https://www.mydomain.com:8080/path/"; -a.host = "www.other\dom/ain.com"; -shouldBe("a.href", "'https://www.otherdom%2Fain.com:8080/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// WebKit fails to strip the \r in the authority, and therefore treats the URL as invalid -// and gets a different result than Firefox or Chrome; we should probably strip it -debug("Set host to a malformed URL"); -a.href = "https:/\rww.my@domain.com:8080/path/"; -a.host = "www.other!domain.com:15"; -shouldBe("a.href", "'https:/\\rww.my@domain.com:8080/path/'"); - -// IE8 throws an "Object Error" exception. -// Firefox 3.5.2 accepts this but throws an exception later -// WebKit should just reject -debug("Set host that starts with ':'"); -try { -a.href = "https://domain.com:8080/path/"; -a.host = ":www.otherdomain.com:15"; -shouldBe("a.href", "'https://domain.com:8080/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// IE8 throws a security exception if the host contains '@' -debug("Set host to URL containing username and .."); -try { -a.href = "https://rwwmy@domain.com:8080/pa..th/"; -a.host = "www.other!domain.com:25"; -shouldBe("a.href", "'https://rwwmy@www.other!domain.com:25/pa..th/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// Both IE8 and Firefox append the hosts, instead of rejecting, per -// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . -debug("Set host to a URL with tel: protocol"); -a.href = "tel:+1-816-555-1212"; -a.host = "+1-800-555-1212"; -shouldBe("a.href", "'tel:+1-816-555-1212'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js deleted file mode 100644 index 3c47b10a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js +++ /dev/null
@@ -1,67 +0,0 @@ -description('Test setting the hostname attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Basic test"); -a.href = "https://www.mydomain.com:8080/path/"; -a.hostname = "www.otherdomain.com"; -shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); - -// IE8 throws an exception "The URL is invalid". -try { -debug("Extra slashes before hostname"); -a.href = "https://www.mydomain.com:8080/path/"; -a.hostname = "//www.otherdomain.com"; -shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// Firefox 3.5.2 does not allow setting the host to foo: protocol -debug("Set hostname to URL with foo: protocol"); -a.href = "foo://www.mydomain.com/path/"; -a.hostname = "www.otherdomain.com"; -shouldBe("a.href", "'foo://www.otherdomain.com/path/'"); - -debug("Set hostname to null"); -a.href = "https://www.mydomain.com:8080/path/"; -a.hostname = null; -shouldBe("a.href", "'https://null:8080/path/'"); - -// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, against the spec at -// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . -// Since both do that in a buggy way, WebKit should not follow either one of them. -debug("Set hostname to empty string"); -a.href = "https://www.mydomain.com:8080/path/"; -a.hostname = ""; -shouldBe("a.href", "'https://www.mydomain.com:8080/path/'"); - -// IE8 fails to process really: protocol. -debug("Set hostname to URL with 2 colons"); -a.href = "really:bad:url"; -a.hostname = "mydomain.com"; -shouldBe("a.href", "'really:bad:url'"); - -// The expected behavior should change when the character table is updated. -// IE8 encodes the space in the hostname. -// Firefox3.5.2 and WebKit consider space as illegal character and would not set -// the new hostname. -debug("Set a hostname that contains space in it"); -a.href = "http://www.my domain.com/path/"; -a.hostname = "www.other domain.com"; -shouldBe("a.href", "'http://www.my domain.com/path/'"); - -// IE8 throws an exception "The URL is invalid". -try { -debug("Set hostname on a local file"); -a.href = "c:/path/testurl.html"; -a.hostname= "a"; -shouldBe("a.href", "'c:/path/testurl.html'"); -} catch(e) { -debug("Exception: " + e.description); -} - -debug("Set hostname to undefined"); -a.href = "https://www.mydomain.com:8080/path/"; -a.hostname = undefined; -shouldBe("a.href", "'https://undefined:8080/path/'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js deleted file mode 100644 index 44412f1..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js +++ /dev/null
@@ -1,68 +0,0 @@ -description('Test setting the pathname attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Set pathname that starts with slash"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value"; -a.pathname = "/path name"; -shouldBe("a.href", "'https://www.mydomain.com/path%20name?key=value'"); - -// IE8 throws an "Invalid URL" exception. -try { -debug("Set pathname that does not start with slash and contains '?'"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value"; -a.pathname = "pa?th"; -shouldBe("a.href", "'https://www.mydomain.com/pa%3Fth?key=value'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// IE8 throws an "Invalid URL" exception. -try { -debug("Set pathname that starts with double slash and contains '#'"); -a.href = "https://www.mydomain.com/path?key=value"; -a.pathname = "//path#name"; -shouldBe("a.href", "'https://www.mydomain.com//path%23name?key=value'"); -} catch(e) { -debug("Exception: " + e.description); -} - -debug("Set a pathname containing .. in it"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value"; -a.pathname = "/it/../path"; -shouldBe("a.href", "'https://www.mydomain.com/path?key=value'"); - -debug("Set pathname to null"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value"; -a.pathname = null; -shouldBe("a.href", "'https://www.mydomain.com/null?key=value'"); - -debug("Set pathname to empty string"); -a.href = "https://www.mydomain.com/?key=value"; -a.pathname = ""; -shouldBe("a.href", "'https://www.mydomain.com/?key=value'"); - -// The expected behavior should change when the character table is updated. -// IE8 considers this URL as valid. -debug("Set pathname that includes illegal characters to URL that contains illegal characters."); -a.href = "https://www.my|d[]()omain.com/path/testurl.html?key=value"; -a.pathname = "p$a|th"; -shouldBe("a.href", "'https://www.my|d[]()omain.com/path/testurl.html?key=value'"); - -// IE8 throws a security exception. -try { -debug("Set pathname to URL that contains '@' in host"); -a.href = "http://w@#ww"; -a.pathname = "path"; -shouldBe("a.href", "'http://w@/path#ww'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// IE8 allows setting the pathname, for non-hierarchial URL. -// It is not supposed to allow that per -// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . -debug("Set pathname to a URL with non-hierarchical protocol"); -a.href = "tel:+1800-555-1212"; -a.pathname = "the-path"; -shouldBe("a.href", "'tel:+1800-555-1212'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js deleted file mode 100644 index d7ea00a1d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-port.js +++ /dev/null
@@ -1,47 +0,0 @@ -description('Test setting the port attribute of the URL in HTMLAnchorElement.'); - -var a = document.createElement('a'); - -debug("Default port as number"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = 443; -shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); - -debug("Default port as string"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = "443"; -shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); - -debug("Set port to 0"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = "0"; -shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); - -// Firefox 3.5.2 does not accept the port if any character is not a digit. -debug("Set port to non-number"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = "4a"; -shouldBe("a.href", "'https://www.mydomain.com:4/path/testurl.html?key=value'"); - -// Firefox 3.5.2 does not accept the port if it is null. -debug("Set port to null"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = null; -shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); - -// Firefox 3.5.2 does not accept the port if it is null. -debug("Set port to empty string"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = ""; -shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); - -debug("Set port to undefined"); -a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; -a.port = undefined; -shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); - -// Firefox 3.5.2 does not allow setting the port on a URL with protocol foo: . -debug("Set port to URL with foo: protocol"); -a.href = "foo://bar/"; -a.port = 50; -shouldBe("a.href", "'foo://bar:50/'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-prevents-rebase.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-prevents-rebase.js deleted file mode 100644 index 0e823bdd..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-prevents-rebase.js +++ /dev/null
@@ -1,117 +0,0 @@ -description('Tests that when an href attribute is set, the href is no longer subject to updates to the document base URI.'); - -var a = document.createElement('a'); -var base = document.createElement('base'); -document.head.appendChild(base); - - -debug("Search attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "?search"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://new_base/?search'"); - -debug("Search attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "?foo"; -a.search = "search"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://old_base/?search'"); -debug(''); - - -debug("Pathname attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "path"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://new_base/path'"); - -debug("Pathname attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "foo"; -a.pathname = "path"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://old_base/path'"); -debug(''); - - -debug("Hash attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "#hash"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://new_base/#hash'"); - -debug("Pathname attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "#foo"; -a.hash = "hash"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://old_base/#hash'"); -debug(''); - - -debug('Note that for the following attributes, updating the document base URI has no effect because we have to use an abosulte URL for the href in order to set an initial value for the attribute we wish to update. They are included for completeness.'); -debug(''); - - -debug("Host attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "http://host:0"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host:0/'"); - -debug("Host attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "http://foo:80"; -a.host = "host:0"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host:0/'"); -debug(''); - - -debug("Hostname attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "http://host"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host/'"); - -debug("Hostname attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "http://foo"; -a.hostname = "host"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host/'"); -debug(''); - - -debug("Protocol attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "protocol:"; -base.href = "http://new_base/"; -shouldBe("a.href", "'protocol:'"); - -debug("Protocol attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "foo:"; -a.protocol = "protocol:"; -base.href = "http://new_base/"; -shouldBe("a.href", "'protocol:'"); -debug(''); - - -debug("Port attribute, update document base URI without attribute having been set"); -base.href = "http://old_base/"; -a.href = "http://host:0"; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host:0/'"); - -debug("Port attribute, update document base URI after attribute has been set"); -base.href = "http://old_base/"; -a.href = "http://host:80"; -a.port = 0; -base.href = "http://new_base/"; -shouldBe("a.href", "'http://host:0/'"); -debug(''); - - -base.href = '';
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js deleted file mode 100644 index 974d60c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js +++ /dev/null
@@ -1,77 +0,0 @@ -description('Test setting the protocol attribute of the URL in HTMLAnchorElement .'); - -var a = document.createElement('a'); - -debug("Basic test"); -a.href = "https://www.mydomain.com/path/"; -a.protocol = "http-foo"; -shouldBe("a.href", "'http-foo://www.mydomain.com/path/'"); - -// IE8 throws "Invalid argument" exception. -debug("Set a protocol that contains ':'"); -try { -a.href = "https://www.mydomain.com/path/"; -a.protocol = "http:foo"; -shouldBe("a.href", "'http://www.mydomain.com/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// IE8 throws "Invalid argument" exception. -debug("Set a protocol that contains invalid characters"); -try { -a.href = "https://www.mydomain.com/path/"; -a.protocol = "http^foo"; -shouldBe("a.href", "'https://www.mydomain.com/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// The expected behavior should change when the character table is updated. -// IE8 encodes '^' in the host. -debug("Set a protocol to a URL with invalid host name"); -a.href = "h:^^"; -a.protocol = "foo"; -shouldBe("a.href", "'foo:^^'"); - -// IE8 throws "Invalid argument" exception. -try { -debug("Set a protocol that starts with ':'"); -a.href = "https://www.mydomain.com/path/"; -a.protocol = ":http"; -shouldBe("a.href", "'https://www.mydomain.com/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -debug("Set protocol to null"); -a.href = "https://www.mydomain.com/path/"; -a.protocol = null; -shouldBe("a.href", "'null://www.mydomain.com/path/'"); - -// IE8 throws "Invalid argument" exception. -try { -debug("Set protocol to empty string"); -a.href = "https://www.mydomain.com/path/"; -a.protocol = ""; -shouldBe("a.href", "'https://www.mydomain.com/path/'"); -} catch(e) { -debug("Exception: " + e.description); -} - -// Firefox 4 adds three slashes, unlike Safari and Chrome -debug("Set protocol to http on malformed URL"); -a.href = "foo:??bar"; -a.protocol = "http"; -shouldBe("a.href", "'http:/??bar'"); - -// IE8 keeps the protocol if it is 'c:'. -debug("Set protocol to a URL which points to a local file"); -a.href = "c:\path"; -a.protocol = "f-oo"; -shouldBe("a.href", "'f-oo:path'"); - -debug("Set protocol to undefined"); -a.href = "https://www.mydomain.com/path/"; -a.protocol = undefined; -shouldBe("a.href", "'undefined://www.mydomain.com/path/'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js deleted file mode 100644 index 39370a1..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js +++ /dev/null
@@ -1,46 +0,0 @@ -description('Test setting the search attribute of the URL in HTMLAnchorElement .'); - -var a = document.createElement('a'); - -debug("Set search without '?'"); -a.href = "https://www.mydomain.com/path/?key=value"; -a.search = "value=key"; -shouldBe("a.href", "'https://www.mydomain.com/path/?value=key'"); - -// IE8 does not encode spaces in search string -debug("Set search that starts with '?' and contains spaces"); -a.href = "https://www.mydomain.com/path/?key=value"; -a.search = "?val ue= key?"; -shouldBe("a.href", "'https://www.mydomain.com/path/?val%20ue=%20key?'"); - -debug("Set search to a malformed URL"); -a.href = "s:www.mydomain.com/path/"; -a.search = "%"; -shouldBe("a.href", "'s:www.mydomain.com/path/?%'"); - -// IE8 throws "The URL is invalid" exception. -debug("Set search containing '#'"); -try { -a.href = "https://www.mydomain.com/path/?key=value#hash"; -a.search = "?value#key"; -shouldBe("a.href", "'https://www.mydomain.com/path/?value%23key#hash'"); -} catch(e) { -debug("Exception: " + e.description); -} - -debug("Set search to a malformed URL"); -a.href = "bad:/|/url"; -a.search = "?value=key"; -shouldBe("a.href", "'bad:/|/url?value=key'"); - -debug("Set search to null"); -a.href = "https://www.mydomain.com/path/?key=value"; -a.search = null; -shouldBe("a.href", "'https://www.mydomain.com/path/?null'"); - -// Firefox 3.5.2 Removes the '?', and it should, per -// http://url.spec.whatwg.org/#dom-url-search -debug("Set search to empty string"); -a.href = "https://www.mydomain.com/path/?key=value"; -a.search = ""; -shouldBe("a.href", "'https://www.mydomain.com/path/'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js deleted file mode 100644 index af58754..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-whitespace.js +++ /dev/null
@@ -1,47 +0,0 @@ -description('Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.'); - -var a = document.createElement('a'); - -debug("Set href that starts with a space"); -a.href = " https://www.mydomain.com/path/testurl.html?key=value"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that starts with a newline"); -a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that starts with a tab"); -a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that starts with a carriage return"); -a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that starts with a combination of newlines, spaces and tabs"); -a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that ends with a space"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value "; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that ends with a newline"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value\n"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that ends with a tab"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value\t"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that ends with a carriage return"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value\r"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that ends with a combination of newlines, spaces and tabs"); -a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n"; -shouldBe("a.hostname", "'www.mydomain.com'"); - -debug("Set href that starts and ends with a combination of newlines, spaces and tabs"); -a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n"; -shouldBe("a.hostname", "'www.mydomain.com'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html index ca9e4dd..9c79967 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash.html
@@ -4,6 +4,72 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-hash.js"></script> +<script> +description('Test setting the hash attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Hash value does not start with '#'"); +a.href = "https://www.mydomain.com:8080/path/testurl.html#middle"; +a.hash = "hash-value"; +shouldBe("a.href", "'https://www.mydomain.com:8080/path/testurl.html#hash-value'"); + +debug("Hash value starts with '#'"); +a.href = "file:///path/testurl.html#middle"; +a.hash = "#hash_value"; +shouldBe("a.href", "'file:///path/testurl.html#hash_value'"); + +debug("'?' in hash value"); +a.href = "http://www.mydomain.com/path/testurl.html#middle"; +a.hash = "#hash?value"; +shouldBe("a.href", "'http://www.mydomain.com/path/testurl.html#hash?value'"); + +// The expected behavior should change when character table is updated. +// IE8 and Firefox3.5.2 don't consider these characters as illegal. +debug("'#' in hash value, and illegal characters in hostname"); +a.href = "https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle"; +a.hash = "#hash#value"; +shouldBe("a.href", "'https://www.my\"d(){}|~om?ain#com/path/testurl.html#middle'"); + +debug("Set hash to null"); +a.href = "https://www.mydomain.com/path/testurl.html#middle"; +a.hash = null; +shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html#null'"); + +// Firefox 3.5.2 removes the '#' at the end, and it should per +// http://url.spec.whatwg.org/#dom-url-hash +debug("Set hash to empty string"); +a.href = "https://www.mydomain.com/path/testurl.html#middle"; +a.hash = ""; +shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html'"); + +// Firefox 3.5.2 does not allow setting hash to mailto: scheme, and it should. +debug("Add hash to mailto: protocol"); +a.href = "mailto:e-mail_address@goes_here"; +a.hash = "hash-value"; +shouldBe("a.href", "'mailto:e-mail_address@goes_here#hash-value'"); + +// IE8 does not percent-encode spaces in the hash component, but it does that +// in the path component. +debug("Add hash to file: protocol"); +a.href = "file:///some path"; +a.hash = "hash value"; +shouldBe("a.href", "'file:///some%20path#hash value'"); + +debug("Set hash to '#'"); +a.href = "http://mydomain.com#middle"; +a.hash = "#"; +shouldBe("a.href", "'http://mydomain.com/'"); + +// Firefox 3.5.2 does not allow setting hash to foo: scheme, and it should. +debug("Add hash to non-standard protocol"); +try { +a.href = "foo:bar"; +a.hash = "#hash"; +shouldBe("a.href", "'foo:bar#hash'"); +} catch(e) { +debug("Exception: " + e.description); +} +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html index 7d4356ff..b6b923f99 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host.html
@@ -4,6 +4,128 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-host.js"></script> +<script> +description('Test setting the host attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Basic test"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:0"; +shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); + +debug("Set host without port"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com"; +shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); + +// IE8 throws "The URL is invalid" exception. +debug("Set host with '?' in it"); +try { +a.href = "https://www.mydomain.com:8080/path/?key=value"; +a.host = "www.other?domain.com:8080"; +shouldBe("a.href", "'https://www.other/?domain.com:8080/path/?key=value'"); +} catch(e) { +debug("Exception: " + e.description); +} + +debug("Set default port for another protocol"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:80"; +shouldBe("a.href", "'https://www.otherdomain.com:80/path/'"); + +debug("Set default port"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:443"; +shouldBe("a.href", "'https://www.otherdomain.com/path/'"); + +debug("Set host with invalid port"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:invalid"; +shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); + +// Firefox 3.5.2 rejects a port that contains non-digits. +debug("Set host with letters in port number"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:44a5"; +shouldBe("a.href", "'https://www.otherdomain.com:44/path/'"); + +// Firefox 3.5.2 ignores the leading space in the port, but errs on reparsing the port. +debug("Leading space in port number"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com: 443"; +shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); + +// Firefox 3.5.2 removed the port, clearly against the spec . +debug("Colon without port number"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.otherdomain.com:"; +shouldBe("a.href", "'https://www.otherdomain.com:0/path/'"); + +debug("Set host to null"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = null; +shouldBe("a.href", "'https://null:8080/path/'"); + +// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, which they shouldn't, per +// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . +// Since both do that in a buggy way, WebKit does not follow either one of them. +debug("Set host to empty string"); +a.href = "https://www.mydomain.com:8080/path/"; +a.host = ""; +shouldBe("a.href", "'https://www.mydomain.com:8080/path/'"); + +// Firefox 3.5.2 does not `set the host for file: . +debug("Set host to URL with file: protocol"); +a.href = "file:///path/"; +a.host = "mydomain.com"; +shouldBe("a.href", "'file://mydomain.com/path/'"); + +// IE8 throws if the host contains '/' +debug("Set host containing slashes in it"); +try { +a.href = "https://www.mydomain.com:8080/path/"; +a.host = "www.other\dom/ain.com"; +shouldBe("a.href", "'https://www.otherdom%2Fain.com:8080/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// WebKit fails to strip the \r in the authority, and therefore treats the URL as invalid +// and gets a different result than Firefox or Chrome; we should probably strip it +debug("Set host to a malformed URL"); +a.href = "https:/\rww.my@domain.com:8080/path/"; +a.host = "www.other!domain.com:15"; +shouldBe("a.href", "'https:/\\rww.my@domain.com:8080/path/'"); + +// IE8 throws an "Object Error" exception. +// Firefox 3.5.2 accepts this but throws an exception later +// WebKit should just reject +debug("Set host that starts with ':'"); +try { +a.href = "https://domain.com:8080/path/"; +a.host = ":www.otherdomain.com:15"; +shouldBe("a.href", "'https://domain.com:8080/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// IE8 throws a security exception if the host contains '@' +debug("Set host to URL containing username and .."); +try { +a.href = "https://rwwmy@domain.com:8080/pa..th/"; +a.host = "www.other!domain.com:25"; +shouldBe("a.href", "'https://rwwmy@www.other!domain.com:25/pa..th/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// Both IE8 and Firefox append the hosts, instead of rejecting, per +// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . +debug("Set host to a URL with tel: protocol"); +a.href = "tel:+1-816-555-1212"; +a.host = "+1-800-555-1212"; +shouldBe("a.href", "'tel:+1-816-555-1212'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html index 786a825..505cc1a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html
@@ -4,6 +4,74 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-hostname.js"></script> +<script> +description('Test setting the hostname attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Basic test"); +a.href = "https://www.mydomain.com:8080/path/"; +a.hostname = "www.otherdomain.com"; +shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); + +// IE8 throws an exception "The URL is invalid". +try { +debug("Extra slashes before hostname"); +a.href = "https://www.mydomain.com:8080/path/"; +a.hostname = "//www.otherdomain.com"; +shouldBe("a.href", "'https://www.otherdomain.com:8080/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// Firefox 3.5.2 does not allow setting the host to foo: protocol +debug("Set hostname to URL with foo: protocol"); +a.href = "foo://www.mydomain.com/path/"; +a.hostname = "www.otherdomain.com"; +shouldBe("a.href", "'foo://www.otherdomain.com/path/'"); + +debug("Set hostname to null"); +a.href = "https://www.mydomain.com:8080/path/"; +a.hostname = null; +shouldBe("a.href", "'https://null:8080/path/'"); + +// Both IE8 and Firefox 3.5.2 allow setting the host to empty string, against the spec at +// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . +// Since both do that in a buggy way, WebKit should not follow either one of them. +debug("Set hostname to empty string"); +a.href = "https://www.mydomain.com:8080/path/"; +a.hostname = ""; +shouldBe("a.href", "'https://www.mydomain.com:8080/path/'"); + +// IE8 fails to process really: protocol. +debug("Set hostname to URL with 2 colons"); +a.href = "really:bad:url"; +a.hostname = "mydomain.com"; +shouldBe("a.href", "'really:bad:url'"); + +// The expected behavior should change when the character table is updated. +// IE8 encodes the space in the hostname. +// Firefox3.5.2 and WebKit consider space as illegal character and would not set +// the new hostname. +debug("Set a hostname that contains space in it"); +a.href = "http://www.my domain.com/path/"; +a.hostname = "www.other domain.com"; +shouldBe("a.href", "'http://www.my domain.com/path/'"); + +// IE8 throws an exception "The URL is invalid". +try { +debug("Set hostname on a local file"); +a.href = "c:/path/testurl.html"; +a.hostname= "a"; +shouldBe("a.href", "'c:/path/testurl.html'"); +} catch(e) { +debug("Exception: " + e.description); +} + +debug("Set hostname to undefined"); +a.href = "https://www.mydomain.com:8080/path/"; +a.hostname = undefined; +shouldBe("a.href", "'https://undefined:8080/path/'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html index d1168e4..3e81c39 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname.html
@@ -4,6 +4,75 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-pathname.js"></script> +<script> +description('Test setting the pathname attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Set pathname that starts with slash"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value"; +a.pathname = "/path name"; +shouldBe("a.href", "'https://www.mydomain.com/path%20name?key=value'"); + +// IE8 throws an "Invalid URL" exception. +try { +debug("Set pathname that does not start with slash and contains '?'"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value"; +a.pathname = "pa?th"; +shouldBe("a.href", "'https://www.mydomain.com/pa%3Fth?key=value'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// IE8 throws an "Invalid URL" exception. +try { +debug("Set pathname that starts with double slash and contains '#'"); +a.href = "https://www.mydomain.com/path?key=value"; +a.pathname = "//path#name"; +shouldBe("a.href", "'https://www.mydomain.com//path%23name?key=value'"); +} catch(e) { +debug("Exception: " + e.description); +} + +debug("Set a pathname containing .. in it"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value"; +a.pathname = "/it/../path"; +shouldBe("a.href", "'https://www.mydomain.com/path?key=value'"); + +debug("Set pathname to null"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value"; +a.pathname = null; +shouldBe("a.href", "'https://www.mydomain.com/null?key=value'"); + +debug("Set pathname to empty string"); +a.href = "https://www.mydomain.com/?key=value"; +a.pathname = ""; +shouldBe("a.href", "'https://www.mydomain.com/?key=value'"); + +// The expected behavior should change when the character table is updated. +// IE8 considers this URL as valid. +debug("Set pathname that includes illegal characters to URL that contains illegal characters."); +a.href = "https://www.my|d[]()omain.com/path/testurl.html?key=value"; +a.pathname = "p$a|th"; +shouldBe("a.href", "'https://www.my|d[]()omain.com/path/testurl.html?key=value'"); + +// IE8 throws a security exception. +try { +debug("Set pathname to URL that contains '@' in host"); +a.href = "http://w@#ww"; +a.pathname = "path"; +shouldBe("a.href", "'http://w@/path#ww'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// IE8 allows setting the pathname, for non-hierarchial URL. +// It is not supposed to allow that per +// http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes . +debug("Set pathname to a URL with non-hierarchical protocol"); +a.href = "tel:+1800-555-1212"; +a.pathname = "the-path"; +shouldBe("a.href", "'tel:+1800-555-1212'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html index 852148e..f297331b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port.html
@@ -4,6 +4,54 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-port.js"></script> +<script> +description('Test setting the port attribute of the URL in HTMLAnchorElement.'); + +var a = document.createElement('a'); + +debug("Default port as number"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = 443; +shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); + +debug("Default port as string"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = "443"; +shouldBe("a.href", "'https://www.mydomain.com/path/testurl.html?key=value'"); + +debug("Set port to 0"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = "0"; +shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); + +// Firefox 3.5.2 does not accept the port if any character is not a digit. +debug("Set port to non-number"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = "4a"; +shouldBe("a.href", "'https://www.mydomain.com:4/path/testurl.html?key=value'"); + +// Firefox 3.5.2 does not accept the port if it is null. +debug("Set port to null"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = null; +shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); + +// Firefox 3.5.2 does not accept the port if it is null. +debug("Set port to empty string"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = ""; +shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); + +debug("Set port to undefined"); +a.href = "https://www.mydomain.com:8080/path/testurl.html?key=value"; +a.port = undefined; +shouldBe("a.href", "'https://www.mydomain.com:0/path/testurl.html?key=value'"); + +// Firefox 3.5.2 does not allow setting the port on a URL with protocol foo: . +debug("Set port to URL with foo: protocol"); +a.href = "foo://bar/"; +a.port = 50; +shouldBe("a.href", "'foo://bar:50/'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase.html index b75e2e5..8c31fe8a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase.html
@@ -4,6 +4,124 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-prevents-rebase.js"></script> +<script> +description('Tests that when an href attribute is set, the href is no longer subject to updates to the document base URI.'); + +var a = document.createElement('a'); +var base = document.createElement('base'); +document.head.appendChild(base); + + +debug("Search attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "?search"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://new_base/?search'"); + +debug("Search attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "?foo"; +a.search = "search"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://old_base/?search'"); +debug(''); + + +debug("Pathname attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "path"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://new_base/path'"); + +debug("Pathname attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "foo"; +a.pathname = "path"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://old_base/path'"); +debug(''); + + +debug("Hash attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "#hash"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://new_base/#hash'"); + +debug("Pathname attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "#foo"; +a.hash = "hash"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://old_base/#hash'"); +debug(''); + + +debug('Note that for the following attributes, updating the document base URI has no effect because we have to use an abosulte URL for the href in order to set an initial value for the attribute we wish to update. They are included for completeness.'); +debug(''); + + +debug("Host attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "http://host:0"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host:0/'"); + +debug("Host attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "http://foo:80"; +a.host = "host:0"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host:0/'"); +debug(''); + + +debug("Hostname attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "http://host"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host/'"); + +debug("Hostname attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "http://foo"; +a.hostname = "host"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host/'"); +debug(''); + + +debug("Protocol attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "protocol:"; +base.href = "http://new_base/"; +shouldBe("a.href", "'protocol:'"); + +debug("Protocol attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "foo:"; +a.protocol = "protocol:"; +base.href = "http://new_base/"; +shouldBe("a.href", "'protocol:'"); +debug(''); + + +debug("Port attribute, update document base URI without attribute having been set"); +base.href = "http://old_base/"; +a.href = "http://host:0"; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host:0/'"); + +debug("Port attribute, update document base URI after attribute has been set"); +base.href = "http://old_base/"; +a.href = "http://host:80"; +a.port = 0; +base.href = "http://new_base/"; +shouldBe("a.href", "'http://host:0/'"); +debug(''); + + +base.href = ''; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html index 16185c4..c5ab954 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol.html
@@ -4,6 +4,84 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-protocol.js"></script> +<script> +description('Test setting the protocol attribute of the URL in HTMLAnchorElement .'); + +var a = document.createElement('a'); + +debug("Basic test"); +a.href = "https://www.mydomain.com/path/"; +a.protocol = "http-foo"; +shouldBe("a.href", "'http-foo://www.mydomain.com/path/'"); + +// IE8 throws "Invalid argument" exception. +debug("Set a protocol that contains ':'"); +try { +a.href = "https://www.mydomain.com/path/"; +a.protocol = "http:foo"; +shouldBe("a.href", "'http://www.mydomain.com/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// IE8 throws "Invalid argument" exception. +debug("Set a protocol that contains invalid characters"); +try { +a.href = "https://www.mydomain.com/path/"; +a.protocol = "http^foo"; +shouldBe("a.href", "'https://www.mydomain.com/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// The expected behavior should change when the character table is updated. +// IE8 encodes '^' in the host. +debug("Set a protocol to a URL with invalid host name"); +a.href = "h:^^"; +a.protocol = "foo"; +shouldBe("a.href", "'foo:^^'"); + +// IE8 throws "Invalid argument" exception. +try { +debug("Set a protocol that starts with ':'"); +a.href = "https://www.mydomain.com/path/"; +a.protocol = ":http"; +shouldBe("a.href", "'https://www.mydomain.com/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +debug("Set protocol to null"); +a.href = "https://www.mydomain.com/path/"; +a.protocol = null; +shouldBe("a.href", "'null://www.mydomain.com/path/'"); + +// IE8 throws "Invalid argument" exception. +try { +debug("Set protocol to empty string"); +a.href = "https://www.mydomain.com/path/"; +a.protocol = ""; +shouldBe("a.href", "'https://www.mydomain.com/path/'"); +} catch(e) { +debug("Exception: " + e.description); +} + +// Firefox 4 adds three slashes, unlike Safari and Chrome +debug("Set protocol to http on malformed URL"); +a.href = "foo:??bar"; +a.protocol = "http"; +shouldBe("a.href", "'http:/??bar'"); + +// IE8 keeps the protocol if it is 'c:'. +debug("Set protocol to a URL which points to a local file"); +a.href = "c:\path"; +a.protocol = "f-oo"; +shouldBe("a.href", "'f-oo:path'"); + +debug("Set protocol to undefined"); +a.href = "https://www.mydomain.com/path/"; +a.protocol = undefined; +shouldBe("a.href", "'undefined://www.mydomain.com/path/'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html index 668f9f8..f37951b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search.html
@@ -4,6 +4,53 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-search.js"></script> +<script> +description('Test setting the search attribute of the URL in HTMLAnchorElement .'); + +var a = document.createElement('a'); + +debug("Set search without '?'"); +a.href = "https://www.mydomain.com/path/?key=value"; +a.search = "value=key"; +shouldBe("a.href", "'https://www.mydomain.com/path/?value=key'"); + +// IE8 does not encode spaces in search string +debug("Set search that starts with '?' and contains spaces"); +a.href = "https://www.mydomain.com/path/?key=value"; +a.search = "?val ue= key?"; +shouldBe("a.href", "'https://www.mydomain.com/path/?val%20ue=%20key?'"); + +debug("Set search to a malformed URL"); +a.href = "s:www.mydomain.com/path/"; +a.search = "%"; +shouldBe("a.href", "'s:www.mydomain.com/path/?%'"); + +// IE8 throws "The URL is invalid" exception. +debug("Set search containing '#'"); +try { +a.href = "https://www.mydomain.com/path/?key=value#hash"; +a.search = "?value#key"; +shouldBe("a.href", "'https://www.mydomain.com/path/?value%23key#hash'"); +} catch(e) { +debug("Exception: " + e.description); +} + +debug("Set search to a malformed URL"); +a.href = "bad:/|/url"; +a.search = "?value=key"; +shouldBe("a.href", "'bad:/|/url?value=key'"); + +debug("Set search to null"); +a.href = "https://www.mydomain.com/path/?key=value"; +a.search = null; +shouldBe("a.href", "'https://www.mydomain.com/path/?null'"); + +// Firefox 3.5.2 Removes the '?', and it should, per +// http://url.spec.whatwg.org/#dom-url-search +debug("Set search to empty string"); +a.href = "https://www.mydomain.com/path/?key=value"; +a.search = ""; +shouldBe("a.href", "'https://www.mydomain.com/path/'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html index 3aae634..1dbbdeb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace.html
@@ -4,6 +4,54 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-href-attribute-whitespace.js"></script> +<script> +description('Test setting the href attribute of an HTMLAnchorElement to a URL with leading and trailing whitespace.'); + +var a = document.createElement('a'); + +debug("Set href that starts with a space"); +a.href = " https://www.mydomain.com/path/testurl.html?key=value"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that starts with a newline"); +a.href = "\nhttps://www.mydomain.com/path/testurl.html?key=value"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that starts with a tab"); +a.href = "\thttps://www.mydomain.com/path/testurl.html?key=value"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that starts with a carriage return"); +a.href = "\rhttps://www.mydomain.com/path/testurl.html?key=value"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that starts with a combination of newlines, spaces and tabs"); +a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that ends with a space"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value "; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that ends with a newline"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value\n"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that ends with a tab"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value\t"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that ends with a carriage return"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value\r"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that ends with a combination of newlines, spaces and tabs"); +a.href = "https://www.mydomain.com/path/testurl.html?key=value\n \t\r \n"; +shouldBe("a.hostname", "'www.mydomain.com'"); + +debug("Set href that starts and ends with a combination of newlines, spaces and tabs"); +a.href = "\n \t\r \nhttps://www.mydomain.com/path/testurl.html?key=value\n \t\r \n"; +shouldBe("a.hostname", "'www.mydomain.com'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html index e340fef2..1a42fe6f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/multiple-base-elements.html
@@ -4,6 +4,49 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/multiple-base-elements.js"></script> +<script> +description('Test the behavior of multiple base elements.'); + +var originalBase = document.URL.replace(/[^/]*$/, ""); + +function clean(url) +{ + if (url.length < originalBase.length) + return url; + if (url.substring(0, originalBase.length) !== originalBase) + return url; + return "http://originalbase.com/" + url.substring(originalBase.length); +} + +var anchor = document.createElement('a'); +anchor.href = "file"; + +document.body.appendChild(anchor); + +shouldBe("clean(anchor.href)", "'http://originalbase.com/file'"); + +var base = document.createElement('base'); +base.href = "http://domain.com/base/"; + +shouldBe("document.head.appendChild(base), clean(anchor.href)", "'http://domain.com/base/file'"); +shouldBe("base.href = 'http://domain.com/base-changed/', clean(anchor.href)", "'http://domain.com/base-changed/file'"); +shouldBe("document.head.removeChild(base), clean(anchor.href)", "'http://originalbase.com/file'"); + +base.href = "http://domain.com/base/"; + +var base2 = document.createElement('base'); +base2.href = "http://domain.com/base2/"; + +var base3 = document.createElement('base'); +base3.href = "http://domain.com/base3/"; + +shouldBe("document.head.appendChild(base), document.head.appendChild(base2), clean(anchor.href)", "'http://domain.com/base/file'"); +shouldBe("base.removeAttribute('href'), clean(anchor.href)", "'http://domain.com/base2/file'"); +shouldBe("document.head.appendChild(base3), clean(anchor.href)", "'http://domain.com/base2/file'"); + +document.head.removeChild(base); +document.head.removeChild(base2); +document.head.removeChild(base3); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js deleted file mode 100644 index 06ff007..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLBaseElement/script-tests/multiple-base-elements.js +++ /dev/null
@@ -1,42 +0,0 @@ -description('Test the behavior of multiple base elements.'); - -var originalBase = document.URL.replace(/[^/]*$/, ""); - -function clean(url) -{ - if (url.length < originalBase.length) - return url; - if (url.substring(0, originalBase.length) !== originalBase) - return url; - return "http://originalbase.com/" + url.substring(originalBase.length); -} - -var anchor = document.createElement('a'); -anchor.href = "file"; - -document.body.appendChild(anchor); - -shouldBe("clean(anchor.href)", "'http://originalbase.com/file'"); - -var base = document.createElement('base'); -base.href = "http://domain.com/base/"; - -shouldBe("document.head.appendChild(base), clean(anchor.href)", "'http://domain.com/base/file'"); -shouldBe("base.href = 'http://domain.com/base-changed/', clean(anchor.href)", "'http://domain.com/base-changed/file'"); -shouldBe("document.head.removeChild(base), clean(anchor.href)", "'http://originalbase.com/file'"); - -base.href = "http://domain.com/base/"; - -var base2 = document.createElement('base'); -base2.href = "http://domain.com/base2/"; - -var base3 = document.createElement('base'); -base3.href = "http://domain.com/base3/"; - -shouldBe("document.head.appendChild(base), document.head.appendChild(base2), clean(anchor.href)", "'http://domain.com/base/file'"); -shouldBe("base.removeAttribute('href'), clean(anchor.href)", "'http://domain.com/base2/file'"); -shouldBe("document.head.appendChild(base3), clean(anchor.href)", "'http://domain.com/base2/file'"); - -document.head.removeChild(base); -document.head.removeChild(base2); -document.head.removeChild(base3);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-all.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-all.html index 7a68b4b..4ca9cd2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-all.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-all.html
@@ -4,6 +4,9 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/document-all.js"></script> +<script> +var htmlallcollection = document.all; +shouldBe('htmlallcollection.toString()', "'[object HTMLAllCollection]'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/script-tests/document-all.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/script-tests/document-all.js deleted file mode 100644 index f2ade4ee..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/script-tests/document-all.js +++ /dev/null
@@ -1,2 +0,0 @@ -var htmlallcollection = document.all; -shouldBe('htmlallcollection.toString()', "'[object HTMLAllCollection]'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc.html index d954603..823f8b5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc.html
@@ -1,9 +1,38 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/class-list-gc.js"></script> +<script> +description('This tests that properties on the classList persists GC.'); + +function gc() +{ + if (window.GCController) + return GCController.collect(); + + for (var i = 0; i < 10000; i++) { + var s = new String; + } +} + +var d = document.createElement('div'); + +// Ensure the classList is created. +var classList = d.classList; + +// Set a custom property. +d.classList.life = 42; +shouldEvaluateTo('d.classList.life', 42); + +// Null out reference to the dataset. +classList = null; + +gc(); + +// Test that the classList wrapper persisted the GC and still has the custom property. +shouldEvaluateTo('d.classList.life', 42); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html index 6758452..fbde3b2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks.html
@@ -4,6 +4,6 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/class-list.js"></script> +<script src="resources/class-list.js"></script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list.html index 56a9e0e..1ac6569 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list.html
@@ -4,6 +4,6 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/class-list.js"></script> +<script src="resources/class-list.js"></script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors.html index 8e5b7fd..3d8ba74 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors.html
@@ -4,6 +4,16 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/insertAdjacentHTML-errors.js"></script> +<script> +description('Test insertAdjacentHTML exceptions to make sure they match HTML5'); + +var div = document.createElement("div"); + +shouldThrow("div.insertAdjacentHTML('beforeBegin', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."'); +shouldThrow("div.insertAdjacentHTML('afterEnd', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."'); + +shouldThrow("div.insertAdjacentHTML('FOO', 'text')", '"SyntaxError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The value provided (\'FOO\') is not one of \'beforeBegin\', \'afterBegin\', \'beforeEnd\', or \'afterEnd\'."'); +shouldThrow("document.documentElement.insertAdjacentHTML('afterEnd', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/resources/class-list.js similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js rename to third_party/WebKit/LayoutTests/fast/dom/HTMLElement/resources/class-list.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list-gc.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list-gc.js deleted file mode 100644 index c3b3153..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list-gc.js +++ /dev/null
@@ -1,28 +0,0 @@ -description('This tests that properties on the classList persists GC.'); - -function gc() -{ - if (window.GCController) - return GCController.collect(); - - for (var i = 0; i < 10000; i++) { - var s = new String; - } -} - -var d = document.createElement('div'); - -// Ensure the classList is created. -var classList = d.classList; - -// Set a custom property. -d.classList.life = 42; -shouldEvaluateTo('d.classList.life', 42); - -// Null out reference to the dataset. -classList = null; - -gc(); - -// Test that the classList wrapper persisted the GC and still has the custom property. -shouldEvaluateTo('d.classList.life', 42);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/insertAdjacentHTML-errors.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/insertAdjacentHTML-errors.js deleted file mode 100644 index 5638cb25..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/insertAdjacentHTML-errors.js +++ /dev/null
@@ -1,9 +0,0 @@ -description('Test insertAdjacentHTML exceptions to make sure they match HTML5'); - -var div = document.createElement("div"); - -shouldThrow("div.insertAdjacentHTML('beforeBegin', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."'); -shouldThrow("div.insertAdjacentHTML('afterEnd', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."'); - -shouldThrow("div.insertAdjacentHTML('FOO', 'text')", '"SyntaxError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The value provided (\'FOO\') is not one of \'beforeBegin\', \'afterBegin\', \'beforeEnd\', or \'afterEnd\'."'); -shouldThrow("document.documentElement.insertAdjacentHTML('afterEnd', 'text')", '"NoModificationAllowedError: Failed to execute \'insertAdjacentHTML\' on \'Element\': The element has no parent."');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js deleted file mode 100644 index f1edf33..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/spellcheck.js +++ /dev/null
@@ -1,100 +0,0 @@ -description('Tests the spellcheck attribute.'); - -var parent = document.createElement("div"); -document.body.appendChild(parent); - -function testFor(initialAttribute, initialExpectation, setValue, lastExpectation, lastAttributeExpectation) -{ - var target = document.createElement("span"); - parent.appendChild(target); - - window.target = target; - window.initialExpectation = initialExpectation; - window.lastExpectation = lastExpectation; - window.lastAttributeExpectation = lastAttributeExpectation; - - if (undefined !== initialAttribute) - target.setAttribute("spellcheck", initialAttribute); - shouldBe("target.spellcheck", "initialExpectation"); - - if (undefined !== setValue) - target.spellcheck = setValue; - shouldBe("target.spellcheck", "lastExpectation"); - shouldBe("target.getAttribute('spellcheck')", "lastAttributeExpectation"); - - parent.removeChild(target); -} - -function testUsingSetAttributes() -{ - var target = document.createElement("span"); - parent.appendChild(target); - window.target = target; - - shouldBe("target.spellcheck", "true"); - shouldBe("target.getAttribute('spellcheck')", "'true'"); - // Set using property. - target.spellcheck = false; - shouldBe("target.spellcheck", "false"); - shouldBe("target.getAttribute('spellcheck')", "'false'"); - // Set using setAttribute(). - target.setAttribute("spellcheck", "true"); - shouldBe("target.spellcheck", "true"); - shouldBe("target.getAttribute('spellcheck')", "'true'"); - - // Set using setAttribute(), valid but non canonical value. - target.spellcheck = false; // clear at first - target.setAttribute("spellcheck", "TRUE"); - shouldBe("target.spellcheck", "true"); - shouldBe("target.getAttribute('spellcheck')", "'TRUE'"); - // Set using setAttribute(), invalid value. - target.spellcheck = false; // clear at first - target.setAttribute("spellcheck", "INVALID"); - shouldBe("target.spellcheck", "true"); - shouldBe("target.getAttribute('spellcheck')", "'INVALID'"); - - parent.removeChild(target); -} - -testFor(undefined, true, undefined, true, null); -testFor(undefined, true, false, false, "false"); -testFor(undefined, true, true, true, "true"); -testFor(undefined, true, 0, false, "false"); // 0 will be coerced to false -testFor(undefined, true, 1, true, "true"); // 0 will be coerced to true -testFor(undefined, true, "invalid", true, "true"); // string will be coerced to true -testFor(undefined, true, "false", true, "true"); // ...even if the string is "false" (as Firefox does). - -testFor("true", true, undefined, true, "true"); -testFor("true", true, false, false, "false"); -testFor("true", true, true, true, "true"); -testFor("true", true, 0, false, "false"); -testFor("true", true, 1, true, "true"); -testFor("true", true, "invalid", true, "true"); -testFor("true", true, "false", true, "true"); - -testFor("false", false, undefined, false, "false"); -testFor("false", false, false, false, "false"); -testFor("false", false, true, true, "true"); -testFor("false", false, 0, false, "false"); -testFor("false", false, 1, true, "true"); -testFor("false", false, "invalid", true, "true"); -testFor("false", false, "false", true, "true"); - -// various initial values -testFor("", true, undefined, true, ""); -testFor("", true, 1, true, "true"); -testFor("TRUE", true, undefined, true, "TRUE"); -testFor("TRUE", true, 1, true, "true"); -testFor("FALSE", false, undefined, false, "FALSE"); -testFor("FALSE", false, 0, false, "false"); -testFor("invalid", true, undefined, true, "invalid"); -testFor("invalid", true, 1, true, "true"); -testFor("false ", true, undefined, true, "false "); -testFor("false ", true, 1, true, "true"); -testFor("false ", true, 0, false, "false"); -testFor("0", true, undefined, true, "0"); -testFor("0", true, 0, false, "false"); -testFor("1", true, undefined, true, "1"); -testFor("1", true, 0, false, "false"); - -testUsingSetAttributes();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck.html index dc79b13..9e2429a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck.html
@@ -4,6 +4,107 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/spellcheck.js"></script> +<script> +description('Tests the spellcheck attribute.'); + +var parent = document.createElement("div"); +document.body.appendChild(parent); + +function testFor(initialAttribute, initialExpectation, setValue, lastExpectation, lastAttributeExpectation) +{ + var target = document.createElement("span"); + parent.appendChild(target); + + window.target = target; + window.initialExpectation = initialExpectation; + window.lastExpectation = lastExpectation; + window.lastAttributeExpectation = lastAttributeExpectation; + + if (undefined !== initialAttribute) + target.setAttribute("spellcheck", initialAttribute); + shouldBe("target.spellcheck", "initialExpectation"); + + if (undefined !== setValue) + target.spellcheck = setValue; + shouldBe("target.spellcheck", "lastExpectation"); + shouldBe("target.getAttribute('spellcheck')", "lastAttributeExpectation"); + + parent.removeChild(target); +} + +function testUsingSetAttributes() +{ + var target = document.createElement("span"); + parent.appendChild(target); + window.target = target; + + shouldBe("target.spellcheck", "true"); + shouldBe("target.getAttribute('spellcheck')", "'true'"); + // Set using property. + target.spellcheck = false; + shouldBe("target.spellcheck", "false"); + shouldBe("target.getAttribute('spellcheck')", "'false'"); + // Set using setAttribute(). + target.setAttribute("spellcheck", "true"); + shouldBe("target.spellcheck", "true"); + shouldBe("target.getAttribute('spellcheck')", "'true'"); + + // Set using setAttribute(), valid but non canonical value. + target.spellcheck = false; // clear at first + target.setAttribute("spellcheck", "TRUE"); + shouldBe("target.spellcheck", "true"); + shouldBe("target.getAttribute('spellcheck')", "'TRUE'"); + // Set using setAttribute(), invalid value. + target.spellcheck = false; // clear at first + target.setAttribute("spellcheck", "INVALID"); + shouldBe("target.spellcheck", "true"); + shouldBe("target.getAttribute('spellcheck')", "'INVALID'"); + + parent.removeChild(target); +} + +testFor(undefined, true, undefined, true, null); +testFor(undefined, true, false, false, "false"); +testFor(undefined, true, true, true, "true"); +testFor(undefined, true, 0, false, "false"); // 0 will be coerced to false +testFor(undefined, true, 1, true, "true"); // 0 will be coerced to true +testFor(undefined, true, "invalid", true, "true"); // string will be coerced to true +testFor(undefined, true, "false", true, "true"); // ...even if the string is "false" (as Firefox does). + +testFor("true", true, undefined, true, "true"); +testFor("true", true, false, false, "false"); +testFor("true", true, true, true, "true"); +testFor("true", true, 0, false, "false"); +testFor("true", true, 1, true, "true"); +testFor("true", true, "invalid", true, "true"); +testFor("true", true, "false", true, "true"); + +testFor("false", false, undefined, false, "false"); +testFor("false", false, false, false, "false"); +testFor("false", false, true, true, "true"); +testFor("false", false, 0, false, "false"); +testFor("false", false, 1, true, "true"); +testFor("false", false, "invalid", true, "true"); +testFor("false", false, "false", true, "true"); + +// various initial values +testFor("", true, undefined, true, ""); +testFor("", true, 1, true, "true"); +testFor("TRUE", true, undefined, true, "TRUE"); +testFor("TRUE", true, 1, true, "true"); +testFor("FALSE", false, undefined, false, "FALSE"); +testFor("FALSE", false, 0, false, "false"); +testFor("invalid", true, undefined, true, "invalid"); +testFor("invalid", true, 1, true, "true"); +testFor("false ", true, undefined, true, "false "); +testFor("false ", true, 1, true, "true"); +testFor("false ", true, 0, false, "false"); +testFor("0", true, undefined, true, "0"); +testFor("0", true, 0, false, "false"); +testFor("1", true, undefined, true, "1"); +testFor("1", true, 0, false, "false"); + +testUsingSetAttributes(); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js deleted file mode 100644 index 076b80c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/script-tests/size-attribute.js +++ /dev/null
@@ -1,91 +0,0 @@ -description("HTMLFontElement size attribute test"); - -function fontSizeAttributeEffect(value) -{ - var element = document.createElement("font"); - element.setAttribute("size", value); - var outerElement = document.createElement("p"); - outerElement.setAttribute("style", "font-size: 100px"); - document.body.appendChild(outerElement); - outerElement.appendChild(element); - var computedStyle = getComputedStyle(element, ""); - var result = computedStyle.fontSize; - document.body.removeChild(outerElement); - return result === "100px" ? null : result; -} - -shouldBe('fontSizeAttributeEffect("")', 'null'); - -shouldBe('fontSizeAttributeEffect("1")', '"10px"'); -shouldBe('fontSizeAttributeEffect("2")', '"13px"'); -shouldBe('fontSizeAttributeEffect("3")', '"16px"'); -shouldBe('fontSizeAttributeEffect("4")', '"18px"'); -shouldBe('fontSizeAttributeEffect("5")', '"24px"'); -shouldBe('fontSizeAttributeEffect("6")', '"32px"'); -shouldBe('fontSizeAttributeEffect("7")', '"48px"'); - -shouldBe('fontSizeAttributeEffect("0")', '"10px"'); - -shouldBe('fontSizeAttributeEffect("-1")', '"13px"'); -shouldBe('fontSizeAttributeEffect("-2")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-3")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-4")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-5")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-6")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-7")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-8")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-9")', '"10px"'); -shouldBe('fontSizeAttributeEffect("-10")', '"10px"'); - -shouldBe('fontSizeAttributeEffect("x6")', 'null'); -shouldBe('fontSizeAttributeEffect(" 6")', '"32px"'); -shouldBe('fontSizeAttributeEffect("\\t6")', '"32px"'); -shouldBe('fontSizeAttributeEffect("\\r6")', '"32px"'); -shouldBe('fontSizeAttributeEffect("\\n6")', '"32px"'); -shouldBe('fontSizeAttributeEffect("\\u20086")', 'null'); - -shouldBe('fontSizeAttributeEffect("x-6")', 'null'); -shouldBe('fontSizeAttributeEffect(" -6")', '"10px"'); -shouldBe('fontSizeAttributeEffect("\\t-6")', '"10px"'); -shouldBe('fontSizeAttributeEffect("\\r-6")', '"10px"'); -shouldBe('fontSizeAttributeEffect("\\n-6")', '"10px"'); -shouldBe('fontSizeAttributeEffect("\\u2008-6")', 'null'); - -shouldBe('fontSizeAttributeEffect("x+6")', 'null'); -shouldBe('fontSizeAttributeEffect(" +6")', '"48px"'); -shouldBe('fontSizeAttributeEffect("\\t+6")', '"48px"'); -shouldBe('fontSizeAttributeEffect("\\r+6")', '"48px"'); -shouldBe('fontSizeAttributeEffect("\\n+6")', '"48px"'); -shouldBe('fontSizeAttributeEffect("\\u2008+6")', 'null'); - -shouldBe('fontSizeAttributeEffect("x+x6")', 'null'); -shouldBe('fontSizeAttributeEffect(" + 6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\t+\\t6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\r+\\r6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\n+\\n6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\u2008+\\u20086")', 'null'); - -shouldBe('fontSizeAttributeEffect("x-x6")', 'null'); -shouldBe('fontSizeAttributeEffect(" - 6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\t-\\t6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\r-\\r6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\n-\\n6")', 'null'); -shouldBe('fontSizeAttributeEffect("\\u2008-\\u20086")', 'null'); - -shouldBe('fontSizeAttributeEffect("8")', '"48px"'); -shouldBe('fontSizeAttributeEffect("9")', '"48px"'); -shouldBe('fontSizeAttributeEffect("10")', '"48px"'); -shouldBe('fontSizeAttributeEffect("100")', '"48px"'); -shouldBe('fontSizeAttributeEffect("1000")', '"48px"'); - -shouldBe('fontSizeAttributeEffect("1x")', '"10px"'); -shouldBe('fontSizeAttributeEffect("1.")', '"10px"'); -shouldBe('fontSizeAttributeEffect("1.9")', '"10px"'); -shouldBe('fontSizeAttributeEffect("2x")', '"13px"'); -shouldBe('fontSizeAttributeEffect("2.")', '"13px"'); -shouldBe('fontSizeAttributeEffect("2.9")', '"13px"'); - -shouldBe('fontSizeAttributeEffect("a")', 'null'); - -var arabicIndicDigitOne = String.fromCharCode(0x661); -shouldBe('fontSizeAttributeEffect(arabicIndicDigitOne)', 'null');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html index a08cff4..a3da4968 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute.html
@@ -4,6 +4,98 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/size-attribute.js"></script> +<script> +description("HTMLFontElement size attribute test"); + +function fontSizeAttributeEffect(value) +{ + var element = document.createElement("font"); + element.setAttribute("size", value); + var outerElement = document.createElement("p"); + outerElement.setAttribute("style", "font-size: 100px"); + document.body.appendChild(outerElement); + outerElement.appendChild(element); + var computedStyle = getComputedStyle(element, ""); + var result = computedStyle.fontSize; + document.body.removeChild(outerElement); + return result === "100px" ? null : result; +} + +shouldBe('fontSizeAttributeEffect("")', 'null'); + +shouldBe('fontSizeAttributeEffect("1")', '"10px"'); +shouldBe('fontSizeAttributeEffect("2")', '"13px"'); +shouldBe('fontSizeAttributeEffect("3")', '"16px"'); +shouldBe('fontSizeAttributeEffect("4")', '"18px"'); +shouldBe('fontSizeAttributeEffect("5")', '"24px"'); +shouldBe('fontSizeAttributeEffect("6")', '"32px"'); +shouldBe('fontSizeAttributeEffect("7")', '"48px"'); + +shouldBe('fontSizeAttributeEffect("0")', '"10px"'); + +shouldBe('fontSizeAttributeEffect("-1")', '"13px"'); +shouldBe('fontSizeAttributeEffect("-2")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-3")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-4")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-5")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-6")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-7")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-8")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-9")', '"10px"'); +shouldBe('fontSizeAttributeEffect("-10")', '"10px"'); + +shouldBe('fontSizeAttributeEffect("x6")', 'null'); +shouldBe('fontSizeAttributeEffect(" 6")', '"32px"'); +shouldBe('fontSizeAttributeEffect("\\t6")', '"32px"'); +shouldBe('fontSizeAttributeEffect("\\r6")', '"32px"'); +shouldBe('fontSizeAttributeEffect("\\n6")', '"32px"'); +shouldBe('fontSizeAttributeEffect("\\u20086")', 'null'); + +shouldBe('fontSizeAttributeEffect("x-6")', 'null'); +shouldBe('fontSizeAttributeEffect(" -6")', '"10px"'); +shouldBe('fontSizeAttributeEffect("\\t-6")', '"10px"'); +shouldBe('fontSizeAttributeEffect("\\r-6")', '"10px"'); +shouldBe('fontSizeAttributeEffect("\\n-6")', '"10px"'); +shouldBe('fontSizeAttributeEffect("\\u2008-6")', 'null'); + +shouldBe('fontSizeAttributeEffect("x+6")', 'null'); +shouldBe('fontSizeAttributeEffect(" +6")', '"48px"'); +shouldBe('fontSizeAttributeEffect("\\t+6")', '"48px"'); +shouldBe('fontSizeAttributeEffect("\\r+6")', '"48px"'); +shouldBe('fontSizeAttributeEffect("\\n+6")', '"48px"'); +shouldBe('fontSizeAttributeEffect("\\u2008+6")', 'null'); + +shouldBe('fontSizeAttributeEffect("x+x6")', 'null'); +shouldBe('fontSizeAttributeEffect(" + 6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\t+\\t6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\r+\\r6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\n+\\n6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\u2008+\\u20086")', 'null'); + +shouldBe('fontSizeAttributeEffect("x-x6")', 'null'); +shouldBe('fontSizeAttributeEffect(" - 6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\t-\\t6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\r-\\r6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\n-\\n6")', 'null'); +shouldBe('fontSizeAttributeEffect("\\u2008-\\u20086")', 'null'); + +shouldBe('fontSizeAttributeEffect("8")', '"48px"'); +shouldBe('fontSizeAttributeEffect("9")', '"48px"'); +shouldBe('fontSizeAttributeEffect("10")', '"48px"'); +shouldBe('fontSizeAttributeEffect("100")', '"48px"'); +shouldBe('fontSizeAttributeEffect("1000")', '"48px"'); + +shouldBe('fontSizeAttributeEffect("1x")', '"10px"'); +shouldBe('fontSizeAttributeEffect("1.")', '"10px"'); +shouldBe('fontSizeAttributeEffect("1.9")', '"10px"'); +shouldBe('fontSizeAttributeEffect("2x")', '"13px"'); +shouldBe('fontSizeAttributeEffect("2.")', '"13px"'); +shouldBe('fontSizeAttributeEffect("2.9")', '"13px"'); + +shouldBe('fontSizeAttributeEffect("a")', 'null'); + +var arabicIndicDigitOne = String.fromCharCode(0x661); +shouldBe('fontSizeAttributeEffect(arabicIndicDigitOne)', 'null'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html index 6315f32..81d76c21 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/elements-not-in-document.html
@@ -4,6 +4,42 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/elements-not-in-document.js"></script> +<script> +description('Test the elements collection when the form is not a descendant of the document. This test case failed in an early version of Acid3.'); + +var f = document.createElement('form'); +var i = document.createElement('input'); +i.name = 'first'; +i.type = 'text'; +i.value = 'test'; +f.appendChild(i); + +shouldBe("i.getAttribute('name')", "'first'"); +shouldBe("i.name", "'first'"); +shouldBe("i.getAttribute('type')", "'text'"); +shouldBe("i.type", "'text'"); +shouldBe("i.value", "'test'"); +shouldBe("f.elements.length", "1"); +shouldBe("f.elements[0]", "i"); +shouldBe("f.elements.first", "i"); + +f.elements.second; +i.name = 'second'; +i.type = 'password'; +i.value = 'TEST'; + +// This has to be the first expression tested, because reporting the result will fix the bug. +shouldBe("f.elements.second", "i"); + +shouldBe("i.getAttribute('name')", "'second'"); +shouldBe("i.name", "'second'"); +shouldBe("i.getAttribute('type')", "'password'"); +shouldBe("i.type", "'password'"); +shouldBe("i.value", "'TEST'"); +shouldBe("f.elements.length", "1"); +shouldBe("f.elements[0]", "i"); +shouldBe("f.elements.first", "undefined"); +shouldBe("f.elements.second", "i"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js deleted file mode 100644 index 9792fff..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/script-tests/elements-not-in-document.js +++ /dev/null
@@ -1,35 +0,0 @@ -description('Test the elements collection when the form is not a descendant of the document. This test case failed in an early version of Acid3.'); - -var f = document.createElement('form'); -var i = document.createElement('input'); -i.name = 'first'; -i.type = 'text'; -i.value = 'test'; -f.appendChild(i); - -shouldBe("i.getAttribute('name')", "'first'"); -shouldBe("i.name", "'first'"); -shouldBe("i.getAttribute('type')", "'text'"); -shouldBe("i.type", "'text'"); -shouldBe("i.value", "'test'"); -shouldBe("f.elements.length", "1"); -shouldBe("f.elements[0]", "i"); -shouldBe("f.elements.first", "i"); - -f.elements.second; -i.name = 'second'; -i.type = 'password'; -i.value = 'TEST'; - -// This has to be the first expression tested, because reporting the result will fix the bug. -shouldBe("f.elements.second", "i"); - -shouldBe("i.getAttribute('name')", "'second'"); -shouldBe("i.name", "'second'"); -shouldBe("i.getAttribute('type')", "'password'"); -shouldBe("i.type", "'password'"); -shouldBe("i.value", "'TEST'"); -shouldBe("f.elements.length", "1"); -shouldBe("f.elements[0]", "i"); -shouldBe("f.elements.first", "undefined"); -shouldBe("f.elements.second", "i");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute.html index 42e14e7..74e6a929 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute.html
@@ -10,6 +10,25 @@ <hr id="hrElement4" noshade> <hr id="hrElement5"> <hr id="hrElement6"> - <script src="script-tests/color-noshade-attribute.js"></script> + <script> +description("HTMLHeaderElement color and noshade attribute test"); + +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('border-color')","rgb(255, 0, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('background-color')","rgb(255, 0, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement2'),null).getPropertyValue('border-color')","rgb(0, 0, 255)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement2'),null).getPropertyValue('background-color')","rgb(0, 0, 255)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement3'),null).getPropertyValue('border-color')","rgb(0, 0, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement3'),null).getPropertyValue('background-color')","rgb(0, 0, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement4'),null).getPropertyValue('border-color')","rgb(128, 128, 128)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement4'),null).getPropertyValue('background-color')","rgb(128, 128, 128)"); +document.getElementById('hrElement5').setAttribute('color','yellow'); +document.getElementById('hrElement5').setAttribute('noshade', ''); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement5'),null).getPropertyValue('border-color')","rgb(255, 255, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement5'),null).getPropertyValue('background-color')","rgb(255, 255, 0)"); +document.getElementById('hrElement6').setAttribute('noshade', ''); +document.getElementById('hrElement6').setAttribute('color','green'); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement6'),null).getPropertyValue('border-color')","rgb(0, 128, 0)"); +shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement6'),null).getPropertyValue('background-color')","rgb(0, 128, 0)"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/script-tests/color-noshade-attribute.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/script-tests/color-noshade-attribute.js deleted file mode 100644 index 716ca15..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/script-tests/color-noshade-attribute.js +++ /dev/null
@@ -1,19 +0,0 @@ -description("HTMLHeaderElement color and noshade attribute test"); - -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('border-color')","rgb(255, 0, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('background-color')","rgb(255, 0, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement2'),null).getPropertyValue('border-color')","rgb(0, 0, 255)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement2'),null).getPropertyValue('background-color')","rgb(0, 0, 255)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement3'),null).getPropertyValue('border-color')","rgb(0, 0, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement3'),null).getPropertyValue('background-color')","rgb(0, 0, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement4'),null).getPropertyValue('border-color')","rgb(128, 128, 128)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement4'),null).getPropertyValue('background-color')","rgb(128, 128, 128)"); -document.getElementById('hrElement5').setAttribute('color','yellow'); -document.getElementById('hrElement5').setAttribute('noshade', ''); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement5'),null).getPropertyValue('border-color')","rgb(255, 255, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement5'),null).getPropertyValue('background-color')","rgb(255, 255, 0)"); -document.getElementById('hrElement6').setAttribute('noshade', ''); -document.getElementById('hrElement6').setAttribute('color','green'); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement6'),null).getPropertyValue('border-color')","rgb(0, 128, 0)"); -shouldBeEqualToString("window.getComputedStyle(document.getElementById('hrElement6'),null).getPropertyValue('background-color')","rgb(0, 128, 0)"); -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src.html index e3e232a..b8fe33b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src.html
@@ -4,6 +4,30 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/parse-src.js"></script> +<script> +description('Test that when using the JavaScript bindings to get the value of a URL attribute such \ + as \'src\', leading whitespace is ignored'); + +function testURL(attribute, url) +{ + img[attribute] = url; + return img[attribute]; +} + +var img = new Image(); +var url = "about:blank"; + +shouldBe('testURL("src", url)', 'url'); +shouldBe('testURL("src", "\\n" + url)', 'url'); +shouldBe('testURL("src", " " + url)', 'url'); + +shouldBe('testURL("lowsrc", url)', 'url'); +shouldBe('testURL("lowsrc", "\\n" + url)', 'url'); +shouldBe('testURL("lowsrc", " " + url)', 'url'); + +shouldBe('testURL("longDesc", url)', 'url'); +shouldBe('testURL("longDesc", "\\n" + url)', 'url'); +shouldBe('testURL("longDesc", " " + url)', 'url'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/parse-src.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/parse-src.js deleted file mode 100644 index 6b5f182..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/script-tests/parse-src.js +++ /dev/null
@@ -1,23 +0,0 @@ -description('Test that when using the JavaScript bindings to get the value of a URL attribute such \ - as \'src\', leading whitespace is ignored'); - -function testURL(attribute, url) -{ - img[attribute] = url; - return img[attribute]; -} - -var img = new Image(); -var url = "about:blank"; - -shouldBe('testURL("src", url)', 'url'); -shouldBe('testURL("src", "\\n" + url)', 'url'); -shouldBe('testURL("src", " " + url)', 'url'); - -shouldBe('testURL("lowsrc", url)', 'url'); -shouldBe('testURL("lowsrc", "\\n" + url)', 'url'); -shouldBe('testURL("lowsrc", " " + url)', 'url'); - -shouldBe('testURL("longDesc", url)', 'url'); -shouldBe('testURL("longDesc", "\\n" + url)', 'url'); -shouldBe('testURL("longDesc", " " + url)', 'url');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/checked-pseudo-selector.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/checked-pseudo-selector.html index 86592540..8e4cdceb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/checked-pseudo-selector.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/checked-pseudo-selector.html
@@ -4,6 +4,24 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/checked-pseudo-selector.js"></script> +<script> +var style = document.createElement('style'); +style.appendChild(document.createTextNode("input { color: green; }")); +style.appendChild(document.createTextNode("input:checked { color: red; }")); +document.documentElement.firstChild.appendChild(style); + +var input1 = document.createElement('input'); +input1.type = 'radio'; +document.body.appendChild(input1); +input1.checked = true; +input1.type = "text"; + +var view = document.defaultView; +shouldBeEqualToString("view.getComputedStyle(input1, '').getPropertyValue('color')", "rgb(0, 128, 0)"); +shouldBeTrue("input1.checked"); + +// cleanup +document.body.removeChild(input1); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/checked-pseudo-selector.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/checked-pseudo-selector.js deleted file mode 100644 index 49b77b1e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/checked-pseudo-selector.js +++ /dev/null
@@ -1,17 +0,0 @@ -var style = document.createElement('style'); -style.appendChild(document.createTextNode("input { color: green; }")); -style.appendChild(document.createTextNode("input:checked { color: red; }")); -document.documentElement.firstChild.appendChild(style); - -var input1 = document.createElement('input'); -input1.type = 'radio'; -document.body.appendChild(input1); -input1.checked = true; -input1.type = "text"; - -var view = document.defaultView; -shouldBeEqualToString("view.getComputedStyle(input1, '').getPropertyValue('color')", "rgb(0, 128, 0)"); -shouldBeTrue("input1.checked"); - -// cleanup -document.body.removeChild(input1);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/size-attribute.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/size-attribute.js deleted file mode 100644 index 83bc5c0..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/script-tests/size-attribute.js +++ /dev/null
@@ -1,40 +0,0 @@ -description("HTMLInputElement size attribute test"); - -function sizeAttributeEffect(value) -{ - var element = document.createElement("input"); - element.setAttribute("size", value); - return element.size; -} - -shouldBe('document.createElement("input").size', '20'); - -shouldBe('sizeAttributeEffect("")', '20'); - -shouldBe('sizeAttributeEffect("1")', '1'); -shouldBe('sizeAttributeEffect("2")', '2'); -shouldBe('sizeAttributeEffect("10")', '10'); - -shouldBe('sizeAttributeEffect("0")', '20'); - -shouldBe('sizeAttributeEffect("-1")', '20'); - -shouldBe('sizeAttributeEffect("1x")', '1'); -shouldBe('sizeAttributeEffect("1.")', '1'); -shouldBe('sizeAttributeEffect("1.9")', '1'); -shouldBe('sizeAttributeEffect("2x")', '2'); -shouldBe('sizeAttributeEffect("2.")', '2'); -shouldBe('sizeAttributeEffect("2.9")', '2'); - -shouldBe('sizeAttributeEffect("a")', '20'); -shouldBe('sizeAttributeEffect("\v7")', '20'); -shouldBe('sizeAttributeEffect(" 7")', '7'); - -var arabicIndicDigitOne = String.fromCharCode(0x661); -shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', '20'); -shouldBe('sizeAttributeEffect("2" + arabicIndicDigitOne)', '2'); - -shouldBe('sizeAttributeEffect("2147483647")', '2147483647'); -shouldBe('sizeAttributeEffect("2147483648")', '20'); -shouldBe('sizeAttributeEffect("4294967295")', '20'); -shouldBe('sizeAttributeEffect("4294967296")', '20');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html index a08cff4..b04c7ef 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLInputElement/size-attribute.html
@@ -4,6 +4,47 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/size-attribute.js"></script> +<script> +description("HTMLInputElement size attribute test"); + +function sizeAttributeEffect(value) +{ + var element = document.createElement("input"); + element.setAttribute("size", value); + return element.size; +} + +shouldBe('document.createElement("input").size', '20'); + +shouldBe('sizeAttributeEffect("")', '20'); + +shouldBe('sizeAttributeEffect("1")', '1'); +shouldBe('sizeAttributeEffect("2")', '2'); +shouldBe('sizeAttributeEffect("10")', '10'); + +shouldBe('sizeAttributeEffect("0")', '20'); + +shouldBe('sizeAttributeEffect("-1")', '20'); + +shouldBe('sizeAttributeEffect("1x")', '1'); +shouldBe('sizeAttributeEffect("1.")', '1'); +shouldBe('sizeAttributeEffect("1.9")', '1'); +shouldBe('sizeAttributeEffect("2x")', '2'); +shouldBe('sizeAttributeEffect("2.")', '2'); +shouldBe('sizeAttributeEffect("2.9")', '2'); + +shouldBe('sizeAttributeEffect("a")', '20'); +shouldBe('sizeAttributeEffect("\v7")', '20'); +shouldBe('sizeAttributeEffect(" 7")', '7'); + +var arabicIndicDigitOne = String.fromCharCode(0x661); +shouldBe('sizeAttributeEffect(arabicIndicDigitOne)', '20'); +shouldBe('sizeAttributeEffect("2" + arabicIndicDigitOne)', '2'); + +shouldBe('sizeAttributeEffect("2147483647")', '2147483647'); +shouldBe('sizeAttributeEffect("2147483648")', '20'); +shouldBe('sizeAttributeEffect("4294967295")', '20'); +shouldBe('sizeAttributeEffect("4294967296")', '20'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain.html index 1506f1a..6a885009 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain.html
@@ -4,6 +4,22 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/prototype-chain.js"></script> +<script> +description("HTMLIsIndexElement should inherit directly from HTMLElement and be an HTMLUnknownElement"); + +var isIndex = document.createElement("isindex"); + +shouldBe("isIndex.__proto__", "HTMLUnknownElement.prototype"); +shouldBe("isIndex.__proto__.__proto__", "HTMLElement.prototype"); + +shouldBeUndefined("isIndex.prompt"); +shouldBeUndefined("isIndex.form"); + +shouldBeUndefined("isIndex.defaultValue"); +shouldBeUndefined("isIndex.disabled"); +shouldBeUndefined("isIndex.multiple"); +shouldBeUndefined("isIndex.alt"); +shouldBeUndefined("isIndex.accept"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/script-tests/prototype-chain.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/script-tests/prototype-chain.js deleted file mode 100644 index 9b2fe58..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/script-tests/prototype-chain.js +++ /dev/null
@@ -1,15 +0,0 @@ -description("HTMLIsIndexElement should inherit directly from HTMLElement and be an HTMLUnknownElement"); - -var isIndex = document.createElement("isindex"); - -shouldBe("isIndex.__proto__", "HTMLUnknownElement.prototype"); -shouldBe("isIndex.__proto__.__proto__", "HTMLElement.prototype"); - -shouldBeUndefined("isIndex.prompt"); -shouldBeUndefined("isIndex.form"); - -shouldBeUndefined("isIndex.defaultValue"); -shouldBeUndefined("isIndex.disabled"); -shouldBeUndefined("isIndex.multiple"); -shouldBeUndefined("isIndex.alt"); -shouldBeUndefined("isIndex.accept");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/label-control.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/label-control.html index fb46644..97a4d94 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/label-control.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/label-control.html
@@ -4,6 +4,70 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/label-control.js"></script> +<script> +description('Test that label.control references the correct form control, or null if there is no associated control.'); + +debug("Find a control that is the first descendent in a label"); +document.write("<label id='test1'><input id='inputId1'></label>"); +shouldBe("document.getElementById('test1').control.id", "'inputId1'"); + +debug("Find a control based on a label with valid 'for' attribute"); +document.write("<label id='test2' for='inputId2'></label><input id='inputId2' type='number'>"); +shouldBe("document.getElementById('test2').htmlFor", "'inputId2'"); +shouldBe("document.getElementById('test2').control.type", "'number'"); + +debug("Find a control in p element in label"); +document.write("<label id='test3'><p><input id='inputId3' type='date'></p></label>"); +shouldBe("document.getElementById('test3').control.id", "'inputId3'"); + +debug("Find a control in fieldset in label."); +debug("Note that filedset is a form control that is not labelable."); +document.write("<label id='test4'><fieldset><input id='inputId4'></fieldset></label>"); +shouldBe("document.getElementById('test4').control.id", "'inputId4'"); + +debug("Find a control in legend in label."); +debug("Note that legend is a form control that is not labelable."); +document.write("<label id='test5'><legend><input id='inputId5'></legend></label>"); +shouldBe("document.getElementById('test5').control.id", "'inputId5'"); + +debug("Find a control in optgroup in label."); +debug("Note that optgroup is a form control that is not labelable."); +document.write("<label id='test6'><optgroup><input id='inputId6'></optgroup></label>"); +shouldBe("document.getElementById('test6').control.id", "'inputId6'"); + +debug("Find a control in option in label."); +debug("Note that option is a form control that is not labelable."); +document.write("<label id='test7'><option><input id='inputId7'></option></label>"); +shouldBe("document.getElementById('test7').control.id", "'inputId7'"); + +debug("Test label with 'for' attribute which is not a valid element id"); +document.write("<label for='foo' id='test8'><input id='inputId8'></label>"); +shouldBe("document.getElementById('test8').control", "null"); + +debug("Test label with 'for' attribute which is not a form control"); +document.write("<label for='divId' id='test9'><input id='inputId9'></label><div id='divId'></div>"); +shouldBe("document.getElementById('test9').htmlFor", "'divId'"); +shouldBe("document.getElementById('test9').control", "null"); + +debug("Test label with 'for' attribute which is not a labelable form control - fieldset"); +document.write("<label for='fsId' id='test10'><input id='inputId10'></label><fieldset id='fsId'></fieldset>"); +shouldBe("document.getElementById('test10').htmlFor", "'fsId'"); +shouldBe("document.getElementById('test10').control", "null"); + +debug("Test label with 'for' attribute which is not a labelable form control - legend"); +document.write("<label for='legendId' id='test11'><input id='inputId11'></label><legend id='legendId'></legend>"); +shouldBe("document.getElementById('test11').htmlFor", "'legendId'"); +shouldBe("document.getElementById('test11').control", "null"); + +debug("Test label with 'for' attribute which is not a labelable form control - optgroup"); +document.write("<label for='optgroupId' id='test12'><input id='inputId12'></label><optgroup id='optgroupId'></optgroup>"); +shouldBe("document.getElementById('test12').htmlFor", "'optgroupId'"); +shouldBe("document.getElementById('test12').control", "null"); + +debug("Test label with 'for' attribute which is not a labelable form control - option"); +document.write("<label for='optionId' id='test13'><input id='inputId13'></label><option id='optionId'></option>"); +shouldBe("document.getElementById('test13').htmlFor", "'optionId'"); +shouldBe("document.getElementById('test13').control", "null"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js deleted file mode 100644 index f47a051..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLabelElement/script-tests/label-control.js +++ /dev/null
@@ -1,63 +0,0 @@ -description('Test that label.control references the correct form control, or null if there is no associated control.'); - -debug("Find a control that is the first descendent in a label"); -document.write("<label id='test1'><input id='inputId1'></label>"); -shouldBe("document.getElementById('test1').control.id", "'inputId1'"); - -debug("Find a control based on a label with valid 'for' attribute"); -document.write("<label id='test2' for='inputId2'></label><input id='inputId2' type='number'>"); -shouldBe("document.getElementById('test2').htmlFor", "'inputId2'"); -shouldBe("document.getElementById('test2').control.type", "'number'"); - -debug("Find a control in p element in label"); -document.write("<label id='test3'><p><input id='inputId3' type='date'></p></label>"); -shouldBe("document.getElementById('test3').control.id", "'inputId3'"); - -debug("Find a control in fieldset in label."); -debug("Note that filedset is a form control that is not labelable."); -document.write("<label id='test4'><fieldset><input id='inputId4'></fieldset></label>"); -shouldBe("document.getElementById('test4').control.id", "'inputId4'"); - -debug("Find a control in legend in label."); -debug("Note that legend is a form control that is not labelable."); -document.write("<label id='test5'><legend><input id='inputId5'></legend></label>"); -shouldBe("document.getElementById('test5').control.id", "'inputId5'"); - -debug("Find a control in optgroup in label."); -debug("Note that optgroup is a form control that is not labelable."); -document.write("<label id='test6'><optgroup><input id='inputId6'></optgroup></label>"); -shouldBe("document.getElementById('test6').control.id", "'inputId6'"); - -debug("Find a control in option in label."); -debug("Note that option is a form control that is not labelable."); -document.write("<label id='test7'><option><input id='inputId7'></option></label>"); -shouldBe("document.getElementById('test7').control.id", "'inputId7'"); - -debug("Test label with 'for' attribute which is not a valid element id"); -document.write("<label for='foo' id='test8'><input id='inputId8'></label>"); -shouldBe("document.getElementById('test8').control", "null"); - -debug("Test label with 'for' attribute which is not a form control"); -document.write("<label for='divId' id='test9'><input id='inputId9'></label><div id='divId'></div>"); -shouldBe("document.getElementById('test9').htmlFor", "'divId'"); -shouldBe("document.getElementById('test9').control", "null"); - -debug("Test label with 'for' attribute which is not a labelable form control - fieldset"); -document.write("<label for='fsId' id='test10'><input id='inputId10'></label><fieldset id='fsId'></fieldset>"); -shouldBe("document.getElementById('test10').htmlFor", "'fsId'"); -shouldBe("document.getElementById('test10').control", "null"); - -debug("Test label with 'for' attribute which is not a labelable form control - legend"); -document.write("<label for='legendId' id='test11'><input id='inputId11'></label><legend id='legendId'></legend>"); -shouldBe("document.getElementById('test11').htmlFor", "'legendId'"); -shouldBe("document.getElementById('test11').control", "null"); - -debug("Test label with 'for' attribute which is not a labelable form control - optgroup"); -document.write("<label for='optgroupId' id='test12'><input id='inputId12'></label><optgroup id='optgroupId'></optgroup>"); -shouldBe("document.getElementById('test12').htmlFor", "'optgroupId'"); -shouldBe("document.getElementById('test12').control", "null"); - -debug("Test label with 'for' attribute which is not a labelable form control - option"); -document.write("<label for='optionId' id='test13'><input id='inputId13'></label><option id='optionId'></option>"); -shouldBe("document.getElementById('test13').htmlFor", "'optionId'"); -shouldBe("document.getElementById('test13').control", "null");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js deleted file mode 100644 index 33e6ef2..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js +++ /dev/null
@@ -1,127 +0,0 @@ -description('Test setting valid and invalid properties of HTMLMeterElement.'); - -var m = document.createElement('meter'); - -debug("Test values before properties were set"); -shouldBe("m.min", "0"); -shouldBe("m.value", "0"); -shouldBe("m.max", "1"); -shouldBe("m.low", "0"); -shouldBe("m.high", "1"); -shouldBe("m.optimum", "0.5"); - -debug("Set valid values"); -m.min = "-10"; -m.value = 7e1; -m.max = "1e2"; -m.low = "10.1"; -m.high = "99.5"; -m.optimum = "70"; -shouldBe("m.min", "-10"); -shouldBe("m.value", "70"); -shouldBe("m.max", "100"); -shouldBe("m.low", "10.1"); -shouldBe("m.high", "99.5"); -shouldBe("m.optimum", "70"); - -debug("Set attributes to improper values - 1"); -m.min = -10; -m.value = 200; -m.max = 100.0; -m.low = 200; -m.high = -50; -m.optimum = null; -shouldBe("m.min", "-10"); -shouldBe("m.value", "100"); -shouldBe("m.max", "100"); -shouldBe("m.low", "100"); -shouldBe("m.high", "100"); -shouldBe("m.optimum", "0"); - -debug("Set attributes to improper values - 2"); -m.min = 200.0; -m.value = -200.0; -m.max = 0; -m.low = null; -shouldBe("m.min", "200.0"); -shouldBe("m.value", "200.0"); -shouldBe("m.max", "200.0"); -shouldBe("m.low", "200.0"); - -debug("Set attributes to improper values - 3"); -m.min = 100.0; -m.value = 200.0; -m.max = 50; -m.low = 10; -m.high = 15e1; -m.optimum = 12.5; -shouldBe("m.min", "100.0"); -shouldBe("m.value", "100.0"); -shouldBe("m.max", "100.0"); -shouldBe("m.low", "100.0"); -shouldBe("m.high", "100.0"); -shouldBe("m.optimum", "100.0"); - -debug("Set attributes to improper values - 4"); -m.min = 0.0; -m.value = 250.0; -m.max = 200; -m.low = -10; -m.high = 15e2; -m.optimum = 12.5; -shouldBe("m.min", "0.0"); -shouldBe("m.value", "200.0"); -shouldBe("m.max", "200.0"); -shouldBe("m.low", "0.0"); -shouldBe("m.high", "200.0"); -shouldBe("m.optimum", "12.5"); - -debug("Set value to invalid value"); -shouldThrow('m.value = "value";'); - -debug("Set min to NaN"); -shouldThrow('m.min = NaN;'); - -debug("Set max to Infinity"); -shouldThrow('m.max = Infinity;'); - -debug("Set low to invalid value"); -shouldThrow('m.low = "low";'); - -debug("Set high to NaN"); -shouldThrow('m.high = NaN;'); - -debug("Set optimum to Infinity"); -shouldThrow('m.optimum = Infinity;'); - -debug("Set attributes to valid numbers"); -m.setAttribute("min", 0); -m.setAttribute("value", 5); -m.setAttribute("max", 10); -shouldBe("m.value", "5"); -shouldBe("m.max", "10"); -shouldBe("parseInt(m.getAttribute('value'))", "5"); -shouldBe("parseInt(m.getAttribute('max'))", "10"); - -debug("Set attributes to invalid values"); -m.setAttribute("value", "ABC"); -m.setAttribute("max", "#"); -shouldBe("m.value", "0"); -shouldBe("m.max", "1"); -shouldBe("m.getAttribute('value')", "'ABC'"); -shouldBe("m.getAttribute('max')", "'#'"); - -debug("Set attributes to numbers with leading spaces"); -m.setAttribute("value", " 5"); -m.setAttribute("min", " 5"); -m.setAttribute("max", " 5"); -m.setAttribute("low", " 5"); -m.setAttribute("high", " 5"); -m.setAttribute("optimum", " 5"); -shouldBe("m.value", "0"); -shouldBe("m.min", "0"); -shouldBe("m.max", "1"); -shouldBe("m.low", "0"); -shouldBe("m.high", "1"); -shouldBe("m.optimum", "0.5"); -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties.html index a9e3ca1..2bbdbb54 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties.html
@@ -4,6 +4,134 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-meter-properties.js"></script> +<script> +description('Test setting valid and invalid properties of HTMLMeterElement.'); + +var m = document.createElement('meter'); + +debug("Test values before properties were set"); +shouldBe("m.min", "0"); +shouldBe("m.value", "0"); +shouldBe("m.max", "1"); +shouldBe("m.low", "0"); +shouldBe("m.high", "1"); +shouldBe("m.optimum", "0.5"); + +debug("Set valid values"); +m.min = "-10"; +m.value = 7e1; +m.max = "1e2"; +m.low = "10.1"; +m.high = "99.5"; +m.optimum = "70"; +shouldBe("m.min", "-10"); +shouldBe("m.value", "70"); +shouldBe("m.max", "100"); +shouldBe("m.low", "10.1"); +shouldBe("m.high", "99.5"); +shouldBe("m.optimum", "70"); + +debug("Set attributes to improper values - 1"); +m.min = -10; +m.value = 200; +m.max = 100.0; +m.low = 200; +m.high = -50; +m.optimum = null; +shouldBe("m.min", "-10"); +shouldBe("m.value", "100"); +shouldBe("m.max", "100"); +shouldBe("m.low", "100"); +shouldBe("m.high", "100"); +shouldBe("m.optimum", "0"); + +debug("Set attributes to improper values - 2"); +m.min = 200.0; +m.value = -200.0; +m.max = 0; +m.low = null; +shouldBe("m.min", "200.0"); +shouldBe("m.value", "200.0"); +shouldBe("m.max", "200.0"); +shouldBe("m.low", "200.0"); + +debug("Set attributes to improper values - 3"); +m.min = 100.0; +m.value = 200.0; +m.max = 50; +m.low = 10; +m.high = 15e1; +m.optimum = 12.5; +shouldBe("m.min", "100.0"); +shouldBe("m.value", "100.0"); +shouldBe("m.max", "100.0"); +shouldBe("m.low", "100.0"); +shouldBe("m.high", "100.0"); +shouldBe("m.optimum", "100.0"); + +debug("Set attributes to improper values - 4"); +m.min = 0.0; +m.value = 250.0; +m.max = 200; +m.low = -10; +m.high = 15e2; +m.optimum = 12.5; +shouldBe("m.min", "0.0"); +shouldBe("m.value", "200.0"); +shouldBe("m.max", "200.0"); +shouldBe("m.low", "0.0"); +shouldBe("m.high", "200.0"); +shouldBe("m.optimum", "12.5"); + +debug("Set value to invalid value"); +shouldThrow('m.value = "value";'); + +debug("Set min to NaN"); +shouldThrow('m.min = NaN;'); + +debug("Set max to Infinity"); +shouldThrow('m.max = Infinity;'); + +debug("Set low to invalid value"); +shouldThrow('m.low = "low";'); + +debug("Set high to NaN"); +shouldThrow('m.high = NaN;'); + +debug("Set optimum to Infinity"); +shouldThrow('m.optimum = Infinity;'); + +debug("Set attributes to valid numbers"); +m.setAttribute("min", 0); +m.setAttribute("value", 5); +m.setAttribute("max", 10); +shouldBe("m.value", "5"); +shouldBe("m.max", "10"); +shouldBe("parseInt(m.getAttribute('value'))", "5"); +shouldBe("parseInt(m.getAttribute('max'))", "10"); + +debug("Set attributes to invalid values"); +m.setAttribute("value", "ABC"); +m.setAttribute("max", "#"); +shouldBe("m.value", "0"); +shouldBe("m.max", "1"); +shouldBe("m.getAttribute('value')", "'ABC'"); +shouldBe("m.getAttribute('max')", "'#'"); + +debug("Set attributes to numbers with leading spaces"); +m.setAttribute("value", " 5"); +m.setAttribute("min", " 5"); +m.setAttribute("max", " 5"); +m.setAttribute("low", " 5"); +m.setAttribute("high", " 5"); +m.setAttribute("optimum", " 5"); +shouldBe("m.value", "0"); +shouldBe("m.min", "0"); +shouldBe("m.max", "1"); +shouldBe("m.low", "0"); +shouldBe("m.high", "1"); +shouldBe("m.optimum", "0.5"); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/dom-token-list.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/dom-token-list.html index d433ea9..8b88878b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/dom-token-list.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/dom-token-list.html
@@ -4,6 +4,262 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/dom-token-list.js"></script> +<script> +// This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js +description('Tests the htmlFor attribute and its properties.'); + +var container = document.createElement('div'); +document.body.appendChild(container); + +var element; + +function createElement(tokenList) +{ + container.innerHTML = '<output for="' + tokenList + '"></output>'; + element = container.lastChild; +} + +debug('- Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/'); + +// HTMLOutputElement::htmlFor setter is forwarding assignment to DOMTokenList.value attribute. +createElement('x'); +shouldBeEqualToString('element.htmlFor.value', 'x'); +shouldBeEqualToString('String(element.htmlFor)', 'x'); +element.htmlFor = 'y'; +shouldBeEqualToString('element.htmlFor.value', 'y'); +shouldBeEqualToString('String(element.htmlFor)', 'y'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm +createElement(''); +shouldEvaluateTo('element.htmlFor.length', 0); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/002.htm +createElement('x'); +shouldEvaluateTo('element.htmlFor.length', 1); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/003.htm +createElement('x x'); +shouldEvaluateTo('element.htmlFor.length', 2); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/004.htm +createElement('x y'); +shouldEvaluateTo('element.htmlFor.length', 2); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/005.htm +createElement(''); +element.htmlFor.add('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'x'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/006.htm +createElement('x'); +element.htmlFor.add('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'x'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/007.htm +createElement('x x'); +element.htmlFor.add('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'x x'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/008.htm +createElement('y'); +element.htmlFor.add('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'y x'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/009.htm +createElement(''); +element.htmlFor.remove('x'); +shouldBeEqualToString('element.htmlFor.toString()', ''); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/010.htm +createElement('x'); +element.htmlFor.remove('x'); +shouldBeEqualToString('element.htmlFor.toString()', ''); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm +createElement(' y x y '); +element.htmlFor.remove('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'y y'); + +// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm +createElement(' x y x '); +element.htmlFor.remove('x'); +shouldBeEqualToString('element.htmlFor.toString()', 'y'); + + +debug('- Ensure that we can handle empty form attribute correctly'); +element = document.createElement('output'); +var list = element.htmlFor; +list.toggle('x'); +shouldBeEqualToString('list.value', 'x'); + +list.toggle('x'); +shouldBeEqualToString('list.value', ''); + +element = document.createElement('output'); +shouldBeFalse('element.htmlFor.contains(\'x\')'); +shouldBeUndefined('element.htmlFor[1]'); +element.htmlFor.remove('x'); +element.htmlFor.add('x') +shouldBeTrue('element.htmlFor.contains(\'x\')'); +shouldBeUndefined('element.htmlFor[1]'); + +debug('- Testing add in presence of trailing white spaces.'); + +createElement('x '); +element.htmlFor.add('y'); +shouldBeEqualToString('element.htmlFor.toString()', 'x y'); + +createElement('x\t'); +element.htmlFor.add('y'); +shouldBeEqualToString('element.htmlFor.toString()', 'x\ty'); + +createElement(' '); +element.htmlFor.add('y'); +shouldBeEqualToString('element.htmlFor.toString()', ' y'); + + +debug('- Test invalid tokens'); + +// Testing exception due to invalid token + +// shouldThrow from js-test.js is not sufficient. +function shouldThrowDOMException(f, ec) +{ + try { + f(); + testFailed('Expected an exception'); + } catch (ex) { + if (!(ex instanceof DOMException)) { + testFailed('Exception is not an instance of DOMException, found: ' + + Object.toString.call(ex)); + return; + } + if (ec !== ex.code) { + testFailed('Wrong exception code: ' + ex.code); + return; + } + } + var formattedFunction = String(f).replace(/^function.+\{\s*/m, ''). + replace(/;?\s+\}/m, ''); + testPassed(formattedFunction + ' threw expected DOMException with code ' + ec); +} + +createElement('x'); +shouldThrowDOMException(function() { + element.htmlFor.contains(''); +}, DOMException.SYNTAX_ERR); + +createElement('x y'); +shouldThrowDOMException(function() { + element.htmlFor.contains('x y'); +}, DOMException.INVALID_CHARACTER_ERR); + +createElement(''); +shouldThrowDOMException(function() { + element.htmlFor.add(''); +}, DOMException.SYNTAX_ERR); + +createElement(''); +shouldThrowDOMException(function() { + element.htmlFor.add('x y'); +}, DOMException.INVALID_CHARACTER_ERR); + +createElement(''); +shouldThrowDOMException(function() { + element.htmlFor.remove(''); +}, DOMException.SYNTAX_ERR); + +createElement(''); +shouldThrowDOMException(function() { + element.htmlFor.remove('x y'); +}, DOMException.INVALID_CHARACTER_ERR); + +createElement(''); +shouldThrowDOMException(function() { + element.htmlFor.toggle(''); +}, DOMException.SYNTAX_ERR); + +createElement('x y'); +shouldThrowDOMException(function() { + element.htmlFor.toggle('x y'); +}, DOMException.INVALID_CHARACTER_ERR); + + +debug('- Indexing'); + +createElement('x'); +shouldBeEqualToString('element.htmlFor[0]', 'x'); +shouldBeEqualToString('element.htmlFor.item(0)', 'x'); + +createElement('x x'); +shouldBeEqualToString('element.htmlFor[1]', 'x'); +shouldBeEqualToString('element.htmlFor.item(1)', 'x'); + +createElement('x y'); +shouldBeEqualToString('element.htmlFor[1]', 'y'); +shouldBeEqualToString('element.htmlFor.item(1)', 'y'); + +createElement(''); +shouldBeUndefined('element.htmlFor[0]'); +shouldBeNull('element.htmlFor.item(0)'); + +createElement('x y z'); +shouldBeUndefined('element.htmlFor[4]'); +shouldBeNull('element.htmlFor.item(4)'); +shouldBeUndefined('element.htmlFor[-1]'); // Not a valid index so should not trigger item(). +shouldBeNull('element.htmlFor.item(-1)'); + +debug('- Test case since DOMTokenList is case sensitive'); + +createElement('x'); +shouldBeTrue('element.htmlFor.contains(\'x\')'); +shouldBeFalse('element.htmlFor.contains(\'X\')'); +shouldBeEqualToString('element.htmlFor[0]', 'x'); + +createElement('X'); +shouldBeTrue('element.htmlFor.contains(\'X\')'); +shouldBeFalse('element.htmlFor.contains(\'x\')'); +shouldBeEqualToString('element.htmlFor[0]', 'X'); + + +debug('- Testing whitespace'); +// U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), +// U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR) + +createElement('x\u0020y'); +shouldEvaluateTo('element.htmlFor.length', 2); + +createElement('x\u0009y'); +shouldEvaluateTo('element.htmlFor.length', 2); + +createElement('x\u000Ay'); +shouldEvaluateTo('element.htmlFor.length', 2); + +createElement('x\u000Cy'); +shouldEvaluateTo('element.htmlFor.length', 2); + +createElement('x\u000Dy'); +shouldEvaluateTo('element.htmlFor.length', 2); + + +debug('- DOMTokenList presence and type'); + + +// Safari returns object +// Firefox returns object +// IE8 returns object +// Chrome returns function +// assertEquals('object', typeof DOMTokenList); +shouldBeTrue('\'undefined\' != typeof DOMTokenList'); + +shouldBeEqualToString('typeof DOMTokenList.prototype', 'object'); + +createElement('x'); +shouldBeEqualToString('typeof element.htmlFor', 'object'); + +shouldEvaluateTo('element.htmlFor.constructor', 'DOMTokenList'); + +shouldBeTrue('element.htmlFor === element.htmlFor'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-reset-event.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-reset-event.html index b74a048..51d4943 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-reset-event.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-reset-event.html
@@ -1,9 +1,37 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<!DOCTYPE html> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/htmloutputelement-reset-event.js"></script> +<script> +description('A Test for sending a reset event to output elements.'); + +var form = document.createElement('form'); +var output = document.createElement('output'); +output.defaultValue = 'defaultValue'; +form.appendChild(output); + +debug('- Sets the value attribute of the output element.'); +output.value = 'aValue'; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'aValue'); +shouldBeEqualToString('output.innerText', 'aValue'); +shouldBeEqualToString('output.innerHTML', 'aValue'); + +debug('- Sends a reset event to reset the value to the default value.'); +form.reset(); +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'defaultValue'); +shouldBeEqualToString('output.innerText', 'defaultValue'); +shouldBeEqualToString('output.innerHTML', 'defaultValue'); + +debug('- Ensures that the value mode flags is in mode "default".'); +output.defaultValue = 'another defaultValue'; +shouldBeEqualToString('output.defaultValue', 'another defaultValue'); +shouldBeEqualToString('output.value', 'another defaultValue'); +shouldBeEqualToString('output.innerText', 'another defaultValue'); +shouldBeEqualToString('output.innerHTML', 'another defaultValue'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity.html index 3f8a11a..63be7bd 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-validity.html
@@ -1,9 +1,35 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<!DOCTYPE html> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/htmloutputelement-validity.js"></script> +<script> +description('Tests for the validation APIs of output elements.'); + +var container; +var output; + +container = document.createElement('div'); +document.body.appendChild(container); + +debug('- Ensures whether the willValidate is defined and it always returns false.'); +container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; +output = document.getElementById('outputElement'); +shouldBe('typeof output.willValidate', '"boolean"'); +shouldBeFalse('output.willValidate'); +container.innerHTML = '<output id="outputElement">aValue</output>'; +output = document.getElementById('outputElement'); +shouldBeFalse('output.willValidate'); + +debug('- Ensures validity is always "valid" and validationMessage() always returns an empty string.'); +container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; +output = document.getElementById('outputElement'); +shouldBeEqualToString('output.validationMessage', ''); +shouldBeTrue('output.checkValidity()'); +output.setCustomValidity('This should not be affected.'); +shouldBeEqualToString('output.validationMessage', ''); +shouldBeTrue('output.checkValidity()'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value.html index ae30d56..7f6307c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value.html
@@ -1,9 +1,131 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<!DOCTYPE html> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/htmloutputelement-value.js"></script> +<script> +description('Tests for assigning the value attribute to output elements.'); + +var output; +var childNode; + +debug('- Sets the defaultValue attribute with the value mode flag is in mode "defalut".'); +output = document.createElement('output'); +output.defaultValue = "defaultValue"; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'defaultValue'); +shouldBeEqualToString('output.innerText', 'defaultValue'); +shouldBeEqualToString('output.innerHTML', 'defaultValue'); + +debug('- Sets the value attribute. This will change the value mode flag from "default" to "value".'); + +output.value = 'aValue'; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'aValue'); +shouldBeEqualToString('output.innerText', 'aValue'); +shouldBeEqualToString('output.innerHTML', 'aValue'); + +debug('- Sets the defaultValue attribute with the value mode flag is in mode "value".'); +output.defaultValue = 'another defaultValue'; +shouldBeEqualToString('output.defaultValue', 'another defaultValue'); +shouldBeEqualToString('output.value', 'aValue'); +shouldBeEqualToString('output.innerText', 'aValue'); +shouldBeEqualToString('output.innerHTML', 'aValue'); + +debug('- Ensures that setting text to the value attribute works as setTextContent().'); +output.value = '<strong>A <span style=\"color: red;\">strong</span> text</strong>'; +shouldBe('output.value', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); +shouldBe('output.innerText', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); +shouldBe('output.innerHTML', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); + +debug('- Sets the innerText attribute with the value mode flag is in mode "default".'); +output = document.createElement('output'); +output.innerText = 'text'; +shouldBeEqualToString('output.defaultValue', 'text'); +shouldBeEqualToString('output.value', 'text'); +shouldBeEqualToString('output.innerText', 'text'); +shouldBeEqualToString('output.innerHTML', 'text'); + +output.innerText = '<strong>strong</strong> text'; +shouldBeEqualToString('output.defaultValue', '<strong>strong</strong> text'); +shouldBeEqualToString('output.value', '<strong>strong</strong> text'); +shouldBeEqualToString('output.innerText', '<strong>strong</strong> text'); +shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); + +debug('- Sets the innerText attribute with the value mode flag is in mode "value".'); +output = document.createElement('output'); +output.value = 'aValue'; +output.defaultValue = 'defaultValue'; +output.innerText = 'text'; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'text'); +shouldBeEqualToString('output.innerText', 'text'); +shouldBeEqualToString('output.innerHTML', 'text'); + +debug('- Sets the innerHTML attribute with the value mode flag is in mode "default".'); +output = document.createElement('output'); +output.innerHTML = 'text'; +shouldBeEqualToString('output.defaultValue', 'text'); +shouldBeEqualToString('output.value', 'text'); +shouldBeEqualToString('output.innerText', 'text'); +shouldBeEqualToString('output.innerHTML', 'text'); + +output.innerHTML = '<strong>strong</strong> text'; +shouldBeEqualToString('output.defaultValue', 'strong text'); +shouldBeEqualToString('output.value', 'strong text'); +shouldBeEqualToString('output.innerText', 'strong text'); +shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); + +debug('- Sets the innerHTML attribute with the value mode flag is in mode "value".'); +output = document.createElement('output'); +output.value = 'aValue'; +output.defaultValue = 'defaultValue'; +output.innerHTML = 'text'; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'text'); +shouldBeEqualToString('output.innerText', 'text'); +shouldBeEqualToString('output.innerHTML', 'text'); + +output.innerHTML = '<strong>strong</strong> text'; +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'strong text'); +shouldBeEqualToString('output.innerText', 'strong text'); +shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); + +debug('- Appends a child node to the output element with the value mode flag is in mode "default".'); +output = document.createElement('output'); +childNode = document.createElement('span'); +childNode.innerText = 'childText'; +output.appendChild(childNode); +shouldBeEqualToString('output.defaultValue', 'childText'); +shouldBeEqualToString('output.value', 'childText'); +shouldBeEqualToString('output.innerText', 'childText'); +shouldBeEqualToString('output.innerHTML', '<span>childText</span>'); +debug('- Then removes the child node from the output element with the value mode flag is in mode "default".'); +output.removeChild(childNode); +shouldBeEqualToString('output.defaultValue', ''); +shouldBeEqualToString('output.value', ''); +shouldBeEqualToString('output.innerText', ''); +shouldBeEqualToString('output.innerHTML', ''); + +debug('- Appends a child node to the output element with the value mode flag is in mode "value".'); +output = document.createElement('output'); +output.value = 'aValue'; +output.defaultValue = 'defaultValue'; +childNode = document.createElement('span'); +childNode.innerText = ' and childText'; +output.appendChild(childNode); +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'aValue and childText'); +shouldBeEqualToString('output.innerText', 'aValue and childText'); +shouldBeEqualToString('output.innerHTML', 'aValue<span> and childText</span>'); +debug('- Then removes the child node from the output element with the value mode flag is in mode "default".'); +output.removeChild(childNode); +shouldBeEqualToString('output.defaultValue', 'defaultValue'); +shouldBeEqualToString('output.value', 'aValue'); +shouldBeEqualToString('output.innerText', 'aValue'); +shouldBeEqualToString('output.innerHTML', 'aValue'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-token-list.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-token-list.js deleted file mode 100644 index 64a1c58..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/dom-token-list.js +++ /dev/null
@@ -1,255 +0,0 @@ -// This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js -description('Tests the htmlFor attribute and its properties.'); - -var container = document.createElement('div'); -document.body.appendChild(container); - -var element; - -function createElement(tokenList) -{ - container.innerHTML = '<output for="' + tokenList + '"></output>'; - element = container.lastChild; -} - -debug('- Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/'); - -// HTMLOutputElement::htmlFor setter is forwarding assignment to DOMTokenList.value attribute. -createElement('x'); -shouldBeEqualToString('element.htmlFor.value', 'x'); -shouldBeEqualToString('String(element.htmlFor)', 'x'); -element.htmlFor = 'y'; -shouldBeEqualToString('element.htmlFor.value', 'y'); -shouldBeEqualToString('String(element.htmlFor)', 'y'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/001.htm -createElement(''); -shouldEvaluateTo('element.htmlFor.length', 0); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/002.htm -createElement('x'); -shouldEvaluateTo('element.htmlFor.length', 1); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/003.htm -createElement('x x'); -shouldEvaluateTo('element.htmlFor.length', 2); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/004.htm -createElement('x y'); -shouldEvaluateTo('element.htmlFor.length', 2); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/005.htm -createElement(''); -element.htmlFor.add('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'x'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/006.htm -createElement('x'); -element.htmlFor.add('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'x'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/007.htm -createElement('x x'); -element.htmlFor.add('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'x x'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/008.htm -createElement('y'); -element.htmlFor.add('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'y x'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/009.htm -createElement(''); -element.htmlFor.remove('x'); -shouldBeEqualToString('element.htmlFor.toString()', ''); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/010.htm -createElement('x'); -element.htmlFor.remove('x'); -shouldBeEqualToString('element.htmlFor.toString()', ''); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm -createElement(' y x y '); -element.htmlFor.remove('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'y y'); - -// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm -createElement(' x y x '); -element.htmlFor.remove('x'); -shouldBeEqualToString('element.htmlFor.toString()', 'y'); - - -debug('- Ensure that we can handle empty form attribute correctly'); -element = document.createElement('output'); -var list = element.htmlFor; -list.toggle('x'); -shouldBeEqualToString('list.value', 'x'); - -list.toggle('x'); -shouldBeEqualToString('list.value', ''); - -element = document.createElement('output'); -shouldBeFalse('element.htmlFor.contains(\'x\')'); -shouldBeUndefined('element.htmlFor[1]'); -element.htmlFor.remove('x'); -element.htmlFor.add('x') -shouldBeTrue('element.htmlFor.contains(\'x\')'); -shouldBeUndefined('element.htmlFor[1]'); - -debug('- Testing add in presence of trailing white spaces.'); - -createElement('x '); -element.htmlFor.add('y'); -shouldBeEqualToString('element.htmlFor.toString()', 'x y'); - -createElement('x\t'); -element.htmlFor.add('y'); -shouldBeEqualToString('element.htmlFor.toString()', 'x\ty'); - -createElement(' '); -element.htmlFor.add('y'); -shouldBeEqualToString('element.htmlFor.toString()', ' y'); - - -debug('- Test invalid tokens'); - -// Testing exception due to invalid token - -// shouldThrow from js-test.js is not sufficient. -function shouldThrowDOMException(f, ec) -{ - try { - f(); - testFailed('Expected an exception'); - } catch (ex) { - if (!(ex instanceof DOMException)) { - testFailed('Exception is not an instance of DOMException, found: ' + - Object.toString.call(ex)); - return; - } - if (ec !== ex.code) { - testFailed('Wrong exception code: ' + ex.code); - return; - } - } - var formattedFunction = String(f).replace(/^function.+\{\s*/m, ''). - replace(/;?\s+\}/m, ''); - testPassed(formattedFunction + ' threw expected DOMException with code ' + ec); -} - -createElement('x'); -shouldThrowDOMException(function() { - element.htmlFor.contains(''); -}, DOMException.SYNTAX_ERR); - -createElement('x y'); -shouldThrowDOMException(function() { - element.htmlFor.contains('x y'); -}, DOMException.INVALID_CHARACTER_ERR); - -createElement(''); -shouldThrowDOMException(function() { - element.htmlFor.add(''); -}, DOMException.SYNTAX_ERR); - -createElement(''); -shouldThrowDOMException(function() { - element.htmlFor.add('x y'); -}, DOMException.INVALID_CHARACTER_ERR); - -createElement(''); -shouldThrowDOMException(function() { - element.htmlFor.remove(''); -}, DOMException.SYNTAX_ERR); - -createElement(''); -shouldThrowDOMException(function() { - element.htmlFor.remove('x y'); -}, DOMException.INVALID_CHARACTER_ERR); - -createElement(''); -shouldThrowDOMException(function() { - element.htmlFor.toggle(''); -}, DOMException.SYNTAX_ERR); - -createElement('x y'); -shouldThrowDOMException(function() { - element.htmlFor.toggle('x y'); -}, DOMException.INVALID_CHARACTER_ERR); - - -debug('- Indexing'); - -createElement('x'); -shouldBeEqualToString('element.htmlFor[0]', 'x'); -shouldBeEqualToString('element.htmlFor.item(0)', 'x'); - -createElement('x x'); -shouldBeEqualToString('element.htmlFor[1]', 'x'); -shouldBeEqualToString('element.htmlFor.item(1)', 'x'); - -createElement('x y'); -shouldBeEqualToString('element.htmlFor[1]', 'y'); -shouldBeEqualToString('element.htmlFor.item(1)', 'y'); - -createElement(''); -shouldBeUndefined('element.htmlFor[0]'); -shouldBeNull('element.htmlFor.item(0)'); - -createElement('x y z'); -shouldBeUndefined('element.htmlFor[4]'); -shouldBeNull('element.htmlFor.item(4)'); -shouldBeUndefined('element.htmlFor[-1]'); // Not a valid index so should not trigger item(). -shouldBeNull('element.htmlFor.item(-1)'); - -debug('- Test case since DOMTokenList is case sensitive'); - -createElement('x'); -shouldBeTrue('element.htmlFor.contains(\'x\')'); -shouldBeFalse('element.htmlFor.contains(\'X\')'); -shouldBeEqualToString('element.htmlFor[0]', 'x'); - -createElement('X'); -shouldBeTrue('element.htmlFor.contains(\'X\')'); -shouldBeFalse('element.htmlFor.contains(\'x\')'); -shouldBeEqualToString('element.htmlFor[0]', 'X'); - - -debug('- Testing whitespace'); -// U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), -// U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR) - -createElement('x\u0020y'); -shouldEvaluateTo('element.htmlFor.length', 2); - -createElement('x\u0009y'); -shouldEvaluateTo('element.htmlFor.length', 2); - -createElement('x\u000Ay'); -shouldEvaluateTo('element.htmlFor.length', 2); - -createElement('x\u000Cy'); -shouldEvaluateTo('element.htmlFor.length', 2); - -createElement('x\u000Dy'); -shouldEvaluateTo('element.htmlFor.length', 2); - - -debug('- DOMTokenList presence and type'); - - -// Safari returns object -// Firefox returns object -// IE8 returns object -// Chrome returns function -// assertEquals('object', typeof DOMTokenList); -shouldBeTrue('\'undefined\' != typeof DOMTokenList'); - -shouldBeEqualToString('typeof DOMTokenList.prototype', 'object'); - -createElement('x'); -shouldBeEqualToString('typeof element.htmlFor', 'object'); - -shouldEvaluateTo('element.htmlFor.constructor', 'DOMTokenList'); - -shouldBeTrue('element.htmlFor === element.htmlFor');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-reset-event.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-reset-event.js deleted file mode 100644 index 4d62d92..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-reset-event.js +++ /dev/null
@@ -1,27 +0,0 @@ -description('A Test for sending a reset event to output elements.'); - -var form = document.createElement('form'); -var output = document.createElement('output'); -output.defaultValue = 'defaultValue'; -form.appendChild(output); - -debug('- Sets the value attribute of the output element.'); -output.value = 'aValue'; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'aValue'); -shouldBeEqualToString('output.innerText', 'aValue'); -shouldBeEqualToString('output.innerHTML', 'aValue'); - -debug('- Sends a reset event to reset the value to the default value.'); -form.reset(); -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'defaultValue'); -shouldBeEqualToString('output.innerText', 'defaultValue'); -shouldBeEqualToString('output.innerHTML', 'defaultValue'); - -debug('- Ensures that the value mode flags is in mode "default".'); -output.defaultValue = 'another defaultValue'; -shouldBeEqualToString('output.defaultValue', 'another defaultValue'); -shouldBeEqualToString('output.value', 'another defaultValue'); -shouldBeEqualToString('output.innerText', 'another defaultValue'); -shouldBeEqualToString('output.innerHTML', 'another defaultValue');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-validity.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-validity.js deleted file mode 100644 index 687bf551..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-validity.js +++ /dev/null
@@ -1,25 +0,0 @@ -description('Tests for the validation APIs of output elements.'); - -var container; -var output; - -container = document.createElement('div'); -document.body.appendChild(container); - -debug('- Ensures whether the willValidate is defined and it always returns false.'); -container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; -output = document.getElementById('outputElement'); -shouldBe('typeof output.willValidate', '"boolean"'); -shouldBeFalse('output.willValidate'); -container.innerHTML = '<output id="outputElement">aValue</output>'; -output = document.getElementById('outputElement'); -shouldBeFalse('output.willValidate'); - -debug('- Ensures validity is always "valid" and validationMessage() always returns an empty string.'); -container.innerHTML = '<form><output id="outputElement">aValue</output></form>'; -output = document.getElementById('outputElement'); -shouldBeEqualToString('output.validationMessage', ''); -shouldBeTrue('output.checkValidity()'); -output.setCustomValidity('This should not be affected.'); -shouldBeEqualToString('output.validationMessage', ''); -shouldBeTrue('output.checkValidity()');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-value.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-value.js deleted file mode 100644 index 14e5658c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/script-tests/htmloutputelement-value.js +++ /dev/null
@@ -1,121 +0,0 @@ -description('Tests for assigning the value attribute to output elements.'); - -var output; -var childNode; - -debug('- Sets the defaultValue attribute with the value mode flag is in mode "defalut".'); -output = document.createElement('output'); -output.defaultValue = "defaultValue"; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'defaultValue'); -shouldBeEqualToString('output.innerText', 'defaultValue'); -shouldBeEqualToString('output.innerHTML', 'defaultValue'); - -debug('- Sets the value attribute. This will change the value mode flag from "default" to "value".'); - -output.value = 'aValue'; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'aValue'); -shouldBeEqualToString('output.innerText', 'aValue'); -shouldBeEqualToString('output.innerHTML', 'aValue'); - -debug('- Sets the defaultValue attribute with the value mode flag is in mode "value".'); -output.defaultValue = 'another defaultValue'; -shouldBeEqualToString('output.defaultValue', 'another defaultValue'); -shouldBeEqualToString('output.value', 'aValue'); -shouldBeEqualToString('output.innerText', 'aValue'); -shouldBeEqualToString('output.innerHTML', 'aValue'); - -debug('- Ensures that setting text to the value attribute works as setTextContent().'); -output.value = '<strong>A <span style=\"color: red;\">strong</span> text</strong>'; -shouldBe('output.value', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); -shouldBe('output.innerText', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); -shouldBe('output.innerHTML', '\'<strong>A <span style="color: red;">strong</span> text</strong>\''); - -debug('- Sets the innerText attribute with the value mode flag is in mode "default".'); -output = document.createElement('output'); -output.innerText = 'text'; -shouldBeEqualToString('output.defaultValue', 'text'); -shouldBeEqualToString('output.value', 'text'); -shouldBeEqualToString('output.innerText', 'text'); -shouldBeEqualToString('output.innerHTML', 'text'); - -output.innerText = '<strong>strong</strong> text'; -shouldBeEqualToString('output.defaultValue', '<strong>strong</strong> text'); -shouldBeEqualToString('output.value', '<strong>strong</strong> text'); -shouldBeEqualToString('output.innerText', '<strong>strong</strong> text'); -shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); - -debug('- Sets the innerText attribute with the value mode flag is in mode "value".'); -output = document.createElement('output'); -output.value = 'aValue'; -output.defaultValue = 'defaultValue'; -output.innerText = 'text'; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'text'); -shouldBeEqualToString('output.innerText', 'text'); -shouldBeEqualToString('output.innerHTML', 'text'); - -debug('- Sets the innerHTML attribute with the value mode flag is in mode "default".'); -output = document.createElement('output'); -output.innerHTML = 'text'; -shouldBeEqualToString('output.defaultValue', 'text'); -shouldBeEqualToString('output.value', 'text'); -shouldBeEqualToString('output.innerText', 'text'); -shouldBeEqualToString('output.innerHTML', 'text'); - -output.innerHTML = '<strong>strong</strong> text'; -shouldBeEqualToString('output.defaultValue', 'strong text'); -shouldBeEqualToString('output.value', 'strong text'); -shouldBeEqualToString('output.innerText', 'strong text'); -shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); - -debug('- Sets the innerHTML attribute with the value mode flag is in mode "value".'); -output = document.createElement('output'); -output.value = 'aValue'; -output.defaultValue = 'defaultValue'; -output.innerHTML = 'text'; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'text'); -shouldBeEqualToString('output.innerText', 'text'); -shouldBeEqualToString('output.innerHTML', 'text'); - -output.innerHTML = '<strong>strong</strong> text'; -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'strong text'); -shouldBeEqualToString('output.innerText', 'strong text'); -shouldBeEqualToString('output.innerHTML', '<strong>strong</strong> text'); - -debug('- Appends a child node to the output element with the value mode flag is in mode "default".'); -output = document.createElement('output'); -childNode = document.createElement('span'); -childNode.innerText = 'childText'; -output.appendChild(childNode); -shouldBeEqualToString('output.defaultValue', 'childText'); -shouldBeEqualToString('output.value', 'childText'); -shouldBeEqualToString('output.innerText', 'childText'); -shouldBeEqualToString('output.innerHTML', '<span>childText</span>'); -debug('- Then removes the child node from the output element with the value mode flag is in mode "default".'); -output.removeChild(childNode); -shouldBeEqualToString('output.defaultValue', ''); -shouldBeEqualToString('output.value', ''); -shouldBeEqualToString('output.innerText', ''); -shouldBeEqualToString('output.innerHTML', ''); - -debug('- Appends a child node to the output element with the value mode flag is in mode "value".'); -output = document.createElement('output'); -output.value = 'aValue'; -output.defaultValue = 'defaultValue'; -childNode = document.createElement('span'); -childNode.innerText = ' and childText'; -output.appendChild(childNode); -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'aValue and childText'); -shouldBeEqualToString('output.innerText', 'aValue and childText'); -shouldBeEqualToString('output.innerHTML', 'aValue<span> and childText</span>'); -debug('- Then removes the child node from the output element with the value mode flag is in mode "default".'); -output.removeChild(childNode); -shouldBeEqualToString('output.defaultValue', 'defaultValue'); -shouldBeEqualToString('output.value', 'aValue'); -shouldBeEqualToString('output.innerText', 'aValue'); -shouldBeEqualToString('output.innerHTML', 'aValue');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js deleted file mode 100644 index bd6d9af..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/script-tests/set-progress-properties.js +++ /dev/null
@@ -1,69 +0,0 @@ -description('Test setting valid and invalid properties of HTMLProgressElement.'); - -var p = document.createElement('progress'); - -debug("Test values before properties were set"); -shouldBe("p.value", "0"); -shouldBe("p.max", "1"); -shouldBe("p.position", "-1"); - -debug("Set valid values"); -p.value = 7e1; -p.max = "1e2"; -shouldBe("p.value", "70"); -shouldBe("p.max", "100"); -shouldBe("p.position", "0.7"); - -debug("Set value bigger than max"); -p.value = 200; -p.max = 100.0; -shouldBe("p.value", "100"); -shouldBe("p.max", "100"); -shouldBe("p.position", "1"); - -debug("Set value less than zero"); -p.value = -42; -shouldBe('p.value', '0'); -shouldBe('p.position', '0'); - -debug("Set invalid value, should throw"); -shouldThrow('p.value = "200A";'); - -debug("Set invalid max, should throw"); -shouldThrow('p.max = "max";'); - -debug("Set max to Infinity, should throw"); -shouldThrow('p.max = Infinity;'); - -debug("Set value to NaN, should throw"); -shouldThrow('p.value = NaN;'); - -debug("Set value to null and max to 0"); -p.value = null; -p.max = 0; -shouldBe("p.value", "0"); -shouldBe("p.max", "1"); -shouldBe("p.position", "0"); - -debug("Set attributes to valid numbers"); -p.setAttribute("value", 5); -p.setAttribute("max", 10); -shouldBe("p.value", "5"); -shouldBe("p.max", "10"); -shouldBe("parseInt(p.getAttribute('value'))", "5"); -shouldBe("parseInt(p.getAttribute('max'))", "10"); - -debug("Set attributes to invalid values"); -p.setAttribute("value", "ABC"); -p.setAttribute("max", "#"); -shouldBe("p.value", "0"); -shouldBe("p.max", "1"); -shouldBe("p.getAttribute('value')", "'ABC'"); -shouldBe("p.getAttribute('max')", "'#'"); - -debug("Set value and max to numbers with leading spaces"); -p.setAttribute("value", " 5"); -p.setAttribute("max", " 10"); -shouldBe("p.value", "0"); -shouldBe("p.max", "1"); -shouldBe("p.position", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html index b6bbc770..85120c0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties.html
@@ -4,6 +4,76 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/set-progress-properties.js"></script> +<script> +description('Test setting valid and invalid properties of HTMLProgressElement.'); + +var p = document.createElement('progress'); + +debug("Test values before properties were set"); +shouldBe("p.value", "0"); +shouldBe("p.max", "1"); +shouldBe("p.position", "-1"); + +debug("Set valid values"); +p.value = 7e1; +p.max = "1e2"; +shouldBe("p.value", "70"); +shouldBe("p.max", "100"); +shouldBe("p.position", "0.7"); + +debug("Set value bigger than max"); +p.value = 200; +p.max = 100.0; +shouldBe("p.value", "100"); +shouldBe("p.max", "100"); +shouldBe("p.position", "1"); + +debug("Set value less than zero"); +p.value = -42; +shouldBe('p.value', '0'); +shouldBe('p.position', '0'); + +debug("Set invalid value, should throw"); +shouldThrow('p.value = "200A";'); + +debug("Set invalid max, should throw"); +shouldThrow('p.max = "max";'); + +debug("Set max to Infinity, should throw"); +shouldThrow('p.max = Infinity;'); + +debug("Set value to NaN, should throw"); +shouldThrow('p.value = NaN;'); + +debug("Set value to null and max to 0"); +p.value = null; +p.max = 0; +shouldBe("p.value", "0"); +shouldBe("p.max", "1"); +shouldBe("p.position", "0"); + +debug("Set attributes to valid numbers"); +p.setAttribute("value", 5); +p.setAttribute("max", 10); +shouldBe("p.value", "5"); +shouldBe("p.max", "10"); +shouldBe("parseInt(p.getAttribute('value'))", "5"); +shouldBe("parseInt(p.getAttribute('max'))", "10"); + +debug("Set attributes to invalid values"); +p.setAttribute("value", "ABC"); +p.setAttribute("max", "#"); +shouldBe("p.value", "0"); +shouldBe("p.max", "1"); +shouldBe("p.getAttribute('value')", "'ABC'"); +shouldBe("p.getAttribute('max')", "'#'"); + +debug("Set value and max to numbers with leading spaces"); +p.setAttribute("value", " 5"); +p.setAttribute("max", " 10"); +shouldBe("p.value", "0"); +shouldBe("p.max", "1"); +shouldBe("p.position", "0"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution.html index 1c8cf82..7dc0ed4 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution.html
@@ -4,7 +4,20 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/script-for-attribute-unexpected-execution.js"></script> +<script> +description("Tests that scripts which have a for-event other than window.onload are not executed."); + +document.write('<script for="window">testPassed(\'for=window\');<' + '/script>'); +document.write('<script for="anything">testPassed(\'for=anything\');<' + '/script>'); +document.write('<script event="onload">testPassed(\'event=onload\');<' + '/script>'); +document.write('<script event="anything">testPassed(\'event=anything\');<' + '/script>'); +document.write('<script for="window" event="onload">testPassed(\'for=window event=onload\');<' + '/script>'); +document.write('<script for="window" event="onload()">testPassed(\'for=window event=onload()\');<' + '/script>'); +document.write('<script for=" WINDOW " event=" ONLOAD() ">testPassed(\'for=WINDOW event=ONLOAD()\');<' + '/script>'); +document.write('<script for="window" event="onresize">testFailed(\'for=window event=onresize\');<' + '/script>'); +document.write('<script for="document" event="onload">testFailed(\'for=document event=onload\');<' + '/script>'); +document.write('<script for="document" event="onclick">testFailed(\'for=document event=onclick\');<' + '/script>'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-tests/script-for-attribute-unexpected-execution.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-tests/script-for-attribute-unexpected-execution.js deleted file mode 100644 index d605699d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-tests/script-for-attribute-unexpected-execution.js +++ /dev/null
@@ -1,12 +0,0 @@ -description("Tests that scripts which have a for-event other than window.onload are not executed."); - -document.write('<script for="window">testPassed(\'for=window\');</script>'); -document.write('<script for="anything">testPassed(\'for=anything\');</script>'); -document.write('<script event="onload">testPassed(\'event=onload\');</script>'); -document.write('<script event="anything">testPassed(\'event=anything\');</script>'); -document.write('<script for="window" event="onload">testPassed(\'for=window event=onload\');</script>'); -document.write('<script for="window" event="onload()">testPassed(\'for=window event=onload()\');</script>'); -document.write('<script for=" WINDOW " event=" ONLOAD() ">testPassed(\'for=WINDOW event=ONLOAD()\');</script>'); -document.write('<script for="window" event="onresize">testFailed(\'for=window event=onresize\');</script>'); -document.write('<script for="document" event="onload">testFailed(\'for=document event=onload\');</script>'); -document.write('<script for="document" event="onclick">testFailed(\'for=document event=onclick\');</script>');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute.html index 58e69f4..5714490 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/cellpadding-attribute.html
@@ -4,6 +4,44 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/cellpadding-attribute.js"></script> +<script> +description("HTMLTableElement cellpadding attribute test"); + +function cellPaddingAttributeEffect(value) +{ + var table = document.createElement("table"); + table.setAttribute("cellpadding", value); + var cell = document.createElement("td"); + table.appendChild(cell); + document.body.appendChild(table); + var computedStyle = getComputedStyle(cell, ""); + var result = computedStyle.paddingTop; + document.body.removeChild(table); + return result; +} + +shouldBe('cellPaddingAttributeEffect("")', '"1px"'); + +shouldBe('cellPaddingAttributeEffect("1")', '"1px"'); +shouldBe('cellPaddingAttributeEffect("2")', '"2px"'); +shouldBe('cellPaddingAttributeEffect("10")', '"10px"'); + +shouldBe('cellPaddingAttributeEffect("0")', '"0px"'); + +shouldBe('cellPaddingAttributeEffect("-1")', '"0px"'); + +shouldBe('cellPaddingAttributeEffect("1x")', '"1px"'); +shouldBe('cellPaddingAttributeEffect("1.")', '"1px"'); +shouldBe('cellPaddingAttributeEffect("1.9")', '"1px"'); +shouldBe('cellPaddingAttributeEffect("2x")', '"2px"'); +shouldBe('cellPaddingAttributeEffect("2.")', '"2px"'); +shouldBe('cellPaddingAttributeEffect("2.9")', '"2px"'); + +shouldBe('cellPaddingAttributeEffect("a")', '"0px"'); + +var arabicIndicDigitOne = String.fromCharCode(0x661); +shouldBe('cellPaddingAttributeEffect(arabicIndicDigitOne)', '"0px"'); +shouldBe('cellPaddingAttributeEffect("2" + arabicIndicDigitOne)', '"2px"'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-65-excerpt.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-65-excerpt.html index 21f8e74..b538663 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-65-excerpt.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-65-excerpt.html
@@ -4,6 +4,43 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/early-acid3-65-excerpt.js"></script> +<script> +description('An excerpt from an early Acid3 test 65: construct a table, and see if the table is as expected'); + +var table = document.createElement('table'); +table.appendChild(document.createElement('tbody')); +var tr1 = document.createElement('tr'); +table.appendChild(tr1); +table.appendChild(document.createElement('caption')); +table.appendChild(document.createElement('thead')); +// <table><tbody/><tr/><caption/><thead/> +table.insertBefore(table.firstChild.nextSibling, null); // move the <tr/> to the end +// <table><tbody/><caption/><thead/><tr/> +table.replaceChild(table.firstChild, table.lastChild); // move the <tbody/> to the end and remove the <tr> +// <table><caption/><thead/><tbody/> +var tr2 = table.tBodies[0].insertRow(0); +// <table><caption/><thead/><tbody><tr/></tbody> +shouldBe("table.tBodies[0].rows[0].rowIndex", "0"); +shouldBe("table.tBodies[0].rows[0].sectionRowIndex", "0"); +shouldBe("table.childNodes.length", "3"); +shouldBe("!!table.caption", "true"); +shouldBe("!!table.tHead", "true"); +shouldBe("table.tFoot", "null"); +shouldBe("table.tBodies.length", "1"); +shouldBe("table.rows.length", "1"); +shouldBe("tr1.parentNode", "null"); +shouldBe("table.caption", "table.createCaption()"); +shouldBe("table.tFoot", "null"); +shouldBe("table.tHead", "table.createTHead()"); +shouldBe("table.createTFoot()", "table.tFoot"); +// either: <table><caption/><thead/><tbody><tr/></tbody><tfoot/> +// or: <table><caption/><thead/><tfoot/><tbody><tr/></tbody> +table.tHead.appendChild(tr1); +// either: <table><caption/><thead><tr/></thead><tbody><tr/></tbody><tfoot/> +// or: <table><caption/><thead><tr/></thead><tfoot/><tbody><tr/></tbody> +shouldBe("table.rows[0]", "table.tHead.firstChild"); +shouldBe("table.rows.length", "2"); +shouldBe("table.rows[1]", "table.tBodies[0].firstChild"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-66-excerpt.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-66-excerpt.html index efb783a..0a6fb3e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-66-excerpt.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/early-acid3-66-excerpt.html
@@ -4,6 +4,45 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/early-acid3-66-excerpt.js"></script> +<script> +description('An excerpt from an early Acid3 test 66: test the ordering and creation of rows'); + +var table = document.createElement('table'); +var rows = [ + document.createElement('tr'), // 0: ends up first child of the tfoot + document.createElement('tr'), // 1: goes at the end of the table + document.createElement('tr'), // 2: becomes second child of thead + document.createElement('tr'), // 3: becomes third child of the thead + document.createElement('tr'), // 4: not in the table + table.insertRow(0), // 5: not in the table + table.createTFoot().insertRow(0) // 6: ends up second in the tfoot +]; +rows[6].parentNode.appendChild(rows[0]); +table.appendChild(rows[1]); +table.insertBefore(document.createElement('thead'), table.firstChild); +table.firstChild.appendChild(rows[2]); +rows[2].parentNode.appendChild(rows[3]); +rows[4].appendChild(rows[5].parentNode); +table.insertRow(0); +table.tFoot.appendChild(rows[6]); + +shouldBe("table.rows.length", "6"); +shouldBe("table.getElementsByTagName('tr').length", "6"); +shouldBe("table.childNodes.length", "3"); +shouldBe("table.tHead", "table.childNodes[0]"); +shouldBe("table.tHead.childNodes[0]", "table.getElementsByTagName('tr')[0]"); +shouldBe("table.tHead.childNodes[1]", "table.getElementsByTagName('tr')[1]"); +shouldBe("rows[2]", "table.getElementsByTagName('tr')[1]"); +shouldBe("table.tHead.childNodes[2]", "table.getElementsByTagName('tr')[2]"); +shouldBe("rows[3]", "table.getElementsByTagName('tr')[2]"); +shouldBe("table.tFoot", "table.childNodes[1]"); +shouldBe("table.tFoot.childNodes[0]", "table.getElementsByTagName('tr')[3]"); +shouldBe("rows[0]", "table.getElementsByTagName('tr')[3]"); +shouldBe("table.tFoot.childNodes[1]", "table.getElementsByTagName('tr')[4]"); +shouldBe("rows[6]", "table.getElementsByTagName('tr')[4]"); +shouldBe("table.childNodes[2]", "table.getElementsByTagName('tr')[5]"); +shouldBe("rows[1]", "table.getElementsByTagName('tr')[5]"); +shouldBe("table.tBodies.length", "0"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/rows.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/rows.html index 5e37f1c..34f1256 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/rows.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/rows.html
@@ -4,6 +4,75 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/rows.js"></script> +<script> +description('Test behavior of the HTMLTableElement rows attribute in cases where there is unusual nesting.'); + +function checkNoBodyRowNesting(tag) +{ + var table = document.createElement("table"); + var container = document.createElement(tag); + var row = document.createElement("tr"); + table.appendChild(container); + container.appendChild(row); + return table.rows.length; +} + +function checkRowNesting(tag) +{ + var table = document.createElement("table"); + var body = document.createElement("tbody"); + var container = document.createElement(tag); + var row = document.createElement("tr"); + table.appendChild(body); + body.appendChild(container); + container.appendChild(row); + return table.rows.length; +} + +var sectionTags = [ + "tbody", + "tfoot", + "thead", +]; + +var otherTags = [ + "col", + "colgroup", + "div", + "form", + "script", + "table", + "td", + "th", +]; + +for (i = 0; i < otherTags.length; ++i) + shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); + +debug(''); + +for (i = 0; i < sectionTags.length; ++i) + shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); + +debug(''); + +shouldBe('checkRowNesting("tr")', '1'); + +debug(''); + +for (i = 0; i < otherTags.length; ++i) + shouldBe('checkNoBodyRowNesting("' + otherTags[i] + '")', '0'); + +debug(''); + +for (i = 0; i < sectionTags.length; ++i) + shouldBe('checkNoBodyRowNesting("' + sectionTags[i] + '")', '1'); + +debug(''); + +shouldBe('checkNoBodyRowNesting("tr")', '1'); + +debug(''); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/cellpadding-attribute.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/cellpadding-attribute.js deleted file mode 100644 index 93653b3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/cellpadding-attribute.js +++ /dev/null
@@ -1,37 +0,0 @@ -description("HTMLTableElement cellpadding attribute test"); - -function cellPaddingAttributeEffect(value) -{ - var table = document.createElement("table"); - table.setAttribute("cellpadding", value); - var cell = document.createElement("td"); - table.appendChild(cell); - document.body.appendChild(table); - var computedStyle = getComputedStyle(cell, ""); - var result = computedStyle.paddingTop; - document.body.removeChild(table); - return result; -} - -shouldBe('cellPaddingAttributeEffect("")', '"1px"'); - -shouldBe('cellPaddingAttributeEffect("1")', '"1px"'); -shouldBe('cellPaddingAttributeEffect("2")', '"2px"'); -shouldBe('cellPaddingAttributeEffect("10")', '"10px"'); - -shouldBe('cellPaddingAttributeEffect("0")', '"0px"'); - -shouldBe('cellPaddingAttributeEffect("-1")', '"0px"'); - -shouldBe('cellPaddingAttributeEffect("1x")', '"1px"'); -shouldBe('cellPaddingAttributeEffect("1.")', '"1px"'); -shouldBe('cellPaddingAttributeEffect("1.9")', '"1px"'); -shouldBe('cellPaddingAttributeEffect("2x")', '"2px"'); -shouldBe('cellPaddingAttributeEffect("2.")', '"2px"'); -shouldBe('cellPaddingAttributeEffect("2.9")', '"2px"'); - -shouldBe('cellPaddingAttributeEffect("a")', '"0px"'); - -var arabicIndicDigitOne = String.fromCharCode(0x661); -shouldBe('cellPaddingAttributeEffect(arabicIndicDigitOne)', '"0px"'); -shouldBe('cellPaddingAttributeEffect("2" + arabicIndicDigitOne)', '"2px"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-65-excerpt.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-65-excerpt.js deleted file mode 100644 index 7bf0177..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-65-excerpt.js +++ /dev/null
@@ -1,36 +0,0 @@ -description('An excerpt from an early Acid3 test 65: construct a table, and see if the table is as expected'); - -var table = document.createElement('table'); -table.appendChild(document.createElement('tbody')); -var tr1 = document.createElement('tr'); -table.appendChild(tr1); -table.appendChild(document.createElement('caption')); -table.appendChild(document.createElement('thead')); -// <table><tbody/><tr/><caption/><thead/> -table.insertBefore(table.firstChild.nextSibling, null); // move the <tr/> to the end -// <table><tbody/><caption/><thead/><tr/> -table.replaceChild(table.firstChild, table.lastChild); // move the <tbody/> to the end and remove the <tr> -// <table><caption/><thead/><tbody/> -var tr2 = table.tBodies[0].insertRow(0); -// <table><caption/><thead/><tbody><tr/></tbody> -shouldBe("table.tBodies[0].rows[0].rowIndex", "0"); -shouldBe("table.tBodies[0].rows[0].sectionRowIndex", "0"); -shouldBe("table.childNodes.length", "3"); -shouldBe("!!table.caption", "true"); -shouldBe("!!table.tHead", "true"); -shouldBe("table.tFoot", "null"); -shouldBe("table.tBodies.length", "1"); -shouldBe("table.rows.length", "1"); -shouldBe("tr1.parentNode", "null"); -shouldBe("table.caption", "table.createCaption()"); -shouldBe("table.tFoot", "null"); -shouldBe("table.tHead", "table.createTHead()"); -shouldBe("table.createTFoot()", "table.tFoot"); -// either: <table><caption/><thead/><tbody><tr/></tbody><tfoot/> -// or: <table><caption/><thead/><tfoot/><tbody><tr/></tbody> -table.tHead.appendChild(tr1); -// either: <table><caption/><thead><tr/></thead><tbody><tr/></tbody><tfoot/> -// or: <table><caption/><thead><tr/></thead><tfoot/><tbody><tr/></tbody> -shouldBe("table.rows[0]", "table.tHead.firstChild"); -shouldBe("table.rows.length", "2"); -shouldBe("table.rows[1]", "table.tBodies[0].firstChild");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-66-excerpt.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-66-excerpt.js deleted file mode 100644 index 677ffed..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/early-acid3-66-excerpt.js +++ /dev/null
@@ -1,38 +0,0 @@ -description('An excerpt from an early Acid3 test 66: test the ordering and creation of rows'); - -var table = document.createElement('table'); -var rows = [ - document.createElement('tr'), // 0: ends up first child of the tfoot - document.createElement('tr'), // 1: goes at the end of the table - document.createElement('tr'), // 2: becomes second child of thead - document.createElement('tr'), // 3: becomes third child of the thead - document.createElement('tr'), // 4: not in the table - table.insertRow(0), // 5: not in the table - table.createTFoot().insertRow(0) // 6: ends up second in the tfoot -]; -rows[6].parentNode.appendChild(rows[0]); -table.appendChild(rows[1]); -table.insertBefore(document.createElement('thead'), table.firstChild); -table.firstChild.appendChild(rows[2]); -rows[2].parentNode.appendChild(rows[3]); -rows[4].appendChild(rows[5].parentNode); -table.insertRow(0); -table.tFoot.appendChild(rows[6]); - -shouldBe("table.rows.length", "6"); -shouldBe("table.getElementsByTagName('tr').length", "6"); -shouldBe("table.childNodes.length", "3"); -shouldBe("table.tHead", "table.childNodes[0]"); -shouldBe("table.tHead.childNodes[0]", "table.getElementsByTagName('tr')[0]"); -shouldBe("table.tHead.childNodes[1]", "table.getElementsByTagName('tr')[1]"); -shouldBe("rows[2]", "table.getElementsByTagName('tr')[1]"); -shouldBe("table.tHead.childNodes[2]", "table.getElementsByTagName('tr')[2]"); -shouldBe("rows[3]", "table.getElementsByTagName('tr')[2]"); -shouldBe("table.tFoot", "table.childNodes[1]"); -shouldBe("table.tFoot.childNodes[0]", "table.getElementsByTagName('tr')[3]"); -shouldBe("rows[0]", "table.getElementsByTagName('tr')[3]"); -shouldBe("table.tFoot.childNodes[1]", "table.getElementsByTagName('tr')[4]"); -shouldBe("rows[6]", "table.getElementsByTagName('tr')[4]"); -shouldBe("table.childNodes[2]", "table.getElementsByTagName('tr')[5]"); -shouldBe("rows[1]", "table.getElementsByTagName('tr')[5]"); -shouldBe("table.tBodies.length", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/rows.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/rows.js deleted file mode 100644 index 76a7fed..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/rows.js +++ /dev/null
@@ -1,68 +0,0 @@ -description('Test behavior of the HTMLTableElement rows attribute in cases where there is unusual nesting.'); - -function checkNoBodyRowNesting(tag) -{ - var table = document.createElement("table"); - var container = document.createElement(tag); - var row = document.createElement("tr"); - table.appendChild(container); - container.appendChild(row); - return table.rows.length; -} - -function checkRowNesting(tag) -{ - var table = document.createElement("table"); - var body = document.createElement("tbody"); - var container = document.createElement(tag); - var row = document.createElement("tr"); - table.appendChild(body); - body.appendChild(container); - container.appendChild(row); - return table.rows.length; -} - -var sectionTags = [ - "tbody", - "tfoot", - "thead", -]; - -var otherTags = [ - "col", - "colgroup", - "div", - "form", - "script", - "table", - "td", - "th", -]; - -for (i = 0; i < otherTags.length; ++i) - shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); - -debug(''); - -for (i = 0; i < sectionTags.length; ++i) - shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); - -debug(''); - -shouldBe('checkRowNesting("tr")', '1'); - -debug(''); - -for (i = 0; i < otherTags.length; ++i) - shouldBe('checkNoBodyRowNesting("' + otherTags[i] + '")', '0'); - -debug(''); - -for (i = 0; i < sectionTags.length; ++i) - shouldBe('checkNoBodyRowNesting("' + sectionTags[i] + '")', '1'); - -debug(''); - -shouldBe('checkNoBodyRowNesting("tr")', '1'); - -debug('');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/tBodies.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/tBodies.js deleted file mode 100644 index 55f00eb..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/script-tests/tBodies.js +++ /dev/null
@@ -1,34 +0,0 @@ -description('Test behavior of the HTMLTableElement tBodies attribute in cases where there is unusual nesting.'); - -function checkTBodyNesting(tag) -{ - var table = document.createElement("table"); - var container = document.createElement(tag); - var tbody = document.createElement("tbody"); - table.appendChild(container); - container.appendChild(tbody); - return table.tBodies.length; -} - -var tags = [ - "col", - "colgroup", - "div", - "form", - "script", - "table", - "td", - "tfoot", - "th", - "thead", - "tr", -]; - -for (i = 0; i < tags.length; ++i) - shouldBe('checkTBodyNesting("' + tags[i] + '")', '0'); - -debug(''); - -shouldBe('checkTBodyNesting("tbody")', '1'); - -debug('');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/tBodies.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/tBodies.html index fb4dfdfb..63b26e5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/tBodies.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableElement/tBodies.html
@@ -4,6 +4,41 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/tBodies.js"></script> +<script> +description('Test behavior of the HTMLTableElement tBodies attribute in cases where there is unusual nesting.'); + +function checkTBodyNesting(tag) +{ + var table = document.createElement("table"); + var container = document.createElement(tag); + var tbody = document.createElement("tbody"); + table.appendChild(container); + container.appendChild(tbody); + return table.tBodies.length; +} + +var tags = [ + "col", + "colgroup", + "div", + "form", + "script", + "table", + "td", + "tfoot", + "th", + "thead", + "tr", +]; + +for (i = 0; i < tags.length; ++i) + shouldBe('checkTBodyNesting("' + tags[i] + '")', '0'); + +debug(''); + +shouldBe('checkTBodyNesting("tbody")', '1'); + +debug(''); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html index 4ef75527..ba207cce 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/cells.html
@@ -4,6 +4,61 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/cells.js"></script> +<script> +description('Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting.'); + +function checkCellNesting(tag) +{ + var row = document.createElement("tr"); + var container = document.createElement(tag); + var cell = document.createElement("td"); + row.appendChild(container); + container.appendChild(cell); + return row.cells.length; +} + +function checkHeaderCellNesting(tag) +{ + var row = document.createElement("tr"); + var container = document.createElement(tag); + var cell = document.createElement("th"); + row.appendChild(container); + container.appendChild(cell); + return row.cells.length; +} + +var tags = [ + "col", + "colgroup", + "div", + "form", + "script", + "table", + "tbody", + "tfoot", + "thead", + "tr", +]; + +for (i = 0; i < tags.length; ++i) + shouldBe('checkCellNesting("' + tags[i] + '")', '0'); + +debug(''); + +shouldBe('checkCellNesting("td")', '1'); +shouldBe('checkCellNesting("th")', '1'); + +debug(''); + +for (i = 0; i < tags.length; ++i) + shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0'); + +debug(''); + +shouldBe('checkHeaderCellNesting("td")', '1'); +shouldBe('checkHeaderCellNesting("th")', '1'); + +debug(''); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js deleted file mode 100644 index a3ad0ee..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableRowElement/script-tests/cells.js +++ /dev/null
@@ -1,54 +0,0 @@ -description('Test behavior of the HTMLTableRowElement cells attribute in cases where there is unusual nesting.'); - -function checkCellNesting(tag) -{ - var row = document.createElement("tr"); - var container = document.createElement(tag); - var cell = document.createElement("td"); - row.appendChild(container); - container.appendChild(cell); - return row.cells.length; -} - -function checkHeaderCellNesting(tag) -{ - var row = document.createElement("tr"); - var container = document.createElement(tag); - var cell = document.createElement("th"); - row.appendChild(container); - container.appendChild(cell); - return row.cells.length; -} - -var tags = [ - "col", - "colgroup", - "div", - "form", - "script", - "table", - "tbody", - "tfoot", - "thead", - "tr", -]; - -for (i = 0; i < tags.length; ++i) - shouldBe('checkCellNesting("' + tags[i] + '")', '0'); - -debug(''); - -shouldBe('checkCellNesting("td")', '1'); -shouldBe('checkCellNesting("th")', '1'); - -debug(''); - -for (i = 0; i < tags.length; ++i) - shouldBe('checkHeaderCellNesting("' + tags[i] + '")', '0'); - -debug(''); - -shouldBe('checkHeaderCellNesting("td")', '1'); -shouldBe('checkHeaderCellNesting("th")', '1'); - -debug('');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html index 5e37f1c..a3315d885 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/rows.html
@@ -4,6 +4,49 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/rows.js"></script> +<script> +description('Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.'); + +function checkRowNesting(tag) +{ + var body = document.createElement("tbody"); + var container = document.createElement(tag); + var row = document.createElement("tr"); + body.appendChild(container); + container.appendChild(row); + return body.rows.length; +} + +var sectionTags = [ + "tbody", + "tfoot", + "thead", +]; + +var otherTags = [ + "col", + "colgroup", + "div", + "form", + "script", + "table", + "td", + "th", +]; + +for (i = 0; i < otherTags.length; ++i) + shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); + +debug(''); + +for (i = 0; i < sectionTags.length; ++i) + shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); + +debug(''); + +shouldBe('checkRowNesting("tr")', '1'); + +debug(''); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js deleted file mode 100644 index 3923cae..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTableSectionElement/script-tests/rows.js +++ /dev/null
@@ -1,42 +0,0 @@ -description('Test behavior of the HTMLTableSectionElement rows attribute in cases where there is unusual nesting.'); - -function checkRowNesting(tag) -{ - var body = document.createElement("tbody"); - var container = document.createElement(tag); - var row = document.createElement("tr"); - body.appendChild(container); - container.appendChild(row); - return body.rows.length; -} - -var sectionTags = [ - "tbody", - "tfoot", - "thead", -]; - -var otherTags = [ - "col", - "colgroup", - "div", - "form", - "script", - "table", - "td", - "th", -]; - -for (i = 0; i < otherTags.length; ++i) - shouldBe('checkRowNesting("' + otherTags[i] + '")', '0'); - -debug(''); - -for (i = 0; i < sectionTags.length; ++i) - shouldBe('checkRowNesting("' + sectionTags[i] + '")', '0'); - -debug(''); - -shouldBe('checkRowNesting("tr")', '1'); - -debug('');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html b/third_party/WebKit/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html index 50476a2..26f024a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/DOMNodeRemovedEvent.html
@@ -4,6 +4,17 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/DOMNodeRemovedEvent.js"></script> +<script> +description("This test checks that DOMNodeRemovedEvent is emitted once (and only once)."); + +var div = document.createElement("div"); +document.body.appendChild(div); + +var count = 0; +document.body.addEventListener("DOMNodeRemoved", function () { count++; }, false); +document.body.removeChild(div); + +shouldBe("count", "1"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/contains-method.html b/third_party/WebKit/LayoutTests/fast/dom/Node/contains-method.html index abb6ef2..677165bd 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/contains-method.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/contains-method.html
@@ -4,6 +4,42 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/contains-method.js"></script> +<script> +description( +'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="test2">[test 2]</span>]</div>' +); + +var test1 = document.getElementById('test1'); +var test1TextChild = document.getElementById('test1').firstChild; +var test2 = document.getElementById('test2'); + +shouldBeEqualToString("typeof document.contains", "function"); +shouldBeTrue("test1.contains(test2)"); +shouldBeTrue("test1.contains(test1TextChild)"); +shouldBeTrue("document.contains(test1)"); +shouldBeTrue("document.contains(test1TextChild)"); +shouldBeTrue("document.contains(document)"); +shouldBeTrue("test1.contains(test1)"); +shouldBeTrue("test1TextChild.contains(test1TextChild)"); +shouldThrow("test1.contains(123)"); +shouldBeFalse("test1.contains(null)"); + +// Cross document tests +var iframe = document.createElement("iframe"); + +shouldBeFalse("document.contains(iframe)"); // Not in document +shouldBeTrue("iframe.contains(iframe)"); + +document.body.appendChild(iframe); +debug('iframe is now in document'); +shouldBeTrue("document.contains(iframe)"); + +var iframeDoc = iframe.contentDocument; +var iframeBody = iframeDoc.body; + +shouldBeFalse("document.contains(iframeDoc)"); +shouldBeTrue("iframeDoc.contains(iframeBody)"); +shouldBeFalse("document.contains(iframeBody)"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/initial-values.html b/third_party/WebKit/LayoutTests/fast/dom/Node/initial-values.html index f92d582e..ab46c5f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/initial-values.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/initial-values.html
@@ -4,6 +4,185 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/initial-values.js"></script> +<script> +description("Test creation of each type of Node and check initial values") + +var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); + +debug("Attribute creation using createElement on an HTML doc:") +var attr = document.createAttribute("foo"); +shouldBe("attr.nodeName", "'foo'"); +shouldBe("attr.name", "'foo'"); +// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute +// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null +shouldBe("attr.localName", "null"); +shouldBe("attr.namespaceURI", "null"); +shouldBe("attr.prefix", "null"); +shouldBe("attr.value", "''"); + +debug("Attribute creation using createElementNS on an HTML doc:") +attr = document.createAttributeNS("http://www.example.com", "example:foo"); +shouldBe("attr.nodeName", "'example:foo'"); +shouldBe("attr.name", "'example:foo'"); +shouldBe("attr.localName", "'foo'"); +shouldBe("attr.namespaceURI", "'http://www.example.com'"); +shouldBe("attr.prefix", "'example'"); +shouldBe("attr.nodeValue", "''"); +shouldBe("attr.value", "''"); + +debug("Attribute creation using createElement on an XHTML doc:") +attr = xmlDoc.createAttribute("foo"); +shouldBe("attr.nodeName", "'foo'"); +shouldBe("attr.name", "'foo'"); +// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute +// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null +shouldBe("attr.localName", "null"); +shouldBe("attr.namespaceURI", "null"); +shouldBe("attr.prefix", "null"); +shouldBe("attr.value", "''"); + +debug("Attribute creation using createElementNS on an XHTML doc:") +attr = xmlDoc.createAttributeNS("http://www.example.com", "example:foo"); +shouldBe("attr.nodeName", "'example:foo'"); +shouldBe("attr.name", "'example:foo'"); +shouldBe("attr.localName", "'foo'"); +shouldBe("attr.namespaceURI", "'http://www.example.com'"); +shouldBe("attr.prefix", "'example'"); +shouldBe("attr.nodeValue", "''"); +shouldBe("attr.value", "''"); + +var comment = document.createComment("foo"); +shouldBe("comment.nodeName", "'#comment'"); +shouldBe("comment.localName", "undefined"); +shouldBe("comment.namespaceURI", "undefined"); +shouldBe("comment.nodeValue", "'foo'"); +shouldBe("comment.data", "'foo'"); + +shouldThrow("document.createCDATASection('foo')"); +var cdata = xmlDoc.createCDATASection("foo"); +shouldBe("cdata.nodeName", "'#cdata-section'"); +shouldBe("cdata.localName", "undefined"); +shouldBe("cdata.namespaceURI", "undefined"); +shouldBe("cdata.nodeValue", "'foo'"); +shouldBe("cdata.data", "'foo'"); + +var fragment = document.createDocumentFragment(); +shouldBe("fragment.nodeName", "'#document-fragment'"); +shouldBe("fragment.localName", "undefined"); +shouldBe("fragment.namespaceURI", "undefined"); +shouldBe("fragment.nodeValue", "null"); + +var doc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); +shouldBe("doc.nodeName", "'#document'"); +shouldBe("doc.localName", "undefined"); +shouldBe("doc.namespaceURI", "undefined"); +shouldBe("doc.nodeValue", "null"); + +var doctype = document.implementation.createDocumentType("svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"); +shouldBe("doctype.nodeName", "'svg'"); +shouldBe("doctype.name", "'svg'"); +shouldBe("doctype.localName", "undefined"); +shouldBe("doctype.namespaceURI", "undefined"); +shouldBe("doctype.nodeValue", "null"); + +debug("Element creation using createElement on an HTML doc:") +var element = document.createElement("pre"); +shouldBe("element.nodeName", "'PRE'"); +// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createElement +// FF returns "PRE" for localName, WebKit returns "pre", the spec says we should return null +shouldBe("element.localName", "null"); +// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null +shouldBe("element.namespaceURI", "null"); +shouldBe("element.prefix", "null"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Prefixed element creation using createElementNS on an HTML doc:") +element = document.createElementNS("http://www.w3.org/1999/xhtml", "html:pre"); +shouldBe("element.nodeName", "'HTML:PRE'"); +shouldBe("element.localName", "'pre'"); +shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); +shouldBe("element.prefix", "'html'"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("SVG Element creation using createElementNS on an HTML doc:") +element = document.createElementNS("http://www.w3.org/2000/svg", "svg"); +shouldBe("element.nodeName", "'svg'"); +shouldBe("element.localName", "'svg'"); +shouldBe("element.namespaceURI", "'http://www.w3.org/2000/svg'"); +shouldBe("element.prefix", "null"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Unknown Element creation using createElementNS on an HTML doc:") +element = document.createElementNS("http://www.webkit.org", "foo:svg"); +shouldBe("element.nodeName", "'foo:svg'"); +shouldBe("element.localName", "'svg'"); +shouldBe("element.namespaceURI", "'http://www.webkit.org'"); +shouldBe("element.prefix", "'foo'"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Element creation using createElementNS on an HTML doc:") +element = document.createElementNS("http://www.w3.org/1999/xhtml", "pre"); +// Spec: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-104682815 (element.tagName) +// FF and Opera returns "pre" for nodeName as it is an XHTML element, WebKit returns "PRE". +shouldBe("element.nodeName", "'pre'"); +shouldBe("element.localName", "'pre'"); +shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); +shouldBe("element.prefix", "null"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Element creation using createElement on an XHTML doc:") +element = xmlDoc.createElement("pre"); +shouldBe("element.nodeName", "'pre'"); +shouldBe("element.localName", "null"); +// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null +shouldBe("element.namespaceURI", "null"); +shouldBe("element.prefix", "null"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Element creation using createElementNS on an XHTML doc:") +element = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "html:pre"); +shouldBe("element.nodeName", "'html:pre'"); +shouldBe("element.localName", "'pre'"); +shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); +shouldBe("element.prefix", "'html'"); +shouldBe("element.nodeValue", "null"); +shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); + +debug("Processing instruction creation using createProcessingInstruction on an HTML doc:") +var processingInstruction = document.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"'); +shouldBe("processingInstruction.nodeName", "'xml-stylesheet'"); +shouldBe("processingInstruction.localName", "undefined"); +shouldBe("processingInstruction.namespaceURI", "undefined"); +// DOM Core Level 2 and DOM Core Level 3 disagree on ProcessingInstruction.nodeValue +// L2: entire content excluding the target +// L3: same as ProcessingInstruction.data +// We're following Level 3 +shouldBe("processingInstruction.nodeValue", "'type=\"text/xsl\" href=\"missing.xsl\"'"); +shouldBe("processingInstruction.target", "'xml-stylesheet'"); +shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'"); + +debug("Processing instruction creation using createProcessingInstruction on an XHTML doc:") +processingInstruction = xmlDoc.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"'); +shouldBe("processingInstruction.nodeName", "'xml-stylesheet'"); +shouldBe("processingInstruction.localName", "undefined"); +shouldBe("processingInstruction.namespaceURI", "undefined"); +shouldBe("processingInstruction.nodeValue", "'type=\"text/xsl\" href=\"missing.xsl\"'"); +shouldBe("processingInstruction.target", "'xml-stylesheet'"); +shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'"); + +debug("Text node creation using createTextNode on an HTML doc:") +var text = document.createTextNode("foo"); +shouldBe("text.nodeName", "'#text'"); +shouldBe("text.localName", "undefined"); +shouldBe("text.namespaceURI", "undefined"); +shouldBe("text.nodeValue", "'foo'"); +shouldBe("text.data", "'foo'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/isEqualNode.html b/third_party/WebKit/LayoutTests/fast/dom/Node/isEqualNode.html index 372276e..a963db9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/isEqualNode.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/isEqualNode.html
@@ -4,6 +4,18 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/isEqualNode.js"></script> +<script> +description("Test the isEqualNode API."); + +debug("Test isEqualNode for DocumentType nodes."); +var docTypeAllSet = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); +var docTypeAllSet2 = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); +var docTypeDifferentPublicID = document.implementation.createDocumentType('html', 'foo', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); +var docTypeDifferentSystemID = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'bar'); + +shouldBeTrue("docTypeAllSet.isEqualNode(docTypeAllSet2)"); +shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentPublicID)"); +shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentSystemID)"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html b/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html index 0b1cafb..d326aed 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Node/normalize-with-cdata.html
@@ -4,6 +4,27 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/normalize-with-cdata.js"></script> +<script> +description('Test of normalize on an XML document with CDATA.'); + +var parser = new DOMParser(); +var serializer = new XMLSerializer(); + +var xmlChunk = parser.parseFromString( + '<foo>' + + 'This is some text before the CDATA' + + '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' + + 'This is some text after the CDATA' + + '</foo>', + 'application/xml'); + +debug('Before normalize'); +shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"'); +shouldBe('xmlChunk.documentElement.childNodes.length', '3'); +xmlChunk.documentElement.normalize(); +debug('After normalize'); +shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"'); +shouldBe('xmlChunk.documentElement.childNodes.length', '3'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js deleted file mode 100644 index af3c97a45..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/DOMNodeRemovedEvent.js +++ /dev/null
@@ -1,10 +0,0 @@ -description("This test checks that DOMNodeRemovedEvent is emitted once (and only once)."); - -var div = document.createElement("div"); -document.body.appendChild(div); - -var count = 0; -document.body.addEventListener("DOMNodeRemoved", function () { count++; }, false); -document.body.removeChild(div); - -shouldBe("count", "1");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/contains-method.js b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/contains-method.js deleted file mode 100644 index a8dc218..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/contains-method.js +++ /dev/null
@@ -1,35 +0,0 @@ -description( -'This test checks behavior of Node.contains. <div id="test1">[test1 <span id="test2">[test 2]</span>]</div>' -); - -var test1 = document.getElementById('test1'); -var test1TextChild = document.getElementById('test1').firstChild; -var test2 = document.getElementById('test2'); - -shouldBeEqualToString("typeof document.contains", "function"); -shouldBeTrue("test1.contains(test2)"); -shouldBeTrue("test1.contains(test1TextChild)"); -shouldBeTrue("document.contains(test1)"); -shouldBeTrue("document.contains(test1TextChild)"); -shouldBeTrue("document.contains(document)"); -shouldBeTrue("test1.contains(test1)"); -shouldBeTrue("test1TextChild.contains(test1TextChild)"); -shouldThrow("test1.contains(123)"); -shouldBeFalse("test1.contains(null)"); - -// Cross document tests -var iframe = document.createElement("iframe"); - -shouldBeFalse("document.contains(iframe)"); // Not in document -shouldBeTrue("iframe.contains(iframe)"); - -document.body.appendChild(iframe); -debug('iframe is now in document'); -shouldBeTrue("document.contains(iframe)"); - -var iframeDoc = iframe.contentDocument; -var iframeBody = iframeDoc.body; - -shouldBeFalse("document.contains(iframeDoc)"); -shouldBeTrue("iframeDoc.contains(iframeBody)"); -shouldBeFalse("document.contains(iframeBody)");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/initial-values.js b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/initial-values.js deleted file mode 100644 index 39d650f..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/initial-values.js +++ /dev/null
@@ -1,178 +0,0 @@ -description("Test creation of each type of Node and check initial values") - -var xmlDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); - -debug("Attribute creation using createElement on an HTML doc:") -var attr = document.createAttribute("foo"); -shouldBe("attr.nodeName", "'foo'"); -shouldBe("attr.name", "'foo'"); -// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute -// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null -shouldBe("attr.localName", "null"); -shouldBe("attr.namespaceURI", "null"); -shouldBe("attr.prefix", "null"); -shouldBe("attr.value", "''"); - -debug("Attribute creation using createElementNS on an HTML doc:") -attr = document.createAttributeNS("http://www.example.com", "example:foo"); -shouldBe("attr.nodeName", "'example:foo'"); -shouldBe("attr.name", "'example:foo'"); -shouldBe("attr.localName", "'foo'"); -shouldBe("attr.namespaceURI", "'http://www.example.com'"); -shouldBe("attr.prefix", "'example'"); -shouldBe("attr.nodeValue", "''"); -shouldBe("attr.value", "''"); - -debug("Attribute creation using createElement on an XHTML doc:") -attr = xmlDoc.createAttribute("foo"); -shouldBe("attr.nodeName", "'foo'"); -shouldBe("attr.name", "'foo'"); -// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createAttribute -// Both FF and WebKit return "foo" for Attribute.localName, even though the spec says null -shouldBe("attr.localName", "null"); -shouldBe("attr.namespaceURI", "null"); -shouldBe("attr.prefix", "null"); -shouldBe("attr.value", "''"); - -debug("Attribute creation using createElementNS on an XHTML doc:") -attr = xmlDoc.createAttributeNS("http://www.example.com", "example:foo"); -shouldBe("attr.nodeName", "'example:foo'"); -shouldBe("attr.name", "'example:foo'"); -shouldBe("attr.localName", "'foo'"); -shouldBe("attr.namespaceURI", "'http://www.example.com'"); -shouldBe("attr.prefix", "'example'"); -shouldBe("attr.nodeValue", "''"); -shouldBe("attr.value", "''"); - -var comment = document.createComment("foo"); -shouldBe("comment.nodeName", "'#comment'"); -shouldBe("comment.localName", "undefined"); -shouldBe("comment.namespaceURI", "undefined"); -shouldBe("comment.nodeValue", "'foo'"); -shouldBe("comment.data", "'foo'"); - -shouldThrow("document.createCDATASection('foo')"); -var cdata = xmlDoc.createCDATASection("foo"); -shouldBe("cdata.nodeName", "'#cdata-section'"); -shouldBe("cdata.localName", "undefined"); -shouldBe("cdata.namespaceURI", "undefined"); -shouldBe("cdata.nodeValue", "'foo'"); -shouldBe("cdata.data", "'foo'"); - -var fragment = document.createDocumentFragment(); -shouldBe("fragment.nodeName", "'#document-fragment'"); -shouldBe("fragment.localName", "undefined"); -shouldBe("fragment.namespaceURI", "undefined"); -shouldBe("fragment.nodeValue", "null"); - -var doc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null); -shouldBe("doc.nodeName", "'#document'"); -shouldBe("doc.localName", "undefined"); -shouldBe("doc.namespaceURI", "undefined"); -shouldBe("doc.nodeValue", "null"); - -var doctype = document.implementation.createDocumentType("svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"); -shouldBe("doctype.nodeName", "'svg'"); -shouldBe("doctype.name", "'svg'"); -shouldBe("doctype.localName", "undefined"); -shouldBe("doctype.namespaceURI", "undefined"); -shouldBe("doctype.nodeValue", "null"); - -debug("Element creation using createElement on an HTML doc:") -var element = document.createElement("pre"); -shouldBe("element.nodeName", "'PRE'"); -// Spec: http://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createElement -// FF returns "PRE" for localName, WebKit returns "pre", the spec says we should return null -shouldBe("element.localName", "null"); -// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null -shouldBe("element.namespaceURI", "null"); -shouldBe("element.prefix", "null"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Prefixed element creation using createElementNS on an HTML doc:") -element = document.createElementNS("http://www.w3.org/1999/xhtml", "html:pre"); -shouldBe("element.nodeName", "'HTML:PRE'"); -shouldBe("element.localName", "'pre'"); -shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); -shouldBe("element.prefix", "'html'"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("SVG Element creation using createElementNS on an HTML doc:") -element = document.createElementNS("http://www.w3.org/2000/svg", "svg"); -shouldBe("element.nodeName", "'svg'"); -shouldBe("element.localName", "'svg'"); -shouldBe("element.namespaceURI", "'http://www.w3.org/2000/svg'"); -shouldBe("element.prefix", "null"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Unknown Element creation using createElementNS on an HTML doc:") -element = document.createElementNS("http://www.webkit.org", "foo:svg"); -shouldBe("element.nodeName", "'foo:svg'"); -shouldBe("element.localName", "'svg'"); -shouldBe("element.namespaceURI", "'http://www.webkit.org'"); -shouldBe("element.prefix", "'foo'"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Element creation using createElementNS on an HTML doc:") -element = document.createElementNS("http://www.w3.org/1999/xhtml", "pre"); -// Spec: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-104682815 (element.tagName) -// FF and Opera returns "pre" for nodeName as it is an XHTML element, WebKit returns "PRE". -shouldBe("element.nodeName", "'pre'"); -shouldBe("element.localName", "'pre'"); -shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); -shouldBe("element.prefix", "null"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Element creation using createElement on an XHTML doc:") -element = xmlDoc.createElement("pre"); -shouldBe("element.nodeName", "'pre'"); -shouldBe("element.localName", "null"); -// FF returns null for namespaceURI, WebKit returns http://www.w3.org/1999/xhtml, the spec says we should return null -shouldBe("element.namespaceURI", "null"); -shouldBe("element.prefix", "null"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Element creation using createElementNS on an XHTML doc:") -element = xmlDoc.createElementNS("http://www.w3.org/1999/xhtml", "html:pre"); -shouldBe("element.nodeName", "'html:pre'"); -shouldBe("element.localName", "'pre'"); -shouldBe("element.namespaceURI", "'http://www.w3.org/1999/xhtml'"); -shouldBe("element.prefix", "'html'"); -shouldBe("element.nodeValue", "null"); -shouldBe("element.attributes.toString()", "'[object NamedNodeMap]'"); - -debug("Processing instruction creation using createProcessingInstruction on an HTML doc:") -var processingInstruction = document.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"'); -shouldBe("processingInstruction.nodeName", "'xml-stylesheet'"); -shouldBe("processingInstruction.localName", "undefined"); -shouldBe("processingInstruction.namespaceURI", "undefined"); -// DOM Core Level 2 and DOM Core Level 3 disagree on ProcessingInstruction.nodeValue -// L2: entire content excluding the target -// L3: same as ProcessingInstruction.data -// We're following Level 3 -shouldBe("processingInstruction.nodeValue", "'type=\"text/xsl\" href=\"missing.xsl\"'"); -shouldBe("processingInstruction.target", "'xml-stylesheet'"); -shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'"); - -debug("Processing instruction creation using createProcessingInstruction on an XHTML doc:") -processingInstruction = xmlDoc.createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="missing.xsl"'); -shouldBe("processingInstruction.nodeName", "'xml-stylesheet'"); -shouldBe("processingInstruction.localName", "undefined"); -shouldBe("processingInstruction.namespaceURI", "undefined"); -shouldBe("processingInstruction.nodeValue", "'type=\"text/xsl\" href=\"missing.xsl\"'"); -shouldBe("processingInstruction.target", "'xml-stylesheet'"); -shouldBe("processingInstruction.data", "'type=\"text/xsl\" href=\"missing.xsl\"'"); - -debug("Text node creation using createTextNode on an HTML doc:") -var text = document.createTextNode("foo"); -shouldBe("text.nodeName", "'#text'"); -shouldBe("text.localName", "undefined"); -shouldBe("text.namespaceURI", "undefined"); -shouldBe("text.nodeValue", "'foo'"); -shouldBe("text.data", "'foo'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js deleted file mode 100644 index debb4f47..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/isEqualNode.js +++ /dev/null
@@ -1,11 +0,0 @@ -description("Test the isEqualNode API."); - -debug("Test isEqualNode for DocumentType nodes."); -var docTypeAllSet = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); -var docTypeAllSet2 = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); -var docTypeDifferentPublicID = document.implementation.createDocumentType('html', 'foo', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); -var docTypeDifferentSystemID = document.implementation.createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'bar'); - -shouldBeTrue("docTypeAllSet.isEqualNode(docTypeAllSet2)"); -shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentPublicID)"); -shouldBeFalse("docTypeAllSet.isEqualNode(docTypeDifferentSystemID)");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js b/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js deleted file mode 100644 index f15671c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Node/script-tests/normalize-with-cdata.js +++ /dev/null
@@ -1,20 +0,0 @@ -description('Test of normalize on an XML document with CDATA.'); - -var parser = new DOMParser(); -var serializer = new XMLSerializer(); - -var xmlChunk = parser.parseFromString( - '<foo>' + - 'This is some text before the CDATA' + - '<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>' + - 'This is some text after the CDATA' + - '</foo>', - 'application/xml'); - -debug('Before normalize'); -shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"'); -shouldBe('xmlChunk.documentElement.childNodes.length', '3'); -xmlChunk.documentElement.normalize(); -debug('After normalize'); -shouldBe('serializer.serializeToString(xmlChunk)', '"<foo>This is some text before the CDATA<![CDATA[This is some <bold>markup</bold> inside of a CDATA]]>This is some text after the CDATA</foo>"'); -shouldBe('xmlChunk.documentElement.childNodes.length', '3');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html index 257314c..14196f8 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html +++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function.html
@@ -4,6 +4,12 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/nodelist-item-call-as-function.js"></script> +<script> +description('This tests that items in a NodeList cannot be called indexed using [[Call]].'); + +var nodeList = document.getElementsByTagName('div'); +shouldThrow("nodeList(0)"); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js b/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js deleted file mode 100644 index 8f6d501..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js +++ /dev/null
@@ -1,5 +0,0 @@ -description('This tests that items in a NodeList cannot be called indexed using [[Call]].'); - -var nodeList = document.getElementsByTagName('div'); -shouldThrow("nodeList(0)"); -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/31684.html b/third_party/WebKit/LayoutTests/fast/dom/Range/31684.html index 2603187..045f55a6 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/31684.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/31684.html
@@ -4,6 +4,17 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/31684.js"></script> +<script> +description( + "This test checks an orphan text node cannot be surrounded by the range. (bug31684)" +); + +var range = document.createRange(); +var text = document.createTextNode('hello'); +var element = document.createElement("div"); +range.selectNodeContents(text); + +shouldThrow("range.surroundContents(element)", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': The container node is a detached character data node; no parent node is available for insertion."'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/mutation.html b/third_party/WebKit/LayoutTests/fast/dom/Range/mutation.html index bd8ab12..6de90639 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/mutation.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/mutation.html
@@ -4,6 +4,303 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/mutation.js"></script> +<script> +description( +"This test checks mutation of the DOM and how it affects Ranges." +); + +var a; +var b; +var c; +var d; +var e; +var paragraph; +var section; +var text; +var text1; +var text2; +var text3; + +function name(node) +{ + if (node == a) + return "a"; + if (node == b) + return "b"; + if (node == c) + return "c"; + if (node == d) + return "d"; + if (node == e) + return "e"; + if (node == paragraph) + return "paragraph"; + if (node == section) + return "section"; + if (node == text) + return "text"; + if (node == text1) + return "text1"; + if (node == text2) + return "text2"; + if (node == text3) + return "text3"; + return "???"; +} + +function description(range) +{ + return name(range.startContainer) + "," + range.startOffset + " -> " + name(range.endContainer) + "," + range.endOffset + ": " + range.toString(); +} + +function makeRange(sc, so, ec, eo) +{ + var newRange = document.createRange(); + newRange.setStart(sc, so); + newRange.setEnd(ec, eo); + return newRange; +} + +function setUp1() +{ + paragraph = document.createElement("p"); + text = document.createTextNode("Abcd efgh XY blah ijkl"); + paragraph.appendChild(text); + range = makeRange(text, 11, text, 19); +} + +function createTestElement(name) +{ + var element = document.createElement("em"); + var text = document.createTextNode(name); + element.appendChild(text); + return element; +} + +function setUp2() +{ + paragraph = document.createElement("p"); + a = createTestElement("a"); + b = createTestElement("b"); + c = createTestElement("c"); + d = createTestElement("d"); + e = createTestElement("e"); + + paragraph.appendChild(a); + paragraph.appendChild(b); + paragraph.appendChild(c); + paragraph.appendChild(d); + range = makeRange(paragraph, 1, paragraph, 3); +} + +function setUp3() +{ + paragraph = document.createElement("p"); + a = document.createTextNode("ax"); + b = document.createTextNode("by"); + + paragraph.appendChild(a); + paragraph.appendChild(b); + + range = makeRange(a, 1, b, 1); +} + +function setUp4() +{ + paragraph = document.createElement("p"); + a = document.createTextNode("abcd"); + + paragraph.appendChild(a); + + range = makeRange(a, 1, a, 3); +} + +function setUp5() +{ + section = document.createElement("div"); + paragraph = document.createElement("p"); + a = document.createTextNode("abcde"); + + section.appendChild(paragraph); + paragraph.appendChild(a); + + range = makeRange(a, 2, section, 1); +} + +// First, tests from the DOM Level 2 specification. + +// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 1. +setUp1(); +text.insertData(10, "inserted text"); +shouldBe('description(range)', '"text,24 -> text,32: Y blah i"'); + +// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 2. +// Firefox does not match the DOM Level 2 specification on this one. +setUp1(); +text.insertData(11, "inserted text"); +shouldBe('description(range)', '"text,11 -> text,32: inserted textY blah i"'); + +// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 3. +setUp1(); +text.insertData(12, "inserted text"); +shouldBe('description(range)', '"text,11 -> text,32: Yinserted text blah i"'); + +// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 4. +setUp1(); +text.insertData(17, "inserted text"); +shouldBe('description(range)', '"text,11 -> text,32: Y blahinserted text i"'); + +// Similar test at the range end. +setUp1(); +text.insertData(18, "inserted text"); +shouldBe('description(range)', '"text,11 -> text,32: Y blah inserted texti"'); + +// Similar test at the range end. +setUp1(); +text.insertData(19, "inserted text"); +shouldBe('description(range)', '"text,11 -> text,19: Y blah i"'); + +// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 1. +paragraph = document.createElement("p"); +text = document.createTextNode("Abcd efgh The Range ijkl"); +paragraph.appendChild(text); +range = makeRange(text, 11, text, 21); +text.deleteData(5, 8); +shouldBe('description(range)', '"text,5 -> text,13: Range i"'); + +// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 2. +paragraph = document.createElement("p"); +text = document.createTextNode("Abcd efgh The Range ijkl"); +paragraph.appendChild(text); +range = makeRange(text, 11, text, 21); +text.deleteData(5, 17); +shouldBe('description(range)', '"text,5 -> text,5: "'); + +// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 3. +// Firefox does not match the DOM Level 2 specification on this one. +// Or maybe I wrote the test wrong? +paragraph = document.createElement("p"); +text1 = document.createTextNode("ABCD efgh The "); +paragraph.appendChild(text1); +em = document.createElement("em"); +paragraph.appendChild(em); +text2 = document.createTextNode("Range"); +em.appendChild(text2); +text3 = document.createTextNode(" ijkl"); +paragraph.appendChild(text3); +range = makeRange(text1, 11, text2, 5); +makeRange(text1, 5, text2, 1).deleteContents(); +shouldBe('description(range)', '"text1,5 -> text2,4: ange"'); + +// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 4. +paragraph = document.createElement("p"); +text = document.createTextNode("Abcd efgh The Range ijkl"); +paragraph.appendChild(text); +range = makeRange(text, 11, text, 21); +text.deleteData(5, 6); +shouldBe('description(range)', '"text,5 -> text,15: he Range i"'); + +// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 5. +paragraph = document.createElement("p"); +text1 = document.createTextNode("Abcd "); +paragraph.appendChild(text1); +em = document.createElement("em"); +paragraph.appendChild(em); +text2 = document.createTextNode("efgh The Range ij"); +em.appendChild(text2); +text3 = document.createTextNode("kl"); +paragraph.appendChild(text3); +range = makeRange(text2, 6, text2, 16); +makeRange(paragraph, 1, paragraph, 2).deleteContents(); +shouldBe('paragraph.childNodes.length', '2'); +shouldBe('text1.length', '5'); +shouldBe('description(range)', '"paragraph,1 -> paragraph,1: "'); +paragraph.normalize(); +shouldBe('paragraph.childNodes.length', '1'); +shouldBe('text1.length', '7'); +shouldBe('description(range)', '"text1,5 -> text1,5: "'); + +// Inserting a node in the start container, before the range start offset. +setUp2(); +paragraph.insertBefore(e, a); +shouldBe('description(range)', '"paragraph,2 -> paragraph,4: bc"'); + +// Inserting a node in the start container, at the range start offset. +setUp2(); +paragraph.insertBefore(e, b); +shouldBe('description(range)', '"paragraph,1 -> paragraph,4: ebc"'); + +// Inserting a node in the start container, between start and end. +setUp2(); +paragraph.insertBefore(e, c); +shouldBe('description(range)', '"paragraph,1 -> paragraph,4: bec"'); + +// Inserting a node in the end container, at the range end offset. +setUp2(); +paragraph.insertBefore(e, d); +shouldBe('description(range)', '"paragraph,1 -> paragraph,3: bc"'); + +// Inserting a node in the end container, after the range end offset. +setUp2(); +paragraph.appendChild(e); +shouldBe('description(range)', '"paragraph,1 -> paragraph,3: bc"'); + +// Removing the start container of a range. +setUp2(); +range = makeRange(b, 0, d, 1); +paragraph.removeChild(b); +shouldBe('description(range)', '"paragraph,1 -> d,1: cd"'); +setUp2(); +range = makeRange(b, 1, d, 0); +paragraph.removeChild(b); +shouldBe('description(range)', '"paragraph,1 -> d,0: c"'); + +// Removing the end container of a range. +setUp2(); +range = makeRange(b, 0, d, 1); +paragraph.removeChild(d); +shouldBe('description(range)', '"b,0 -> paragraph,3: bc"'); +setUp2(); +range = makeRange(b, 1, d, 0); +paragraph.removeChild(d); +shouldBe('description(range)', '"b,1 -> paragraph,3: c"'); + +// Calling normalize with a range that has an endpoint in a text node that gets merged into another. +// Firefox does not do what the DOM Level 2 specification seems to call for on this one. +setUp3(); +paragraph.normalize(); +shouldBe('description(range)', '"a,1 -> a,3: xb"'); + +// Calling splitText when a range has an endpoint on in the piece that gets made into a new text node. +// Firefox does not do what the DOM Level 2 specification seems to call for on this one. +setUp4(); +b = a.splitText(1); +shouldBe('description(range)', '"a,1 -> b,2: bc"'); +setUp4(); +b = a.splitText(2); +shouldBe('description(range)', '"a,1 -> b,1: bc"'); +setUp4(); +b = a.splitText(3); +shouldBe('description(range)', '"a,1 -> a,3: bc"'); + +// Range test in Acid3. +setUp5(); +shouldBe('description(range)', '"a,2 -> section,1: cde"'); +section.removeChild(paragraph); +shouldBe('description(range)', '"section,0 -> section,0: "'); + +// Children in a range being removed, but by DOM mutation (not CharacterData mutation). +// Test CharacterData.replaceData cases? +// Test Element.innerHTML cases (setting it)? +// Test Element.innerText cases (setting it)? +// Test Element.outerHTML cases (setting it)? +// Test Element.outerText cases (setting it)? +// Test Node.replaceChild cases? +// Test cases where Node.insertBefore/appendChild has a side effect of deleting the node from a range. +// Test Range.deleteContents cases? +// Test Range.extractContents cases? +// Test Range.surroundContents cases? +// Test Text.replaceWholeText cases? +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty.html index 38bbda5..7e790f3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty.html
@@ -4,6 +4,14 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/range-clone-empty.js"></script> +<script> +description( +"This test checks cloning an empty range returns an empty fragment." +); + +var r = document.createRange(); +shouldBeTrue("r.cloneContents() != undefined"); +shouldBeTrue("r.cloneContents() != null"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions.html index a0984d63..deee2328 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions.html
@@ -4,6 +4,31 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/range-exceptions.js"></script> +<script> +description( +"This test checks some DOM Range exceptions." +); + +// Test to be sure the name BAD_BOUNDARYPOINTS_ERR dumps properly. +var node = document.createElement("DIV"); +node.innerHTML = "<BAR>AB<MOO>C</MOO>DE</BAR>"; +shouldBe("node.innerHTML", "'<bar>AB<moo>C</moo>DE</bar>'"); + +// Ensure that we throw BAD_BOUNDARYPOINTS_ERR when trying to split a comment +// (non-text but character-offset node). (Test adapted from Acid3.) +var c1 = document.createComment("aaaaa"); +node.appendChild(c1); +var c2 = document.createComment("bbbbb"); +node.appendChild(c2); +var r = document.createRange(); +r.setStart(c1, 2); +r.setEnd(c2, 3); +shouldThrow("r.surroundContents(document.createElement('a'))", '"InvalidStateError: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."'); + +// But not when we don't try to split the comment. +r.setStart(c1, 0); +r.setEnd(c1, 5); +shouldThrow("r.surroundContents(document.createElement('a'))", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': The node to be inserted is a \'A\' node, which may not be inserted here."'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html index 5e3b281..663067e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer.html
@@ -4,6 +4,43 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/range-insertNode-separate-endContainer.js"></script> +<script> +description('Test for proper behavior of Range.insertNode(documentFragment) when startContainer != endContainer'); + +var p = document.createElement('p'); +var t1 = document.createTextNode('12345'); +p.appendChild(t1); +var t2 = document.createTextNode('ABCDE'); +p.appendChild(t2); +document.body.appendChild(p); +var r = document.createRange(); +r.setStart(p, 1); +r.setEnd(t2, 3); +shouldBeEqualToString("r.toString()", "ABC"); + +var df = document.createDocumentFragment(); +var t3 = document.createTextNode("PQR"); +var t4 = document.createTextNode("XYZ"); +df.appendChild(t3); +df.appendChild(t4); +r.insertNode(df); + +shouldBe("p.childNodes.length", "4"); +shouldBe("p.childNodes[0]", "t1"); +shouldBe("p.childNodes[1]", "t3"); +shouldBe("p.childNodes[2]", "t4"); +shouldBe("p.childNodes[3]", "t2"); + +shouldBeFalse("r.collapsed"); +shouldBe("r.commonAncestorContainer", "p"); +shouldBe("r.startContainer", "p"); +shouldBe("r.startOffset", "1"); +shouldBe("r.endContainer", "t2"); +shouldBe("r.endOffset", "3"); +shouldBeEqualToString("r.toString()", "PQRXYZABC") + +// clean up after ourselves +document.body.removeChild(p); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext.html index 48e38cb0..a12cc86 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext.html
@@ -4,6 +4,38 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/range-insertNode-splittext.js"></script> +<script> +description('Test for proper behavior of Range.insertNode when splitting text nodes'); + +var p = document.createElement('p'); +var t1 = document.createTextNode('12345'); +p.appendChild(t1); +var t2 = document.createTextNode('ABCDE'); +document.body.appendChild(p); +var r = document.createRange(); +r.setStart(t1, 2); +r.setEnd(t1, 3); +r.insertNode(t2); + +shouldBe("p.childNodes.length", "3"); +shouldBe("p.childNodes[0]", "t1"); +shouldBeEqualToString("p.childNodes[0].data", "12"); +shouldBe("p.childNodes[1]", "t2"); +shouldBeEqualToString("p.childNodes[1].data", "ABCDE"); +shouldBeEqualToString("p.childNodes[2].data", "345"); + +var t3 = p.childNodes[2]; + +shouldBeFalse("r.collapsed"); +shouldBe("r.commonAncestorContainer", "p"); +shouldBe("r.startContainer", "t1"); +shouldBe("r.startOffset", "2"); +shouldBe("r.endContainer", "t3"); +shouldBe("r.endOffset", "1"); +shouldBeEqualToString("r.toString()", "ABCDE3") + +// clean up after ourselves +document.body.removeChild(p); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents.html b/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents.html index 35acb204..6dad04c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents.html
@@ -4,6 +4,103 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/range-modifycontents.js"></script> +<script> +description( +"Test modification of contents of a range" +); + +var r; + +// TEST 1: Initial values +debug('<span>Start test 1</span>'); +var r = document.createRange(); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "0"); +shouldBe("r.startContainer", "document"); +shouldBe("r.endContainer", "document"); +shouldBeTrue("r.collapsed"); +shouldBe("r.commonAncestorContainer", "document"); + +// TEST 2: Insert a comment into the document +debug('<span>Start test 2</span>'); +r.insertNode(document.createComment("test comment")); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "1"); +shouldBe("r.startContainer", "document"); +shouldBe("r.endContainer", "document"); +shouldBeFalse("r.collapsed"); +shouldBe("r.commonAncestorContainer", "document"); + +// TEST 3: Remove the comment again +debug('<span>Start test 3</span>'); +r.deleteContents(); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "0"); +shouldBe("r.startContainer", "document"); +shouldBe("r.endContainer", "document"); +shouldBeTrue("r.collapsed"); +shouldBe("r.commonAncestorContainer", "document"); + +// TEST 4: Insert a document fragment +debug('<span>Start test 4</span>'); +var f = document.createDocumentFragment(); +var c = document.getElementById("description"); +r.setStart(c, 0); +f.appendChild(document.createTextNode("test text node")); +f.appendChild(document.createComment("another text comment")); +f.appendChild(document.createTextNode("another test text node")); +r.insertNode(f); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "3"); +shouldBe("r.startContainer", "c"); +shouldBe("r.endContainer", "c"); +shouldBeFalse("r.collapsed"); +shouldBe("r.commonAncestorContainer", "c"); + +// TEST 5: Remove the fragment again +debug('<span>Start test 5</span>'); +r.deleteContents(); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "0"); +shouldBe("r.startContainer", "c"); +shouldBe("r.endContainer", "c"); +shouldBeTrue("r.collapsed"); +shouldBe("r.commonAncestorContainer", "c"); + +// TEST 6: Insert an empty document fragment +debug('<span>Start test 6</span>'); +f = document.createDocumentFragment(); +r.insertNode(f); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "0"); +shouldBe("r.startContainer", "c"); +shouldBe("r.endContainer", "c"); +shouldBeTrue("r.collapsed"); +shouldBe("r.commonAncestorContainer", "c"); + +// TEST 7: Insert a div +debug('<span>Start test 7</span>'); +var d = document.createElement("div"); +d.appendChild(document.createTextNode("test text node")); +d.appendChild(document.createComment("another text comment")); +d.appendChild(document.createTextNode("another test text node")); +r.insertNode(d); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "1"); +shouldBe("r.startContainer", "c"); +shouldBe("r.endContainer", "c"); +shouldBeFalse("r.collapsed"); +shouldBe("r.commonAncestorContainer", "c"); + +// TEST 8: Remove the div +debug('<span>Start test 8</span>'); +r.deleteContents(); +shouldBe("r.startOffset", "0"); +shouldBe("r.endOffset", "0"); +shouldBe("r.startContainer", "c"); +shouldBe("r.endContainer", "c"); +shouldBeTrue("r.collapsed"); +shouldBe("r.commonAncestorContainer", "c"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/31684.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/31684.js deleted file mode 100644 index 6b3e1a9..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/31684.js +++ /dev/null
@@ -1,10 +0,0 @@ -description( - "This test checks an orphan text node cannot be surrounded by the range. (bug31684)" -); - -var range = document.createRange(); -var text = document.createTextNode('hello'); -var element = document.createElement("div"); -range.selectNodeContents(text); - -shouldThrow("range.surroundContents(element)", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': The container node is a detached character data node; no parent node is available for insertion."');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/mutation.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/mutation.js deleted file mode 100644 index 22debea..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/mutation.js +++ /dev/null
@@ -1,296 +0,0 @@ -description( -"This test checks mutation of the DOM and how it affects Ranges." -); - -var a; -var b; -var c; -var d; -var e; -var paragraph; -var section; -var text; -var text1; -var text2; -var text3; - -function name(node) -{ - if (node == a) - return "a"; - if (node == b) - return "b"; - if (node == c) - return "c"; - if (node == d) - return "d"; - if (node == e) - return "e"; - if (node == paragraph) - return "paragraph"; - if (node == section) - return "section"; - if (node == text) - return "text"; - if (node == text1) - return "text1"; - if (node == text2) - return "text2"; - if (node == text3) - return "text3"; - return "???"; -} - -function description(range) -{ - return name(range.startContainer) + "," + range.startOffset + " -> " + name(range.endContainer) + "," + range.endOffset + ": " + range.toString(); -} - -function makeRange(sc, so, ec, eo) -{ - var newRange = document.createRange(); - newRange.setStart(sc, so); - newRange.setEnd(ec, eo); - return newRange; -} - -function setUp1() -{ - paragraph = document.createElement("p"); - text = document.createTextNode("Abcd efgh XY blah ijkl"); - paragraph.appendChild(text); - range = makeRange(text, 11, text, 19); -} - -function createTestElement(name) -{ - var element = document.createElement("em"); - var text = document.createTextNode(name); - element.appendChild(text); - return element; -} - -function setUp2() -{ - paragraph = document.createElement("p"); - a = createTestElement("a"); - b = createTestElement("b"); - c = createTestElement("c"); - d = createTestElement("d"); - e = createTestElement("e"); - - paragraph.appendChild(a); - paragraph.appendChild(b); - paragraph.appendChild(c); - paragraph.appendChild(d); - range = makeRange(paragraph, 1, paragraph, 3); -} - -function setUp3() -{ - paragraph = document.createElement("p"); - a = document.createTextNode("ax"); - b = document.createTextNode("by"); - - paragraph.appendChild(a); - paragraph.appendChild(b); - - range = makeRange(a, 1, b, 1); -} - -function setUp4() -{ - paragraph = document.createElement("p"); - a = document.createTextNode("abcd"); - - paragraph.appendChild(a); - - range = makeRange(a, 1, a, 3); -} - -function setUp5() -{ - section = document.createElement("div"); - paragraph = document.createElement("p"); - a = document.createTextNode("abcde"); - - section.appendChild(paragraph); - paragraph.appendChild(a); - - range = makeRange(a, 2, section, 1); -} - -// First, tests from the DOM Level 2 specification. - -// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 1. -setUp1(); -text.insertData(10, "inserted text"); -shouldBe('description(range)', '"text,24 -> text,32: Y blah i"'); - -// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 2. -// Firefox does not match the DOM Level 2 specification on this one. -setUp1(); -text.insertData(11, "inserted text"); -shouldBe('description(range)', '"text,11 -> text,32: inserted textY blah i"'); - -// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 3. -setUp1(); -text.insertData(12, "inserted text"); -shouldBe('description(range)', '"text,11 -> text,32: Yinserted text blah i"'); - -// DOM Level 2 Traversal Range, 2.12.1. Insertions, example 4. -setUp1(); -text.insertData(17, "inserted text"); -shouldBe('description(range)', '"text,11 -> text,32: Y blahinserted text i"'); - -// Similar test at the range end. -setUp1(); -text.insertData(18, "inserted text"); -shouldBe('description(range)', '"text,11 -> text,32: Y blah inserted texti"'); - -// Similar test at the range end. -setUp1(); -text.insertData(19, "inserted text"); -shouldBe('description(range)', '"text,11 -> text,19: Y blah i"'); - -// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 1. -paragraph = document.createElement("p"); -text = document.createTextNode("Abcd efgh The Range ijkl"); -paragraph.appendChild(text); -range = makeRange(text, 11, text, 21); -text.deleteData(5, 8); -shouldBe('description(range)', '"text,5 -> text,13: Range i"'); - -// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 2. -paragraph = document.createElement("p"); -text = document.createTextNode("Abcd efgh The Range ijkl"); -paragraph.appendChild(text); -range = makeRange(text, 11, text, 21); -text.deleteData(5, 17); -shouldBe('description(range)', '"text,5 -> text,5: "'); - -// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 3. -// Firefox does not match the DOM Level 2 specification on this one. -// Or maybe I wrote the test wrong? -paragraph = document.createElement("p"); -text1 = document.createTextNode("ABCD efgh The "); -paragraph.appendChild(text1); -em = document.createElement("em"); -paragraph.appendChild(em); -text2 = document.createTextNode("Range"); -em.appendChild(text2); -text3 = document.createTextNode(" ijkl"); -paragraph.appendChild(text3); -range = makeRange(text1, 11, text2, 5); -makeRange(text1, 5, text2, 1).deleteContents(); -shouldBe('description(range)', '"text1,5 -> text2,4: ange"'); - -// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 4. -paragraph = document.createElement("p"); -text = document.createTextNode("Abcd efgh The Range ijkl"); -paragraph.appendChild(text); -range = makeRange(text, 11, text, 21); -text.deleteData(5, 6); -shouldBe('description(range)', '"text,5 -> text,15: he Range i"'); - -// DOM Level 2 Traversal Range, 2.12.2. Deletions, example 5. -paragraph = document.createElement("p"); -text1 = document.createTextNode("Abcd "); -paragraph.appendChild(text1); -em = document.createElement("em"); -paragraph.appendChild(em); -text2 = document.createTextNode("efgh The Range ij"); -em.appendChild(text2); -text3 = document.createTextNode("kl"); -paragraph.appendChild(text3); -range = makeRange(text2, 6, text2, 16); -makeRange(paragraph, 1, paragraph, 2).deleteContents(); -shouldBe('paragraph.childNodes.length', '2'); -shouldBe('text1.length', '5'); -shouldBe('description(range)', '"paragraph,1 -> paragraph,1: "'); -paragraph.normalize(); -shouldBe('paragraph.childNodes.length', '1'); -shouldBe('text1.length', '7'); -shouldBe('description(range)', '"text1,5 -> text1,5: "'); - -// Inserting a node in the start container, before the range start offset. -setUp2(); -paragraph.insertBefore(e, a); -shouldBe('description(range)', '"paragraph,2 -> paragraph,4: bc"'); - -// Inserting a node in the start container, at the range start offset. -setUp2(); -paragraph.insertBefore(e, b); -shouldBe('description(range)', '"paragraph,1 -> paragraph,4: ebc"'); - -// Inserting a node in the start container, between start and end. -setUp2(); -paragraph.insertBefore(e, c); -shouldBe('description(range)', '"paragraph,1 -> paragraph,4: bec"'); - -// Inserting a node in the end container, at the range end offset. -setUp2(); -paragraph.insertBefore(e, d); -shouldBe('description(range)', '"paragraph,1 -> paragraph,3: bc"'); - -// Inserting a node in the end container, after the range end offset. -setUp2(); -paragraph.appendChild(e); -shouldBe('description(range)', '"paragraph,1 -> paragraph,3: bc"'); - -// Removing the start container of a range. -setUp2(); -range = makeRange(b, 0, d, 1); -paragraph.removeChild(b); -shouldBe('description(range)', '"paragraph,1 -> d,1: cd"'); -setUp2(); -range = makeRange(b, 1, d, 0); -paragraph.removeChild(b); -shouldBe('description(range)', '"paragraph,1 -> d,0: c"'); - -// Removing the end container of a range. -setUp2(); -range = makeRange(b, 0, d, 1); -paragraph.removeChild(d); -shouldBe('description(range)', '"b,0 -> paragraph,3: bc"'); -setUp2(); -range = makeRange(b, 1, d, 0); -paragraph.removeChild(d); -shouldBe('description(range)', '"b,1 -> paragraph,3: c"'); - -// Calling normalize with a range that has an endpoint in a text node that gets merged into another. -// Firefox does not do what the DOM Level 2 specification seems to call for on this one. -setUp3(); -paragraph.normalize(); -shouldBe('description(range)', '"a,1 -> a,3: xb"'); - -// Calling splitText when a range has an endpoint on in the piece that gets made into a new text node. -// Firefox does not do what the DOM Level 2 specification seems to call for on this one. -setUp4(); -b = a.splitText(1); -shouldBe('description(range)', '"a,1 -> b,2: bc"'); -setUp4(); -b = a.splitText(2); -shouldBe('description(range)', '"a,1 -> b,1: bc"'); -setUp4(); -b = a.splitText(3); -shouldBe('description(range)', '"a,1 -> a,3: bc"'); - -// Range test in Acid3. -setUp5(); -shouldBe('description(range)', '"a,2 -> section,1: cde"'); -section.removeChild(paragraph); -shouldBe('description(range)', '"section,0 -> section,0: "'); - -// Children in a range being removed, but by DOM mutation (not CharacterData mutation). -// Test CharacterData.replaceData cases? -// Test Element.innerHTML cases (setting it)? -// Test Element.innerText cases (setting it)? -// Test Element.outerHTML cases (setting it)? -// Test Element.outerText cases (setting it)? -// Test Node.replaceChild cases? -// Test cases where Node.insertBefore/appendChild has a side effect of deleting the node from a range. -// Test Range.deleteContents cases? -// Test Range.extractContents cases? -// Test Range.surroundContents cases? -// Test Text.replaceWholeText cases?
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-clone-empty.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-clone-empty.js deleted file mode 100644 index 4d44b7c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-clone-empty.js +++ /dev/null
@@ -1,7 +0,0 @@ -description( -"This test checks cloning an empty range returns an empty fragment." -); - -var r = document.createRange(); -shouldBeTrue("r.cloneContents() != undefined"); -shouldBeTrue("r.cloneContents() != null");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-exceptions.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-exceptions.js deleted file mode 100644 index c036cc6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-exceptions.js +++ /dev/null
@@ -1,24 +0,0 @@ -description( -"This test checks some DOM Range exceptions." -); - -// Test to be sure the name BAD_BOUNDARYPOINTS_ERR dumps properly. -var node = document.createElement("DIV"); -node.innerHTML = "<BAR>AB<MOO>C</MOO>DE</BAR>"; -shouldBe("node.innerHTML", "'<bar>AB<moo>C</moo>DE</bar>'"); - -// Ensure that we throw BAD_BOUNDARYPOINTS_ERR when trying to split a comment -// (non-text but character-offset node). (Test adapted from Acid3.) -var c1 = document.createComment("aaaaa"); -node.appendChild(c1); -var c2 = document.createComment("bbbbb"); -node.appendChild(c2); -var r = document.createRange(); -r.setStart(c1, 2); -r.setEnd(c2, 3); -shouldThrow("r.surroundContents(document.createElement('a'))", '"InvalidStateError: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."'); - -// But not when we don't try to split the comment. -r.setStart(c1, 0); -r.setEnd(c1, 5); -shouldThrow("r.surroundContents(document.createElement('a'))", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': The node to be inserted is a \'A\' node, which may not be inserted here."');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-separate-endContainer.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-separate-endContainer.js deleted file mode 100644 index 1afa86ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-separate-endContainer.js +++ /dev/null
@@ -1,36 +0,0 @@ -description('Test for proper behavior of Range.insertNode(documentFragment) when startContainer != endContainer'); - -var p = document.createElement('p'); -var t1 = document.createTextNode('12345'); -p.appendChild(t1); -var t2 = document.createTextNode('ABCDE'); -p.appendChild(t2); -document.body.appendChild(p); -var r = document.createRange(); -r.setStart(p, 1); -r.setEnd(t2, 3); -shouldBeEqualToString("r.toString()", "ABC"); - -var df = document.createDocumentFragment(); -var t3 = document.createTextNode("PQR"); -var t4 = document.createTextNode("XYZ"); -df.appendChild(t3); -df.appendChild(t4); -r.insertNode(df); - -shouldBe("p.childNodes.length", "4"); -shouldBe("p.childNodes[0]", "t1"); -shouldBe("p.childNodes[1]", "t3"); -shouldBe("p.childNodes[2]", "t4"); -shouldBe("p.childNodes[3]", "t2"); - -shouldBeFalse("r.collapsed"); -shouldBe("r.commonAncestorContainer", "p"); -shouldBe("r.startContainer", "p"); -shouldBe("r.startOffset", "1"); -shouldBe("r.endContainer", "t2"); -shouldBe("r.endOffset", "3"); -shouldBeEqualToString("r.toString()", "PQRXYZABC") - -// clean up after ourselves -document.body.removeChild(p);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-splittext.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-splittext.js deleted file mode 100644 index 869ed19..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-insertNode-splittext.js +++ /dev/null
@@ -1,31 +0,0 @@ -description('Test for proper behavior of Range.insertNode when splitting text nodes'); - -var p = document.createElement('p'); -var t1 = document.createTextNode('12345'); -p.appendChild(t1); -var t2 = document.createTextNode('ABCDE'); -document.body.appendChild(p); -var r = document.createRange(); -r.setStart(t1, 2); -r.setEnd(t1, 3); -r.insertNode(t2); - -shouldBe("p.childNodes.length", "3"); -shouldBe("p.childNodes[0]", "t1"); -shouldBeEqualToString("p.childNodes[0].data", "12"); -shouldBe("p.childNodes[1]", "t2"); -shouldBeEqualToString("p.childNodes[1].data", "ABCDE"); -shouldBeEqualToString("p.childNodes[2].data", "345"); - -var t3 = p.childNodes[2]; - -shouldBeFalse("r.collapsed"); -shouldBe("r.commonAncestorContainer", "p"); -shouldBe("r.startContainer", "t1"); -shouldBe("r.startOffset", "2"); -shouldBe("r.endContainer", "t3"); -shouldBe("r.endOffset", "1"); -shouldBeEqualToString("r.toString()", "ABCDE3") - -// clean up after ourselves -document.body.removeChild(p);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-modifycontents.js b/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-modifycontents.js deleted file mode 100644 index 0c7a339..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Range/script-tests/range-modifycontents.js +++ /dev/null
@@ -1,96 +0,0 @@ -description( -"Test modification of contents of a range" -); - -var r; - -// TEST 1: Initial values -debug('<span>Start test 1</span>'); -var r = document.createRange(); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "0"); -shouldBe("r.startContainer", "document"); -shouldBe("r.endContainer", "document"); -shouldBeTrue("r.collapsed"); -shouldBe("r.commonAncestorContainer", "document"); - -// TEST 2: Insert a comment into the document -debug('<span>Start test 2</span>'); -r.insertNode(document.createComment("test comment")); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "1"); -shouldBe("r.startContainer", "document"); -shouldBe("r.endContainer", "document"); -shouldBeFalse("r.collapsed"); -shouldBe("r.commonAncestorContainer", "document"); - -// TEST 3: Remove the comment again -debug('<span>Start test 3</span>'); -r.deleteContents(); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "0"); -shouldBe("r.startContainer", "document"); -shouldBe("r.endContainer", "document"); -shouldBeTrue("r.collapsed"); -shouldBe("r.commonAncestorContainer", "document"); - -// TEST 4: Insert a document fragment -debug('<span>Start test 4</span>'); -var f = document.createDocumentFragment(); -var c = document.getElementById("description"); -r.setStart(c, 0); -f.appendChild(document.createTextNode("test text node")); -f.appendChild(document.createComment("another text comment")); -f.appendChild(document.createTextNode("another test text node")); -r.insertNode(f); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "3"); -shouldBe("r.startContainer", "c"); -shouldBe("r.endContainer", "c"); -shouldBeFalse("r.collapsed"); -shouldBe("r.commonAncestorContainer", "c"); - -// TEST 5: Remove the fragment again -debug('<span>Start test 5</span>'); -r.deleteContents(); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "0"); -shouldBe("r.startContainer", "c"); -shouldBe("r.endContainer", "c"); -shouldBeTrue("r.collapsed"); -shouldBe("r.commonAncestorContainer", "c"); - -// TEST 6: Insert an empty document fragment -debug('<span>Start test 6</span>'); -f = document.createDocumentFragment(); -r.insertNode(f); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "0"); -shouldBe("r.startContainer", "c"); -shouldBe("r.endContainer", "c"); -shouldBeTrue("r.collapsed"); -shouldBe("r.commonAncestorContainer", "c"); - -// TEST 7: Insert a div -debug('<span>Start test 7</span>'); -var d = document.createElement("div"); -d.appendChild(document.createTextNode("test text node")); -d.appendChild(document.createComment("another text comment")); -d.appendChild(document.createTextNode("another test text node")); -r.insertNode(d); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "1"); -shouldBe("r.startContainer", "c"); -shouldBe("r.endContainer", "c"); -shouldBeFalse("r.collapsed"); -shouldBe("r.commonAncestorContainer", "c"); - -// TEST 8: Remove the div -debug('<span>Start test 8</span>'); -r.deleteContents(); -shouldBe("r.startOffset", "0"); -shouldBe("r.endOffset", "0"); -shouldBe("r.startContainer", "c"); -shouldBe("r.endContainer", "c"); -shouldBeTrue("r.collapsed"); -shouldBe("r.commonAncestorContainer", "c");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/collapseToX-empty-selection.html b/third_party/WebKit/LayoutTests/fast/dom/Selection/collapseToX-empty-selection.html index 8029bda..983744a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Selection/collapseToX-empty-selection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Selection/collapseToX-empty-selection.html
@@ -4,6 +4,22 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/collapseToX-empty-selection.js"></script> +<script> +description("Test that collapseToStart() and collapseToEnd() throw INVALID_STATE_ERR if no selection is made."); + +var sel = window.getSelection(); +var textNode = document.createTextNode("abcdef"); +document.body.appendChild(textNode); + +shouldThrow("sel.collapseToStart()", '"InvalidStateError: Failed to execute \'collapseToStart\' on \'Selection\': there is no selection."'); +shouldThrow("sel.collapseToEnd()", '"InvalidStateError: Failed to execute \'collapseToEnd\' on \'Selection\': there is no selection."'); + +sel.selectAllChildren(textNode); + +shouldBe("sel.collapseToStart()", "undefined"); +shouldBe("sel.collapseToEnd()", "undefined"); + +document.body.removeChild(textNode); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/getRangeAt.html b/third_party/WebKit/LayoutTests/fast/dom/Selection/getRangeAt.html index 891b681d5..52d45db 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Selection/getRangeAt.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Selection/getRangeAt.html
@@ -4,6 +4,38 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/getRangeAt.js"></script> +<script> +description("Test to make sure that getRangeAt does not modify the range when returning it.") + +var div = document.createElement('div'); +document.body.appendChild(div); +var textNode = document.createTextNode("asd"); +div.appendChild(textNode); + +var sel = window.getSelection(); +sel.collapse(textNode, 0); +var range = sel.getRangeAt(0); + +var result = range.comparePoint(textNode, 0); +if (result == 0) { + testPassed("range is correctly (text, 0)"); +} else { + testFailed("range did not match (text, 0)"); + debug("window.getSelection():"); + debug("anchorNode: " + sel.anchorNode); + debug("anchorOffset: " + sel.anchorOffset); + debug("focusNode: " + sel.focusNode); + debug("focusOffset: " + sel.focusOffset); + + debug("window.getSelection().getRangeAt(0):"); + debug("startContainer: " + range.startContainer); + debug("startOffset: " + range.startOffset); + debug("endContainer: " + range.endContainer); + debug("endOffset: " + range.endOffset); +} + +// Clean up after ourselves +document.body.removeChild(div); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/collapseToX-empty-selection.js b/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/collapseToX-empty-selection.js deleted file mode 100644 index e32618e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/collapseToX-empty-selection.js +++ /dev/null
@@ -1,15 +0,0 @@ -description("Test that collapseToStart() and collapseToEnd() throw INVALID_STATE_ERR if no selection is made."); - -var sel = window.getSelection(); -var textNode = document.createTextNode("abcdef"); -document.body.appendChild(textNode); - -shouldThrow("sel.collapseToStart()", '"InvalidStateError: Failed to execute \'collapseToStart\' on \'Selection\': there is no selection."'); -shouldThrow("sel.collapseToEnd()", '"InvalidStateError: Failed to execute \'collapseToEnd\' on \'Selection\': there is no selection."'); - -sel.selectAllChildren(textNode); - -shouldBe("sel.collapseToStart()", "undefined"); -shouldBe("sel.collapseToEnd()", "undefined"); - -document.body.removeChild(textNode);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js b/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js deleted file mode 100644 index 9410b60..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Selection/script-tests/getRangeAt.js +++ /dev/null
@@ -1,31 +0,0 @@ -description("Test to make sure that getRangeAt does not modify the range when returning it.") - -var div = document.createElement('div'); -document.body.appendChild(div); -var textNode = document.createTextNode("asd"); -div.appendChild(textNode); - -var sel = window.getSelection(); -sel.collapse(textNode, 0); -var range = sel.getRangeAt(0); - -var result = range.comparePoint(textNode, 0); -if (result == 0) { - testPassed("range is correctly (text, 0)"); -} else { - testFailed("range did not match (text, 0)"); - debug("window.getSelection():"); - debug("anchorNode: " + sel.anchorNode); - debug("anchorOffset: " + sel.anchorOffset); - debug("focusNode: " + sel.focusNode); - debug("focusOffset: " + sel.focusOffset); - - debug("window.getSelection().getRangeAt(0):"); - debug("startContainer: " + range.startContainer); - debug("startOffset: " + range.startOffset); - debug("endContainer: " + range.endContainer); - debug("endOffset: " + range.endOffset); -} - -// Clean up after ourselves -document.body.removeChild(div);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html index d422c82..cebc4a5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html
@@ -4,6 +4,30 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/detached-element.js"></script> +<script> +description( +"This tests that querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) work with elements that are not in a document yet." +); + +var root = document.createElement('div'); +var correctNode = document.createElement('div'); +correctNode.setAttribute("id", "testId") +root.appendChild(correctNode); +var noChild = document.createElement('div'); + +shouldBe("root.querySelector('div')", "correctNode"); +shouldBe("root.querySelector('#testId')", "correctNode"); + +shouldBe("root.querySelectorAll('div').length", "1"); +shouldBe("root.querySelectorAll('div').item(0)", "correctNode"); +shouldBe("root.querySelectorAll('#testId').length", "1"); +shouldBe("root.querySelectorAll('#testId').item(0)", "correctNode"); + +shouldBeNull("noChild.querySelector('div')"); +shouldBe("noChild.querySelectorAll('div').length", "0"); + +shouldBeTrue("correctNode.webkitMatchesSelector('div')"); +shouldBeTrue("correctNode.webkitMatchesSelector('#testId')"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html index ca88de8..98a494fb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html
@@ -4,6 +4,24 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/elementRoot.js"></script> +<script> +description( +"This tests that querySelector and querySelectorAll don't search outside their root node." +); + +var root = document.createElement('div'); +var correctNode = document.createElement('div'); +root.appendChild(correctNode); +document.body.appendChild(root); +var noChild = document.createElement('div'); +document.body.appendChild(noChild); + +shouldBe("root.querySelector('div')", "correctNode"); +shouldBe("root.querySelectorAll('div').length", "1"); +shouldBe("root.querySelectorAll('div').item(0)", "correctNode"); + +shouldBeNull("noChild.querySelector('div')"); +shouldBe("noChild.querySelectorAll('div').length", "0"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath.html index 40f8c47..db578ff 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath.html +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath.html
@@ -4,6 +4,32 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/id-fastpath.js"></script> +<script> +description( +"This tests that the querySelector and querySelectorAll fast path for IDs is not overzelous." +); + +var root = document.createElement('div'); +var correctNode = document.createElement('div'); +correctNode.setAttribute("id", "testid") +root.appendChild(correctNode); +document.body.appendChild(root); + +shouldBe("document.querySelector('div#testid')", "correctNode"); +shouldBe("document.querySelector('#testid')", "correctNode"); +shouldBeNull("document.querySelector('ul#testid')"); +shouldBeNull("document.querySelector('ul #testid')"); +shouldBeNull("document.querySelector('#testid[attr]')"); +shouldBeNull("document.querySelector('#testid:not(div)')"); + +shouldBe("document.querySelectorAll('div#testid').length", "1"); +shouldBe("document.querySelectorAll('div#testid').item(0)", "correctNode"); +shouldBe("document.querySelectorAll('#testid').length", "1"); +shouldBe("document.querySelectorAll('#testid').item(0)", "correctNode"); +shouldBe("document.querySelectorAll('ul#testid').length", "0"); +shouldBe("document.querySelectorAll('ul #testid').length", "0"); +shouldBe("document.querySelectorAll('#testid[attr]').length", "0"); +shouldBe("document.querySelectorAll('#testid:not(div)').length", "0"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/detached-element.js b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/detached-element.js deleted file mode 100644 index 289ebbd..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/detached-element.js +++ /dev/null
@@ -1,23 +0,0 @@ -description( -"This tests that querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) work with elements that are not in a document yet." -); - -var root = document.createElement('div'); -var correctNode = document.createElement('div'); -correctNode.setAttribute("id", "testId") -root.appendChild(correctNode); -var noChild = document.createElement('div'); - -shouldBe("root.querySelector('div')", "correctNode"); -shouldBe("root.querySelector('#testId')", "correctNode"); - -shouldBe("root.querySelectorAll('div').length", "1"); -shouldBe("root.querySelectorAll('div').item(0)", "correctNode"); -shouldBe("root.querySelectorAll('#testId').length", "1"); -shouldBe("root.querySelectorAll('#testId').item(0)", "correctNode"); - -shouldBeNull("noChild.querySelector('div')"); -shouldBe("noChild.querySelectorAll('div').length", "0"); - -shouldBeTrue("correctNode.webkitMatchesSelector('div')"); -shouldBeTrue("correctNode.webkitMatchesSelector('#testId')");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/elementRoot.js b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/elementRoot.js deleted file mode 100644 index 650ae0d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/elementRoot.js +++ /dev/null
@@ -1,17 +0,0 @@ -description( -"This tests that querySelector and querySelectorAll don't search outside their root node." -); - -var root = document.createElement('div'); -var correctNode = document.createElement('div'); -root.appendChild(correctNode); -document.body.appendChild(root); -var noChild = document.createElement('div'); -document.body.appendChild(noChild); - -shouldBe("root.querySelector('div')", "correctNode"); -shouldBe("root.querySelectorAll('div').length", "1"); -shouldBe("root.querySelectorAll('div').item(0)", "correctNode"); - -shouldBeNull("noChild.querySelector('div')"); -shouldBe("noChild.querySelectorAll('div').length", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/id-fastpath.js b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/id-fastpath.js deleted file mode 100644 index 925281d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/id-fastpath.js +++ /dev/null
@@ -1,25 +0,0 @@ -description( -"This tests that the querySelector and querySelectorAll fast path for IDs is not overzelous." -); - -var root = document.createElement('div'); -var correctNode = document.createElement('div'); -correctNode.setAttribute("id", "testid") -root.appendChild(correctNode); -document.body.appendChild(root); - -shouldBe("document.querySelector('div#testid')", "correctNode"); -shouldBe("document.querySelector('#testid')", "correctNode"); -shouldBeNull("document.querySelector('ul#testid')"); -shouldBeNull("document.querySelector('ul #testid')"); -shouldBeNull("document.querySelector('#testid[attr]')"); -shouldBeNull("document.querySelector('#testid:not(div)')"); - -shouldBe("document.querySelectorAll('div#testid').length", "1"); -shouldBe("document.querySelectorAll('div#testid').item(0)", "correctNode"); -shouldBe("document.querySelectorAll('#testid').length", "1"); -shouldBe("document.querySelectorAll('#testid').item(0)", "correctNode"); -shouldBe("document.querySelectorAll('ul#testid').length", "0"); -shouldBe("document.querySelectorAll('ul #testid').length", "0"); -shouldBe("document.querySelectorAll('#testid[attr]').length", "0"); -shouldBe("document.querySelectorAll('#testid:not(div)').length", "0");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js deleted file mode 100644 index 7aaa2a60..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/undefined-null-stringify.js +++ /dev/null
@@ -1,21 +0,0 @@ -description( -"This tests that the querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) correctly stringify null and undefined to \"null\" and \"undefined\"." -); - -var root = document.createElement('div'); -var nullNode = document.createElement('null'); -root.appendChild(nullNode); -var undefinedNode = document.createElement('undefined'); -root.appendChild(undefinedNode); -document.body.appendChild(root); - -shouldBe("document.querySelector(null)", "nullNode"); -shouldBe("document.querySelector(undefined)", "undefinedNode"); - -shouldBe("document.querySelectorAll(null).length", "1"); -shouldBe("document.querySelectorAll(null).item(0)", "nullNode"); -shouldBe("document.querySelectorAll(undefined).length", "1"); -shouldBe("document.querySelectorAll(undefined).item(0)", "undefinedNode"); - -shouldBeTrue("nullNode.webkitMatchesSelector(null)"); -shouldBeTrue("undefinedNode.webkitMatchesSelector(undefined)");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/viewless-document.js b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/viewless-document.js deleted file mode 100644 index 7a9d43e2..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/script-tests/viewless-document.js +++ /dev/null
@@ -1,26 +0,0 @@ -description( -"This tests that querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) don't crash when used in a viewless document." -); - -var testDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html"); -testDoc.documentElement.appendChild(testDoc.createElement("body")); -testDoc.body.appendChild(testDoc.createElement("p")).id = "p1"; -testDoc.getElementById("p1").appendChild(testDoc.createElement("span")).id = "s1"; -testDoc.body.appendChild(testDoc.createElement("span")).id = "s2"; -testDoc.body.appendChild(testDoc.createElement("div")).className = "d1"; - -var p1 = testDoc.getElementById("p1"); -var s1 = testDoc.getElementById("s1"); -var s2 = testDoc.getElementById("s2"); -var d1 = testDoc.body.lastChild; - -shouldBe("testDoc.querySelector('p')", "p1"); -shouldBe("testDoc.querySelectorAll('span').length", "2"); -shouldBe("testDoc.querySelectorAll('span').item(1)", "s2"); -shouldBe("testDoc.querySelector('.d1')", "d1"); -shouldBe("testDoc.querySelectorAll('p span').length", "1"); - -shouldBeTrue("p1.webkitMatchesSelector('p')"); -shouldBeTrue("s1.webkitMatchesSelector('p span')"); -shouldBeTrue("s2.webkitMatchesSelector('#s2')"); -shouldBeTrue("d1.webkitMatchesSelector('.d1')");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify.html index 4c92c91..18b9911e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify.html +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify.html
@@ -4,6 +4,28 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/undefined-null-stringify.js"></script> +<script> +description( +"This tests that the querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) correctly stringify null and undefined to \"null\" and \"undefined\"." +); + +var root = document.createElement('div'); +var nullNode = document.createElement('null'); +root.appendChild(nullNode); +var undefinedNode = document.createElement('undefined'); +root.appendChild(undefinedNode); +document.body.appendChild(root); + +shouldBe("document.querySelector(null)", "nullNode"); +shouldBe("document.querySelector(undefined)", "undefinedNode"); + +shouldBe("document.querySelectorAll(null).length", "1"); +shouldBe("document.querySelectorAll(null).item(0)", "nullNode"); +shouldBe("document.querySelectorAll(undefined).length", "1"); +shouldBe("document.querySelectorAll(undefined).item(0)", "undefinedNode"); + +shouldBeTrue("nullNode.webkitMatchesSelector(null)"); +shouldBeTrue("undefinedNode.webkitMatchesSelector(undefined)"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document.html index 386e9d4..953a24e0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document.html +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document.html
@@ -4,6 +4,33 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/viewless-document.js"></script> +<script> +description( +"This tests that querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) don't crash when used in a viewless document." +); + +var testDoc = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html"); +testDoc.documentElement.appendChild(testDoc.createElement("body")); +testDoc.body.appendChild(testDoc.createElement("p")).id = "p1"; +testDoc.getElementById("p1").appendChild(testDoc.createElement("span")).id = "s1"; +testDoc.body.appendChild(testDoc.createElement("span")).id = "s2"; +testDoc.body.appendChild(testDoc.createElement("div")).className = "d1"; + +var p1 = testDoc.getElementById("p1"); +var s1 = testDoc.getElementById("s1"); +var s2 = testDoc.getElementById("s2"); +var d1 = testDoc.body.lastChild; + +shouldBe("testDoc.querySelector('p')", "p1"); +shouldBe("testDoc.querySelectorAll('span').length", "2"); +shouldBe("testDoc.querySelectorAll('span').item(1)", "s2"); +shouldBe("testDoc.querySelector('.d1')", "d1"); +shouldBe("testDoc.querySelectorAll('p span').length", "1"); + +shouldBeTrue("p1.webkitMatchesSelector('p')"); +shouldBeTrue("s1.webkitMatchesSelector('p span')"); +shouldBeTrue("s2.webkitMatchesSelector('#s2')"); +shouldBeTrue("d1.webkitMatchesSelector('.d1')"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html index 847b5ee6..0551120c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html +++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item.html
@@ -4,6 +4,21 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/css-medialist-item.js"></script> +<script> +description("This tests indexing outside the range of the media list object."); + +var styleElement = document.createElement('style'); +styleElement.setAttribute('media', 'screen, print'); +document.documentElement.appendChild(styleElement) +var mediaList = document.styleSheets[document.styleSheets.length - 1].media; + +shouldEvaluateTo('mediaList.length', 2); +shouldBeEqualToString('mediaList[0]', 'screen'); +shouldBeEqualToString('mediaList[1]', 'print'); +shouldBeUndefined('mediaList[2]'); +shouldBeUndefined('mediaList[-1]') + +document.documentElement.removeChild(styleElement); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html index 610fada..b164713 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html +++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname.html
@@ -4,6 +4,13 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/get-stylesheet-byname.js"></script> +<script> +description("This test verifies that a StyleSheet object will be returned instead of a HTMLStyleElement when calling document.styleSheets named property getter."); + +var styleElement = document.createElement("style"); +styleElement.setAttribute("id", "test"); +document.head.appendChild(styleElement); +shouldBe('document.styleSheets["test"]', 'styleElement.sheet'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js deleted file mode 100644 index 5945062..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/css-medialist-item.js +++ /dev/null
@@ -1,14 +0,0 @@ -description("This tests indexing outside the range of the media list object."); - -var styleElement = document.createElement('style'); -styleElement.setAttribute('media', 'screen, print'); -document.documentElement.appendChild(styleElement) -var mediaList = document.styleSheets[document.styleSheets.length - 1].media; - -shouldEvaluateTo('mediaList.length', 2); -shouldBeEqualToString('mediaList[0]', 'screen'); -shouldBeEqualToString('mediaList[1]', 'print'); -shouldBeUndefined('mediaList[2]'); -shouldBeUndefined('mediaList[-1]') - -document.documentElement.removeChild(styleElement);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js deleted file mode 100644 index 958fd7e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/script-tests/get-stylesheet-byname.js +++ /dev/null
@@ -1,6 +0,0 @@ -description("This test verifies that a StyleSheet object will be returned instead of a HTMLStyleElement when calling document.styleSheets named property getter."); - -var styleElement = document.createElement("style"); -styleElement.setAttribute("id", "test"); -document.head.appendChild(styleElement); -shouldBe('document.styleSheets["test"]', 'styleElement.sheet');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Text/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html index 6b082d3..23c42d7 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter.html
@@ -1,9 +1,106 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/acceptNode-filter.js"></script> +<script> +description('Test JS objects as NodeFilters.'); + +var walker; +var testElement = document.createElement("div"); +testElement.id = 'root'; +testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>'; + +function filter(node) +{ + debug(" filtering node " + node.id + " [this=" + this + "]"); + if (node.id == "B1") + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; +} + +debug("Testing with raw function filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); + +function strictFilter(node) +{ + "use strict"; + debug(" filtering node " + node.id + " [this=" + this + "]"); + if (node.id == "B1") + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; +} + +debug("<br>Testing with strict raw function filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, strictFilter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); + +debug("<br>Testing with object filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { + toString : function() { + return "custom node filter"; + }, + acceptNode : function(node) { + debug(" filtering node " + node.id + " [this=" + this + "]"); + if (node.id == "B1") + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; + } + }, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); + +debug("<br>Testing with null filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, null, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); + +debug("<br>Testing with undefined filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, undefined, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); + +debug("<br>Testing with object lacking acceptNode property"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {}, false); + +shouldThrow("walker.firstChild();"); +shouldBe("walker.currentNode.id;", "'root'"); +shouldThrow("walker.nextNode();"); +shouldBe("walker.currentNode.id;", "'root'"); + +debug("<br>Testing with object with non-function acceptNode property"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { acceptNode: "foo" }, false); + +shouldThrow("walker.firstChild();"); +shouldBe("walker.currentNode.id;", "'root'"); +shouldThrow("walker.nextNode();"); +shouldBe("walker.currentNode.id;", "'root'"); + +debug("<br>Testing with function having acceptNode function"); +var filter = function() { return NodeFilter.FILTER_ACCEPT; }; +filter.acceptNode = function(node) { return NodeFilter.FILTER_SKIP; }; +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); + +debug("<br>Testing acceptNode callee"); +var filter = { + acceptNode: function(node) { + debug('Callee: ' + arguments.callee); + return NodeFilter.FILTER_ACCEPT; + } +}; +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw.html index 607be7d..ea8744e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw.html
@@ -1,9 +1,40 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/filter-throw.js"></script> +<script> +description('Test JS objects as NodeFilters.'); + +var walker; +var testElement = document.createElement("div"); +testElement.id = 'root'; +testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>'; +debug("Testing with object filter"); +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, function(node) { + throw('filter exception'); + return NodeFilter.FILTER_ACCEPT; +}, false); + +debug("Test with filter function"); +shouldThrow("walker.firstChild();"); +shouldBe("walker.currentNode.id", "'root'") +shouldThrow("walker.nextNode();walker.currentNode.id"); +shouldBe("walker.currentNode.id", "'root'") + +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { + acceptNode : function(node) { + throw('filter exception'); + return NodeFilter.FILTER_ACCEPT; + } + }, false); + +debug("<br>Test with filter object"); +shouldThrow("walker.firstChild();"); +shouldBe("walker.currentNode.id", "'root'") +shouldThrow("walker.nextNode();walker.currentNode.id"); +shouldBe("walker.currentNode.id", "'root'") +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html index 5b554d2..78e53f98 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject.html
@@ -4,6 +4,26 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/previousNodeLastChildReject.js"></script> +<script> +description('Test for a specific problem with previousNode that failed in older versions of WebKit.'); + +var testElement = document.createElement("div"); +testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>'; + +function filter(node) +{ + if (node.id == "C2") + return NodeFilter.FILTER_REJECT; + return NodeFilter.FILTER_ACCEPT; +} + +var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html index 98e072a..3fb66a49 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip.html
@@ -4,6 +4,28 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/previousSiblingLastChildSkip.js"></script> +<script> +description('Test for a specific problem with previousSibling that failed in older versions of WebKit.'); + +var testElement = document.createElement("div"); +testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>'; + +function filter(node) +{ + if (node.id == "B1") + return NodeFilter.FILTER_SKIP; + return NodeFilter.FILTER_ACCEPT; +} + +var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); + +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'C2'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'D1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'D2'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.previousSibling(); walker.currentNode.id", "'C2'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js deleted file mode 100644 index 09f9263..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/acceptNode-filter.js +++ /dev/null
@@ -1,96 +0,0 @@ -description('Test JS objects as NodeFilters.'); - -var walker; -var testElement = document.createElement("div"); -testElement.id = 'root'; -testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>'; - -function filter(node) -{ - debug(" filtering node " + node.id + " [this=" + this + "]"); - if (node.id == "B1") - return NodeFilter.FILTER_SKIP; - return NodeFilter.FILTER_ACCEPT; -} - -debug("Testing with raw function filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); - -function strictFilter(node) -{ - "use strict"; - debug(" filtering node " + node.id + " [this=" + this + "]"); - if (node.id == "B1") - return NodeFilter.FILTER_SKIP; - return NodeFilter.FILTER_ACCEPT; -} - -debug("<br>Testing with strict raw function filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, strictFilter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); - -debug("<br>Testing with object filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { - toString : function() { - return "custom node filter"; - }, - acceptNode : function(node) { - debug(" filtering node " + node.id + " [this=" + this + "]"); - if (node.id == "B1") - return NodeFilter.FILTER_SKIP; - return NodeFilter.FILTER_ACCEPT; - } - }, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); - -debug("<br>Testing with null filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, null, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); - -debug("<br>Testing with undefined filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, undefined, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); - -debug("<br>Testing with object lacking acceptNode property"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {}, false); - -shouldThrow("walker.firstChild();"); -shouldBe("walker.currentNode.id;", "'root'"); -shouldThrow("walker.nextNode();"); -shouldBe("walker.currentNode.id;", "'root'"); - -debug("<br>Testing with object with non-function acceptNode property"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { acceptNode: "foo" }, false); - -shouldThrow("walker.firstChild();"); -shouldBe("walker.currentNode.id;", "'root'"); -shouldThrow("walker.nextNode();"); -shouldBe("walker.currentNode.id;", "'root'"); - -debug("<br>Testing with function having acceptNode function"); -var filter = function() { return NodeFilter.FILTER_ACCEPT; }; -filter.acceptNode = function(node) { return NodeFilter.FILTER_SKIP; }; -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); - -debug("<br>Testing acceptNode callee"); -var filter = { - acceptNode: function(node) { - debug('Callee: ' + arguments.callee); - return NodeFilter.FILTER_ACCEPT; - } -}; -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js deleted file mode 100644 index caf621c8..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js +++ /dev/null
@@ -1,30 +0,0 @@ -description('Test JS objects as NodeFilters.'); - -var walker; -var testElement = document.createElement("div"); -testElement.id = 'root'; -testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>'; -debug("Testing with object filter"); -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, function(node) { - throw('filter exception'); - return NodeFilter.FILTER_ACCEPT; -}, false); - -debug("Test with filter function"); -shouldThrow("walker.firstChild();"); -shouldBe("walker.currentNode.id", "'root'") -shouldThrow("walker.nextNode();walker.currentNode.id"); -shouldBe("walker.currentNode.id", "'root'") - -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, { - acceptNode : function(node) { - throw('filter exception'); - return NodeFilter.FILTER_ACCEPT; - } - }, false); - -debug("<br>Test with filter object"); -shouldThrow("walker.firstChild();"); -shouldBe("walker.currentNode.id", "'root'") -shouldThrow("walker.nextNode();walker.currentNode.id"); -shouldBe("walker.currentNode.id", "'root'")
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js deleted file mode 100644 index 1bdf0ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousNodeLastChildReject.js +++ /dev/null
@@ -1,19 +0,0 @@ -description('Test for a specific problem with previousNode that failed in older versions of WebKit.'); - -var testElement = document.createElement("div"); -testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>'; - -function filter(node) -{ - if (node.id == "C2") - return NodeFilter.FILTER_REJECT; - return NodeFilter.FILTER_ACCEPT; -} - -var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js deleted file mode 100644 index 19fdb7c3..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/previousSiblingLastChildSkip.js +++ /dev/null
@@ -1,21 +0,0 @@ -description('Test for a specific problem with previousSibling that failed in older versions of WebKit.'); - -var testElement = document.createElement("div"); -testElement.innerHTML='<div id="A1"><div id="B1"><div id="C1"></div><div id="C2"><div id="D1"></div><div id="D2"></div></div></div><div id="B2"><div id="C3"></div><div id="C4"></div></div></div>'; - -function filter(node) -{ - if (node.id == "B1") - return NodeFilter.FILTER_SKIP; - return NodeFilter.FILTER_ACCEPT; -} - -var walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); - -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'C2'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'D1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'D2'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.previousSibling(); walker.currentNode.id", "'C2'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js deleted file mode 100644 index 80294531..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-reject.js +++ /dev/null
@@ -1,56 +0,0 @@ -description('Test TreeWalker with rejection'); - -var walker; -var testElement = document.createElement("div"); -testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>'; - -var rejectB1Filter = { - acceptNode: function(node) { - if (node.id == 'B1') - return NodeFilter.FILTER_REJECT; - - return NodeFilter.FILTER_ACCEPT; - } -} - -var rejectB2Filter = { - acceptNode: function(node) { - if (node.id == 'B2') - return NodeFilter.FILTER_SKIP; - - return NodeFilter.FILTER_ACCEPT; - } -} - -debug("<br>Testing nextNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); -shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'"); - -debug("<br>Testing firstChild") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.firstChild(); walker.currentNode.id", "'B2'"); - -debug("<br>Testing nextSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); -shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); - -debug("<br>Testing parentNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); -walker.currentNode = testElement.querySelectorAll('#C1')[0]; -shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'"); - -debug("<br>Testing previousSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false); -walker.currentNode = testElement.querySelectorAll('#B3')[0]; -shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'"); - -debug("<br>Testing previousNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); -walker.currentNode = testElement.querySelectorAll('#B3')[0]; -shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js deleted file mode 100644 index 0698127..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip-most.js +++ /dev/null
@@ -1,24 +0,0 @@ -description('Test TreeWalker with skipping'); - -var walker; -var testElement = document.createElement("div"); -testElement.innerHTML='<div id="A1"><div id="B1" class="keep"></div><div id="B2">this text matters</div><div id="B3" class="keep"></div></div>'; - -var filter = { - acceptNode: function(node) { - if (node.className == 'keep') - return NodeFilter.FILTER_ACCEPT; - - return NodeFilter.FILTER_SKIP; - } -} - -debug("<br>Testing nextSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); -shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); - -debug("<br>Testing previousSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); -walker.currentNode = testElement.querySelectorAll('#B3')[0]; -shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js deleted file mode 100644 index eed10b25..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/script-tests/traversal-skip.js +++ /dev/null
@@ -1,58 +0,0 @@ -description('Test TreeWalker with skipping'); - -var walker; -var testElement = document.createElement("div"); -testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>'; - -var skipB1Filter = { - acceptNode: function(node) { - if (node.id == 'B1') - return NodeFilter.FILTER_SKIP; - - return NodeFilter.FILTER_ACCEPT; - } -} - -var skipB2Filter = { - acceptNode: function(node) { - if (node.id == 'B2') - return NodeFilter.FILTER_SKIP; - - return NodeFilter.FILTER_ACCEPT; - } -} - -debug("<br>Testing nextNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); -shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'"); - -debug("<br>Testing firstChild") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.firstChild(); walker.currentNode.id", "'C1'"); - -debug("<br>Testing nextSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false); -shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); -shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); -shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); - -debug("<br>Testing parentNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); -walker.currentNode = testElement.querySelectorAll('#C1')[0]; -shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'"); - -debug("<br>Testing previousSibling") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false); -walker.currentNode = testElement.querySelectorAll('#B3')[0]; -shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'"); - -debug("<br>Testing previousNode") -walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); -walker.currentNode = testElement.querySelectorAll('#B3')[0]; -shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'"); -shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'"); -shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject.html index 82757ac..ab04aca9b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject.html
@@ -1,9 +1,66 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/traversal-reject.js"></script> +<script> +description('Test TreeWalker with rejection'); + +var walker; +var testElement = document.createElement("div"); +testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>'; + +var rejectB1Filter = { + acceptNode: function(node) { + if (node.id == 'B1') + return NodeFilter.FILTER_REJECT; + + return NodeFilter.FILTER_ACCEPT; + } +} + +var rejectB2Filter = { + acceptNode: function(node) { + if (node.id == 'B2') + return NodeFilter.FILTER_SKIP; + + return NodeFilter.FILTER_ACCEPT; + } +} + +debug("<br>Testing nextNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); +shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'"); + +debug("<br>Testing firstChild") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.firstChild(); walker.currentNode.id", "'B2'"); + +debug("<br>Testing nextSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); +shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); + +debug("<br>Testing parentNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); +walker.currentNode = testElement.querySelectorAll('#C1')[0]; +shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'"); + +debug("<br>Testing previousSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB2Filter, false); +walker.currentNode = testElement.querySelectorAll('#B3')[0]; +shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'"); + +debug("<br>Testing previousNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, rejectB1Filter, false); +walker.currentNode = testElement.querySelectorAll('#B3')[0]; +shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html index 5eabebe..1e4c8c2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most.html
@@ -1,9 +1,34 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/traversal-skip-most.js"></script> +<script> +description('Test TreeWalker with skipping'); + +var walker; +var testElement = document.createElement("div"); +testElement.innerHTML='<div id="A1"><div id="B1" class="keep"></div><div id="B2">this text matters</div><div id="B3" class="keep"></div></div>'; + +var filter = { + acceptNode: function(node) { + if (node.className == 'keep') + return NodeFilter.FILTER_ACCEPT; + + return NodeFilter.FILTER_SKIP; + } +} + +debug("<br>Testing nextSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); +shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); + +debug("<br>Testing previousSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, filter, false); +walker.currentNode = testElement.querySelectorAll('#B3')[0]; +shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip.html b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip.html index c920b25..4ab1c8d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip.html +++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip.html
@@ -1,9 +1,68 @@ -<!DOCTYPE html> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/traversal-skip.js"></script> +<script> +description('Test TreeWalker with skipping'); + +var walker; +var testElement = document.createElement("div"); +testElement.innerHTML='<div id="A1"> <div id="B1"> <div id="C1"></div> </div> <div id="B2"></div><div id="B3"></div> </div>'; + +var skipB1Filter = { + acceptNode: function(node) { + if (node.id == 'B1') + return NodeFilter.FILTER_SKIP; + + return NodeFilter.FILTER_ACCEPT; + } +} + +var skipB2Filter = { + acceptNode: function(node) { + if (node.id == 'B2') + return NodeFilter.FILTER_SKIP; + + return NodeFilter.FILTER_ACCEPT; + } +} + +debug("<br>Testing nextNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); +shouldBe("walker.nextNode(); walker.currentNode.id", "'A1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'C1'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.nextNode(); walker.currentNode.id", "'B3'"); + +debug("<br>Testing firstChild") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.firstChild(); walker.currentNode.id", "'C1'"); + +debug("<br>Testing nextSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false); +shouldBe("walker.firstChild(); walker.currentNode.id", "'A1'"); +shouldBe("walker.firstChild(); walker.currentNode.id", "'B1'"); +shouldBe("walker.nextSibling(); walker.currentNode.id", "'B3'"); + +debug("<br>Testing parentNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); +walker.currentNode = testElement.querySelectorAll('#C1')[0]; +shouldBe("walker.parentNode(); walker.currentNode.id", "'A1'"); + +debug("<br>Testing previousSibling") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB2Filter, false); +walker.currentNode = testElement.querySelectorAll('#B3')[0]; +shouldBe("walker.previousSibling(); walker.currentNode.id", "'B1'"); + +debug("<br>Testing previousNode") +walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, skipB1Filter, false); +walker.currentNode = testElement.querySelectorAll('#B3')[0]; +shouldBe("walker.previousNode(); walker.currentNode.id", "'B2'"); +shouldBe("walker.previousNode(); walker.currentNode.id", "'C1'"); +shouldBe("walker.previousNode(); walker.currentNode.id", "'A1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection.html index 4b54efb..9a802f9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection.html
@@ -4,6 +4,74 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/URL-attribute-reflection.js"></script> +<script> +description("Test reflecting URL attributes with empty string values."); + +function testURLReflection(attributeName, tag, scriptAttributeName) +{ + if (!scriptAttributeName) + scriptAttributeName = attributeName.toLowerCase(); + + var element; + if (tag === "html") + element = document.documentElement; + else { + element = document.createElement(tag); + document.body.appendChild(element); + } + element.setAttribute(scriptAttributeName, "x"); + var xValue = element[attributeName]; + element.setAttribute(scriptAttributeName, ""); + var emptyValue = element[attributeName]; + if (tag !== "html") + document.body.removeChild(element); + + if (xValue === undefined) + return "none"; + if (xValue === "x") + return "non-URL"; + if (xValue !== document.baseURI.replace(/[^\/]+$/, "x")) + return "error (x): " + xValue; + if (emptyValue === "") + return "non-empty URL"; + if (emptyValue === document.baseURI) + return "URL"; + return "error (empty): " + emptyValue; +} + +shouldBe("testURLReflection('attribute', 'element')", "'none'"); +shouldBe("testURLReflection('id', 'element')", "'non-URL'"); + +// The following list comes from the HTML5 document’s attributes index. +// These are the URL attributes from that list. + +shouldBe("testURLReflection('action', 'form')", "'URL'"); +shouldBe("testURLReflection('cite', 'blockquote')", "'URL'"); +shouldBe("testURLReflection('cite', 'del')", "'URL'"); +shouldBe("testURLReflection('cite', 'ins')", "'URL'"); +shouldBe("testURLReflection('cite', 'q')", "'URL'"); +shouldBe("testURLReflection('data', 'object')", "'URL'"); +shouldBe("testURLReflection('formaction', 'button')", "'URL'"); +shouldBe("testURLReflection('formaction', 'input')", "'URL'"); +shouldBe("testURLReflection('href', 'a')", "'URL'"); +shouldBe("testURLReflection('href', 'area')", "'URL'"); +shouldBe("testURLReflection('href', 'link')", "'URL'"); +shouldBe("testURLReflection('href', 'base')", "'URL'"); +shouldBe("testURLReflection('icon', 'command')", "'URL'"); +shouldBe("testURLReflection('poster', 'video')", "'URL'"); +shouldBe("testURLReflection('src', 'audio')", "'URL'"); +shouldBe("testURLReflection('src', 'embed')", "'URL'"); +shouldBe("testURLReflection('src', 'iframe')", "'URL'"); +shouldBe("testURLReflection('src', 'img')", "'URL'"); +shouldBe("testURLReflection('src', 'input')", "'URL'"); +shouldBe("testURLReflection('src', 'script')", "'URL'"); +shouldBe("testURLReflection('src', 'source')", "'URL'"); +shouldBe("testURLReflection('src', 'video')", "'URL'"); + +// Other reflected URL attributes. + +shouldBe("testURLReflection('longDesc', 'img')", "'URL'"); +shouldBe("testURLReflection('lowsrc', 'img')", "'URL'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html index e1ebd4e..ee9e860 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes.html
@@ -4,6 +4,75 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/HTMLBodyElement-window-eventListener-attributes.js"></script> +<script> +description("This tests that setting window event listeners on the body, sets them on the window."); + +function gc() +{ + if (window.GCController) + return GCController.collect(); + + for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) + var s = new String(""); + } +} + +var func = function() { } + +document.body.onblur = func; +shouldBe("window.onblur", "func"); +shouldBe("window.onblur", "document.body.onblur"); + +document.body.onfocus = func; +shouldBe("window.onfocus", "func"); +shouldBe("window.onfocus", "document.body.onfocus"); + +document.body.onerror = func; +shouldBe("window.onerror", "func"); +shouldBe("window.onerror", "document.body.onerror"); + +document.body.onload = func; +shouldBe("window.onload", "func"); +shouldBe("window.onload", "document.body.onload"); + +document.body.onbeforeunload = func; +shouldBe("window.onbeforeunload", "func"); +shouldBe("window.onbeforeunload", "document.body.onbeforeunload"); + +document.body.onhashchange = func; +shouldBe("window.onhashchange", "func"); +shouldBe("window.onhashchange", "document.body.onhashchange"); + +document.body.onmessage = func; +shouldBe("window.onmessage", "func"); +shouldBe("window.onmessage", "document.body.onmessage"); + +document.body.onoffline = func; +shouldBe("window.onoffline", "func"); +shouldBe("window.onoffline", "document.body.onoffline"); + +document.body.ononline = func; +shouldBe("window.ononline", "func"); +shouldBe("window.ononline", "document.body.ononline"); + +document.body.onresize = func; +shouldBe("window.onresize", "func"); +shouldBe("window.onresize", "document.body.onresize"); + +document.body.onscroll = func; +shouldBe("window.onscroll", "func"); +shouldBe("window.onscroll", "document.body.onscroll"); + +document.body.onstorage = func; +shouldBe("window.onstorage", "func"); +shouldBe("window.onstorage", "document.body.onstorage"); + +document.body.onunload = func; +shouldBe("window.onunload", "func"); +shouldBe("window.onunload", "document.body.onunload"); +window.onunload = null; + +gc(); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html index 156d844..1dfdfaa 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes.html
@@ -4,6 +4,76 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/HTMLFrameSetElement-window-eventListener-attributes.js"></script> +<script> +description("This tests that setting window event listeners on the frameset, sets them on the window."); + +function gc() +{ + if (window.GCController) + return GCController.collect(); + + for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) + var s = new String(""); + } +} + +var frameSet = document.createElement("frameset"); +var func = function() { } + +frameSet.onblur = func; +shouldBe("window.onblur", "func"); +shouldBe("window.onblur", "frameSet.onblur"); + +frameSet.onfocus = func; +shouldBe("window.onfocus", "func"); +shouldBe("window.onfocus", "frameSet.onfocus"); + +frameSet.onerror = func; +shouldBe("window.onerror", "func"); +shouldBe("window.onerror", "frameSet.onerror"); + +frameSet.onload = func; +shouldBe("window.onload", "func"); +shouldBe("window.onload", "frameSet.onload"); + +frameSet.onbeforeunload = func; +shouldBe("window.onbeforeunload", "func"); +shouldBe("window.onbeforeunload", "frameSet.onbeforeunload"); + +frameSet.onhashchange = func; +shouldBe("window.onhashchange", "func"); +shouldBe("window.onhashchange", "frameSet.onhashchange"); + +frameSet.onmessage = func; +shouldBe("window.onmessage", "func"); +shouldBe("window.onmessage", "frameSet.onmessage"); + +frameSet.onoffline = func; +shouldBe("window.onoffline", "func"); +shouldBe("window.onoffline", "frameSet.onoffline"); + +frameSet.ononline = func; +shouldBe("window.ononline", "func"); +shouldBe("window.ononline", "frameSet.ononline"); + +frameSet.onresize = func; +shouldBe("window.onresize", "func"); +shouldBe("window.onresize", "frameSet.onresize"); + +frameSet.onscroll = func; +shouldBe("window.onscroll", "func"); +shouldBe("window.onscroll", "frameSet.onscroll"); + +frameSet.onstorage = func; +shouldBe("window.onstorage", "func"); +shouldBe("window.onstorage", "frameSet.onstorage"); + +frameSet.onunload = func; +shouldBe("window.onunload", "func"); +shouldBe("window.onunload", "frameSet.onunload"); +window.onunload = null; + +gc(); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent.html b/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent.html index e4ca6f6..48777599 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent.html
@@ -4,6 +4,47 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/dispatchEvent.js"></script> +<script> +description("Test window.dispatchEvent()."); + +// Test that non-events throw +var event = {}; +shouldThrow("window.dispatchEvent(event)"); + +// Test that non-initialized events throw +event = document.createEvent("Event"); +shouldThrow("window.dispatchEvent(event)"); + +// Test basic dispatch +var myEventDispatched = false; +var target; +var currentTarget; +window.addEventListener("myEvent", function(evt) { + myEventDispatched = true; + target = evt.target; + currentTarget = evt.currentTarget; +}, false); +event = document.createEvent("Event"); +event.initEvent("myEvent", false, false); +window.dispatchEvent(event); +shouldBeTrue("myEventDispatched"); +shouldBe("target", "window"); +shouldBe("currentTarget", "window"); + +// Test that both useCapture and non-useCapture listeners are dispatched to +var useCaptureDispatched = false; +window.addEventListener("myEvent", function(evt) { + useCaptureDispatched = true; +}, true); +var nonUseCaptureDispatched = false; +window.addEventListener("myEvent", function(evt) { + nonUseCaptureDispatched = true; +}, false); +event = document.createEvent("Event"); +event.initEvent("myEvent", false, false); +window.dispatchEvent(event); +shouldBeTrue("useCaptureDispatched"); +shouldBeTrue("nonUseCaptureDispatched"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol.html b/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol.html index 89f98f5..78aee49 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol.html
@@ -4,6 +4,34 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/invalid-protocol.js"></script> +<script> +description("Test URL protocol setter."); + +var a = document.createElement("a"); +a.setAttribute("href", "http://www.apple.com/"); +document.body.appendChild(a); + +shouldThrow("location.protocol = ''", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'\' is an invalid protocol."'); +shouldThrow("location.protocol = ':'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \':\' is an invalid protocol."'); +shouldThrow("location.protocol = 'é'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'é\' is an invalid protocol."'); +shouldThrow("location.protocol = '['", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'[\' is an invalid protocol."'); +shouldThrow("location.protocol = '0'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'0\' is an invalid protocol."'); + +// IE raises exceptions for anchors, too - but Firefox does not. In either case, protocol shouldn't change. +try { a.protocol = '' } catch (ex) { } +try { a.protocol = 'é' } catch (ex) { } +try { a.protocol = '[' } catch (ex) { } +try { a.protocol = '0' } catch (ex) { } +shouldBe("a.protocol", "'http:'"); + +a.protocol = "https"; +shouldBe("a.href", "'https://www.apple.com/'"); + +a.protocol = "http:"; +shouldBe("a.href", "'http://www.apple.com/'"); + +a.protocol = "https://foobar"; +shouldBe("a.href", "'https://www.apple.com/'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js b/third_party/WebKit/LayoutTests/fast/dom/Window/resources/postmessage-test.js similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-test.js rename to third_party/WebKit/LayoutTests/fast/dom/Window/resources/postmessage-test.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLBodyElement-window-eventListener-attributes.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLBodyElement-window-eventListener-attributes.js deleted file mode 100644 index 72211924..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLBodyElement-window-eventListener-attributes.js +++ /dev/null
@@ -1,68 +0,0 @@ -description("This tests that setting window event listeners on the body, sets them on the window."); - -function gc() -{ - if (window.GCController) - return GCController.collect(); - - for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) - var s = new String(""); - } -} - -var func = function() { } - -document.body.onblur = func; -shouldBe("window.onblur", "func"); -shouldBe("window.onblur", "document.body.onblur"); - -document.body.onfocus = func; -shouldBe("window.onfocus", "func"); -shouldBe("window.onfocus", "document.body.onfocus"); - -document.body.onerror = func; -shouldBe("window.onerror", "func"); -shouldBe("window.onerror", "document.body.onerror"); - -document.body.onload = func; -shouldBe("window.onload", "func"); -shouldBe("window.onload", "document.body.onload"); - -document.body.onbeforeunload = func; -shouldBe("window.onbeforeunload", "func"); -shouldBe("window.onbeforeunload", "document.body.onbeforeunload"); - -document.body.onhashchange = func; -shouldBe("window.onhashchange", "func"); -shouldBe("window.onhashchange", "document.body.onhashchange"); - -document.body.onmessage = func; -shouldBe("window.onmessage", "func"); -shouldBe("window.onmessage", "document.body.onmessage"); - -document.body.onoffline = func; -shouldBe("window.onoffline", "func"); -shouldBe("window.onoffline", "document.body.onoffline"); - -document.body.ononline = func; -shouldBe("window.ononline", "func"); -shouldBe("window.ononline", "document.body.ononline"); - -document.body.onresize = func; -shouldBe("window.onresize", "func"); -shouldBe("window.onresize", "document.body.onresize"); - -document.body.onscroll = func; -shouldBe("window.onscroll", "func"); -shouldBe("window.onscroll", "document.body.onscroll"); - -document.body.onstorage = func; -shouldBe("window.onstorage", "func"); -shouldBe("window.onstorage", "document.body.onstorage"); - -document.body.onunload = func; -shouldBe("window.onunload", "func"); -shouldBe("window.onunload", "document.body.onunload"); -window.onunload = null; - -gc();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLFrameSetElement-window-eventListener-attributes.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLFrameSetElement-window-eventListener-attributes.js deleted file mode 100644 index ba7d2e8e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/HTMLFrameSetElement-window-eventListener-attributes.js +++ /dev/null
@@ -1,69 +0,0 @@ -description("This tests that setting window event listeners on the frameset, sets them on the window."); - -function gc() -{ - if (window.GCController) - return GCController.collect(); - - for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) - var s = new String(""); - } -} - -var frameSet = document.createElement("frameset"); -var func = function() { } - -frameSet.onblur = func; -shouldBe("window.onblur", "func"); -shouldBe("window.onblur", "frameSet.onblur"); - -frameSet.onfocus = func; -shouldBe("window.onfocus", "func"); -shouldBe("window.onfocus", "frameSet.onfocus"); - -frameSet.onerror = func; -shouldBe("window.onerror", "func"); -shouldBe("window.onerror", "frameSet.onerror"); - -frameSet.onload = func; -shouldBe("window.onload", "func"); -shouldBe("window.onload", "frameSet.onload"); - -frameSet.onbeforeunload = func; -shouldBe("window.onbeforeunload", "func"); -shouldBe("window.onbeforeunload", "frameSet.onbeforeunload"); - -frameSet.onhashchange = func; -shouldBe("window.onhashchange", "func"); -shouldBe("window.onhashchange", "frameSet.onhashchange"); - -frameSet.onmessage = func; -shouldBe("window.onmessage", "func"); -shouldBe("window.onmessage", "frameSet.onmessage"); - -frameSet.onoffline = func; -shouldBe("window.onoffline", "func"); -shouldBe("window.onoffline", "frameSet.onoffline"); - -frameSet.ononline = func; -shouldBe("window.ononline", "func"); -shouldBe("window.ononline", "frameSet.ononline"); - -frameSet.onresize = func; -shouldBe("window.onresize", "func"); -shouldBe("window.onresize", "frameSet.onresize"); - -frameSet.onscroll = func; -shouldBe("window.onscroll", "func"); -shouldBe("window.onscroll", "frameSet.onscroll"); - -frameSet.onstorage = func; -shouldBe("window.onstorage", "func"); -shouldBe("window.onstorage", "frameSet.onstorage"); - -frameSet.onunload = func; -shouldBe("window.onunload", "func"); -shouldBe("window.onunload", "frameSet.onunload"); -window.onunload = null; - -gc();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/TEMPLATE.html deleted file mode 100644 index a44cea6a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/dispatchEvent.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/dispatchEvent.js deleted file mode 100644 index 1b521db6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/dispatchEvent.js +++ /dev/null
@@ -1,40 +0,0 @@ -description("Test window.dispatchEvent()."); - -// Test that non-events throw -var event = {}; -shouldThrow("window.dispatchEvent(event)"); - -// Test that non-initialized events throw -event = document.createEvent("Event"); -shouldThrow("window.dispatchEvent(event)"); - -// Test basic dispatch -var myEventDispatched = false; -var target; -var currentTarget; -window.addEventListener("myEvent", function(evt) { - myEventDispatched = true; - target = evt.target; - currentTarget = evt.currentTarget; -}, false); -event = document.createEvent("Event"); -event.initEvent("myEvent", false, false); -window.dispatchEvent(event); -shouldBeTrue("myEventDispatched"); -shouldBe("target", "window"); -shouldBe("currentTarget", "window"); - -// Test that both useCapture and non-useCapture listeners are dispatched to -var useCaptureDispatched = false; -window.addEventListener("myEvent", function(evt) { - useCaptureDispatched = true; -}, true); -var nonUseCaptureDispatched = false; -window.addEventListener("myEvent", function(evt) { - nonUseCaptureDispatched = true; -}, false); -event = document.createEvent("Event"); -event.initEvent("myEvent", false, false); -window.dispatchEvent(event); -shouldBeTrue("useCaptureDispatched"); -shouldBeTrue("nonUseCaptureDispatched");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/invalid-protocol.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/invalid-protocol.js deleted file mode 100644 index 7bb20d7..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/invalid-protocol.js +++ /dev/null
@@ -1,27 +0,0 @@ -description("Test URL protocol setter."); - -var a = document.createElement("a"); -a.setAttribute("href", "http://www.apple.com/"); -document.body.appendChild(a); - -shouldThrow("location.protocol = ''", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'\' is an invalid protocol."'); -shouldThrow("location.protocol = ':'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \':\' is an invalid protocol."'); -shouldThrow("location.protocol = 'é'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'é\' is an invalid protocol."'); -shouldThrow("location.protocol = '['", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'[\' is an invalid protocol."'); -shouldThrow("location.protocol = '0'", '"SyntaxError: Failed to set the \'protocol\' property on \'Location\': \'0\' is an invalid protocol."'); - -// IE raises exceptions for anchors, too - but Firefox does not. In either case, protocol shouldn't change. -try { a.protocol = '' } catch (ex) { } -try { a.protocol = 'é' } catch (ex) { } -try { a.protocol = '[' } catch (ex) { } -try { a.protocol = '0' } catch (ex) { } -shouldBe("a.protocol", "'http:'"); - -a.protocol = "https"; -shouldBe("a.href", "'https://www.apple.com/'"); - -a.protocol = "http:"; -shouldBe("a.href", "'http://www.apple.com/'"); - -a.protocol = "https://foobar"; -shouldBe("a.href", "'https://www.apple.com/'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-deep-array.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-deep-array.js deleted file mode 100644 index ad1ead9a..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-deep-array.js +++ /dev/null
@@ -1,6 +0,0 @@ -document.getElementById("description").innerHTML = "Tests that we support cloning deep(ish) arrays."; -deepArray=[]; -for (var i = 0; i < 10000; i++) - deepArray=[deepArray]; -tryPostMessage('deepArray'); -tryPostMessage('"done"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js deleted file mode 100644 index a2bbb65..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone-really-deep-array.js +++ /dev/null
@@ -1,6 +0,0 @@ -document.getElementById("description").innerHTML = "Tests that we abort cloning overdeep arrays."; -reallyDeepArray=[]; -for (var i = 0; i < 100000; i++) - reallyDeepArray=[reallyDeepArray]; -tryPostMessage('reallyDeepArray', true, null, RangeError); -tryPostMessage('"done"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js deleted file mode 100644 index 645a85ce..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js +++ /dev/null
@@ -1,355 +0,0 @@ -document.getElementById("description").innerHTML = "Tests that we clone object hierarchies"; - -tryPostMessage('null'); -tryPostMessage('undefined'); -tryPostMessage('1'); -tryPostMessage('true'); -tryPostMessage('"1"'); -tryPostMessage('({})'); -tryPostMessage('({a:1})'); -tryPostMessage('({a:"a"})'); -tryPostMessage('({b:"a", a:"b"})'); -tryPostMessage('({p0:"string0", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})'); -tryPostMessage('({p0:"string1", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})'); -tryPostMessage('({a:""})'); -tryPostMessage('({a:0})'); -tryPostMessage('({a:1})'); -tryPostMessage('[]'); -tryPostMessage('["a", "a", "b", "a", "b"]'); -tryPostMessage('["a", "a", "b", {a:"b", b:"a"}]'); -tryPostMessage('[1,2,3]'); -tryPostMessage('[,,1]'); -tryPostMessage('(function(){})', true, null, DOMException.DATA_CLONE_ERR); -tryPostMessage('var x = 0; try { eval("badref"); } catch(e) { x = e; } x', true, null, DOMException.DATA_CLONE_ERR); -var arrayBuffer = new ArrayBuffer(1); -tryPostMessage('"data"', false, null, 0, [arrayBuffer]); -tryPostMessage('arrayBuffer', true, null, DOMException.DATA_CLONE_ERR); -var duplicateArrayBuffer = new ArrayBuffer(1); -tryPostMessage('"data"', true, null, DOMException.DATA_CLONE_ERR, [duplicateArrayBuffer, duplicateArrayBuffer]); -var uint8Array = new Uint8Array([10]); -tryPostMessage('"data"', false, null, 0, [uint8Array.buffer]); -tryPostMessage('uint8Array', true, null, DOMException.DATA_CLONE_ERR); -tryPostMessage('new Date(1234567890000)'); -tryPostMessage('new ConstructorWithPrototype("foo")', false, '({field:"foo"})'); -tryPostMessage('new Boolean(true)'); -tryPostMessage('new Boolean(false)'); -tryPostMessage('new String("gnirts")'); -tryPostMessage('new Number(42.0)'); -cyclicObject={}; -cyclicObject.self = cyclicObject; -tryPostMessage('cyclicObject', false, "cyclicObject"); -cyclicArray=[]; -cyclicArray[0] = cyclicArray; -tryPostMessage('cyclicArray', false, "cyclicArray"); -var cyclicObjectGetter = {get self() { return cyclicObjectGetter; }}; -tryPostMessage('cyclicObjectGetter', false, 'cyclicObject'); -objectGraph = {}; -object = {}; -objectGraph.graph1 = object; -objectGraph.graph2 = object; -tryPostMessage('objectGraph', false, "objectGraph"); -arrayGraph = [object, object]; -tryPostMessage('arrayGraph', false, "arrayGraph"); -tryPostMessage('window', true); -tryPostMessage('({get a() { throw "x" }})', true); - -if (window.eventSender) { - var fileInput = document.getElementById("fileInput"); - var fileRect = fileInput.getClientRects()[0]; - var targetX = fileRect.left + fileRect.width / 2; - var targetY = fileRect.top + fileRect.height / 2; - eventSender.beginDragWithFiles(['resources/blank.html', 'resources/child.html']); - eventSender.mouseMoveTo(targetX, targetY); - eventSender.mouseUp(); -} -var imageData = document.createElement("canvas").getContext("2d").createImageData(10,10); -for (var i = 0; i < imageData.data.length * 4; i++) - imageData.data[i] = i % 256; -var mutatedImageData = document.createElement("canvas").getContext("2d").createImageData(10,10); -for (var i = 0; i < imageData.data.length * 4; i++) - mutatedImageData.data[i] = i % 256; -tryPostMessage('imageData', false, imageData); -tryPostMessage('imageData.data', false, imageData.data) -tryPostMessage('mutatedImageData', false, imageData); -tryPostMessage('mutatedImageData.data', false, imageData.data) -for (var i = 0; i < imageData.data.length * 4; i++) - mutatedImageData.data[i] = 0; - -// Test close() special case for Blob (and File.) - -var blob = new Blob(["Hello"]); -var blobSize = blob.size; -tryPostMessage('blob', false, "evalThunk", function(v) { doPassFail(v.size === blobSize, "Cloned Blob size equal to the original size."); }); -tryPostMessage('blob.close(); blob', true, null, DOMException.DATA_CLONE_ERR); - -var constructedFile = new File(["Hello"], "test"); -var fileSize = constructedFile.size; -tryPostMessage('constructedFile', false, "evalThunk", function(v) { doPassFail(v.size === fileSize, "Cloned File size equal to the original size."); }); -tryPostMessage('constructedFile.close(); constructedFile', true, null, DOMException.DATA_CLONE_ERR); - -function thunk(s) { - return "(function() {" + s + "})()"; -} -tryPostMessage(thunk('return 42;'), false, '42'); -tryPostMessage(thunk('return 42;'), false, thunk('return 40 + 2;')); -tryPostMessage(thunk('return 42;'), false, "evalThunk", - function(v) { doPassFail(v == 42, "evalThunk OK"); }) - -// Only enumerable properties should be serialized. -tryPostMessage(thunk('var o = {x:"hello"}; Object.defineProperty(o, "y", {value:"goodbye"}); return o;'), false, '({x:"hello"})'); - -// It's unclear what we should do if an accessor modifies an object out from under us -// while we're serializing it; the standard does mandate certain aspects about evaluation -// order, though, including that properties must be processed in their enumeration order. -tryPostMessage(thunk( - 'var a = [0, 1, 2]; ' + - 'var b = { get x() { a[0] = 40; a[2] = 42; a.push(43); return 41; }}; ' + - 'a[1] = b; ' + - 'return a;' - ), false, "evalThunk", function(v) { - doPassFail(v.length === 3, "length correct"); // undefined - doPassFail(v[0] === 0, "evaluation order OK"); // mandatory - doPassFail(v[1].x === 41, "evaluation order OK/accessor reached"); // mandatory - doPassFail(v[2] === 42, "evaluation order OK"); // mandatory - }); - -tryPostMessage(thunk( - 'var a = [0, 1, 2]; ' + - 'var b = { get x() { a.pop(); return 41; } }; ' + - 'a[1] = b; ' + - 'return a;' - ), false, "evalThunk", function(v) { - doPassFail(v.length === 3 || v.length === 2, "length correct"); // undefined - doPassFail(v[0] === 0, "index 0 OK"); // mandatory - doPassFail(v[1].x === 41, "accessor reached"); // mandatory - doPassFail(v[2] === undefined, "index 2 undefined"); // undefined - }); - -tryPostMessage(thunk( - 'var a = [0, 1, 2]; ' + - 'var b = { get x() { a.pop(); return 41; } }; ' + - 'a[2] = b; ' + - 'return a;' - ), false, "evalThunk", function(v) { - doPassFail(v.length === 3, "length correct"); // undefined - doPassFail(v[0] === 0, "index 0 OK"); // mandatory - doPassFail(v[1] === 1, "index 1 OK"); // mandatory - doPassFail(v[2].x === 41, "index 2 OK"); // undefined - }); - -// Now with objects! This is a little more tricky because the standard does not -// define an enumeration order. -tryPostMessage(thunk( - 'var a = {p0: 0, p1: 1}; ' + - 'Object.defineProperty(a, "p2", {get:function() {delete a.p3; return 42; }, enumerable: true, configurable: true}); ' + - 'Object.defineProperty(a, "p3", {get:function() {delete a.p2; return 43; }, enumerable: true, configurable: true}); ' + - 'Object.defineProperty(a, "p4", {get:function() { a.p5 = 45; return 44; }, enumerable: true, configurable: true}); ' + - 'return a;' - ), false, "evalThunk", function(v) { - doPassFail(v.p0 === 0 && v.p1 === 1, "basic properties OK"); // mandatory - doPassFail(v.p2 === undefined && v.p3 !== undefined || - v.p2 !== undefined && v.p3 === undefined, "one accessor was run"); // mandatory - doPassFail(v.p2 !== undefined || Object.getOwnPropertyDescriptor(v, "p2") === undefined, "property was removed"); // undefined - doPassFail(v.p3 !== undefined || Object.getOwnPropertyDescriptor(v, "p3") === undefined, "property was removed"); // undefined - doPassFail(v.p4 === 44, "accessor was run"); // mandatory - doPassFail(Object.getOwnPropertyDescriptor(v, "p5") === undefined, "dynamic property not sent"); // undefined - }); - -// Objects returned from accessors should still be coalesced. -tryPostMessage(thunk( - 'var obja = {get p() { return 42; }}; ' + - 'var msg = {get a() { return obja; }, b: obja}; ' + - 'return msg;' - ), false, "evalThunk", function(v) { - // Interestingly, the standard admits two answers here! - doPassFail(v.a === v.b, "reference equality preserved"); - doPassFail((v.b.p === 42 && v.a.p === 42) || - (v.b.p === null && v.a.p === null), "accessors used"); - }); -tryPostMessage(thunk( - 'var obja = {get p() { return 42; }}; ' + - 'var msg = {a: obja, get b() { return obja; }}; ' + - 'return msg;' - ), false, "evalThunk", function(v) { - // Interestingly, the standard admits two answers here! - doPassFail(v.a === v.b, "reference equality preserved (opposite order)"); - doPassFail((v.b.p === 42 && v.a.p === 42) || - (v.b.p === null && v.a.p === null), "accessors used (opposite order)"); - }); - -// Tests to verify that accessor and non-accessor properties are -// treated equivalently. -tryPostMessage(thunk( - 'var obja = {get p() { return 42; }, q: 43}; ' + - 'return {get a() { return obja; }};' - ), false, "evalThunk", function(v) { - doPassFail(v.a.p === 42, "accessor value was not nullified"); - doPassFail(v.a.q === 43, "non-accessor value was not nullified"); - }); -tryPostMessage(thunk( - 'var objb = {get r() { return 44; }, t: 45}; ' + - 'var obja = {get p() { return 42; }, q: 43, s: objb}; ' + - 'return {get a() { return obja; }};' - ), false, "evalThunk", function(v) { - doPassFail(v.a.p === 42, "accessor value was not nullified"); - doPassFail(v.a.q === 43, "non-accessor value was not nullified"); - doPassFail(v.s !== null, "non-accessor value was not nullified"); - doPassFail(v.a.s.r === 44, "accessor value was not nullified"); - doPassFail(v.a.s.t === 45, "non-accessor value was not nullified"); - }); -tryPostMessage(thunk( - 'var objb = {get r() { return 44; }, t: 45}; ' + - 'var obja = {get p() { return 42; }, q: 43, s: [objb]}; ' + - 'return {get c() { return 47; }, get a() { return obja; }, get b() { return 46; } };' - ), false, "evalThunk", function(v) { - doPassFail(v.b === 46, "accessor value was not nullified"); - doPassFail(v.c === 47, "accessor value was not nullified"); - doPassFail(v.a.p === 42, "accessor value was not nullified"); - doPassFail(v.a.q === 43, "non-accessor value was not nullified"); - doPassFail(v.a.s !== null, "non-accessor value was not nullified"); - doPassFail(v.a.s !== undefined, "non-accessor value is defined"); - doPassFail(v.a.s[0] !== null, "non-accessor value was not nullified"); - doPassFail(v.a.s[0] !== undefined, "non-accessor value is defined"); - doPassFail(v.a.s[0].r === 44, "accessor value was not nullified"); - doPassFail(v.a.s[0].t === 45, "non-accessor value was not nullified"); - }); - -// We need to pass out the exception raised from internal accessors. -tryPostMessage(thunk( - 'return {get a() { throw "accessor-exn"; }};' - ), true, null, 'accessor-exn'); -tryPostMessage(thunk( - 'var obja = {get p() { throw "accessor-exn"; }}; ' + - 'return {get a() { return obja; }};' - ), true, null, 'accessor-exn'); -tryPostMessage(thunk( - 'window.bcalled = undefined; ' + - 'window.acalled = undefined; ' + - 'window.pcalled = undefined; ' + - 'var objb = {get b() { window.bcalled = true; return 42; }}; ' + - 'var obja = {get a() { window.acalled = true; return objb; }}; ' + - 'return { get p() { window.pcalled = true; return obja; }};' - ), false, "evalThunk", function(v) { - doPassFail(v.p.a.b === 42, "accessor value was not nullified"); - doPassFail(window.pcalled === true, "window.pcalled === true"); - doPassFail(window.acalled === true, "window.acalled === true"); - doPassFail(window.bcalled === true, "window.bcalled === true"); - }); - -// Reference equality between Boolean objects must be maintained. -tryPostMessage(thunk( - 'var t1 = new Boolean(true); ' + - 'var t2 = new Boolean(true); ' + - 'var f1 = new Boolean(false); ' + - 'var f2 = new Boolean(false); ' + - 'return [t1, t1, t2, f1, f1, f2];' - ), false, "evalThunk", function(v) { - doPassFail(equal(v[0], new Boolean(true)), "Boolean values correct (0)"); - doPassFail(equal(v[3], new Boolean(false)), "Boolean values correct (3)"); - doPassFail(equal(v[1], v[2]), "Boolean values correct (1,2)"); - doPassFail(equal(v[4], v[5]), "Boolean values correct (4,5)"); - doPassFail(v[0] === v[1], "References to Booleans correct (0,1)"); - doPassFail(v[3] === v[4], "References to Booleans correct (3,4)"); - doPassFail(v[0] !== v[2], "References to Booleans correct (0,2)"); - doPassFail(v[3] !== v[5], "References to Booleans correct (3,5)"); - }); - -// Reference equality between Number objects must be maintained. -tryPostMessage(thunk( - 'var n1 = new Number(42.0); ' + - 'var n2 = new Number(42.0); ' + - 'return [n1, n1, n2];' - ), false, "evalThunk", function(v) { - doPassFail(equal(v[0], new Number(42.0)), "Number values correct (0)"); - doPassFail(equal(v[0], v[2]), "Number values correct (0,2)"); - doPassFail(v[0] === v[1], "References to numbers correct (0,1)"); - doPassFail(v[0] !== v[2], "References to numbers correct (0,2)"); - }); - -// Reference equality between String objects must be maintained. -tryPostMessage(thunk( - 'var s1 = new String("gnirts"); ' + - 'var s2 = new String("gnirts"); ' + - 'return [s1, s1, s2];' - ), false, "evalThunk", function(v) { - doPassFail(equal(v[0], new String("gnirts")), "String values correct (0)"); - doPassFail(equal(v[0], v[2]), "String values correct (0,2)"); - doPassFail(v[0] === v[1], "References to strings correct (0,1)"); - doPassFail(v[0] !== v[2], "References to strings correct (0,2)"); - }); - -// Properties added to String, Boolean and Number objects should not be serialized. -tryPostMessage(thunk( - 'var s = new String("gnirts"); ' + - 'var n = new Number(42.0); ' + - 'var b = new Boolean(true); ' + - 's.foo = 1; n.foo = 2; b.foo = 3; ' + - 'return [s, n, b];' - ), false, "evalThunk", function(v) { - doPassFail(v[0].foo == undefined, "String object properties not serialized"); - doPassFail(v[1].foo == undefined, "Number object properties not serialized"); - doPassFail(v[2].foo == undefined, "Boolean object properties not serialized"); - }); - -// Reference equality between dates must be maintained. -tryPostMessage(thunk( - 'var d1 = new Date(1,2,3); ' + - 'var d2 = new Date(1,2,3); ' + - 'return [d1,d1,d2];' - ), false, "evalThunk", function(v) { - doPassFail(equal(v[0], new Date(1,2,3)), "Date values correct (0)"); - doPassFail(equal(v[0], v[2]), "Date values correct (1)"); - doPassFail(v[0] === v[1], "References to dates correct (0)"); - doPassFail(v[0] !== v[2], "References to dates correct (1)"); - }); - -// Reference equality between regexps must be preserved. -tryPostMessage(thunk( - 'var rx1 = new RegExp("foo"); ' + - 'var rx2 = new RegExp("foo"); ' + - 'var rx3 = new RegExp("foo", "gim"); ' + - 'rx3.exec("foofoofoo"); ' + - 'doPassFail(rx3.lastIndex === 3, "lastIndex initially correct: was " + rx3.lastIndex); ' + - 'return [rx1,rx1,rx2,rx3];' - ), false, "evalThunk", function(v) { - doPassFail(v[0].source === "foo", "Regexp value correct (0)"); - doPassFail(v[0] === v[1], "References to regexps correct (0)"); - doPassFail(v[0] !== v[2], "References to regexps correct (1)"); - doPassFail(v[0].global === false, "global set (0)"); - doPassFail(v[3].global === true, "global set (1)"); - doPassFail(v[0].ignoreCase === false, "ignoreCase set (0)"); - doPassFail(v[3].ignoreCase === true, "ignoreCase set (1)"); - doPassFail(v[0].multiline === false, "multiline set (0)"); - doPassFail(v[3].multiline === true, "multiline set (1)"); - doPassFail(v[0].lastIndex === 0, "lastIndex correct (0)"); - doPassFail(v[3].lastIndex === 0, "lastIndex correct (1)"); - }); - -if (window.eventSender) { - tryPostMessage(thunk( - 'window.fileList = fileInput.files; ' + - 'window.file0 = fileList[0]; ' + - 'window.file1 = fileList[1]; ' + - 'return window.fileList.length'), false, 2); - doPassFail(window.fileList[0] === window.file0, "sanity on file reference equality") - // The standard mandates that we do _not_ maintain reference equality for files in a transferred FileList. - tryPostMessage(thunk('return [window.file0, window.file0];' - ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "file references transfer")}); - tryPostMessage(thunk('return [window.fileList, window.file0];' - ), false, "evalThunk", function(v) { doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality")}); - tryPostMessage(thunk('return [window.file0, window.fileList];' - ), false, "evalThunk", function(v) { doPassFail(v[1][0] !== v[0], "FileList should not respect reference equality")}); - tryPostMessage(thunk('return [window.fileList, window.fileList];' - ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "FileList respects self-reference equality")}); - tryPostMessage(thunk('return [window.fileList, window.file0, window.file1]' - ), false, "evalThunk", function(v) { - doPassFail(v[0].length === window.fileList.length, "FileList length sent correctly"); - doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality (0)"); - doPassFail(v[0][1] !== v[2], "FileList should not respect reference equality (1)"); - doPassFail(v[0][0].name == window.file0.name, "FileList preserves order and data (name0)"); - doPassFail(v[0][1].name == window.file1.name, "FileList preserves order and data (name1)"); - doPassFail(equal(v[0][0].lastModifiedDate, window.file0.lastModifiedDate), "FileList preserves order and data (date0)"); - doPassFail(equal(v[0][1].lastModifiedDate, window.file1.lastModifiedDate), "FileList preserves order and data (date1)"); - }); -} -tryPostMessage('"done"');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js b/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js deleted file mode 100644 index 09c0735..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js +++ /dev/null
@@ -1,20 +0,0 @@ -description("Test what happens when you set the window's prototype to various values."); - -var originalWindowPrototype = __proto__; -var chainPointingBackToWindow = { __proto__: window }; -var anotherObject = { }; -var error = "'TypeError: Immutable prototype object \\'#<Window>\\' cannot have their prototype set'"; - -shouldThrow("__proto__ = window; __proto__", error); -shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", error); -shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); -shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); -shouldThrow("__proto__ = anotherObject; __proto__", error); -shouldBe("anotherObject.__proto__ = window; __proto__", "originalWindowPrototype"); -shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); -shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); -shouldThrow("__proto__ = anotherObject; __proto__", error); -shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowPrototype"); -shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window"); -shouldThrow("__proto__ = null; __proto__", error); -shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Cyclic __proto__ value'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html index 024f4252..733f169 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html
@@ -4,6 +4,27 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/window-custom-prototype.js"></script> +<script> +description("Test what happens when you set the window's prototype to various values."); + +var originalWindowPrototype = __proto__; +var chainPointingBackToWindow = { __proto__: window }; +var anotherObject = { }; +var error = "'TypeError: Immutable prototype object \\'#<Window>\\' cannot have their prototype set'"; + +shouldThrow("__proto__ = window; __proto__", error); +shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", error); +shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); +shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); +shouldThrow("__proto__ = anotherObject; __proto__", error); +shouldBe("anotherObject.__proto__ = window; __proto__", "originalWindowPrototype"); +shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); +shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); +shouldThrow("__proto__ = anotherObject; __proto__", error); +shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowPrototype"); +shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window"); +shouldThrow("__proto__ = null; __proto__", error); +shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Cyclic __proto__ value'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html index 1c3d1a11..fbe2220 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-deep-array.html
@@ -4,7 +4,14 @@ <div id="description"></div> <input type="file" id="fileInput" multiple></input> <div id="console"></div> -<script src="script-tests/postmessage-test.js"></script> -<script src="script-tests/postmessage-clone-deep-array.js"></script> +<script src="resources/postmessage-test.js"></script> +<script> +document.getElementById("description").innerHTML = "Tests that we support cloning deep(ish) arrays."; +deepArray=[]; +for (var i = 0; i < 10000; i++) + deepArray=[deepArray]; +tryPostMessage('deepArray'); +tryPostMessage('"done"'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html index eb6d66b..14923bf2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-really-deep-array.html
@@ -4,7 +4,14 @@ <div id="description"></div> <input type="file" id="fileInput" multiple></input> <div id="console"></div> -<script src="script-tests/postmessage-test.js"></script> -<script src="script-tests/postmessage-clone-really-deep-array.js"></script> +<script src="resources/postmessage-test.js"></script> +<script> +document.getElementById("description").innerHTML = "Tests that we abort cloning overdeep arrays."; +reallyDeepArray=[]; +for (var i = 0; i < 100000; i++) + reallyDeepArray=[reallyDeepArray]; +tryPostMessage('reallyDeepArray', true, null, RangeError); +tryPostMessage('"done"'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone.html index 8d60603..006e7f5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone.html +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone.html
@@ -4,7 +4,363 @@ <div id="description"></div> <input type="file" id="fileInput" multiple></input> <div id="console"></div> -<script src="script-tests/postmessage-test.js"></script> -<script src="script-tests/postmessage-clone.js"></script> +<script src="resources/postmessage-test.js"></script> +<script> +document.getElementById("description").innerHTML = "Tests that we clone object hierarchies"; + +tryPostMessage('null'); +tryPostMessage('undefined'); +tryPostMessage('1'); +tryPostMessage('true'); +tryPostMessage('"1"'); +tryPostMessage('({})'); +tryPostMessage('({a:1})'); +tryPostMessage('({a:"a"})'); +tryPostMessage('({b:"a", a:"b"})'); +tryPostMessage('({p0:"string0", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})'); +tryPostMessage('({p0:"string1", p1:"string1", p2:"string2", p3:"string3", p4:"string4", p5:"string5", p6:"string6", p7:"string7", p8:"string8", p9:"string9", p10:"string10", p11:"string11", p12:"string12", p13:"string13", p14:"string14", p15:"string15", p16:"string16", p17:"string17", p18:"string18", p19:"string19"})'); +tryPostMessage('({a:""})'); +tryPostMessage('({a:0})'); +tryPostMessage('({a:1})'); +tryPostMessage('[]'); +tryPostMessage('["a", "a", "b", "a", "b"]'); +tryPostMessage('["a", "a", "b", {a:"b", b:"a"}]'); +tryPostMessage('[1,2,3]'); +tryPostMessage('[,,1]'); +tryPostMessage('(function(){})', true, null, DOMException.DATA_CLONE_ERR); +tryPostMessage('var x = 0; try { eval("badref"); } catch(e) { x = e; } x', true, null, DOMException.DATA_CLONE_ERR); +var arrayBuffer = new ArrayBuffer(1); +tryPostMessage('"data"', false, null, 0, [arrayBuffer]); +tryPostMessage('arrayBuffer', true, null, DOMException.DATA_CLONE_ERR); +var duplicateArrayBuffer = new ArrayBuffer(1); +tryPostMessage('"data"', true, null, DOMException.DATA_CLONE_ERR, [duplicateArrayBuffer, duplicateArrayBuffer]); +var uint8Array = new Uint8Array([10]); +tryPostMessage('"data"', false, null, 0, [uint8Array.buffer]); +tryPostMessage('uint8Array', true, null, DOMException.DATA_CLONE_ERR); +tryPostMessage('new Date(1234567890000)'); +tryPostMessage('new ConstructorWithPrototype("foo")', false, '({field:"foo"})'); +tryPostMessage('new Boolean(true)'); +tryPostMessage('new Boolean(false)'); +tryPostMessage('new String("gnirts")'); +tryPostMessage('new Number(42.0)'); +cyclicObject={}; +cyclicObject.self = cyclicObject; +tryPostMessage('cyclicObject', false, "cyclicObject"); +cyclicArray=[]; +cyclicArray[0] = cyclicArray; +tryPostMessage('cyclicArray', false, "cyclicArray"); +var cyclicObjectGetter = {get self() { return cyclicObjectGetter; }}; +tryPostMessage('cyclicObjectGetter', false, 'cyclicObject'); +objectGraph = {}; +object = {}; +objectGraph.graph1 = object; +objectGraph.graph2 = object; +tryPostMessage('objectGraph', false, "objectGraph"); +arrayGraph = [object, object]; +tryPostMessage('arrayGraph', false, "arrayGraph"); +tryPostMessage('window', true); +tryPostMessage('({get a() { throw "x" }})', true); + +if (window.eventSender) { + var fileInput = document.getElementById("fileInput"); + var fileRect = fileInput.getClientRects()[0]; + var targetX = fileRect.left + fileRect.width / 2; + var targetY = fileRect.top + fileRect.height / 2; + eventSender.beginDragWithFiles(['resources/blank.html', 'resources/child.html']); + eventSender.mouseMoveTo(targetX, targetY); + eventSender.mouseUp(); +} +var imageData = document.createElement("canvas").getContext("2d").createImageData(10,10); +for (var i = 0; i < imageData.data.length * 4; i++) + imageData.data[i] = i % 256; +var mutatedImageData = document.createElement("canvas").getContext("2d").createImageData(10,10); +for (var i = 0; i < imageData.data.length * 4; i++) + mutatedImageData.data[i] = i % 256; +tryPostMessage('imageData', false, imageData); +tryPostMessage('imageData.data', false, imageData.data) +tryPostMessage('mutatedImageData', false, imageData); +tryPostMessage('mutatedImageData.data', false, imageData.data) +for (var i = 0; i < imageData.data.length * 4; i++) + mutatedImageData.data[i] = 0; + +// Test close() special case for Blob (and File.) + +var blob = new Blob(["Hello"]); +var blobSize = blob.size; +tryPostMessage('blob', false, "evalThunk", function(v) { doPassFail(v.size === blobSize, "Cloned Blob size equal to the original size."); }); +tryPostMessage('blob.close(); blob', true, null, DOMException.DATA_CLONE_ERR); + +var constructedFile = new File(["Hello"], "test"); +var fileSize = constructedFile.size; +tryPostMessage('constructedFile', false, "evalThunk", function(v) { doPassFail(v.size === fileSize, "Cloned File size equal to the original size."); }); +tryPostMessage('constructedFile.close(); constructedFile', true, null, DOMException.DATA_CLONE_ERR); + +function thunk(s) { + return "(function() {" + s + "})()"; +} +tryPostMessage(thunk('return 42;'), false, '42'); +tryPostMessage(thunk('return 42;'), false, thunk('return 40 + 2;')); +tryPostMessage(thunk('return 42;'), false, "evalThunk", + function(v) { doPassFail(v == 42, "evalThunk OK"); }) + +// Only enumerable properties should be serialized. +tryPostMessage(thunk('var o = {x:"hello"}; Object.defineProperty(o, "y", {value:"goodbye"}); return o;'), false, '({x:"hello"})'); + +// It's unclear what we should do if an accessor modifies an object out from under us +// while we're serializing it; the standard does mandate certain aspects about evaluation +// order, though, including that properties must be processed in their enumeration order. +tryPostMessage(thunk( + 'var a = [0, 1, 2]; ' + + 'var b = { get x() { a[0] = 40; a[2] = 42; a.push(43); return 41; }}; ' + + 'a[1] = b; ' + + 'return a;' + ), false, "evalThunk", function(v) { + doPassFail(v.length === 3, "length correct"); // undefined + doPassFail(v[0] === 0, "evaluation order OK"); // mandatory + doPassFail(v[1].x === 41, "evaluation order OK/accessor reached"); // mandatory + doPassFail(v[2] === 42, "evaluation order OK"); // mandatory + }); + +tryPostMessage(thunk( + 'var a = [0, 1, 2]; ' + + 'var b = { get x() { a.pop(); return 41; } }; ' + + 'a[1] = b; ' + + 'return a;' + ), false, "evalThunk", function(v) { + doPassFail(v.length === 3 || v.length === 2, "length correct"); // undefined + doPassFail(v[0] === 0, "index 0 OK"); // mandatory + doPassFail(v[1].x === 41, "accessor reached"); // mandatory + doPassFail(v[2] === undefined, "index 2 undefined"); // undefined + }); + +tryPostMessage(thunk( + 'var a = [0, 1, 2]; ' + + 'var b = { get x() { a.pop(); return 41; } }; ' + + 'a[2] = b; ' + + 'return a;' + ), false, "evalThunk", function(v) { + doPassFail(v.length === 3, "length correct"); // undefined + doPassFail(v[0] === 0, "index 0 OK"); // mandatory + doPassFail(v[1] === 1, "index 1 OK"); // mandatory + doPassFail(v[2].x === 41, "index 2 OK"); // undefined + }); + +// Now with objects! This is a little more tricky because the standard does not +// define an enumeration order. +tryPostMessage(thunk( + 'var a = {p0: 0, p1: 1}; ' + + 'Object.defineProperty(a, "p2", {get:function() {delete a.p3; return 42; }, enumerable: true, configurable: true}); ' + + 'Object.defineProperty(a, "p3", {get:function() {delete a.p2; return 43; }, enumerable: true, configurable: true}); ' + + 'Object.defineProperty(a, "p4", {get:function() { a.p5 = 45; return 44; }, enumerable: true, configurable: true}); ' + + 'return a;' + ), false, "evalThunk", function(v) { + doPassFail(v.p0 === 0 && v.p1 === 1, "basic properties OK"); // mandatory + doPassFail(v.p2 === undefined && v.p3 !== undefined || + v.p2 !== undefined && v.p3 === undefined, "one accessor was run"); // mandatory + doPassFail(v.p2 !== undefined || Object.getOwnPropertyDescriptor(v, "p2") === undefined, "property was removed"); // undefined + doPassFail(v.p3 !== undefined || Object.getOwnPropertyDescriptor(v, "p3") === undefined, "property was removed"); // undefined + doPassFail(v.p4 === 44, "accessor was run"); // mandatory + doPassFail(Object.getOwnPropertyDescriptor(v, "p5") === undefined, "dynamic property not sent"); // undefined + }); + +// Objects returned from accessors should still be coalesced. +tryPostMessage(thunk( + 'var obja = {get p() { return 42; }}; ' + + 'var msg = {get a() { return obja; }, b: obja}; ' + + 'return msg;' + ), false, "evalThunk", function(v) { + // Interestingly, the standard admits two answers here! + doPassFail(v.a === v.b, "reference equality preserved"); + doPassFail((v.b.p === 42 && v.a.p === 42) || + (v.b.p === null && v.a.p === null), "accessors used"); + }); +tryPostMessage(thunk( + 'var obja = {get p() { return 42; }}; ' + + 'var msg = {a: obja, get b() { return obja; }}; ' + + 'return msg;' + ), false, "evalThunk", function(v) { + // Interestingly, the standard admits two answers here! + doPassFail(v.a === v.b, "reference equality preserved (opposite order)"); + doPassFail((v.b.p === 42 && v.a.p === 42) || + (v.b.p === null && v.a.p === null), "accessors used (opposite order)"); + }); + +// Tests to verify that accessor and non-accessor properties are +// treated equivalently. +tryPostMessage(thunk( + 'var obja = {get p() { return 42; }, q: 43}; ' + + 'return {get a() { return obja; }};' + ), false, "evalThunk", function(v) { + doPassFail(v.a.p === 42, "accessor value was not nullified"); + doPassFail(v.a.q === 43, "non-accessor value was not nullified"); + }); +tryPostMessage(thunk( + 'var objb = {get r() { return 44; }, t: 45}; ' + + 'var obja = {get p() { return 42; }, q: 43, s: objb}; ' + + 'return {get a() { return obja; }};' + ), false, "evalThunk", function(v) { + doPassFail(v.a.p === 42, "accessor value was not nullified"); + doPassFail(v.a.q === 43, "non-accessor value was not nullified"); + doPassFail(v.s !== null, "non-accessor value was not nullified"); + doPassFail(v.a.s.r === 44, "accessor value was not nullified"); + doPassFail(v.a.s.t === 45, "non-accessor value was not nullified"); + }); +tryPostMessage(thunk( + 'var objb = {get r() { return 44; }, t: 45}; ' + + 'var obja = {get p() { return 42; }, q: 43, s: [objb]}; ' + + 'return {get c() { return 47; }, get a() { return obja; }, get b() { return 46; } };' + ), false, "evalThunk", function(v) { + doPassFail(v.b === 46, "accessor value was not nullified"); + doPassFail(v.c === 47, "accessor value was not nullified"); + doPassFail(v.a.p === 42, "accessor value was not nullified"); + doPassFail(v.a.q === 43, "non-accessor value was not nullified"); + doPassFail(v.a.s !== null, "non-accessor value was not nullified"); + doPassFail(v.a.s !== undefined, "non-accessor value is defined"); + doPassFail(v.a.s[0] !== null, "non-accessor value was not nullified"); + doPassFail(v.a.s[0] !== undefined, "non-accessor value is defined"); + doPassFail(v.a.s[0].r === 44, "accessor value was not nullified"); + doPassFail(v.a.s[0].t === 45, "non-accessor value was not nullified"); + }); + +// We need to pass out the exception raised from internal accessors. +tryPostMessage(thunk( + 'return {get a() { throw "accessor-exn"; }};' + ), true, null, 'accessor-exn'); +tryPostMessage(thunk( + 'var obja = {get p() { throw "accessor-exn"; }}; ' + + 'return {get a() { return obja; }};' + ), true, null, 'accessor-exn'); +tryPostMessage(thunk( + 'window.bcalled = undefined; ' + + 'window.acalled = undefined; ' + + 'window.pcalled = undefined; ' + + 'var objb = {get b() { window.bcalled = true; return 42; }}; ' + + 'var obja = {get a() { window.acalled = true; return objb; }}; ' + + 'return { get p() { window.pcalled = true; return obja; }};' + ), false, "evalThunk", function(v) { + doPassFail(v.p.a.b === 42, "accessor value was not nullified"); + doPassFail(window.pcalled === true, "window.pcalled === true"); + doPassFail(window.acalled === true, "window.acalled === true"); + doPassFail(window.bcalled === true, "window.bcalled === true"); + }); + +// Reference equality between Boolean objects must be maintained. +tryPostMessage(thunk( + 'var t1 = new Boolean(true); ' + + 'var t2 = new Boolean(true); ' + + 'var f1 = new Boolean(false); ' + + 'var f2 = new Boolean(false); ' + + 'return [t1, t1, t2, f1, f1, f2];' + ), false, "evalThunk", function(v) { + doPassFail(equal(v[0], new Boolean(true)), "Boolean values correct (0)"); + doPassFail(equal(v[3], new Boolean(false)), "Boolean values correct (3)"); + doPassFail(equal(v[1], v[2]), "Boolean values correct (1,2)"); + doPassFail(equal(v[4], v[5]), "Boolean values correct (4,5)"); + doPassFail(v[0] === v[1], "References to Booleans correct (0,1)"); + doPassFail(v[3] === v[4], "References to Booleans correct (3,4)"); + doPassFail(v[0] !== v[2], "References to Booleans correct (0,2)"); + doPassFail(v[3] !== v[5], "References to Booleans correct (3,5)"); + }); + +// Reference equality between Number objects must be maintained. +tryPostMessage(thunk( + 'var n1 = new Number(42.0); ' + + 'var n2 = new Number(42.0); ' + + 'return [n1, n1, n2];' + ), false, "evalThunk", function(v) { + doPassFail(equal(v[0], new Number(42.0)), "Number values correct (0)"); + doPassFail(equal(v[0], v[2]), "Number values correct (0,2)"); + doPassFail(v[0] === v[1], "References to numbers correct (0,1)"); + doPassFail(v[0] !== v[2], "References to numbers correct (0,2)"); + }); + +// Reference equality between String objects must be maintained. +tryPostMessage(thunk( + 'var s1 = new String("gnirts"); ' + + 'var s2 = new String("gnirts"); ' + + 'return [s1, s1, s2];' + ), false, "evalThunk", function(v) { + doPassFail(equal(v[0], new String("gnirts")), "String values correct (0)"); + doPassFail(equal(v[0], v[2]), "String values correct (0,2)"); + doPassFail(v[0] === v[1], "References to strings correct (0,1)"); + doPassFail(v[0] !== v[2], "References to strings correct (0,2)"); + }); + +// Properties added to String, Boolean and Number objects should not be serialized. +tryPostMessage(thunk( + 'var s = new String("gnirts"); ' + + 'var n = new Number(42.0); ' + + 'var b = new Boolean(true); ' + + 's.foo = 1; n.foo = 2; b.foo = 3; ' + + 'return [s, n, b];' + ), false, "evalThunk", function(v) { + doPassFail(v[0].foo == undefined, "String object properties not serialized"); + doPassFail(v[1].foo == undefined, "Number object properties not serialized"); + doPassFail(v[2].foo == undefined, "Boolean object properties not serialized"); + }); + +// Reference equality between dates must be maintained. +tryPostMessage(thunk( + 'var d1 = new Date(1,2,3); ' + + 'var d2 = new Date(1,2,3); ' + + 'return [d1,d1,d2];' + ), false, "evalThunk", function(v) { + doPassFail(equal(v[0], new Date(1,2,3)), "Date values correct (0)"); + doPassFail(equal(v[0], v[2]), "Date values correct (1)"); + doPassFail(v[0] === v[1], "References to dates correct (0)"); + doPassFail(v[0] !== v[2], "References to dates correct (1)"); + }); + +// Reference equality between regexps must be preserved. +tryPostMessage(thunk( + 'var rx1 = new RegExp("foo"); ' + + 'var rx2 = new RegExp("foo"); ' + + 'var rx3 = new RegExp("foo", "gim"); ' + + 'rx3.exec("foofoofoo"); ' + + 'doPassFail(rx3.lastIndex === 3, "lastIndex initially correct: was " + rx3.lastIndex); ' + + 'return [rx1,rx1,rx2,rx3];' + ), false, "evalThunk", function(v) { + doPassFail(v[0].source === "foo", "Regexp value correct (0)"); + doPassFail(v[0] === v[1], "References to regexps correct (0)"); + doPassFail(v[0] !== v[2], "References to regexps correct (1)"); + doPassFail(v[0].global === false, "global set (0)"); + doPassFail(v[3].global === true, "global set (1)"); + doPassFail(v[0].ignoreCase === false, "ignoreCase set (0)"); + doPassFail(v[3].ignoreCase === true, "ignoreCase set (1)"); + doPassFail(v[0].multiline === false, "multiline set (0)"); + doPassFail(v[3].multiline === true, "multiline set (1)"); + doPassFail(v[0].lastIndex === 0, "lastIndex correct (0)"); + doPassFail(v[3].lastIndex === 0, "lastIndex correct (1)"); + }); + +if (window.eventSender) { + tryPostMessage(thunk( + 'window.fileList = fileInput.files; ' + + 'window.file0 = fileList[0]; ' + + 'window.file1 = fileList[1]; ' + + 'return window.fileList.length'), false, 2); + doPassFail(window.fileList[0] === window.file0, "sanity on file reference equality") + // The standard mandates that we do _not_ maintain reference equality for files in a transferred FileList. + tryPostMessage(thunk('return [window.file0, window.file0];' + ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "file references transfer")}); + tryPostMessage(thunk('return [window.fileList, window.file0];' + ), false, "evalThunk", function(v) { doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality")}); + tryPostMessage(thunk('return [window.file0, window.fileList];' + ), false, "evalThunk", function(v) { doPassFail(v[1][0] !== v[0], "FileList should not respect reference equality")}); + tryPostMessage(thunk('return [window.fileList, window.fileList];' + ), false, "evalThunk", function(v) { doPassFail(v[0] === v[1], "FileList respects self-reference equality")}); + tryPostMessage(thunk('return [window.fileList, window.file0, window.file1]' + ), false, "evalThunk", function(v) { + doPassFail(v[0].length === window.fileList.length, "FileList length sent correctly"); + doPassFail(v[0][0] !== v[1], "FileList should not respect reference equality (0)"); + doPassFail(v[0][1] !== v[2], "FileList should not respect reference equality (1)"); + doPassFail(v[0][0].name == window.file0.name, "FileList preserves order and data (name0)"); + doPassFail(v[0][1].name == window.file1.name, "FileList preserves order and data (name1)"); + doPassFail(equal(v[0][0].lastModifiedDate, window.file0.lastModifiedDate), "FileList preserves order and data (date0)"); + doPassFail(equal(v[0][1].lastModifiedDate, window.file1.lastModifiedDate), "FileList preserves order and data (date1)"); + }); +} +tryPostMessage('"done"'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants.html b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants.html index 9a0fbde..eb988cf 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants.html +++ b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants.html
@@ -4,6 +4,29 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/XMLHttpRequest-constants.js"></script> +<script> +description("This test checks the constants on the XMLHttpRequst object, as well as its prototype and constructor."); + +debug("Test the constants on the XMLHttpRequest object itself.") +shouldBe("new XMLHttpRequest().UNSENT", "0"); +shouldBe("new XMLHttpRequest().OPENED", "1"); +shouldBe("new XMLHttpRequest().HEADERS_RECEIVED", "2"); +shouldBe("new XMLHttpRequest().LOADING", "3"); +shouldBe("new XMLHttpRequest().DONE", "4"); + +debug("Test the constants on the XMLHttpRequest prototype object.") +shouldBe("XMLHttpRequest.prototype.UNSENT", "0"); +shouldBe("XMLHttpRequest.prototype.OPENED", "1"); +shouldBe("XMLHttpRequest.prototype.HEADERS_RECEIVED", "2"); +shouldBe("XMLHttpRequest.prototype.LOADING", "3"); +shouldBe("XMLHttpRequest.prototype.DONE", "4"); + +debug("Test the constants on the XMLHttpRequest constructor object.") +shouldBe("XMLHttpRequest.UNSENT", "0"); +shouldBe("XMLHttpRequest.OPENED", "1"); +shouldBe("XMLHttpRequest.HEADERS_RECEIVED", "2"); +shouldBe("XMLHttpRequest.LOADING", "3"); +shouldBe("XMLHttpRequest.DONE", "4"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors.html b/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors.html index e2032fc9d..35593f0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors.html +++ b/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors.html
@@ -2,4 +2,68 @@ <meta charset=utf8> <body> <script src="../../resources/js-test.js"></script> -<script src="script-tests/attribute-legacy-colors.js"></script> +<script> +description("This test ensures that legacy color attributes are parsed properly."); + +shouldBe("document.body.bgColor='';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); +shouldBe("document.body.bgColor='transparent';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); +shouldBe("document.body.bgColor=' transparent ';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); +(function(){ +var tests = [ + {'test':'red', 'expected':[255, 0, 0]}, + {'test':' red ', 'expected':[255, 0, 0]}, + {'test':'#f00', 'expected':[255, 0, 0]}, + {'test':' #f00 ', 'expected':[255, 0, 0]}, + {'test':'#ff0000', 'expected':[255, 0, 0]}, + {'test':' #ff0000 ', 'expected':[255, 0, 0]}, + {'test':'#fzz', 'expected':[15, 0, 0]}, + {'test':'#ffzzzz', 'expected':[255, 0, 0]}, + {'test':'f00', 'expected':[15, 0, 0]}, + {'test':'ff0000', 'expected':[255, 0, 0]}, + {'test':'#00000000', 'expected':[0, 0, 0]}, + {'test':'foo', 'expected':[15, 0, 0]}, + {'test':'cheese', 'expected':[192, 238, 14]}, + {'test':'ff򀿿ff', 'expected':[255, 0, 255]}, + {'test':'f򀿿f', 'expected':[240, 15, 0]}, + {'test':'rgb(255, 0, 0)', 'expected':[0, 85, 0]}, + {'test':'rgba(255,255,255,50%)', 'expected':[0,80,85]}, + {'test':'hsl(180,100%,50%)', 'expected':[0,1,80]}, + {'test':'hsla(180,100%,50%,50%)', 'expected':[0,16,5]}, + {'test':'currentColor', 'expected':[192,224,0]}, + {'test':'550000001155000000115500000011', 'expected':[17, 17, 17]}, + {'test':'550000000155000000015500000001', 'expected':[1, 1, 1]}, + {'test':'550000000055000000005500000000', 'expected':[0, 0, 0]}, + {'test':'550020001155000000115500000011', 'expected':[32, 0, 0]}, + {'test':'55򀿿20򀿿1155򀿿򀿿00115500򀿿0011', 'expected':[32, 0, 0]}, + {'test':'#', 'expected':[0, 0, 0]}, + {'test':'#5', 'expected':[5, 0, 0]}, + {'test':'#55', 'expected':[5, 5, 0]}, + {'test':'#555', 'expected':[85, 85, 85]}, + {'test':'#5555', 'expected':[85, 85, 0]}, + {'test':'#55555', 'expected':[85, 85, 80]}, + {'test':'#555555', 'expected':[85, 85, 85]}, + {'test':'#5555555', 'expected':[85, 85, 80]}, + {'test':'#55555555', 'expected':[85, 85, 85]}, + {'test':'5', 'expected':[5, 0, 0]}, + {'test':'55', 'expected':[5, 5, 0]}, + {'test':'555', 'expected':[5, 5, 5]}, + {'test':'5555', 'expected':[85, 85, 0]}, + {'test':'55555', 'expected':[85, 85, 80]}, + {'test':'555555', 'expected':[85, 85, 85]}, + {'test':'5555555', 'expected':[85, 85, 80]}, + {'test':'55555555', 'expected':[85, 85, 85]}, + {'test':'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000', 'expected':[255, 255, 255]}, + {'test':'򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿ffffff', 'expected':[0, 0, 0]}, + {'test':' ', 'expected':[0, 0, 0]}, + {'test':' ffffff ', 'expected':[255, 255, 255]} +]; + +for(var i = 0; i < tests.length; i++) { + var t = tests[i].test; + var e = tests[i].expected; + shouldBe("document.body.bgColor='" + t + "';getComputedStyle(document.body).backgroundColor;", "'rgb(" + e[0] + ", " + e[1] + ", " + e[2] + ")'"); +} +})(); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/body-frameset-event-handlers.html b/third_party/WebKit/LayoutTests/fast/dom/body-frameset-event-handlers.html index 5244063f..19efd6e9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/body-frameset-event-handlers.html +++ b/third_party/WebKit/LayoutTests/fast/dom/body-frameset-event-handlers.html
@@ -2,7 +2,7 @@ <title>HTMLBodyElement and HTMLFrameSetElement event handler test</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> -<script src="script-tests/event-handlers.js"></script> +<script src="resources/event-handlers.js"></script> <script> // attribute list from WHATWG HTML Living Standard r8389 [
diff --git a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html index 64b88f3..b62a38c3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection.html
@@ -4,6 +4,70 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/boolean-attribute-reflection.js"></script> +<script> +description("Test reflecting boolean attributes."); + +var attributes = [ + [ "area", "noHref" ], + [ "dir", "compact" ], + [ "dl", "compact" ], + [ "form", "noValidate" ], + [ "frame", "noResize" ], + [ "hr", "noShade" ], + [ "iframe", "allowFullscreen" ], + [ "img", "isMap" ], + [ "input", "autofocus" ], + [ "input", "defaultChecked", "checked" ], + [ "input", "disabled" ], + [ "input", "formNoValidate" ], + [ "input", "multiple" ], + [ "input", "readOnly" ], + [ "input", "required" ], + [ "link", "disabled" ], + [ "menu", "compact" ], + [ "menuitem", "checked" ], + [ "menuitem", "default" ], + [ "menuitem", "disabled" ], + [ "object", "declare" ], + [ "ol", "compact" ], + [ "option", "defaultSelected", "selected" ], + [ "script", "defer" ], + [ "select", "multiple" ], + [ "td", "noWrap" ], + [ "ul", "compact" ], + [ "video", "autoplay" ], + [ "video", "controls" ], + [ "video", "loop" ], +]; + +function make(tag) +{ + return document.createElement(tag); +} + +for (var i = 0; i < attributes.length; ++i) { + var tag = attributes[i][0]; + var reflectingAttribute = attributes[i][1]; + var contentAttribute = attributes[i][2] || reflectingAttribute.toLowerCase(); + shouldBe("e = make('" + tag + "'); " + + "e.removeAttribute('" + contentAttribute + "'); " + + "e." + reflectingAttribute, + "false"); + shouldBe("e = make('" + tag + "'); " + + "e.setAttribute('" + contentAttribute + "', ''); " + + "e." + reflectingAttribute, + "true"); + shouldBe("e = make('" + tag + "'); " + + "e.setAttribute('" + contentAttribute + "', 'x'); " + + "e." + reflectingAttribute + " = false; " + + "e.getAttribute('" + contentAttribute + "')", + "null"); + shouldBe("e = make('" + tag + "'); " + + "e.setAttribute('" + contentAttribute + "', 'x'); " + + "e." + reflectingAttribute + " = true; " + + "e.getAttribute('" + contentAttribute + "')", + "''"); +} +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt index 164545e..2b70897 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
@@ -1,5 +1,5 @@ -CONSOLE WARNING: line 26: 'webkitURL' is deprecated. Please use 'URL' instead. -CONSOLE WARNING: line 26: 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead. +CONSOLE WARNING: line 33: 'webkitURL' is deprecated. Please use 'URL' instead. +CONSOLE WARNING: line 33: 'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead. Make sure prototypes are set up using the window a property came from, instead of the lexical global object. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes.html b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes.html index 435299e..ce95461 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes.html +++ b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes.html
@@ -4,6 +4,82 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/constructed-objects-prototypes.js"></script> +<script> +description("Make sure prototypes are set up using the window a property came from, instead of the lexical global object.") + +var subframe = document.createElement("iframe"); +document.body.appendChild(subframe); +var inner = subframe.contentWindow; // Call it "inner" to make shouldBe output shorter + +// Stash a property on the prototypes. +window.Object.prototype.isInner = false; +inner.Object.prototype.isInner = true; + +function classNameForObject(object) +{ + // call will use the global object if passed null or undefined, so special case those: + if (object == null) + return null; + var result = Object.prototype.toString.call(object); + // remove '[object ' and ']' + return result.split(' ')[1].split(']')[0]; +} + +function constructorPropertiesOnWindow(globalObject) +{ + var constructorNames = []; + var propertyNames = Object.getOwnPropertyNames(window); + for (var i = 0; i < propertyNames.length; i++) { + var value = inner[propertyNames[i]]; + if (value == null) + continue; + var type = classNameForObject(value); + // Ignore these properties because they do not exist in all implementations. They will be tested separately + if (type == "WebGLRenderingContextConstructor" || + type == "ArrayBufferConstructor" || + type =="Float32ArrayConstructor" || + type =="Float64ArrayConstructor" || + type =="Int8ArrayConstructor" || + type =="Int16ArrayConstructor" || + type =="Int32ArrayConstructor" || + type =="Uint8ArrayConstructor" || + type =="Uint8ClampedArrayConstructor" || + type =="Uint16ArrayConstructor" || + type =="Uint32ArrayConstructor" || + type == "FileReaderConstructor" || + type == "AudioContextConstructor" || + type == "SpeechSynthesisUtteranceConstructor") + continue; + if (!type.match('Constructor$')) + continue; + constructorNames.push(property); + } + return constructorNames.sort(); +} + +var constructorNames = constructorPropertiesOnWindow(inner); + +var argumentsForConstructor = { + 'Worker' : "'foo'", +} + +for (var x = 0; x < constructorNames.length; x++) { + var constructorName = constructorNames[x]; + var arguments = argumentsForConstructor[constructorName] || ""; + var argumentsString = "(" + arguments + ")"; + // Test first to see if the object is constructable + var constructedObject; + try { + constructedObject = eval("new inner." + constructorName + argumentsString); + } catch(e) { + continue; + } + + shouldBeTrue("(new inner." + constructorName + argumentsString + ").isInner"); + shouldBeTrue("(new inner." + constructorName + argumentsString + ").constructor.isInner"); +} + +document.body.removeChild(subframe); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached.html b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached.html index c382f363..09b0b59 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached.html +++ b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached.html
@@ -4,6 +4,25 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/constructors-cached.js"></script> +<script> +description("This test ensures that objects with security restrictions are cached correctly"); + +var ctors = ["Image", "Option", "XMLHttpRequest", "Audio"]; + +for (var i = 0; i < ctors.length; i++) { + var ctor = ctors[i]; + try { + // Test retrieving the object twice results in the same object + shouldBe(ctor, ctor); + + // Be paranoid -- make sure that setting a property results in that property + // stays + this[ctor].testProperty = "property set successfully"; + shouldBe(ctor + ".testProperty", '"property set successfully"'); + } catch (e) { + testFailed("Testing " + ctor + " threw " + e); + } +} +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule.html b/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule.html index ee0c5fe..cef526e1 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule.html +++ b/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule.html
@@ -4,6 +4,23 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/css-mediarule-parentRule.js"></script> +<script> +description( +'This tests that calling parentRule on the child rule of MediaRule is equal to that MediaRule.' +); + +if (window.testRunner) + testRunner.dumpAsText(); + +var head = document.getElementsByTagName('head')[0]; +head.innerHTML = "<style>@media all { a { border-color: red; } }</style>"; + +var styleSheetList = document.styleSheets; +var styleSheet = styleSheetList[0]; +var mediaRule = styleSheet.cssRules[0]; +var childRule = mediaRule.cssRules[0]; + +shouldBe("childRule.parentRule", "mediaRule") +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/crash-in-getTypeExtension.html b/third_party/WebKit/LayoutTests/fast/dom/custom/crash-in-getTypeExtension.html new file mode 100644 index 0000000..dd759ff --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/dom/custom/crash-in-getTypeExtension.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> +test(() => { + // TODO(a.obzhirov): Use customElements.define when customized built-in elements are supported. + document.registerElement('x-foo', { prototype: Object.create(HTMLDivElement.prototype) }); + var toStringCalled = false; + assert_throws('NotFoundError', () => { + document.createElement('div', { toString: () => { toStringCalled = true; return 'x-foo'; } }) + }); + assert_false(toStringCalled, 'toString should not have been called.'); +}, 'Test for crbug/666610: Crash in blink::getTypeExtension'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html index 9729ca9..9f55e6dc 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html +++ b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc.html
@@ -4,6 +4,35 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/dataset-gc.js"></script> +<script> +description("This tests that custom properties on element.dataset persist GC."); + +function gc() +{ + if (window.GCController) + return GCController.collect(); + + for (var i = 0; i < 10000; i++) { + var s = new String(""); + } +} + + +var d = document.createElement("div"); + +var dataset = d.dataset; +// Add a property to our prototype. It will be hidden by the corresponding data- attribute. +dataset.__proto__.customProperty = 1; +dataset.customProperty = 1; // Now set a property on ourselves. +shouldBe("d.getAttribute('data-custom-property')", "'1'"); +shouldBe("d.dataset.customProperty", "'1'"); + +dataset = null; + +gc(); + +// Test that the custom property persisted the GC. +shouldBe("d.dataset.customProperty", "'1'"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml.xhtml b/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml.xhtml index cde5e7b..522f32c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml.xhtml +++ b/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml.xhtml
@@ -5,6 +5,99 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/dataset-xhtml.js"></script> +<script> +description("This tests element.dataset for XHTML."); + +function testGet(attr, expected) +{ + var d = document.createElement("div"); + d.setAttribute(attr, "value"); + return d.dataset[expected] == "value"; +} + +shouldBeTrue("testGet('data-foo', 'foo')"); +shouldBeTrue("testGet('data-foo-bar', 'fooBar')"); +shouldBeTrue("testGet('data--', '-')"); +shouldBeTrue("testGet('data--foo', 'Foo')"); +shouldBeTrue("testGet('data---foo', '-Foo')"); +shouldBeTrue("testGet('data-', '')"); +shouldBeTrue("testGet('data-\xE0', '\xE0')"); +debug(""); + +function matchesNothingInDataset(attr) +{ + var d = document.createElement("div"); + d.setAttribute(attr, "value"); + + var count = 0; + for (var item in d.dataset) + count++; + return count == 0; +} + +shouldBeTrue("matchesNothingInDataset('dataFoo')"); +shouldBeTrue("matchesNothingInDataset('data-Foo')"); +debug(""); + +function testSet(prop, expected) +{ + var d = document.createElement("div"); + d.dataset[prop] = "value"; + return d.getAttribute(expected) == "value"; +} + +shouldBeTrue("testSet('foo', 'data-foo')"); +shouldBeTrue("testSet('fooBar', 'data-foo-bar')"); +shouldBeTrue("testSet('-', 'data--')"); +shouldBeTrue("testSet('Foo', 'data--foo')"); +shouldBeTrue("testSet('-Foo', 'data---foo')"); +shouldBeTrue("testSet('', 'data-')"); +shouldBeTrue("testSet('\xE0', 'data-\xE0')"); +debug(""); + +shouldThrow("testSet('-foo', 'dummy')", '"SyntaxError: Failed to set the \'-foo\' property on \'DOMStringMap\': \'-foo\' is not a valid property name."'); +shouldThrow("testSet('foo\x20', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\x20\' property on \'DOMStringMap\': \'data-foo\x20\' is not a valid attribute name."'); +shouldThrow("testSet('foo\uF900', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\uF900\' property on \'DOMStringMap\': \'data-foo\uF900\' is not a valid attribute name."'); +debug(""); + +function testDelete(attr, prop) +{ + var d = document.createElement("div"); + d.setAttribute(attr, "value"); + delete d.dataset[prop]; + return d.getAttribute(attr) != "value"; +} + +shouldBeTrue("testDelete('data-foo', 'foo')"); +shouldBeTrue("testDelete('data-foo-bar', 'fooBar')"); +shouldBeTrue("testDelete('data--', '-')"); +shouldBeTrue("testDelete('data--foo', 'Foo')"); +shouldBeTrue("testDelete('data---foo', '-Foo')"); +shouldBeTrue("testDelete('data-', '')"); +shouldBeTrue("testDelete('data-\xE0', '\xE0')"); +debug(""); + +shouldBeFalse("testDelete('dummy', '-foo')"); +debug(""); + +function testForIn(array) +{ + var d = document.createElement("div"); + for (var i = 0; i < array.length; ++i) { + d.setAttribute(array[i], "value"); + } + + var count = 0; + for (var item in d.dataset) + count++; + + return count; +} + +shouldBe("testForIn(['data-foo', 'data-bar', 'data-baz'])", "3"); +shouldBe("testForIn(['data-foo', 'data-bar', 'dataFoo'])", "2"); +shouldBe("testForIn(['data-foo', 'data-bar', 'style'])", "2"); +shouldBe("testForIn(['data-foo', 'data-bar', 'data-'])", "3"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-head.html b/third_party/WebKit/LayoutTests/fast/dom/document-head.html index ed2bbefb..9f8869ef 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/document-head.html +++ b/third_party/WebKit/LayoutTests/fast/dom/document-head.html
@@ -4,6 +4,16 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/document-head.js"></script> +<script> +description("This test checks to see if document.head is available, readonly, and the same element as what we would expect by getting it by other means."); + +shouldBe("document.head", "document.getElementsByTagName('head')[0]"); + +document.head = 1; +shouldBeTrue("document.head !== 1"); + +document.documentElement.removeChild(document.head); +shouldBeNull("document.head"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration.html b/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration.html index 41a28910..0d44bc0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration.html +++ b/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration.html
@@ -5,6 +5,203 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/domListEnumeration.js"></script> +<script> +description( +'This tests enumerating the elements of DOM lists.' +); + +if (window.testRunner) + testRunner.dumpAsText(); + +// Create a testing environment that can be cleanup up easily. +var testingGround = document.createElement('div'); +document.body.appendChild(testingGround); + +function createFromMarkup(markup) +{ + var range = document.createRange(); + var fragmentContainer = document.createElement("div"); + range.selectNodeContents(fragmentContainer); + testingGround.appendChild(fragmentContainer); + var fragment = range.createContextualFragment(markup); + fragmentContainer.appendChild(fragment); + return fragmentContainer.firstChild; +} + +function setup() +{ + var head = document.getElementsByTagName('head')[0]; + + // 2 additional <style>s needed for StyleSheetList test (one is included in the template). + // 3 rules needed in the first additional <style> for the CSSRuleList test. + // 3 declarations needed in the first rule needed for the CSSStyleDeclaration test. + // @media rule in the second additional <style> for the MediaList test. + head.appendChild(createFromMarkup("<style> ol { width: 100px; height: 100px; color: green; } ol { } ol { } </style>")); + head.appendChild(createFromMarkup("<style> @media screen, projector, printer { ol { } } </style>")); + + // 3 <ol>s for NodeList test. + // 3 attributes in the first <ol> for the NamedNodeMap test. + testingGround.appendChild(createFromMarkup("<ol class='foo' id='bar' name='baz'></ol>")); + testingGround.appendChild(document.createElement('ol')); + testingGround.appendChild(document.createElement('ol')); + + // 3 <form>s for forms for HTMLCollection test. + var form = document.createElement('form'); + testingGround.appendChild(form); + testingGround.appendChild(document.createElement('form')); + testingGround.appendChild(document.createElement('form')); + + // 3 <select>s for HTMLFormElement test. + var select = document.createElement('select'); + form.appendChild(select); + form.appendChild(document.createElement('select')); + form.appendChild(document.createElement('select')); + + // 3 <option>s for HTMLSelectElement test. + select.appendChild(document.createElement('option')); + select.appendChild(document.createElement('option')); + select.appendChild(document.createElement('option')); + + document.body.appendChild(testingGround); +} + +function iterateList(list) +{ + debug(""); + debug(Object.prototype.toString.call(list)); + var temp = new Array(); + for (var i in list) { + temp.push(i); + } + temp.sort(); + + var a = new Array(); + for (var i = 0; i < temp.length; ++i) { + a.push({"i" : temp[i], "item" : list[temp[i]]}); + } + return a; +} + +// ** Firefox DOES include the indexGetter results in enumeration ** +// NodeList +// HTMLCollection +// CSSRuleList +// CSSStyleDeclaration +// CSSValueList +// StyleSheetList +// MediaList +// NamedNodeMap +// HTMLFormElement +// HTMLSelectElement + +// ** Firefox DOESN'T include the indexGetter results in enumeration ** +// Window + +setup(); + +var resultArray = new Array(); + +// NodeList +var nodeList = document.querySelectorAll('ol'); +resultArray = iterateList(nodeList); + +shouldBe("resultArray.length", "9"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "nodeList.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "nodeList.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "nodeList.item(2)"); + +// HTMLCollection +var htmlCollection = document.forms; +resultArray = iterateList(htmlCollection); +shouldBe("resultArray.length", "6"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "htmlCollection.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "htmlCollection.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "htmlCollection.item(2)"); + +// NamedNodeMap +var namedNodeMap = document.getElementsByTagName('ol')[0].attributes; +resultArray = iterateList(namedNodeMap); +shouldBe("resultArray.length", "11"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "namedNodeMap.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "namedNodeMap.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "namedNodeMap.item(2)"); + +// HTMLFormElement +var htmlFormElement = document.getElementsByTagName('form')[0]; +resultArray = iterateList(htmlFormElement); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "document.getElementsByTagName('select')[0]"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "document.getElementsByTagName('select')[1]"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "document.getElementsByTagName('select')[2]"); + +// HTMLSelectElement +var htmlSelectElement = document.getElementsByTagName('select')[0]; +resultArray = iterateList(htmlSelectElement); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "document.getElementsByTagName('option')[0]"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "document.getElementsByTagName('option')[1]"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "document.getElementsByTagName('option')[2]"); + +// StyleSheetList +var styleSheetList = document.styleSheets; +resultArray = iterateList(styleSheetList); +shouldBe("resultArray.length", "6"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "styleSheetList.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "styleSheetList.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "styleSheetList.item(2)"); + +// CSSRuleList +var cssRuleList = document.styleSheets[1].cssRules; +resultArray = iterateList(cssRuleList); +shouldBe("resultArray.length", "5"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "cssRuleList.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "cssRuleList.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "cssRuleList.item(2)"); + +// CSSStyleDeclaration +//debug(escapeHTML(document.getElementsByTagName('style'))); +var cssStyleDeclaration = document.styleSheets[2].cssRules[0].style; +resultArray = iterateList(cssStyleDeclaration); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "cssStyleDeclaration.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "cssStyleDeclaration.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "cssStyleDeclaration.item(2)"); + +// MediaList +var mediaList = document.styleSheets[3].cssRules[0].media; +resultArray = iterateList(mediaList); +shouldBe("resultArray.length", "8"); +shouldBe("resultArray[0].i", "'0'"); +shouldBe("resultArray[0].item", "mediaList.item(0)"); +shouldBe("resultArray[1].i", "'1'"); +shouldBe("resultArray[1].item", "mediaList.item(1)"); +shouldBe("resultArray[2].i", "'2'"); +shouldBe("resultArray[2].item", "mediaList.item(2)"); + +debug(""); + +document.body.removeChild(testingGround); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number.html b/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number.html index b844acfa..8d19328 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number.html +++ b/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number.html
@@ -4,6 +4,19 @@ <script src="../../resources/js-test.js"></script> </head> <body onload="do_check(event)"> -<script src="script-tests/domtimestamp-is-number.js"></script> +<script> +description("This tests that DOMTimeStamp is a Number (and not a Date object)."); +// See https://bugs.webkit.org/show_bug.cgi?id=49963 + +var timestamp = null; + +function do_check(e) { + timestamp = e.timeStamp; + shouldBeFalse("timestamp instanceof Date"); + shouldBeTrue("timestamp == Number(timestamp)"); + finishJSTest(); +} +window.jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability.html b/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability.html index 2f4994c..b1f885c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability.html +++ b/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability.html
@@ -4,6 +4,111 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/event-attribute-availability.js"></script> +<script> +description("This tests what event handler attributes are available on what objects."); + +var elementAndDocumentProperties = [ + "onabort", "onblur", "onchange", "onclick", "oncontextmenu", "ondblclick", "ondrag", "ondragend", + "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onerror", "onfocus", "oninput", + "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", + "onmouseover", "onmouseup", "onmousewheel", "onscroll", "onselect", "onsubmit", + + // Not implemented yet + // "oncanplay", "oncanplaythrough", "ondurationchange", "onemptied", "onended", "onformchange", + // "onforminput", "oninvalid", "onloadeddata", "onloadedmetadata", "onloadstart", "onpause", + // "onplay", "onplaying", "onprogress", "onratechange", "onreadystatechange", "onseeked", "onseeking", + // "onshow", "onstalled", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", + + // WebKit extensions + "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste", "onreset", "onsearch", + "onselectstart" +]; + +var bodyAndFrameSetProperties = [ + "onbeforeunload", "onmessage", "onoffline", "ononline", "onresize", "onstorage", "onunload", "onblur", + "onerror", "onfocus", "onload", + + // Not implemented yet. + // "onafterprint", "onbeforeprint", "onhashchange", "onpopstate", "onredo", "onundo" +]; + +var svgAnimationElementProperties = [ + "onbegin", "onend", "onrepeat" +]; + + +debug("Test Element"); +var element = document.createElement("div"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in element"); +} + +debug("\nTest Document"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in document"); +} + +debug("\nTest Window"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in window"); +} + +debug("\nTest Text Node"); +var textNode = document.createTextNode("text"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeFalse("'" + elementAndDocumentProperties[i] + "' in textNode"); +} + +debug("\nTest Attribute"); +var attribute = document.createAttribute("attr"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeFalse("'" + elementAndDocumentProperties[i] + "' in attribute"); +} + +debug("\nTest HTMLBodyElement"); +var body = document.body; +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in body"); +} +for (var i = 0; i < bodyAndFrameSetProperties.length; ++i) { + shouldBeTrue("'" + bodyAndFrameSetProperties[i] + "' in body"); +} + +debug("\nTest HTMLFrameSetElement"); +var frameSet = document.createElement("frameset"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in frameSet"); +} +for (var i = 0; i < bodyAndFrameSetProperties.length; ++i) { + shouldBeTrue("'" + bodyAndFrameSetProperties[i] + "' in frameSet"); +} + +debug("\nTest SVGPathElement"); +var pathelement = document.createElementNS("http://www.w3.org/2000/svg", "path"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in pathelement"); +} +for (var i = 0; i < svgAnimationElementProperties.length; ++i) { + shouldBeFalse("'" + svgAnimationElementProperties[i] + "' in pathelement"); +} + +debug("\nTest SVGSVGElement"); +var svgelement = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null).documentElement; +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in svgelement"); +} +for (var i = 0; i < svgAnimationElementProperties.length; ++i) { + shouldBeFalse("'" + svgAnimationElementProperties[i] + "' in svgelement"); +} + +debug("\nTest SVGAnimationElement"); +var animateelement = document.createElementNS("http://www.w3.org/2000/svg", "animate"); +for (var i = 0; i < elementAndDocumentProperties.length; ++i) { + shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in animateelement"); +} +for (var i = 0; i < svgAnimationElementProperties.length; ++i) { + shouldBeTrue("'" + svgAnimationElementProperties[i] + "' in animateelement"); +} +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/global-event-handlers.html b/third_party/WebKit/LayoutTests/fast/dom/global-event-handlers.html index 634d2db..e13a93d4 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/global-event-handlers.html +++ b/third_party/WebKit/LayoutTests/fast/dom/global-event-handlers.html
@@ -2,7 +2,7 @@ <title>GlobalEventHandlers test</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> -<script src="script-tests/event-handlers.js"></script> +<script src="resources/event-handlers.js"></script> <script> // attribute list from WHATWG HTML Living Standard r8389 [
diff --git a/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation.html b/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation.html index e79c6f5..fb0e0d5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation.html +++ b/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation.html
@@ -4,6 +4,29 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/javascript-url-exception-isolation.js"></script> +<script> +description("Exceptions thrown in javascript URLs should not propagate to the main script.") + +var subframe = document.createElement("iframe"); +document.body.appendChild(subframe); + +var caughtException = false; + +// Runtime exception. +try { + subframe.src = 'javascript:throw 42'; +} catch(e) { + caughtException = true; +} +shouldBeFalse('caughtException'); + +// Compile-time exception. +try { + subframe.src = 'javascript:<html></html>'; +} catch(e) { + caughtException = true; +} +shouldBeFalse('caughtException'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash.html b/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash.html index 22fcde2c..d26ab8c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash.html +++ b/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash.html
@@ -4,6 +4,66 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/location-new-window-no-crash.js"></script> +<script> +description("Tests that manipulating location properties in a just-created window object does not crash. Note: Turn off pop-up blocking to run this in-browser."); + +if (window.testRunner) { + testRunner.waitUntilDone(); + testRunner.setCanOpenWindows(); +} + +var testWindow = open("data:text/plain,a"); + +// Note that the window does not navigate to the new URL right away, and that is a crucial element +// of the test. We're checking behavior when the object was just created and is not yet at its new +// location. + +shouldBe("testWindow.location.toString()", "'about:blank'"); +shouldBe("testWindow.location.href", "'about:blank'"); +shouldBe("testWindow.location.protocol", "'about:'"); +shouldBe("testWindow.location.host", "''"); // Firefox throws an exception +shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception +shouldBe("testWindow.location.port", "''"); +shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string +shouldBe("testWindow.location.search", "''"); +shouldBe("testWindow.location.hash", "''"); + +shouldBe("testWindow.location.href = 'data:text/plain,b'", "'data:text/plain,b'"); +shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws an exception +shouldBe("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exception +shouldBe("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exception +shouldBe("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exception +shouldBe("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exception +shouldBe("testWindow.location.search = 'g'", "'g'"); +shouldBe("testWindow.location.hash = 'h'", "'h'"); + +shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined"); +shouldBe("testWindow.location.replace('data:text/plain,j')", "undefined"); +shouldBe("testWindow.location.reload()", "undefined"); + +shouldBe("testWindow.location.toString()", "'about:blank'"); +shouldBe("testWindow.location.href", "'about:blank'"); +shouldBe("testWindow.location.protocol", "'about:'"); +shouldBe("testWindow.location.host", "''"); // Firefox throws an exception +shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception +shouldBe("testWindow.location.port", "''"); +shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string +shouldBe("testWindow.location.search", "''"); +shouldBe("testWindow.location.hash", "''"); + +testWindow.close(); + +if (window.testRunner) { + function doneHandler() + { + if (testWindow.closed) { + testRunner.notifyDone(); + return; + } + setTimeout(doneHandler, 0); + } + doneHandler(); +} +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html b/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html index 8f66d65..03ee8e3e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html +++ b/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters.html
@@ -4,6 +4,533 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/non-numeric-values-numeric-parameters.js"></script> +<script> +description( +'This tests the behavior of non-numeric values in contexts where the DOM has a numeric parameter.' +); + +function nonNumericPolicy(template) +{ + var x = 0; + try { + eval(template); + } catch (e) { + return e; + } + + var nullAllowed = 1; + x = null; + try { + eval(template); + } catch (e) { + nullAllowed = 0; + } + + var undefinedAllowed = 1; + x = undefined; + try { + eval(template); + } catch (e) { + undefinedAllowed = 0; + } + + var stringAllowed = 1; + x = "string"; + try { + eval(template); + } catch (e) { + stringAllowed = 0; + } + + var documentAllowed = 1; + x = document; + try { + eval(template); + } catch (e) { + documentAllowed = 0; + } + + var nonIntegerAllowed = 1; + x = 0.1; + try { + eval(template); + } catch (e) { + nonIntegerAllowed = 0; + } + + var infinityAllowed = 1; + x = Infinity; + try { + eval(template); + } catch (e) { + infinityAllowed = 0; + } + + var nanAllowed = 1; + x = NaN; + try { + eval(template); + } catch (e) { + nanAllowed = 0; + } + + var omitAllowed = -1; // means "not applicable" + var templateWithoutArg = template.replace(", x)", ")").replace("(x)", "()"); + if (templateWithoutArg != template) { + omitAllowed = 1; + try { + eval(templateWithoutArg); + } catch(e) { + omitAllowed = 0; + } + } + + var expectOmitAllowed = navigator.userAgent.match("Gecko/") != "Gecko/"; + + if (nullAllowed && undefinedAllowed && stringAllowed && documentAllowed && nonIntegerAllowed && infinityAllowed && nanAllowed) { + if (omitAllowed == -1 || omitAllowed == (expectOmitAllowed ? 1 : 0)) + return "any type allowed"; + if (omitAllowed == 1) + return "any type allowed (or omitted)"; + if (omitAllowed == 0) + return "any type allowed (but not omitted)"; + } + if (nullAllowed && !undefinedAllowed && !stringAllowed && !documentAllowed && nonIntegerAllowed && !infinityAllowed && nanAllowed && omitAllowed == 1) + return "number or null allowed (or omitted, but not infinite)"; + return "mixed"; +} + +var selector = "a"; +var styleText = "font-size: smaller"; +var ruleText = selector + " { " + styleText + " }"; + +var testElementContainer = document.createElement("div"); +document.body.appendChild(testElementContainer); + +function createFromMarkup(markup) +{ + var range = document.createRange(); + var fragmentContainer = document.createElement("div"); + range.selectNodeContents(fragmentContainer); + testElementContainer.appendChild(fragmentContainer); + var fragment = range.createContextualFragment(markup); + fragmentContainer.appendChild(fragment); + return fragmentContainer.firstChild; +} + +function createCSSStyleSheet() +{ + return createFromMarkup("<style>" + ruleText + "</style>").sheet; +} + +function createCSSRuleList() +{ + return createCSSStyleSheet().cssRules; +} + +function createCSSStyleDeclaration() +{ + return createCSSRuleList().item(0).style; +} + +function createCSSMediaRule() +{ + var rule = createFromMarkup("<style>@media screen { a { text-weight: bold } }</style>").sheet.cssRules.item(0); + rule.insertRule(ruleText, 0); + return rule; +} + +function createMediaList() +{ + return createCSSMediaRule().media; +} + +function createHTMLSelectElement() +{ + var select = document.createElement("select"); + select.options.add(document.createElement("option")); + return select; +} + +function createHTMLOptionsCollection() +{ + return createHTMLSelectElement().options; +} + +function createHTMLTableElement() +{ + var table = document.createElement("table"); + table.insertRow(0); + return table; +} + +function createHTMLTableSectionElement() +{ + var table = document.createElement("table"); + table.insertRow(0); + return table.tBodies[0]; +} + +function createHTMLTableRowElement() +{ + var table = document.createElement("table"); + var row = table.insertRow(0); + row.insertCell(0); + return row; +} + +function createCanvasElement() +{ + return document.createElement("canvas"); +} + +// CharacterData + +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").insertData(x, \"b\")')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(x, 0, \"b\")')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(0, x, \"b\")')", "'any type allowed'"); + +// CSSMediaRule + +shouldBe("nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('createCSSMediaRule().deleteRule(x)')", "'any type allowed (but not omitted)'"); + +// CSSRuleList + +shouldBe("nonNumericPolicy('createCSSRuleList().item(x)')", "'any type allowed (but not omitted)'"); + +// CSSStyleDeclaration + +shouldBe("nonNumericPolicy('createCSSStyleDeclaration().item(x)')", "'any type allowed (but not omitted)'"); + +// CSSStyleSheet + +shouldBe("nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type allowed'"); + +// Document + +shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.elementFromPoint(0, x)')", "'any type allowed (but not omitted)'"); + +// Element + +shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'"); + +// History + +// Not tested: go. + +// HTMLCollection + +shouldBe("nonNumericPolicy('document.images.item(x)')", "'any type allowed (but not omitted)'"); + +// HTMLInputElement + +shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(0, x)')", "'any type allowed'"); + +// HTMLOptionsCollection + +shouldBe("nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(\"option\"), x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createHTMLOptionsCollection().remove(x)')", "'any type allowed (but not omitted)'"); + +// HTMLSelectElement + +shouldBe("nonNumericPolicy('createHTMLSelectElement().remove(x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createHTMLSelectElement().item(x)')", "'any type allowed (but not omitted)'"); + +// HTMLTableElement + +shouldBe("nonNumericPolicy('createHTMLTableElement().insertRow(x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createHTMLTableElement().deleteRow(x)')", "'any type allowed (but not omitted)'"); + +// HTMLTableRowElement + +shouldBe("nonNumericPolicy('createHTMLTableRowElement().insertCell(x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createHTMLTableRowElement().deleteCell(x)')", "'any type allowed (but not omitted)'"); + +// HTMLTableSectionElement + +shouldBe("nonNumericPolicy('createHTMLTableSectionElement().insertRow(x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('createHTMLTableSectionElement().deleteRow(x)')", "'any type allowed (but not omitted)'"); + +// HTMLInputElement + +shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(0, x)')", "'any type allowed'"); + +// HTMLCanvasElement + +shouldBe("nonNumericPolicy('createCanvasElement().getContext(x)')", "'any type allowed (but not omitted)'"); + +// KeyboardEvent + +shouldBe("nonNumericPolicy('document.createEvent(\"KeyboardEvent\").initKeyboardEvent(\"a\", false, false, null, \"b\", x, false, false, false, false, false)')", "'any type allowed'"); + +// MediaList + +shouldBe("nonNumericPolicy('createMediaList().item(x)')", "'any type allowed (but not omitted)'"); + +// MouseEvent + +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, x, 0, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, x, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, x, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, x, 0, false, false, false, false, 0, null)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, x, false, false, false, false, 0, null)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)')", "'any type allowed'"); + +// NamedNodeMap + +shouldBe("nonNumericPolicy('document.body.attributes.item(x)')", "'any type allowed (but not omitted)'"); + +// NodeIterator + +shouldBe("nonNumericPolicy('document.createNodeIterator(document, x, null, false)')", "'any type allowed'"); + +// NodeList + +shouldBe("nonNumericPolicy('document.getElementsByTagName(\"div\").item(x)')", "'any type allowed (but not omitted)'"); + +// Range + +shouldBe("nonNumericPolicy('document.createRange().setStart(document, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('document.createRange().setEnd(document, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('document.createRange().comparePoint(document, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('document.createRange().isPointInRange(document, x)')", "'any type allowed (but not omitted)'"); + +// Selection + +shouldBe("nonNumericPolicy('getSelection().collapse(document, x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, x, document, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, 0, document, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('getSelection().collapse(document, x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('getSelection().extend(document, x)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('getSelection().getRangeAt(x)')", "'any type allowed (but not omitted)'"); + +// SQLResultSetRowList + +// Not tested: item. + +// StyleSheetList + +shouldBe("nonNumericPolicy('document.styleSheets.item(x)')", "'any type allowed (but not omitted)'"); + +// Text + +shouldBe("nonNumericPolicy('document.createTextNode(\"a\").splitText(x)')", "'any type allowed (but not omitted)'"); + +// TimeRanges + +// Not tested: start, end. + +// TreeWalker + +shouldBe("nonNumericPolicy('document.createTreeWalker(document, x, null, false)')", "'any type allowed'"); + +// UIEvent + +shouldBe("nonNumericPolicy('document.createEvent(\"UIEvent\").initUIEvent(\"a\", false, false, null, x)')", "'any type allowed'"); + +// Window + +shouldBe("nonNumericPolicy('window.scrollBy(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.scrollBy(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.scrollTo(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.scrollTo(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.scroll(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.scroll(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.moveBy(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.moveBy(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.moveTo(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.moveTo(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.resizeBy(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.resizeBy(0, x)')", "'any type allowed (but not omitted)'"); +shouldBe("nonNumericPolicy('window.resizeTo(x, 0)')", "'any type allowed'"); +shouldBe("nonNumericPolicy('window.resizeTo(0, x)')", "'any type allowed (but not omitted)'"); +// Not tested: openDatabase. + +window.resizeTo(10000, 10000); +document.body.removeChild(testElementContainer); + +/* + +Here are other examples of numeric types in function parameters and settable attributes that we could test: + +../../../../WebCore/css/CSSPrimitiveValue.idl: in float floatValue) +../../../../WebCore/html/CanvasGradient.idl: void addColorStop(in float offset, in DOMString color); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void scale(in float sx, in float sy); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void rotate(in float angle); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void translate(in float tx, in float ty); +../../../../WebCore/html/CanvasRenderingContext2D.idl: CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1); +../../../../WebCore/html/CanvasRenderingContext2D.idl: CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void clearRect(in float x, in float y, in float width, in float height) +../../../../WebCore/html/CanvasRenderingContext2D.idl: void fillRect(in float x, in float y, in float width, in float height) +../../../../WebCore/html/CanvasRenderingContext2D.idl: void moveTo(in float x, in float y); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void lineTo(in float x, in float y); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius) +../../../../WebCore/html/CanvasRenderingContext2D.idl: void rect(in float x, in float y, in float width, in float height) +../../../../WebCore/html/CanvasRenderingContext2D.idl: void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise) +../../../../WebCore/html/CanvasRenderingContext2D.idl: boolean isPointInPath(in float x, in float y); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void setAlpha(in float alpha); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void setLineWidth(in float width); +../../../../WebCore/html/CanvasRenderingContext2D.idl: void setMiterLimit(in float limit); + +../../../../WebCore/html/HTMLAnchorElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLAreaElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollLeft; +../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollTop; +../../../../WebCore/html/HTMLButtonElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLCanvasElement.idl: attribute long width; +../../../../WebCore/html/HTMLCanvasElement.idl: attribute long height; +../../../../WebCore/html/HTMLEmbedElement.idl: attribute [ConvertFromString] long height; +../../../../WebCore/html/HTMLEmbedElement.idl: attribute [ConvertFromString] long width; +../../../../WebCore/html/HTMLImageElement.idl: attribute long height; +../../../../WebCore/html/HTMLImageElement.idl: attribute long hspace; +../../../../WebCore/html/HTMLImageElement.idl: attribute long vspace; +../../../../WebCore/html/HTMLImageElement.idl: attribute long width; +../../../../WebCore/html/HTMLInputElement.idl: attribute long maxLength; +../../../../WebCore/html/HTMLInputElement.idl: attribute unsigned long size; // Changed string -> long as part of DOM level 2 +../../../../WebCore/html/HTMLInputElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLInputElement.idl: attribute long selectionStart; +../../../../WebCore/html/HTMLInputElement.idl: attribute long selectionEnd; +../../../../WebCore/html/HTMLLIElement.idl: attribute long value; +../../../../WebCore/html/HTMLMediaElement.idl: attribute unsigned long playCount +../../../../WebCore/html/HTMLMediaElement.idl: attribute unsigned long currentLoop; +../../../../WebCore/html/HTMLObjectElement.idl: attribute long hspace; +../../../../WebCore/html/HTMLObjectElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLObjectElement.idl: attribute long vspace; +../../../../WebCore/html/HTMLOListElement.idl: attribute long start; +../../../../WebCore/html/HTMLOptionsCollection.idl: attribute long selectedIndex; +../../../../WebCore/html/HTMLOptionsCollection.idl: attribute [Custom] unsigned long length +../../../../WebCore/html/HTMLPreElement.idl: attribute long width; +../../../../WebCore/html/HTMLSelectElement.idl: attribute long selectedIndex; +../../../../WebCore/html/HTMLSelectElement.idl: attribute unsigned long length +../../../../WebCore/html/HTMLSelectElement.idl: attribute long size; +../../../../WebCore/html/HTMLSelectElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLTableCellElement.idl: attribute long colSpan; +../../../../WebCore/html/HTMLTableCellElement.idl: attribute long rowSpan; +../../../../WebCore/html/HTMLTableColElement.idl: attribute long span; +../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long cols; +../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long rows; +../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long tabIndex; +../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long selectionStart; +../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long selectionEnd; +../../../../WebCore/html/HTMLVideoElement.idl: attribute long width; +../../../../WebCore/html/HTMLVideoElement.idl: attribute long height; + +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float globalAlpha; +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float lineWidth; +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float miterLimit; +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowOffsetX; +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowOffsetY; +../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowBlur; +../../../../WebCore/html/HTMLMediaElement.idl: attribute float currentTime +../../../../WebCore/html/HTMLMediaElement.idl: attribute float defaultPlaybackRate +../../../../WebCore/html/HTMLMediaElement.idl: attribute float playbackRate +../../../../WebCore/html/HTMLMediaElement.idl: attribute float start; +../../../../WebCore/html/HTMLMediaElement.idl: attribute float end; +../../../../WebCore/html/HTMLMediaElement.idl: attribute float loopStart; +../../../../WebCore/html/HTMLMediaElement.idl: attribute float loopEnd; +../../../../WebCore/html/HTMLMediaElement.idl: attribute float volume + +../../../../WebCore/svg/SVGAnimatedInteger.idl: attribute long baseVal +../../../../WebCore/svg/SVGElementInstanceList.idl: SVGElementInstance item(in unsigned long index); +../../../../WebCore/svg/SVGLengthList.idl: SVGLength getItem(in unsigned long index) +../../../../WebCore/svg/SVGLengthList.idl: SVGLength insertItemBefore(in SVGLength item, in unsigned long index) +../../../../WebCore/svg/SVGLengthList.idl: SVGLength replaceItem(in SVGLength item, in unsigned long index) +../../../../WebCore/svg/SVGLengthList.idl: SVGLength removeItem(in unsigned long index) +../../../../WebCore/svg/SVGNumberList.idl: SVGNumber getItem(in unsigned long index) +../../../../WebCore/svg/SVGNumberList.idl: SVGNumber insertItemBefore(in SVGNumber item, in unsigned long index) +../../../../WebCore/svg/SVGNumberList.idl: SVGNumber replaceItem(in SVGNumber item, in unsigned long index) +../../../../WebCore/svg/SVGNumberList.idl: SVGNumber removeItem(in unsigned long index) +../../../../WebCore/svg/SVGPathElement.idl: unsigned long getPathSegAtLength(in float distance); +../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint getItem(in unsigned long index) +../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint insertItemBefore(in SVGPoint item, in unsigned long index) +../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint replaceItem(in SVGPoint item, in unsigned long index) +../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint removeItem(in unsigned long index) +../../../../WebCore/svg/SVGStringList.idl: core::DOMString getItem(in unsigned long index) +../../../../WebCore/svg/SVGStringList.idl: core::DOMString insertItemBefore(in core::DOMString item, in unsigned long index) +../../../../WebCore/svg/SVGStringList.idl: core::DOMString replaceItem(in core::DOMString item, in unsigned long index) +../../../../WebCore/svg/SVGStringList.idl: core::DOMString removeItem(in unsigned long index) +../../../../WebCore/svg/SVGSVGElement.idl: unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds); +../../../../WebCore/svg/SVGSVGElement.idl: void unsuspendRedraw(in unsigned long suspendHandleId) +../../../../WebCore/svg/SVGTextContentElement.idl: long getNumberOfChars(); +../../../../WebCore/svg/SVGTextContentElement.idl: float getSubStringLength(in unsigned long offset, +../../../../WebCore/svg/SVGTextContentElement.idl: in unsigned long length) +../../../../WebCore/svg/SVGTextContentElement.idl: SVGPoint getStartPositionOfChar(in unsigned long offset) +../../../../WebCore/svg/SVGTextContentElement.idl: SVGPoint getEndPositionOfChar(in unsigned long offset) +../../../../WebCore/svg/SVGTextContentElement.idl: SVGRect getExtentOfChar(in unsigned long offset) +../../../../WebCore/svg/SVGTextContentElement.idl: float getRotationOfChar(in unsigned long offset) +../../../../WebCore/svg/SVGTextContentElement.idl: long getCharNumAtPosition(in SVGPoint point); +../../../../WebCore/svg/SVGTextContentElement.idl: void selectSubString(in unsigned long offset, +../../../../WebCore/svg/SVGTextContentElement.idl: in unsigned long length) +../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform getItem(in unsigned long index) +../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform insertItemBefore(in SVGTransform item, in unsigned long index) +../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform replaceItem(in SVGTransform item, in unsigned long index) +../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform removeItem(in unsigned long index) +../../../../WebCore/xml/XPathResult.idl: Node snapshotItem(in unsigned long index) + +../../../../WebCore/svg/SVGAngle.idl: in float valueInSpecifiedUnits); +../../../../WebCore/svg/SVGAnimationElement.idl: float getStartTime(); +../../../../WebCore/svg/SVGAnimationElement.idl: float getCurrentTime(); +../../../../WebCore/svg/SVGAnimationElement.idl: float getSimpleDuration() +../../../../WebCore/svg/SVGFEGaussianBlurElement.idl: void setStdDeviation(in float stdDeviationX, in float stdDeviationY); +../../../../WebCore/svg/SVGLength.idl: in float valueInSpecifiedUnits); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix translate(in float x, in float y); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix scale(in float scaleFactor); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix rotate(in float angle); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix rotateFromVector(in float x, in float y) +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix skewX(in float angle); +../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix skewY(in float angle); +../../../../WebCore/svg/SVGNumber.idl: interface [Conditional=SVG, PODType=float] SVGNumber { +../../../../WebCore/svg/SVGPathElement.idl: float getTotalLength(); +../../../../WebCore/svg/SVGPathElement.idl: SVGPoint getPointAtLength(in float distance); +../../../../WebCore/svg/SVGPathElement.idl: unsigned long getPathSegAtLength(in float distance); +../../../../WebCore/svg/SVGSVGElement.idl: float getCurrentTime(); +../../../../WebCore/svg/SVGSVGElement.idl: void setCurrentTime(in float seconds); +../../../../WebCore/svg/SVGTextContentElement.idl: float getComputedTextLength(); +../../../../WebCore/svg/SVGTextContentElement.idl: float getSubStringLength(in unsigned long offset, +../../../../WebCore/svg/SVGTextContentElement.idl: float getRotationOfChar(in unsigned long offset) +../../../../WebCore/svg/SVGTransform.idl: void setTranslate(in float tx, in float ty); +../../../../WebCore/svg/SVGTransform.idl: void setScale(in float sx, in float sy); +../../../../WebCore/svg/SVGTransform.idl: void setRotate(in float angle, in float cx, in float cy); +../../../../WebCore/svg/SVGTransform.idl: void setSkewX(in float angle); +../../../../WebCore/svg/SVGTransform.idl: void setSkewY(in float angle); + +../../../../WebCore/svg/SVGAngle.idl: attribute float value; +../../../../WebCore/svg/SVGAngle.idl: attribute float valueInSpecifiedUnits; +../../../../WebCore/svg/SVGAnimatedNumber.idl: attribute float baseVal +../../../../WebCore/svg/SVGLength.idl: attribute float value; +../../../../WebCore/svg/SVGLength.idl: attribute float valueInSpecifiedUnits; +../../../../WebCore/svg/SVGNumber.idl: attribute float value +../../../../WebCore/svg/SVGPoint.idl: attribute float x +../../../../WebCore/svg/SVGPoint.idl: attribute float y +../../../../WebCore/svg/SVGRect.idl: attribute float x +../../../../WebCore/svg/SVGRect.idl: attribute float y +../../../../WebCore/svg/SVGRect.idl: attribute float width +../../../../WebCore/svg/SVGRect.idl: attribute float height +../../../../WebCore/svg/SVGSVGElement.idl: attribute float currentScale + +../../../../WebCore/svg/SVGMatrix.idl: attribute double a; +../../../../WebCore/svg/SVGMatrix.idl: attribute double b; +../../../../WebCore/svg/SVGMatrix.idl: attribute double c; +../../../../WebCore/svg/SVGMatrix.idl: attribute double d; +../../../../WebCore/svg/SVGMatrix.idl: attribute double e; +../../../../WebCore/svg/SVGMatrix.idl: attribute double f; + +*/ +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/prototype-property.html b/third_party/WebKit/LayoutTests/fast/dom/prototype-property.html index cd2c9a0a..4b4f445 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/prototype-property.html +++ b/third_party/WebKit/LayoutTests/fast/dom/prototype-property.html
@@ -4,6 +4,30 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/prototype-property.js"></script> +<script> +description("Make sure the 'prototype' property on generated Web IDL interfaces is { DontDelete | ReadOnly }."); + +function tryToDeletePrototype(o) { + var orig = o.prototype; + delete o.prototype; + var ret = o.prototype != orig; + o.prototype = orig; + return ret; +} + +function tryToSetPrototype(o, value) { + var orig = o.prototype; + o.prototype = value; + var ret = o.prototype != orig; + o.prototype = orig; + return ret; +} + +shouldBe("tryToDeletePrototype(window.HTMLElement)", "false"); +shouldBe("tryToSetPrototype(window.HTMLElement, null)", "false"); +shouldBe("tryToSetPrototype(window.HTMLElement, undefined)", "false"); +shouldBe("tryToSetPrototype(window.HTMLElement, 1)", "false"); +shouldBe("tryToSetPrototype(window.HTMLElement, window.Object.prototype)", "false"); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/event-handlers.js b/third_party/WebKit/LayoutTests/fast/dom/resources/event-handlers.js similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/script-tests/event-handlers.js rename to third_party/WebKit/LayoutTests/fast/dom/resources/event-handlers.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-async.js b/third_party/WebKit/LayoutTests/fast/dom/resources/webtiming-async.js similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-async.js rename to third_party/WebKit/LayoutTests/fast/dom/resources/webtiming-async.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-defer.js b/third_party/WebKit/LayoutTests/fast/dom/resources/webtiming-defer.js similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-defer.js rename to third_party/WebKit/LayoutTests/fast/dom/resources/webtiming-defer.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/dom/script-tests/TEMPLATE.html deleted file mode 100644 index 397d741..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js deleted file mode 100644 index 5d0f09f..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js +++ /dev/null
@@ -1,67 +0,0 @@ -description("Test reflecting URL attributes with empty string values."); - -function testURLReflection(attributeName, tag, scriptAttributeName) -{ - if (!scriptAttributeName) - scriptAttributeName = attributeName.toLowerCase(); - - var element; - if (tag === "html") - element = document.documentElement; - else { - element = document.createElement(tag); - document.body.appendChild(element); - } - element.setAttribute(scriptAttributeName, "x"); - var xValue = element[attributeName]; - element.setAttribute(scriptAttributeName, ""); - var emptyValue = element[attributeName]; - if (tag !== "html") - document.body.removeChild(element); - - if (xValue === undefined) - return "none"; - if (xValue === "x") - return "non-URL"; - if (xValue !== document.baseURI.replace(/[^\/]+$/, "x")) - return "error (x): " + xValue; - if (emptyValue === "") - return "non-empty URL"; - if (emptyValue === document.baseURI) - return "URL"; - return "error (empty): " + emptyValue; -} - -shouldBe("testURLReflection('attribute', 'element')", "'none'"); -shouldBe("testURLReflection('id', 'element')", "'non-URL'"); - -// The following list comes from the HTML5 document’s attributes index. -// These are the URL attributes from that list. - -shouldBe("testURLReflection('action', 'form')", "'URL'"); -shouldBe("testURLReflection('cite', 'blockquote')", "'URL'"); -shouldBe("testURLReflection('cite', 'del')", "'URL'"); -shouldBe("testURLReflection('cite', 'ins')", "'URL'"); -shouldBe("testURLReflection('cite', 'q')", "'URL'"); -shouldBe("testURLReflection('data', 'object')", "'URL'"); -shouldBe("testURLReflection('formaction', 'button')", "'URL'"); -shouldBe("testURLReflection('formaction', 'input')", "'URL'"); -shouldBe("testURLReflection('href', 'a')", "'URL'"); -shouldBe("testURLReflection('href', 'area')", "'URL'"); -shouldBe("testURLReflection('href', 'link')", "'URL'"); -shouldBe("testURLReflection('href', 'base')", "'URL'"); -shouldBe("testURLReflection('icon', 'command')", "'URL'"); -shouldBe("testURLReflection('poster', 'video')", "'URL'"); -shouldBe("testURLReflection('src', 'audio')", "'URL'"); -shouldBe("testURLReflection('src', 'embed')", "'URL'"); -shouldBe("testURLReflection('src', 'iframe')", "'URL'"); -shouldBe("testURLReflection('src', 'img')", "'URL'"); -shouldBe("testURLReflection('src', 'input')", "'URL'"); -shouldBe("testURLReflection('src', 'script')", "'URL'"); -shouldBe("testURLReflection('src', 'source')", "'URL'"); -shouldBe("testURLReflection('src', 'video')", "'URL'"); - -// Other reflected URL attributes. - -shouldBe("testURLReflection('longDesc', 'img')", "'URL'"); -shouldBe("testURLReflection('lowsrc', 'img')", "'URL'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/XMLHttpRequest-constants.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/XMLHttpRequest-constants.js deleted file mode 100644 index 7d7435f..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/XMLHttpRequest-constants.js +++ /dev/null
@@ -1,22 +0,0 @@ -description("This test checks the constants on the XMLHttpRequst object, as well as its prototype and constructor."); - -debug("Test the constants on the XMLHttpRequest object itself.") -shouldBe("new XMLHttpRequest().UNSENT", "0"); -shouldBe("new XMLHttpRequest().OPENED", "1"); -shouldBe("new XMLHttpRequest().HEADERS_RECEIVED", "2"); -shouldBe("new XMLHttpRequest().LOADING", "3"); -shouldBe("new XMLHttpRequest().DONE", "4"); - -debug("Test the constants on the XMLHttpRequest prototype object.") -shouldBe("XMLHttpRequest.prototype.UNSENT", "0"); -shouldBe("XMLHttpRequest.prototype.OPENED", "1"); -shouldBe("XMLHttpRequest.prototype.HEADERS_RECEIVED", "2"); -shouldBe("XMLHttpRequest.prototype.LOADING", "3"); -shouldBe("XMLHttpRequest.prototype.DONE", "4"); - -debug("Test the constants on the XMLHttpRequest constructor object.") -shouldBe("XMLHttpRequest.UNSENT", "0"); -shouldBe("XMLHttpRequest.OPENED", "1"); -shouldBe("XMLHttpRequest.HEADERS_RECEIVED", "2"); -shouldBe("XMLHttpRequest.LOADING", "3"); -shouldBe("XMLHttpRequest.DONE", "4");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js deleted file mode 100644 index 14580092..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/attribute-legacy-colors.js +++ /dev/null
@@ -1,61 +0,0 @@ -description("This test ensures that legacy color attributes are parsed properly."); - -shouldBe("document.body.bgColor='';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); -shouldBe("document.body.bgColor='transparent';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); -shouldBe("document.body.bgColor=' transparent ';getComputedStyle(document.body).backgroundColor;", "'rgba(0, 0, 0, 0)'"); -(function(){ -var tests = [ - {'test':'red', 'expected':[255, 0, 0]}, - {'test':' red ', 'expected':[255, 0, 0]}, - {'test':'#f00', 'expected':[255, 0, 0]}, - {'test':' #f00 ', 'expected':[255, 0, 0]}, - {'test':'#ff0000', 'expected':[255, 0, 0]}, - {'test':' #ff0000 ', 'expected':[255, 0, 0]}, - {'test':'#fzz', 'expected':[15, 0, 0]}, - {'test':'#ffzzzz', 'expected':[255, 0, 0]}, - {'test':'f00', 'expected':[15, 0, 0]}, - {'test':'ff0000', 'expected':[255, 0, 0]}, - {'test':'#00000000', 'expected':[0, 0, 0]}, - {'test':'foo', 'expected':[15, 0, 0]}, - {'test':'cheese', 'expected':[192, 238, 14]}, - {'test':'ff򀿿ff', 'expected':[255, 0, 255]}, - {'test':'f򀿿f', 'expected':[240, 15, 0]}, - {'test':'rgb(255, 0, 0)', 'expected':[0, 85, 0]}, - {'test':'rgba(255,255,255,50%)', 'expected':[0,80,85]}, - {'test':'hsl(180,100%,50%)', 'expected':[0,1,80]}, - {'test':'hsla(180,100%,50%,50%)', 'expected':[0,16,5]}, - {'test':'currentColor', 'expected':[192,224,0]}, - {'test':'550000001155000000115500000011', 'expected':[17, 17, 17]}, - {'test':'550000000155000000015500000001', 'expected':[1, 1, 1]}, - {'test':'550000000055000000005500000000', 'expected':[0, 0, 0]}, - {'test':'550020001155000000115500000011', 'expected':[32, 0, 0]}, - {'test':'55򀿿20򀿿1155򀿿򀿿00115500򀿿0011', 'expected':[32, 0, 0]}, - {'test':'#', 'expected':[0, 0, 0]}, - {'test':'#5', 'expected':[5, 0, 0]}, - {'test':'#55', 'expected':[5, 5, 0]}, - {'test':'#555', 'expected':[85, 85, 85]}, - {'test':'#5555', 'expected':[85, 85, 0]}, - {'test':'#55555', 'expected':[85, 85, 80]}, - {'test':'#555555', 'expected':[85, 85, 85]}, - {'test':'#5555555', 'expected':[85, 85, 80]}, - {'test':'#55555555', 'expected':[85, 85, 85]}, - {'test':'5', 'expected':[5, 0, 0]}, - {'test':'55', 'expected':[5, 5, 0]}, - {'test':'555', 'expected':[5, 5, 5]}, - {'test':'5555', 'expected':[85, 85, 0]}, - {'test':'55555', 'expected':[85, 85, 80]}, - {'test':'555555', 'expected':[85, 85, 85]}, - {'test':'5555555', 'expected':[85, 85, 80]}, - {'test':'55555555', 'expected':[85, 85, 85]}, - {'test':'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000', 'expected':[255, 255, 255]}, - {'test':'򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿򀿿ffffff', 'expected':[0, 0, 0]}, - {'test':' ', 'expected':[0, 0, 0]}, - {'test':' ffffff ', 'expected':[255, 255, 255]} -]; - -for(var i = 0; i < tests.length; i++) { - var t = tests[i].test; - var e = tests[i].expected; - shouldBe("document.body.bgColor='" + t + "';getComputedStyle(document.body).backgroundColor;", "'rgb(" + e[0] + ", " + e[1] + ", " + e[2] + ")'"); -} -})();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js deleted file mode 100644 index e04a860..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js +++ /dev/null
@@ -1,63 +0,0 @@ -description("Test reflecting boolean attributes."); - -var attributes = [ - [ "area", "noHref" ], - [ "dir", "compact" ], - [ "dl", "compact" ], - [ "form", "noValidate" ], - [ "frame", "noResize" ], - [ "hr", "noShade" ], - [ "iframe", "allowFullscreen" ], - [ "img", "isMap" ], - [ "input", "autofocus" ], - [ "input", "defaultChecked", "checked" ], - [ "input", "disabled" ], - [ "input", "formNoValidate" ], - [ "input", "multiple" ], - [ "input", "readOnly" ], - [ "input", "required" ], - [ "link", "disabled" ], - [ "menu", "compact" ], - [ "menuitem", "checked" ], - [ "menuitem", "default" ], - [ "menuitem", "disabled" ], - [ "object", "declare" ], - [ "ol", "compact" ], - [ "option", "defaultSelected", "selected" ], - [ "script", "defer" ], - [ "select", "multiple" ], - [ "td", "noWrap" ], - [ "ul", "compact" ], - [ "video", "autoplay" ], - [ "video", "controls" ], - [ "video", "loop" ], -]; - -function make(tag) -{ - return document.createElement(tag); -} - -for (var i = 0; i < attributes.length; ++i) { - var tag = attributes[i][0]; - var reflectingAttribute = attributes[i][1]; - var contentAttribute = attributes[i][2] || reflectingAttribute.toLowerCase(); - shouldBe("e = make('" + tag + "'); " - + "e.removeAttribute('" + contentAttribute + "'); " - + "e." + reflectingAttribute, - "false"); - shouldBe("e = make('" + tag + "'); " - + "e.setAttribute('" + contentAttribute + "', ''); " - + "e." + reflectingAttribute, - "true"); - shouldBe("e = make('" + tag + "'); " - + "e.setAttribute('" + contentAttribute + "', 'x'); " - + "e." + reflectingAttribute + " = false; " - + "e.getAttribute('" + contentAttribute + "')", - "null"); - shouldBe("e = make('" + tag + "'); " - + "e.setAttribute('" + contentAttribute + "', 'x'); " - + "e." + reflectingAttribute + " = true; " - + "e.getAttribute('" + contentAttribute + "')", - "''"); -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js deleted file mode 100644 index 1ebf908..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructed-objects-prototypes.js +++ /dev/null
@@ -1,75 +0,0 @@ -description("Make sure prototypes are set up using the window a property came from, instead of the lexical global object.") - -var subframe = document.createElement("iframe"); -document.body.appendChild(subframe); -var inner = subframe.contentWindow; // Call it "inner" to make shouldBe output shorter - -// Stash a property on the prototypes. -window.Object.prototype.isInner = false; -inner.Object.prototype.isInner = true; - -function classNameForObject(object) -{ - // call will use the global object if passed null or undefined, so special case those: - if (object == null) - return null; - var result = Object.prototype.toString.call(object); - // remove '[object ' and ']' - return result.split(' ')[1].split(']')[0]; -} - -function constructorPropertiesOnWindow(globalObject) -{ - var constructorNames = []; - var propertyNames = Object.getOwnPropertyNames(window); - for (var i = 0; i < propertyNames.length; i++) { - var value = inner[propertyNames[i]]; - if (value == null) - continue; - var type = classNameForObject(value); - // Ignore these properties because they do not exist in all implementations. They will be tested separately - if (type == "WebGLRenderingContextConstructor" || - type == "ArrayBufferConstructor" || - type =="Float32ArrayConstructor" || - type =="Float64ArrayConstructor" || - type =="Int8ArrayConstructor" || - type =="Int16ArrayConstructor" || - type =="Int32ArrayConstructor" || - type =="Uint8ArrayConstructor" || - type =="Uint8ClampedArrayConstructor" || - type =="Uint16ArrayConstructor" || - type =="Uint32ArrayConstructor" || - type == "FileReaderConstructor" || - type == "AudioContextConstructor" || - type == "SpeechSynthesisUtteranceConstructor") - continue; - if (!type.match('Constructor$')) - continue; - constructorNames.push(property); - } - return constructorNames.sort(); -} - -var constructorNames = constructorPropertiesOnWindow(inner); - -var argumentsForConstructor = { - 'Worker' : "'foo'", -} - -for (var x = 0; x < constructorNames.length; x++) { - var constructorName = constructorNames[x]; - var arguments = argumentsForConstructor[constructorName] || ""; - var argumentsString = "(" + arguments + ")"; - // Test first to see if the object is constructable - var constructedObject; - try { - constructedObject = eval("new inner." + constructorName + argumentsString); - } catch(e) { - continue; - } - - shouldBeTrue("(new inner." + constructorName + argumentsString + ").isInner"); - shouldBeTrue("(new inner." + constructorName + argumentsString + ").constructor.isInner"); -} - -document.body.removeChild(subframe);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructors-cached.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructors-cached.js deleted file mode 100644 index a42e60d6..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/constructors-cached.js +++ /dev/null
@@ -1,18 +0,0 @@ -description("This test ensures that objects with security restrictions are cached correctly"); - -var ctors = ["Image", "Option", "XMLHttpRequest", "Audio"]; - -for (var i = 0; i < ctors.length; i++) { - var ctor = ctors[i]; - try { - // Test retrieving the object twice results in the same object - shouldBe(ctor, ctor); - - // Be paranoid -- make sure that setting a property results in that property - // stays - this[ctor].testProperty = "property set successfully"; - shouldBe(ctor + ".testProperty", '"property set successfully"'); - } catch (e) { - testFailed("Testing " + ctor + " threw " + e); - } -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/css-mediarule-parentRule.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/css-mediarule-parentRule.js deleted file mode 100644 index de4b866..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/css-mediarule-parentRule.js +++ /dev/null
@@ -1,16 +0,0 @@ -description( -'This tests that calling parentRule on the child rule of MediaRule is equal to that MediaRule.' -); - -if (window.testRunner) - testRunner.dumpAsText(); - -var head = document.getElementsByTagName('head')[0]; -head.innerHTML = "<style>@media all { a { border-color: red; } }</style>"; - -var styleSheetList = document.styleSheets; -var styleSheet = styleSheetList[0]; -var mediaRule = styleSheet.cssRules[0]; -var childRule = mediaRule.cssRules[0]; - -shouldBe("childRule.parentRule", "mediaRule")
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-gc.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-gc.js deleted file mode 100644 index 8e318bf..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-gc.js +++ /dev/null
@@ -1,28 +0,0 @@ -description("This tests that custom properties on element.dataset persist GC."); - -function gc() -{ - if (window.GCController) - return GCController.collect(); - - for (var i = 0; i < 10000; i++) { - var s = new String(""); - } -} - - -var d = document.createElement("div"); - -var dataset = d.dataset; -// Add a property to our prototype. It will be hidden by the corresponding data- attribute. -dataset.__proto__.customProperty = 1; -dataset.customProperty = 1; // Now set a property on ourselves. -shouldBe("d.getAttribute('data-custom-property')", "'1'"); -shouldBe("d.dataset.customProperty", "'1'"); - -dataset = null; - -gc(); - -// Test that the custom property persisted the GC. -shouldBe("d.dataset.customProperty", "'1'");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-xhtml.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-xhtml.js deleted file mode 100644 index 839b74d..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/dataset-xhtml.js +++ /dev/null
@@ -1,92 +0,0 @@ -description("This tests element.dataset for XHTML."); - -function testGet(attr, expected) -{ - var d = document.createElement("div"); - d.setAttribute(attr, "value"); - return d.dataset[expected] == "value"; -} - -shouldBeTrue("testGet('data-foo', 'foo')"); -shouldBeTrue("testGet('data-foo-bar', 'fooBar')"); -shouldBeTrue("testGet('data--', '-')"); -shouldBeTrue("testGet('data--foo', 'Foo')"); -shouldBeTrue("testGet('data---foo', '-Foo')"); -shouldBeTrue("testGet('data-', '')"); -shouldBeTrue("testGet('data-\xE0', '\xE0')"); -debug(""); - -function matchesNothingInDataset(attr) -{ - var d = document.createElement("div"); - d.setAttribute(attr, "value"); - - var count = 0; - for (var item in d.dataset) - count++; - return count == 0; -} - -shouldBeTrue("matchesNothingInDataset('dataFoo')"); -shouldBeTrue("matchesNothingInDataset('data-Foo')"); -debug(""); - -function testSet(prop, expected) -{ - var d = document.createElement("div"); - d.dataset[prop] = "value"; - return d.getAttribute(expected) == "value"; -} - -shouldBeTrue("testSet('foo', 'data-foo')"); -shouldBeTrue("testSet('fooBar', 'data-foo-bar')"); -shouldBeTrue("testSet('-', 'data--')"); -shouldBeTrue("testSet('Foo', 'data--foo')"); -shouldBeTrue("testSet('-Foo', 'data---foo')"); -shouldBeTrue("testSet('', 'data-')"); -shouldBeTrue("testSet('\xE0', 'data-\xE0')"); -debug(""); - -shouldThrow("testSet('-foo', 'dummy')", '"SyntaxError: Failed to set the \'-foo\' property on \'DOMStringMap\': \'-foo\' is not a valid property name."'); -shouldThrow("testSet('foo\x20', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\x20\' property on \'DOMStringMap\': \'data-foo\x20\' is not a valid attribute name."'); -shouldThrow("testSet('foo\uF900', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\uF900\' property on \'DOMStringMap\': \'data-foo\uF900\' is not a valid attribute name."'); -debug(""); - -function testDelete(attr, prop) -{ - var d = document.createElement("div"); - d.setAttribute(attr, "value"); - delete d.dataset[prop]; - return d.getAttribute(attr) != "value"; -} - -shouldBeTrue("testDelete('data-foo', 'foo')"); -shouldBeTrue("testDelete('data-foo-bar', 'fooBar')"); -shouldBeTrue("testDelete('data--', '-')"); -shouldBeTrue("testDelete('data--foo', 'Foo')"); -shouldBeTrue("testDelete('data---foo', '-Foo')"); -shouldBeTrue("testDelete('data-', '')"); -shouldBeTrue("testDelete('data-\xE0', '\xE0')"); -debug(""); - -shouldBeFalse("testDelete('dummy', '-foo')"); -debug(""); - -function testForIn(array) -{ - var d = document.createElement("div"); - for (var i = 0; i < array.length; ++i) { - d.setAttribute(array[i], "value"); - } - - var count = 0; - for (var item in d.dataset) - count++; - - return count; -} - -shouldBe("testForIn(['data-foo', 'data-bar', 'data-baz'])", "3"); -shouldBe("testForIn(['data-foo', 'data-bar', 'dataFoo'])", "2"); -shouldBe("testForIn(['data-foo', 'data-bar', 'style'])", "2"); -shouldBe("testForIn(['data-foo', 'data-bar', 'data-'])", "3");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/document-head.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/document-head.js deleted file mode 100644 index 8786dbe..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/document-head.js +++ /dev/null
@@ -1,9 +0,0 @@ -description("This test checks to see if document.head is available, readonly, and the same element as what we would expect by getting it by other means."); - -shouldBe("document.head", "document.getElementsByTagName('head')[0]"); - -document.head = 1; -shouldBeTrue("document.head !== 1"); - -document.documentElement.removeChild(document.head); -shouldBeNull("document.head");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/domListEnumeration.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/domListEnumeration.js deleted file mode 100644 index d874737..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/domListEnumeration.js +++ /dev/null
@@ -1,196 +0,0 @@ -description( -'This tests enumerating the elements of DOM lists.' -); - -if (window.testRunner) - testRunner.dumpAsText(); - -// Create a testing environment that can be cleanup up easily. -var testingGround = document.createElement('div'); -document.body.appendChild(testingGround); - -function createFromMarkup(markup) -{ - var range = document.createRange(); - var fragmentContainer = document.createElement("div"); - range.selectNodeContents(fragmentContainer); - testingGround.appendChild(fragmentContainer); - var fragment = range.createContextualFragment(markup); - fragmentContainer.appendChild(fragment); - return fragmentContainer.firstChild; -} - -function setup() -{ - var head = document.getElementsByTagName('head')[0]; - - // 2 additional <style>s needed for StyleSheetList test (one is included in the template). - // 3 rules needed in the first additional <style> for the CSSRuleList test. - // 3 declarations needed in the first rule needed for the CSSStyleDeclaration test. - // @media rule in the second additional <style> for the MediaList test. - head.appendChild(createFromMarkup("<style> ol { width: 100px; height: 100px; color: green; } ol { } ol { } </style>")); - head.appendChild(createFromMarkup("<style> @media screen, projector, printer { ol { } } </style>")); - - // 3 <ol>s for NodeList test. - // 3 attributes in the first <ol> for the NamedNodeMap test. - testingGround.appendChild(createFromMarkup("<ol class='foo' id='bar' name='baz'></ol>")); - testingGround.appendChild(document.createElement('ol')); - testingGround.appendChild(document.createElement('ol')); - - // 3 <form>s for forms for HTMLCollection test. - var form = document.createElement('form'); - testingGround.appendChild(form); - testingGround.appendChild(document.createElement('form')); - testingGround.appendChild(document.createElement('form')); - - // 3 <select>s for HTMLFormElement test. - var select = document.createElement('select'); - form.appendChild(select); - form.appendChild(document.createElement('select')); - form.appendChild(document.createElement('select')); - - // 3 <option>s for HTMLSelectElement test. - select.appendChild(document.createElement('option')); - select.appendChild(document.createElement('option')); - select.appendChild(document.createElement('option')); - - document.body.appendChild(testingGround); -} - -function iterateList(list) -{ - debug(""); - debug(Object.prototype.toString.call(list)); - var temp = new Array(); - for (var i in list) { - temp.push(i); - } - temp.sort(); - - var a = new Array(); - for (var i = 0; i < temp.length; ++i) { - a.push({"i" : temp[i], "item" : list[temp[i]]}); - } - return a; -} - -// ** Firefox DOES include the indexGetter results in enumeration ** -// NodeList -// HTMLCollection -// CSSRuleList -// CSSStyleDeclaration -// CSSValueList -// StyleSheetList -// MediaList -// NamedNodeMap -// HTMLFormElement -// HTMLSelectElement - -// ** Firefox DOESN'T include the indexGetter results in enumeration ** -// Window - -setup(); - -var resultArray = new Array(); - -// NodeList -var nodeList = document.querySelectorAll('ol'); -resultArray = iterateList(nodeList); - -shouldBe("resultArray.length", "9"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "nodeList.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "nodeList.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "nodeList.item(2)"); - -// HTMLCollection -var htmlCollection = document.forms; -resultArray = iterateList(htmlCollection); -shouldBe("resultArray.length", "6"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "htmlCollection.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "htmlCollection.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "htmlCollection.item(2)"); - -// NamedNodeMap -var namedNodeMap = document.getElementsByTagName('ol')[0].attributes; -resultArray = iterateList(namedNodeMap); -shouldBe("resultArray.length", "11"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "namedNodeMap.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "namedNodeMap.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "namedNodeMap.item(2)"); - -// HTMLFormElement -var htmlFormElement = document.getElementsByTagName('form')[0]; -resultArray = iterateList(htmlFormElement); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "document.getElementsByTagName('select')[0]"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "document.getElementsByTagName('select')[1]"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "document.getElementsByTagName('select')[2]"); - -// HTMLSelectElement -var htmlSelectElement = document.getElementsByTagName('select')[0]; -resultArray = iterateList(htmlSelectElement); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "document.getElementsByTagName('option')[0]"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "document.getElementsByTagName('option')[1]"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "document.getElementsByTagName('option')[2]"); - -// StyleSheetList -var styleSheetList = document.styleSheets; -resultArray = iterateList(styleSheetList); -shouldBe("resultArray.length", "6"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "styleSheetList.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "styleSheetList.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "styleSheetList.item(2)"); - -// CSSRuleList -var cssRuleList = document.styleSheets[1].cssRules; -resultArray = iterateList(cssRuleList); -shouldBe("resultArray.length", "5"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "cssRuleList.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "cssRuleList.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "cssRuleList.item(2)"); - -// CSSStyleDeclaration -//debug(escapeHTML(document.getElementsByTagName('style'))); -var cssStyleDeclaration = document.styleSheets[2].cssRules[0].style; -resultArray = iterateList(cssStyleDeclaration); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "cssStyleDeclaration.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "cssStyleDeclaration.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "cssStyleDeclaration.item(2)"); - -// MediaList -var mediaList = document.styleSheets[3].cssRules[0].media; -resultArray = iterateList(mediaList); -shouldBe("resultArray.length", "8"); -shouldBe("resultArray[0].i", "'0'"); -shouldBe("resultArray[0].item", "mediaList.item(0)"); -shouldBe("resultArray[1].i", "'1'"); -shouldBe("resultArray[1].item", "mediaList.item(1)"); -shouldBe("resultArray[2].i", "'2'"); -shouldBe("resultArray[2].item", "mediaList.item(2)"); - -debug(""); - -document.body.removeChild(testingGround);
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/domtimestamp-is-number.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/domtimestamp-is-number.js deleted file mode 100644 index 5b28114..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/domtimestamp-is-number.js +++ /dev/null
@@ -1,12 +0,0 @@ -description("This tests that DOMTimeStamp is a Number (and not a Date object)."); -// See https://bugs.webkit.org/show_bug.cgi?id=49963 - -var timestamp = null; - -function do_check(e) { - timestamp = e.timeStamp; - shouldBeFalse("timestamp instanceof Date"); - shouldBeTrue("timestamp == Number(timestamp)"); - finishJSTest(); -} -window.jsTestIsAsync = true; \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/event-attribute-availability.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/event-attribute-availability.js deleted file mode 100644 index 5cca67c..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/event-attribute-availability.js +++ /dev/null
@@ -1,104 +0,0 @@ -description("This tests what event handler attributes are available on what objects."); - -var elementAndDocumentProperties = [ - "onabort", "onblur", "onchange", "onclick", "oncontextmenu", "ondblclick", "ondrag", "ondragend", - "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onerror", "onfocus", "oninput", - "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout", - "onmouseover", "onmouseup", "onmousewheel", "onscroll", "onselect", "onsubmit", - - // Not implemented yet - // "oncanplay", "oncanplaythrough", "ondurationchange", "onemptied", "onended", "onformchange", - // "onforminput", "oninvalid", "onloadeddata", "onloadedmetadata", "onloadstart", "onpause", - // "onplay", "onplaying", "onprogress", "onratechange", "onreadystatechange", "onseeked", "onseeking", - // "onshow", "onstalled", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting", - - // WebKit extensions - "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste", "onreset", "onsearch", - "onselectstart" -]; - -var bodyAndFrameSetProperties = [ - "onbeforeunload", "onmessage", "onoffline", "ononline", "onresize", "onstorage", "onunload", "onblur", - "onerror", "onfocus", "onload", - - // Not implemented yet. - // "onafterprint", "onbeforeprint", "onhashchange", "onpopstate", "onredo", "onundo" -]; - -var svgAnimationElementProperties = [ - "onbegin", "onend", "onrepeat" -]; - - -debug("Test Element"); -var element = document.createElement("div"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in element"); -} - -debug("\nTest Document"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in document"); -} - -debug("\nTest Window"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in window"); -} - -debug("\nTest Text Node"); -var textNode = document.createTextNode("text"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeFalse("'" + elementAndDocumentProperties[i] + "' in textNode"); -} - -debug("\nTest Attribute"); -var attribute = document.createAttribute("attr"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeFalse("'" + elementAndDocumentProperties[i] + "' in attribute"); -} - -debug("\nTest HTMLBodyElement"); -var body = document.body; -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in body"); -} -for (var i = 0; i < bodyAndFrameSetProperties.length; ++i) { - shouldBeTrue("'" + bodyAndFrameSetProperties[i] + "' in body"); -} - -debug("\nTest HTMLFrameSetElement"); -var frameSet = document.createElement("frameset"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in frameSet"); -} -for (var i = 0; i < bodyAndFrameSetProperties.length; ++i) { - shouldBeTrue("'" + bodyAndFrameSetProperties[i] + "' in frameSet"); -} - -debug("\nTest SVGPathElement"); -var pathelement = document.createElementNS("http://www.w3.org/2000/svg", "path"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in pathelement"); -} -for (var i = 0; i < svgAnimationElementProperties.length; ++i) { - shouldBeFalse("'" + svgAnimationElementProperties[i] + "' in pathelement"); -} - -debug("\nTest SVGSVGElement"); -var svgelement = document.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null).documentElement; -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in svgelement"); -} -for (var i = 0; i < svgAnimationElementProperties.length; ++i) { - shouldBeFalse("'" + svgAnimationElementProperties[i] + "' in svgelement"); -} - -debug("\nTest SVGAnimationElement"); -var animateelement = document.createElementNS("http://www.w3.org/2000/svg", "animate"); -for (var i = 0; i < elementAndDocumentProperties.length; ++i) { - shouldBeTrue("'" + elementAndDocumentProperties[i] + "' in animateelement"); -} -for (var i = 0; i < svgAnimationElementProperties.length; ++i) { - shouldBeTrue("'" + svgAnimationElementProperties[i] + "' in animateelement"); -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/javascript-url-exception-isolation.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/javascript-url-exception-isolation.js deleted file mode 100644 index 0891c8e..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/javascript-url-exception-isolation.js +++ /dev/null
@@ -1,22 +0,0 @@ -description("Exceptions thrown in javascript URLs should not propagate to the main script.") - -var subframe = document.createElement("iframe"); -document.body.appendChild(subframe); - -var caughtException = false; - -// Runtime exception. -try { - subframe.src = 'javascript:throw 42'; -} catch(e) { - caughtException = true; -} -shouldBeFalse('caughtException'); - -// Compile-time exception. -try { - subframe.src = 'javascript:<html></html>'; -} catch(e) { - caughtException = true; -} -shouldBeFalse('caughtException');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/location-new-window-no-crash.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/location-new-window-no-crash.js deleted file mode 100644 index a21c179..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/location-new-window-no-crash.js +++ /dev/null
@@ -1,59 +0,0 @@ -description("Tests that manipulating location properties in a just-created window object does not crash. Note: Turn off pop-up blocking to run this in-browser."); - -if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.setCanOpenWindows(); -} - -var testWindow = open("data:text/plain,a"); - -// Note that the window does not navigate to the new URL right away, and that is a crucial element -// of the test. We're checking behavior when the object was just created and is not yet at its new -// location. - -shouldBe("testWindow.location.toString()", "'about:blank'"); -shouldBe("testWindow.location.href", "'about:blank'"); -shouldBe("testWindow.location.protocol", "'about:'"); -shouldBe("testWindow.location.host", "''"); // Firefox throws an exception -shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception -shouldBe("testWindow.location.port", "''"); -shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string -shouldBe("testWindow.location.search", "''"); -shouldBe("testWindow.location.hash", "''"); - -shouldBe("testWindow.location.href = 'data:text/plain,b'", "'data:text/plain,b'"); -shouldBe("testWindow.location.protocol = 'data'", "'data'"); // Firefox throws an exception -shouldBe("testWindow.location.host = 'c'", "'c'"); // Firefox throws an exception -shouldBe("testWindow.location.hostname = 'd'", "'d'"); // Firefox throws an exception -shouldBe("testWindow.location.port = 'e'", "'e'"); // Firefox throws an exception -shouldBe("testWindow.location.pathname = 'f'", "'f'"); // Firefox throws an exception -shouldBe("testWindow.location.search = 'g'", "'g'"); -shouldBe("testWindow.location.hash = 'h'", "'h'"); - -shouldBe("testWindow.location.assign('data:text/plain,i')", "undefined"); -shouldBe("testWindow.location.replace('data:text/plain,j')", "undefined"); -shouldBe("testWindow.location.reload()", "undefined"); - -shouldBe("testWindow.location.toString()", "'about:blank'"); -shouldBe("testWindow.location.href", "'about:blank'"); -shouldBe("testWindow.location.protocol", "'about:'"); -shouldBe("testWindow.location.host", "''"); // Firefox throws an exception -shouldBe("testWindow.location.hostname", "''"); // Firefox throws an exception -shouldBe("testWindow.location.port", "''"); -shouldBe("testWindow.location.pathname", "'blank'"); // Firefox returns the empty string -shouldBe("testWindow.location.search", "''"); -shouldBe("testWindow.location.hash", "''"); - -testWindow.close(); - -if (window.testRunner) { - function doneHandler() - { - if (testWindow.closed) { - testRunner.notifyDone(); - return; - } - setTimeout(doneHandler, 0); - } - doneHandler(); -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js deleted file mode 100644 index a056201..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js +++ /dev/null
@@ -1,526 +0,0 @@ -description( -'This tests the behavior of non-numeric values in contexts where the DOM has a numeric parameter.' -); - -function nonNumericPolicy(template) -{ - var x = 0; - try { - eval(template); - } catch (e) { - return e; - } - - var nullAllowed = 1; - x = null; - try { - eval(template); - } catch (e) { - nullAllowed = 0; - } - - var undefinedAllowed = 1; - x = undefined; - try { - eval(template); - } catch (e) { - undefinedAllowed = 0; - } - - var stringAllowed = 1; - x = "string"; - try { - eval(template); - } catch (e) { - stringAllowed = 0; - } - - var documentAllowed = 1; - x = document; - try { - eval(template); - } catch (e) { - documentAllowed = 0; - } - - var nonIntegerAllowed = 1; - x = 0.1; - try { - eval(template); - } catch (e) { - nonIntegerAllowed = 0; - } - - var infinityAllowed = 1; - x = Infinity; - try { - eval(template); - } catch (e) { - infinityAllowed = 0; - } - - var nanAllowed = 1; - x = NaN; - try { - eval(template); - } catch (e) { - nanAllowed = 0; - } - - var omitAllowed = -1; // means "not applicable" - var templateWithoutArg = template.replace(", x)", ")").replace("(x)", "()"); - if (templateWithoutArg != template) { - omitAllowed = 1; - try { - eval(templateWithoutArg); - } catch(e) { - omitAllowed = 0; - } - } - - var expectOmitAllowed = navigator.userAgent.match("Gecko/") != "Gecko/"; - - if (nullAllowed && undefinedAllowed && stringAllowed && documentAllowed && nonIntegerAllowed && infinityAllowed && nanAllowed) { - if (omitAllowed == -1 || omitAllowed == (expectOmitAllowed ? 1 : 0)) - return "any type allowed"; - if (omitAllowed == 1) - return "any type allowed (or omitted)"; - if (omitAllowed == 0) - return "any type allowed (but not omitted)"; - } - if (nullAllowed && !undefinedAllowed && !stringAllowed && !documentAllowed && nonIntegerAllowed && !infinityAllowed && nanAllowed && omitAllowed == 1) - return "number or null allowed (or omitted, but not infinite)"; - return "mixed"; -} - -var selector = "a"; -var styleText = "font-size: smaller"; -var ruleText = selector + " { " + styleText + " }"; - -var testElementContainer = document.createElement("div"); -document.body.appendChild(testElementContainer); - -function createFromMarkup(markup) -{ - var range = document.createRange(); - var fragmentContainer = document.createElement("div"); - range.selectNodeContents(fragmentContainer); - testElementContainer.appendChild(fragmentContainer); - var fragment = range.createContextualFragment(markup); - fragmentContainer.appendChild(fragment); - return fragmentContainer.firstChild; -} - -function createCSSStyleSheet() -{ - return createFromMarkup("<style>" + ruleText + "</style>").sheet; -} - -function createCSSRuleList() -{ - return createCSSStyleSheet().cssRules; -} - -function createCSSStyleDeclaration() -{ - return createCSSRuleList().item(0).style; -} - -function createCSSMediaRule() -{ - var rule = createFromMarkup("<style>@media screen { a { text-weight: bold } }</style>").sheet.cssRules.item(0); - rule.insertRule(ruleText, 0); - return rule; -} - -function createMediaList() -{ - return createCSSMediaRule().media; -} - -function createHTMLSelectElement() -{ - var select = document.createElement("select"); - select.options.add(document.createElement("option")); - return select; -} - -function createHTMLOptionsCollection() -{ - return createHTMLSelectElement().options; -} - -function createHTMLTableElement() -{ - var table = document.createElement("table"); - table.insertRow(0); - return table; -} - -function createHTMLTableSectionElement() -{ - var table = document.createElement("table"); - table.insertRow(0); - return table.tBodies[0]; -} - -function createHTMLTableRowElement() -{ - var table = document.createElement("table"); - var row = table.insertRow(0); - row.insertCell(0); - return row; -} - -function createCanvasElement() -{ - return document.createElement("canvas"); -} - -// CharacterData - -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").substringData(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").insertData(x, \"b\")')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").deleteData(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(x, 0, \"b\")')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").replaceData(0, x, \"b\")')", "'any type allowed'"); - -// CSSMediaRule - -shouldBe("nonNumericPolicy('createCSSMediaRule().insertRule(ruleText, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('createCSSMediaRule().deleteRule(x)')", "'any type allowed (but not omitted)'"); - -// CSSRuleList - -shouldBe("nonNumericPolicy('createCSSRuleList().item(x)')", "'any type allowed (but not omitted)'"); - -// CSSStyleDeclaration - -shouldBe("nonNumericPolicy('createCSSStyleDeclaration().item(x)')", "'any type allowed (but not omitted)'"); - -// CSSStyleSheet - -shouldBe("nonNumericPolicy('createCSSStyleSheet().insertRule(ruleText, x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createCSSStyleSheet().deleteRule(x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('createCSSStyleSheet().addRule(selector, styleText, x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createCSSStyleSheet().removeRule(x)')", "'any type allowed'"); - -// Document - -shouldBe("nonNumericPolicy('document.elementFromPoint(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.elementFromPoint(0, x)')", "'any type allowed (but not omitted)'"); - -// Element - -shouldBe("nonNumericPolicy('document.body.scrollLeft = x')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.body.scrollTop = x')", "'any type allowed'"); - -// History - -// Not tested: go. - -// HTMLCollection - -shouldBe("nonNumericPolicy('document.images.item(x)')", "'any type allowed (but not omitted)'"); - -// HTMLInputElement - -shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createElement(\"input\").setSelectionRange(0, x)')", "'any type allowed'"); - -// HTMLOptionsCollection - -shouldBe("nonNumericPolicy('createHTMLOptionsCollection().add(document.createElement(\"option\"), x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createHTMLOptionsCollection().remove(x)')", "'any type allowed (but not omitted)'"); - -// HTMLSelectElement - -shouldBe("nonNumericPolicy('createHTMLSelectElement().remove(x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createHTMLSelectElement().item(x)')", "'any type allowed (but not omitted)'"); - -// HTMLTableElement - -shouldBe("nonNumericPolicy('createHTMLTableElement().insertRow(x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createHTMLTableElement().deleteRow(x)')", "'any type allowed (but not omitted)'"); - -// HTMLTableRowElement - -shouldBe("nonNumericPolicy('createHTMLTableRowElement().insertCell(x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createHTMLTableRowElement().deleteCell(x)')", "'any type allowed (but not omitted)'"); - -// HTMLTableSectionElement - -shouldBe("nonNumericPolicy('createHTMLTableSectionElement().insertRow(x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('createHTMLTableSectionElement().deleteRow(x)')", "'any type allowed (but not omitted)'"); - -// HTMLInputElement - -shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createElement(\"textarea\").setSelectionRange(0, x)')", "'any type allowed'"); - -// HTMLCanvasElement - -shouldBe("nonNumericPolicy('createCanvasElement().getContext(x)')", "'any type allowed (but not omitted)'"); - -// KeyboardEvent - -shouldBe("nonNumericPolicy('document.createEvent(\"KeyboardEvent\").initKeyboardEvent(\"a\", false, false, null, \"b\", x, false, false, false, false, false)')", "'any type allowed'"); - -// MediaList - -shouldBe("nonNumericPolicy('createMediaList().item(x)')", "'any type allowed (but not omitted)'"); - -// MouseEvent - -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, x, 0, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, x, 0, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, x, 0, 0, false, false, false, false, 0, null)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, x, 0, false, false, false, false, 0, null)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, x, false, false, false, false, 0, null)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('document.createEvent(\"MouseEvent\").initMouseEvent(\"a\", false, false, null, 0, 0, 0, 0, 0, false, false, false, false, x, null)')", "'any type allowed'"); - -// NamedNodeMap - -shouldBe("nonNumericPolicy('document.body.attributes.item(x)')", "'any type allowed (but not omitted)'"); - -// NodeIterator - -shouldBe("nonNumericPolicy('document.createNodeIterator(document, x, null, false)')", "'any type allowed'"); - -// NodeList - -shouldBe("nonNumericPolicy('document.getElementsByTagName(\"div\").item(x)')", "'any type allowed (but not omitted)'"); - -// Range - -shouldBe("nonNumericPolicy('document.createRange().setStart(document, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('document.createRange().setEnd(document, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('document.createRange().comparePoint(document, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('document.createRange().isPointInRange(document, x)')", "'any type allowed (but not omitted)'"); - -// Selection - -shouldBe("nonNumericPolicy('getSelection().collapse(document, x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, x, document, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('getSelection().setBaseAndExtent(document, 0, document, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('getSelection().collapse(document, x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('getSelection().extend(document, x)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('getSelection().getRangeAt(x)')", "'any type allowed (but not omitted)'"); - -// SQLResultSetRowList - -// Not tested: item. - -// StyleSheetList - -shouldBe("nonNumericPolicy('document.styleSheets.item(x)')", "'any type allowed (but not omitted)'"); - -// Text - -shouldBe("nonNumericPolicy('document.createTextNode(\"a\").splitText(x)')", "'any type allowed (but not omitted)'"); - -// TimeRanges - -// Not tested: start, end. - -// TreeWalker - -shouldBe("nonNumericPolicy('document.createTreeWalker(document, x, null, false)')", "'any type allowed'"); - -// UIEvent - -shouldBe("nonNumericPolicy('document.createEvent(\"UIEvent\").initUIEvent(\"a\", false, false, null, x)')", "'any type allowed'"); - -// Window - -shouldBe("nonNumericPolicy('window.scrollBy(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.scrollBy(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.scrollTo(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.scrollTo(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.scroll(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.scroll(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.moveBy(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.moveBy(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.moveTo(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.moveTo(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.resizeBy(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.resizeBy(0, x)')", "'any type allowed (but not omitted)'"); -shouldBe("nonNumericPolicy('window.resizeTo(x, 0)')", "'any type allowed'"); -shouldBe("nonNumericPolicy('window.resizeTo(0, x)')", "'any type allowed (but not omitted)'"); -// Not tested: openDatabase. - -window.resizeTo(10000, 10000); -document.body.removeChild(testElementContainer); - -/* - -Here are other examples of numeric types in function parameters and settable attributes that we could test: - -../../../../WebCore/css/CSSPrimitiveValue.idl: in float floatValue) -../../../../WebCore/html/CanvasGradient.idl: void addColorStop(in float offset, in DOMString color); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void scale(in float sx, in float sy); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void rotate(in float angle); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void translate(in float tx, in float ty); -../../../../WebCore/html/CanvasRenderingContext2D.idl: CanvasGradient createLinearGradient(in float x0, in float y0, in float x1, in float y1); -../../../../WebCore/html/CanvasRenderingContext2D.idl: CanvasGradient createRadialGradient(in float x0, in float y0, in float r0, in float x1, in float y1, in float r1); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void clearRect(in float x, in float y, in float width, in float height) -../../../../WebCore/html/CanvasRenderingContext2D.idl: void fillRect(in float x, in float y, in float width, in float height) -../../../../WebCore/html/CanvasRenderingContext2D.idl: void moveTo(in float x, in float y); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void lineTo(in float x, in float y); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void quadraticCurveTo(in float cpx, in float cpy, in float x, in float y); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void bezierCurveTo(in float cp1x, in float cp1y, in float cp2x, in float cp2y, in float x, in float y); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void arcTo(in float x1, in float y1, in float x2, in float y2, in float radius) -../../../../WebCore/html/CanvasRenderingContext2D.idl: void rect(in float x, in float y, in float width, in float height) -../../../../WebCore/html/CanvasRenderingContext2D.idl: void arc(in float x, in float y, in float radius, in float startAngle, in float endAngle, in boolean anticlockwise) -../../../../WebCore/html/CanvasRenderingContext2D.idl: boolean isPointInPath(in float x, in float y); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void setAlpha(in float alpha); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void setLineWidth(in float width); -../../../../WebCore/html/CanvasRenderingContext2D.idl: void setMiterLimit(in float limit); - -../../../../WebCore/html/HTMLAnchorElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLAreaElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollLeft; -../../../../WebCore/html/HTMLBodyElement.idl: attribute long scrollTop; -../../../../WebCore/html/HTMLButtonElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLCanvasElement.idl: attribute long width; -../../../../WebCore/html/HTMLCanvasElement.idl: attribute long height; -../../../../WebCore/html/HTMLEmbedElement.idl: attribute [ConvertFromString] long height; -../../../../WebCore/html/HTMLEmbedElement.idl: attribute [ConvertFromString] long width; -../../../../WebCore/html/HTMLImageElement.idl: attribute long height; -../../../../WebCore/html/HTMLImageElement.idl: attribute long hspace; -../../../../WebCore/html/HTMLImageElement.idl: attribute long vspace; -../../../../WebCore/html/HTMLImageElement.idl: attribute long width; -../../../../WebCore/html/HTMLInputElement.idl: attribute long maxLength; -../../../../WebCore/html/HTMLInputElement.idl: attribute unsigned long size; // Changed string -> long as part of DOM level 2 -../../../../WebCore/html/HTMLInputElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLInputElement.idl: attribute long selectionStart; -../../../../WebCore/html/HTMLInputElement.idl: attribute long selectionEnd; -../../../../WebCore/html/HTMLLIElement.idl: attribute long value; -../../../../WebCore/html/HTMLMediaElement.idl: attribute unsigned long playCount -../../../../WebCore/html/HTMLMediaElement.idl: attribute unsigned long currentLoop; -../../../../WebCore/html/HTMLObjectElement.idl: attribute long hspace; -../../../../WebCore/html/HTMLObjectElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLObjectElement.idl: attribute long vspace; -../../../../WebCore/html/HTMLOListElement.idl: attribute long start; -../../../../WebCore/html/HTMLOptionsCollection.idl: attribute long selectedIndex; -../../../../WebCore/html/HTMLOptionsCollection.idl: attribute [Custom] unsigned long length -../../../../WebCore/html/HTMLPreElement.idl: attribute long width; -../../../../WebCore/html/HTMLSelectElement.idl: attribute long selectedIndex; -../../../../WebCore/html/HTMLSelectElement.idl: attribute unsigned long length -../../../../WebCore/html/HTMLSelectElement.idl: attribute long size; -../../../../WebCore/html/HTMLSelectElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLTableCellElement.idl: attribute long colSpan; -../../../../WebCore/html/HTMLTableCellElement.idl: attribute long rowSpan; -../../../../WebCore/html/HTMLTableColElement.idl: attribute long span; -../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long cols; -../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long rows; -../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long tabIndex; -../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long selectionStart; -../../../../WebCore/html/HTMLTextAreaElement.idl: attribute long selectionEnd; -../../../../WebCore/html/HTMLVideoElement.idl: attribute long width; -../../../../WebCore/html/HTMLVideoElement.idl: attribute long height; - -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float globalAlpha; -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float lineWidth; -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float miterLimit; -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowOffsetX; -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowOffsetY; -../../../../WebCore/html/CanvasRenderingContext2D.idl: attribute float shadowBlur; -../../../../WebCore/html/HTMLMediaElement.idl: attribute float currentTime -../../../../WebCore/html/HTMLMediaElement.idl: attribute float defaultPlaybackRate -../../../../WebCore/html/HTMLMediaElement.idl: attribute float playbackRate -../../../../WebCore/html/HTMLMediaElement.idl: attribute float start; -../../../../WebCore/html/HTMLMediaElement.idl: attribute float end; -../../../../WebCore/html/HTMLMediaElement.idl: attribute float loopStart; -../../../../WebCore/html/HTMLMediaElement.idl: attribute float loopEnd; -../../../../WebCore/html/HTMLMediaElement.idl: attribute float volume - -../../../../WebCore/svg/SVGAnimatedInteger.idl: attribute long baseVal -../../../../WebCore/svg/SVGElementInstanceList.idl: SVGElementInstance item(in unsigned long index); -../../../../WebCore/svg/SVGLengthList.idl: SVGLength getItem(in unsigned long index) -../../../../WebCore/svg/SVGLengthList.idl: SVGLength insertItemBefore(in SVGLength item, in unsigned long index) -../../../../WebCore/svg/SVGLengthList.idl: SVGLength replaceItem(in SVGLength item, in unsigned long index) -../../../../WebCore/svg/SVGLengthList.idl: SVGLength removeItem(in unsigned long index) -../../../../WebCore/svg/SVGNumberList.idl: SVGNumber getItem(in unsigned long index) -../../../../WebCore/svg/SVGNumberList.idl: SVGNumber insertItemBefore(in SVGNumber item, in unsigned long index) -../../../../WebCore/svg/SVGNumberList.idl: SVGNumber replaceItem(in SVGNumber item, in unsigned long index) -../../../../WebCore/svg/SVGNumberList.idl: SVGNumber removeItem(in unsigned long index) -../../../../WebCore/svg/SVGPathElement.idl: unsigned long getPathSegAtLength(in float distance); -../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint getItem(in unsigned long index) -../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint insertItemBefore(in SVGPoint item, in unsigned long index) -../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint replaceItem(in SVGPoint item, in unsigned long index) -../../../../WebCore/svg/SVGPointList.idl: [Custom] SVGPoint removeItem(in unsigned long index) -../../../../WebCore/svg/SVGStringList.idl: core::DOMString getItem(in unsigned long index) -../../../../WebCore/svg/SVGStringList.idl: core::DOMString insertItemBefore(in core::DOMString item, in unsigned long index) -../../../../WebCore/svg/SVGStringList.idl: core::DOMString replaceItem(in core::DOMString item, in unsigned long index) -../../../../WebCore/svg/SVGStringList.idl: core::DOMString removeItem(in unsigned long index) -../../../../WebCore/svg/SVGSVGElement.idl: unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds); -../../../../WebCore/svg/SVGSVGElement.idl: void unsuspendRedraw(in unsigned long suspendHandleId) -../../../../WebCore/svg/SVGTextContentElement.idl: long getNumberOfChars(); -../../../../WebCore/svg/SVGTextContentElement.idl: float getSubStringLength(in unsigned long offset, -../../../../WebCore/svg/SVGTextContentElement.idl: in unsigned long length) -../../../../WebCore/svg/SVGTextContentElement.idl: SVGPoint getStartPositionOfChar(in unsigned long offset) -../../../../WebCore/svg/SVGTextContentElement.idl: SVGPoint getEndPositionOfChar(in unsigned long offset) -../../../../WebCore/svg/SVGTextContentElement.idl: SVGRect getExtentOfChar(in unsigned long offset) -../../../../WebCore/svg/SVGTextContentElement.idl: float getRotationOfChar(in unsigned long offset) -../../../../WebCore/svg/SVGTextContentElement.idl: long getCharNumAtPosition(in SVGPoint point); -../../../../WebCore/svg/SVGTextContentElement.idl: void selectSubString(in unsigned long offset, -../../../../WebCore/svg/SVGTextContentElement.idl: in unsigned long length) -../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform getItem(in unsigned long index) -../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform insertItemBefore(in SVGTransform item, in unsigned long index) -../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform replaceItem(in SVGTransform item, in unsigned long index) -../../../../WebCore/svg/SVGTransformList.idl: [Custom] SVGTransform removeItem(in unsigned long index) -../../../../WebCore/xml/XPathResult.idl: Node snapshotItem(in unsigned long index) - -../../../../WebCore/svg/SVGAngle.idl: in float valueInSpecifiedUnits); -../../../../WebCore/svg/SVGAnimationElement.idl: float getStartTime(); -../../../../WebCore/svg/SVGAnimationElement.idl: float getCurrentTime(); -../../../../WebCore/svg/SVGAnimationElement.idl: float getSimpleDuration() -../../../../WebCore/svg/SVGFEGaussianBlurElement.idl: void setStdDeviation(in float stdDeviationX, in float stdDeviationY); -../../../../WebCore/svg/SVGLength.idl: in float valueInSpecifiedUnits); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix translate(in float x, in float y); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix scale(in float scaleFactor); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix scaleNonUniform(in float scaleFactorX, in float scaleFactorY); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix rotate(in float angle); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix rotateFromVector(in float x, in float y) -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix skewX(in float angle); -../../../../WebCore/svg/SVGMatrix.idl: [Custom] SVGMatrix skewY(in float angle); -../../../../WebCore/svg/SVGNumber.idl: interface [Conditional=SVG, PODType=float] SVGNumber { -../../../../WebCore/svg/SVGPathElement.idl: float getTotalLength(); -../../../../WebCore/svg/SVGPathElement.idl: SVGPoint getPointAtLength(in float distance); -../../../../WebCore/svg/SVGPathElement.idl: unsigned long getPathSegAtLength(in float distance); -../../../../WebCore/svg/SVGSVGElement.idl: float getCurrentTime(); -../../../../WebCore/svg/SVGSVGElement.idl: void setCurrentTime(in float seconds); -../../../../WebCore/svg/SVGTextContentElement.idl: float getComputedTextLength(); -../../../../WebCore/svg/SVGTextContentElement.idl: float getSubStringLength(in unsigned long offset, -../../../../WebCore/svg/SVGTextContentElement.idl: float getRotationOfChar(in unsigned long offset) -../../../../WebCore/svg/SVGTransform.idl: void setTranslate(in float tx, in float ty); -../../../../WebCore/svg/SVGTransform.idl: void setScale(in float sx, in float sy); -../../../../WebCore/svg/SVGTransform.idl: void setRotate(in float angle, in float cx, in float cy); -../../../../WebCore/svg/SVGTransform.idl: void setSkewX(in float angle); -../../../../WebCore/svg/SVGTransform.idl: void setSkewY(in float angle); - -../../../../WebCore/svg/SVGAngle.idl: attribute float value; -../../../../WebCore/svg/SVGAngle.idl: attribute float valueInSpecifiedUnits; -../../../../WebCore/svg/SVGAnimatedNumber.idl: attribute float baseVal -../../../../WebCore/svg/SVGLength.idl: attribute float value; -../../../../WebCore/svg/SVGLength.idl: attribute float valueInSpecifiedUnits; -../../../../WebCore/svg/SVGNumber.idl: attribute float value -../../../../WebCore/svg/SVGPoint.idl: attribute float x -../../../../WebCore/svg/SVGPoint.idl: attribute float y -../../../../WebCore/svg/SVGRect.idl: attribute float x -../../../../WebCore/svg/SVGRect.idl: attribute float y -../../../../WebCore/svg/SVGRect.idl: attribute float width -../../../../WebCore/svg/SVGRect.idl: attribute float height -../../../../WebCore/svg/SVGSVGElement.idl: attribute float currentScale - -../../../../WebCore/svg/SVGMatrix.idl: attribute double a; -../../../../WebCore/svg/SVGMatrix.idl: attribute double b; -../../../../WebCore/svg/SVGMatrix.idl: attribute double c; -../../../../WebCore/svg/SVGMatrix.idl: attribute double d; -../../../../WebCore/svg/SVGMatrix.idl: attribute double e; -../../../../WebCore/svg/SVGMatrix.idl: attribute double f; - -*/
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/prototype-property.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/prototype-property.js deleted file mode 100644 index 410e841..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/prototype-property.js +++ /dev/null
@@ -1,23 +0,0 @@ -description("Make sure the 'prototype' property on generated Web IDL interfaces is { DontDelete | ReadOnly }."); - -function tryToDeletePrototype(o) { - var orig = o.prototype; - delete o.prototype; - var ret = o.prototype != orig; - o.prototype = orig; - return ret; -} - -function tryToSetPrototype(o, value) { - var orig = o.prototype; - o.prototype = value; - var ret = o.prototype != orig; - o.prototype = orig; - return ret; -} - -shouldBe("tryToDeletePrototype(window.HTMLElement)", "false"); -shouldBe("tryToSetPrototype(window.HTMLElement, null)", "false"); -shouldBe("tryToSetPrototype(window.HTMLElement, undefined)", "false"); -shouldBe("tryToSetPrototype(window.HTMLElement, 1)", "false"); -shouldBe("tryToSetPrototype(window.HTMLElement, window.Object.prototype)", "false");
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js deleted file mode 100644 index 660270e2..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/unsigned-long-attribute-reflection.js +++ /dev/null
@@ -1,47 +0,0 @@ -// http://whatwg.org/html#reflecting-content-attributes-in-idl-attributes -// http://whatwg.org/html#rules-for-parsing-non-negative-integers -function testUnsignedLong(interface, createElement, attribute) -{ - test(function() - { - var element = createElement(); - - assert_equals(element[attribute], 0); - - function t(input, output) - { - element.setAttribute(attribute, input); - assert_equals(element[attribute], output); - } - - t("", 0); - t("0", 0); - t("1", 1); - t("2147483647", 2147483647); - t("2147483648", 0); - t("-1", 0); - t("+42", 42); - t(" 42", 42); - t("42!", 42); - }, "get " + interface + "." + attribute); - - test(function() - { - var element = createElement(); - - assert_false(element.hasAttribute(attribute)); - - function t(input, output) - { - element[attribute] = input; - assert_equals(element.getAttribute(attribute), output); - } - - t(0, "0"); - t(2147483647, "2147483647"); - t(2147483648, "0"); - t(2147483700, "0"); - t(-1, "0"); - t(-3, "0"); - }, "set " + interface + "." + attribute); -}
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-document-open.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-document-open.js deleted file mode 100644 index 52d9498..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-document-open.js +++ /dev/null
@@ -1,38 +0,0 @@ -window.performance = window.performance || {}; -var navigation = performance.navigation || {}; -var timing = performance.timing || {}; -var originalTiming = {}; - -window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOpen, 0); }, false); - -function testTimingWithDocumentOpen() -{ - for (property in timing) { - originalTiming[property] = timing[property]; - } - - document.open(); - document.write("<html>"); - document.write("<head>"); - document.write("<script src=\"../../resources/js-test.js\"></script>"); - document.write("</head>"); - document.write("<body>"); - document.write("</body>"); - document.write("</html>"); - document.close(); - - description("This test verifies that the NavigationTimings don't change after a document.open()."); - - setTimeout(finishTest, 0); -} - -function finishTest() { - var properties = getAllPropertyNames(timing); - for (var i = 0; i < properties.length; ++i) { - shouldBe("timing." + properties[i], "originalTiming." + properties[i]); - } - - finishJSTest(); -} - -jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-navigate-within-document.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-navigate-within-document.js deleted file mode 100644 index 57fab9802..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming-navigate-within-document.js +++ /dev/null
@@ -1,36 +0,0 @@ -description("This test checks that navigating within the document does not reset Web Timing numbers."); - -window.performance = window.performance || {}; -var timing = performance.timing || {}; - -function checkTimingNotChanged() -{ - var properties = getAllPropertyNames(timing); - for (var i = 0; i < properties.length; ++i) { - var property = properties[i]; - if (timing[property] === initialTiming[property]) - testPassed(property + " is unchanged."); - else - testFailed(property + " changed."); - } - finishJSTest(); -} - -var initialTiming = {}; -function saveTimingAfterLoad() -{ - for (var property in timing) { - initialTiming[property] = timing[property]; - } - window.location.href = "#1"; - setTimeout("checkTimingNotChanged()", 0); -} - -function loadHandler() -{ - window.removeEventListener("load", loadHandler); - setTimeout("saveTimingAfterLoad()", 0); -} -window.addEventListener("load", loadHandler, false); - -jsTestIsAsync = true;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming.js b/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming.js deleted file mode 100644 index dfe9085f9..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/script-tests/webtiming.js +++ /dev/null
@@ -1,227 +0,0 @@ -description("This test checks that all of the <a href='http://dev.w3.org/2006/webapi/WebTiming/'>Web Timing</a> attributes are available and have reasonable values in the right order."); - -window.performance = window.performance || {}; -var navigation = performance.navigation || {}; -var timing = performance.timing || {}; - -// Get the order of magnitude correct without a chance for flakiness. -var oneHourMilliseconds = 60 * 60 * 1000; -var currentUTC = 0; // FIXME: Use performance.now() when available. -var oneHourAgoUTC = currentUTC - oneHourMilliseconds; - -function sleepFiftyMilliseconds() { - var endTime = (new Date()).getTime() + 50; - while ((new Date().getTime() < endTime)) { } -} -window.addEventListener("load", sleepFiftyMilliseconds, false); - -function checkTimingBeforeLoad() -{ - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBe("timing.domInteractive", "0"); - shouldBe("timing.domContentLoadedEventStart", "0"); - shouldBe("timing.domContentLoadedEventEnd", "0"); - shouldBe("timing.domComplete", "0"); - - shouldBe("timing.loadEventStart", "0"); - shouldBe("timing.loadEventEnd", "0"); -} - -function checkTimingWhileDeferred() -{ - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading"); - shouldBe("timing.domContentLoadedEventStart", "0"); - shouldBe("timing.domContentLoadedEventEnd", "0"); - shouldBe("timing.domComplete", "0"); - - shouldBe("timing.loadEventStart", "0"); - shouldBe("timing.loadEventEnd", "0"); - - window.addEventListener("DOMContentLoaded", checkWebTimingOnDOMContentLoaded, false); -} - -function checkWebTimingOnDOMContentLoaded() { - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); - shouldBe("timing.domContentLoadedEventEnd", "0"); - shouldBe("timing.domComplete", "0"); - - shouldBe("timing.loadEventStart", "0"); - shouldBe("timing.loadEventEnd", "0"); - - var body = document.getElementsByTagName("body")[0]; - var script = document.createElement("script"); - script.async = true; - script.type = "text/javascript"; - script.src = "script-tests/webtiming-async.js"; - body.appendChild(script); -} - -function checkWebTimingWhileAsync() -{ - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); - shouldBe("timing.domComplete", "0"); - - shouldBe("timing.loadEventStart", "0"); - shouldBe("timing.loadEventEnd", "0"); - - window.addEventListener("load", checkWebTimingOnLoad, false); -} - -function checkWebTimingOnLoad() -{ - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - shouldBeGreaterThanOrEqual("timing.responseEnd", "timing.responseStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); - shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEventEnd"); - - shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd"); - shouldBe("timing.loadEventEnd", "0"); - - setTimeout("checkWebTimingAfterLoad()", 0); -} - -function checkWebTimingAfterLoad() -{ - shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); - - shouldBe("timing.redirectStart", "0"); - shouldBe("timing.redirectEnd", "0"); - shouldBe("navigation.redirectCount", "0"); - - shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); - - shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); - - shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); - shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); - - shouldBe("timing.secureConnectionStart", "0"); - - shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); - - shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); - shouldBeGreaterThanOrEqual("timing.responseEnd", "timing.responseStart"); - - shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); - shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); - shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); - shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEventEnd"); - - shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd"); - shouldBeGreaterThanOrEqual("timing.loadEventEnd", "timing.loadEventStart + 50"); - - finishJSTest(); -} - -jsTestIsAsync = true; -checkTimingBeforeLoad();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open.html b/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open.html index f2bf853..e3473fc 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open.html +++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open.html
@@ -4,6 +4,45 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/webtiming-document-open.js"></script> +<script> +window.performance = window.performance || {}; +var navigation = performance.navigation || {}; +var timing = performance.timing || {}; +var originalTiming = {}; + +window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOpen, 0); }, false); + +function testTimingWithDocumentOpen() +{ + for (property in timing) { + originalTiming[property] = timing[property]; + } + + document.open(); + document.write("<html>"); + document.write("<head>"); + document.write("<script src=\"../../resources/js-test.js\"></" + "script>"); + document.write("</head>"); + document.write("<body>"); + document.write("</body>"); + document.write("</html>"); + document.close(); + + description("This test verifies that the NavigationTimings don't change after a document.open()."); + + setTimeout(finishTest, 0); +} + +function finishTest() { + var properties = getAllPropertyNames(timing); + for (var i = 0; i < properties.length; ++i) { + shouldBe("timing." + properties[i], "originalTiming." + properties[i]); + } + + finishJSTest(); +} + +jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document.html b/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document.html index c17828832..0c0a648 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document.html +++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document.html
@@ -4,6 +4,43 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/webtiming-navigate-within-document.js"></script> +<script> +description("This test checks that navigating within the document does not reset Web Timing numbers."); + +window.performance = window.performance || {}; +var timing = performance.timing || {}; + +function checkTimingNotChanged() +{ + var properties = getAllPropertyNames(timing); + for (var i = 0; i < properties.length; ++i) { + var property = properties[i]; + if (timing[property] === initialTiming[property]) + testPassed(property + " is unchanged."); + else + testFailed(property + " changed."); + } + finishJSTest(); +} + +var initialTiming = {}; +function saveTimingAfterLoad() +{ + for (var property in timing) { + initialTiming[property] = timing[property]; + } + window.location.href = "#1"; + setTimeout("checkTimingNotChanged()", 0); +} + +function loadHandler() +{ + window.removeEventListener("load", loadHandler); + setTimeout("saveTimingAfterLoad()", 0); +} +window.addEventListener("load", loadHandler, false); + +jsTestIsAsync = true; +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming.html b/third_party/WebKit/LayoutTests/fast/dom/webtiming.html index d347c237..9ba0b711 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/webtiming.html +++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming.html
@@ -4,7 +4,235 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/webtiming.js"></script> -<script src="script-tests/webtiming-defer.js" defer></script> +<script> +description("This test checks that all of the <a href='http://dev.w3.org/2006/webapi/WebTiming/'>Web Timing</a> attributes are available and have reasonable values in the right order."); + +window.performance = window.performance || {}; +var navigation = performance.navigation || {}; +var timing = performance.timing || {}; + +// Get the order of magnitude correct without a chance for flakiness. +var oneHourMilliseconds = 60 * 60 * 1000; +var currentUTC = 0; // FIXME: Use performance.now() when available. +var oneHourAgoUTC = currentUTC - oneHourMilliseconds; + +function sleepFiftyMilliseconds() { + var endTime = (new Date()).getTime() + 50; + while ((new Date().getTime() < endTime)) { } +} +window.addEventListener("load", sleepFiftyMilliseconds, false); + +function checkTimingBeforeLoad() +{ + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBe("timing.domInteractive", "0"); + shouldBe("timing.domContentLoadedEventStart", "0"); + shouldBe("timing.domContentLoadedEventEnd", "0"); + shouldBe("timing.domComplete", "0"); + + shouldBe("timing.loadEventStart", "0"); + shouldBe("timing.loadEventEnd", "0"); +} + +function checkTimingWhileDeferred() +{ + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading"); + shouldBe("timing.domContentLoadedEventStart", "0"); + shouldBe("timing.domContentLoadedEventEnd", "0"); + shouldBe("timing.domComplete", "0"); + + shouldBe("timing.loadEventStart", "0"); + shouldBe("timing.loadEventEnd", "0"); + + window.addEventListener("DOMContentLoaded", checkWebTimingOnDOMContentLoaded, false); +} + +function checkWebTimingOnDOMContentLoaded() { + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.domLoading"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); + shouldBe("timing.domContentLoadedEventEnd", "0"); + shouldBe("timing.domComplete", "0"); + + shouldBe("timing.loadEventStart", "0"); + shouldBe("timing.loadEventEnd", "0"); + + var body = document.getElementsByTagName("body")[0]; + var script = document.createElement("script"); + script.async = true; + script.type = "text/javascript"; + script.src = "resources/webtiming-async.js"; + body.appendChild(script); +} + +function checkWebTimingWhileAsync() +{ + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); + shouldBe("timing.domComplete", "0"); + + shouldBe("timing.loadEventStart", "0"); + shouldBe("timing.loadEventEnd", "0"); + + window.addEventListener("load", checkWebTimingOnLoad, false); +} + +function checkWebTimingOnLoad() +{ + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + shouldBeGreaterThanOrEqual("timing.responseEnd", "timing.responseStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); + shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEventEnd"); + + shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd"); + shouldBe("timing.loadEventEnd", "0"); + + setTimeout("checkWebTimingAfterLoad()", 0); +} + +function checkWebTimingAfterLoad() +{ + shouldBeGreaterThanOrEqual("timing.navigationStart", "oneHourAgoUTC"); + + shouldBe("timing.redirectStart", "0"); + shouldBe("timing.redirectEnd", "0"); + shouldBe("navigation.redirectCount", "0"); + + shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); + + shouldBeGreaterThanOrEqual("timing.domainLookupStart", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domainLookupEnd", "timing.domainLookupStart"); + + shouldBeGreaterThanOrEqual("timing.connectStart", "timing.domainLookupEnd"); + shouldBeGreaterThanOrEqual("timing.connectEnd", "timing.connectStart"); + + shouldBe("timing.secureConnectionStart", "0"); + + shouldBeGreaterThanOrEqual("timing.requestStart", "timing.connectEnd"); + + shouldBeGreaterThanOrEqual("timing.responseStart", "timing.requestStart"); + shouldBeGreaterThanOrEqual("timing.responseEnd", "timing.responseStart"); + + shouldBeGreaterThanOrEqual("timing.domLoading", "timing.fetchStart"); + shouldBeGreaterThanOrEqual("timing.domInteractive", "timing.responseEnd"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventStart", "timing.domInteractive"); + shouldBeGreaterThanOrEqual("timing.domContentLoadedEventEnd", "timing.domContentLoadedEventStart"); + shouldBeGreaterThanOrEqual("timing.domComplete", "timing.domContentLoadedEventEnd"); + + shouldBeGreaterThanOrEqual("timing.loadEventStart", "timing.responseEnd"); + shouldBeGreaterThanOrEqual("timing.loadEventEnd", "timing.loadEventStart + 50"); + + finishJSTest(); +} + +jsTestIsAsync = true; +checkTimingBeforeLoad(); +</script> +<script src="resources/webtiming-defer.js" defer></script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/window-event-handlers.html b/third_party/WebKit/LayoutTests/fast/dom/window-event-handlers.html index f64fe17b..26c2bc9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/window-event-handlers.html +++ b/third_party/WebKit/LayoutTests/fast/dom/window-event-handlers.html
@@ -2,7 +2,7 @@ <title>WindowEventHandlers test</title> <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> -<script src="script-tests/event-handlers.js"></script> +<script src="resources/event-handlers.js"></script> <script> // attribute list from WHATWG HTML Living Standard r8389 [
diff --git a/third_party/WebKit/LayoutTests/fast/html/article-element.html b/third_party/WebKit/LayoutTests/fast/html/article-element.html index d11216e4..6e87d1c 100644 --- a/third_party/WebKit/LayoutTests/fast/html/article-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/article-element.html
@@ -4,6 +4,48 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/article-element.js"></script> +<script> +description('Various tests for the article element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<article> closes <p>:'); +testParent.innerHTML = '<p>Test that <article id="article1">an article element</article> closes <p>.</p>'; +var article1 = document.getElementById('article1'); +shouldBeFalse('article1.parentNode.nodeName == "p"'); + +debug('<p> does not close <article>:'); +testParent.innerHTML = '<article>Test that <p id="p1">a p element</p> does not close an article element.</article>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"ARTICLE"'); + +debug('<article> can be nested inside <article>:'); +testParent.innerHTML = '<article id="article2">Test that <article id="article3">an article element</article> can be nested inside another.</article>'; +var article3 = document.getElementById('article3'); +shouldBe('article3.parentNode.id', '"article2"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><article id="article4">This text should be bold.</article> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("article4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <article>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'article'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/aside-element.html b/third_party/WebKit/LayoutTests/fast/html/aside-element.html index 73d04b2..d621ead 100644 --- a/third_party/WebKit/LayoutTests/fast/html/aside-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/aside-element.html
@@ -4,6 +4,48 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/aside-element.js"></script> +<script> +description('Various tests for the aside element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<aside> closes <p>:'); +testParent.innerHTML = '<p>Test that <aside id="aside1">an aside element</aside> closes <p>.</p>'; +var aside1 = document.getElementById('aside1'); +shouldBeFalse('aside1.parentNode.nodeName == "p"'); + +debug('<p> does not close <aside>:'); +testParent.innerHTML = '<aside>Test that <p id="p1">a p element</p> does not close an aside element.</aside>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"ASIDE"'); + +debug('<aside> can be nested inside <aside>:'); +testParent.innerHTML = '<aside id="aside2">Test that <aside id="aside3">an aside element</aside> can be nested inside another.</aside>'; +var aside3 = document.getElementById('aside3'); +shouldBe('aside3.parentNode.id', '"aside2"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><aside id="aside4">This text should be bold.</aside> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("aside4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <aside>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'aside'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"ASIDE"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/disable-style-element.html b/third_party/WebKit/LayoutTests/fast/html/disable-style-element.html index b71aea6..33c6b6e 100644 --- a/third_party/WebKit/LayoutTests/fast/html/disable-style-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/disable-style-element.html
@@ -15,6 +15,44 @@ </style> </head> <body> -<script src="script-tests/disable-style-element.js"></script> +<script> +description('Test the disabled property on a style element.'); + +var styleElement = document.getElementById('s'); +var console = document.getElementById('console'); +var testElement = document.createElement('div'); +testElement.innerText = "Test element"; +testElement.className = 'test'; +document.body.appendChild(testElement); + +shouldBeFalse('styleElement.disabled'); +shouldBe('window.getComputedStyle(testElement).color', '"rgb(0, 128, 0)"'); + +styleElement.disabled = true +shouldBeTrue('styleElement.disabled'); +shouldBe('window.getComputedStyle(testElement).color', '"rgb(255, 0, 0)"'); + +// Test reflection in the sheet. +shouldBeTrue('styleElement.sheet.disabled'); +styleElement.sheet.disabled = false +shouldBeFalse('styleElement.sheet.disabled'); +shouldBeFalse('styleElement.disabled'); +shouldBe('window.getComputedStyle(testElement).color', '"rgb(0, 128, 0)"'); + +// Test disconnected element +var newStyleElement = document.createElement('style'); +shouldBeFalse('newStyleElement.disabled'); +newStyleElement.disabled = true +shouldBeFalse('newStyleElement.disabled'); + +// Test non-CSS element +var otherStyle = document.getElementById('non-css'); +shouldBeFalse('otherStyle.disabled'); +otherStyle.disabled = true +shouldBeFalse('otherStyle.disabled'); + + +document.body.removeChild(testElement); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html b/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html index a0ceb8f..0587b43 100644 --- a/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/figcaption-element.html
@@ -4,6 +4,45 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/figcaption-element.js"></script> +<script> +description('Various tests for the figcaption element.'); + +function getStyleValue(id, propertyName) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(propertyName); +} + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<figcaption> default styling:'); +testParent.innerHTML = '<figcaption id="figcaption0">element</figure>'; +var emSize = getStyleValue("figcaption0","font-size"); +shouldBe('getStyleValue("figcaption0","display")', '"block"'); + +debug('<figcaption> closes <p>:'); +testParent.innerHTML = '<p>Test that <figcaption id="figcaption1">a figcaption element</figcaption> closes <p>.</p>'; +var figcaption1 = document.getElementById('figcaption1'); +shouldBeFalse('figcaption1.parentNode.nodeName == "p"'); + +debug('<p> does not close <figcaption>:'); +testParent.innerHTML = '<figcaption>Test that <p id="p1">a p element</p> does not close a figcaption element.</figcaption>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"FIGCAPTION"'); + +debug('<figcaption> can be nested inside <figcaption> or <footer>:'); +testParent.innerHTML = '<figcaption id="figcaption2">Test that <figcaption id="figcaption3">a figcaption element</figcaption> can be nested inside another figcaption element.</figcaption>'; +var figcaption3 = document.getElementById('figcaption3'); +shouldBe('figcaption3.parentNode.id', '"figcaption2"'); +testParent.innerHTML = '<footer id="footer1">Test that <figcaption id="figcaption5">a figcaption element</figcaption> can be nested inside a footer element.</footer>'; +var figcaption5 = document.getElementById('figcaption5'); +shouldBe('figcaption5.parentNode.id', '"footer1"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><figcaption id="figcaption4">This text should be bold.</figcaption> <span id="span1">This is also bold.</span></b>'; +shouldBe('getStyleValue("figcaption4","font-weight")', '"bold"'); +shouldBe('getStyleValue("span1","font-weight")', '"bold"'); +document.body.removeChild(testParent); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/figure-element.html b/third_party/WebKit/LayoutTests/fast/html/figure-element.html index deb403d..bd4d047 100644 --- a/third_party/WebKit/LayoutTests/fast/html/figure-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/figure-element.html
@@ -4,6 +4,49 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/figure-element.js"></script> +<script> +description('Various tests for the figure element.'); + +function getStyleValue(id, propertyName) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(propertyName); +} + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<figure> default styling:'); +testParent.innerHTML = '<figure id="figure0">element</figure>'; +var emSize = getStyleValue("figure0","font-size"); +shouldBe('getStyleValue("figure0","display")', '"block"'); +shouldBe('getStyleValue("figure0","margin-top")', 'emSize'); +shouldBe('getStyleValue("figure0","margin-right")', '"40px"'); +shouldBe('getStyleValue("figure0","margin-bottom")', 'emSize'); +shouldBe('getStyleValue("figure0","margin-left")', '"40px"'); + +debug('<figure> closes <p>:'); +testParent.innerHTML = '<p>Test that <figure id="figure1">a figure element</figure> closes <p>.</p>'; +var figure1 = document.getElementById('figure1'); +shouldBeFalse('figure1.parentNode.nodeName == "p"'); + +debug('<p> does not close <figure>:'); +testParent.innerHTML = '<figure>Test that <p id="p1">a p element</p> does not close a figure element.</figure>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"FIGURE"'); + +debug('<figure> can be nested inside <figure> or <footer>:'); +testParent.innerHTML = '<figure id="figure2">Test that <figure id="figure3">a figure element</figure> can be nested inside another figure element.</figure>'; +var figure3 = document.getElementById('figure3'); +shouldBe('figure3.parentNode.id', '"figure2"'); +testParent.innerHTML = '<footer id="footer1">Test that <figure id="figure5">a figure element</figure> can be nested inside a footer element.</footer>'; +var figure5 = document.getElementById('figure5'); +shouldBe('figure5.parentNode.id', '"footer1"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><figure id="figure4">This text should be bold.</figure> <span id="span1">This is also bold.</span></b>'; +shouldBe('getStyleValue("figure4","font-weight")', '"bold"'); +shouldBe('getStyleValue("span1","font-weight")', '"bold"'); +document.body.removeChild(testParent); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/footer-element.html b/third_party/WebKit/LayoutTests/fast/html/footer-element.html index b84a92a..8d101b3 100644 --- a/third_party/WebKit/LayoutTests/fast/html/footer-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/footer-element.html
@@ -4,6 +4,51 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/footer-element.js"></script> +<script> +description('Various tests for the footer element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<footer> closes <p>:'); +testParent.innerHTML = '<p>Test that <footer id="footer1">a footer element</footer> closes <p>.</p>'; +var footer1 = document.getElementById('footer1'); +shouldBeFalse('footer1.parentNode.nodeName == "p"'); + +debug('<p> does not close <footer>:'); +testParent.innerHTML = '<footer>Test that <p id="p1">a p element</p> does not close a footer element.</footer>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"FOOTER"'); + +debug('<footer> can be nested inside <footer> or <header>:'); +testParent.innerHTML = '<footer id="footer2">Test that <footer id="footer3">a footer element</footer> can be nested inside another footer element.</footer>'; +var footer3 = document.getElementById('footer3'); +shouldBe('footer3.parentNode.id', '"footer2"'); +testParent.innerHTML = '<header id="header1">Test that <footer id="footer5">a footer element</footer> can be nested inside a header element.</header>'; +var footer5 = document.getElementById('footer5'); +shouldBe('footer5.parentNode.id', '"header1"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><footer id="footer4">This text should be bold.</footer> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("footer4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <footer>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'footer'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"FOOTER"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/header-element.html b/third_party/WebKit/LayoutTests/fast/html/header-element.html index 38ff111..dd76093 100644 --- a/third_party/WebKit/LayoutTests/fast/html/header-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/header-element.html
@@ -4,6 +4,51 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/header-element.js"></script> +<script> +description('Various tests for the header element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<header> closes <p>:'); +testParent.innerHTML = '<p>Test that <header id="header1">a header element</header> closes <p>.</p>'; +var header1 = document.getElementById('header1'); +shouldBeFalse('header1.parentNode.nodeName == "p"'); + +debug('<p> does not close <header>:'); +testParent.innerHTML = '<header>Test that <p id="p1">a p element</p> does not close a header element.</header>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"HEADER"'); + +debug('<header> can be nested inside <header> or <footer>:'); +testParent.innerHTML = '<header id="header2">Test that <header id="header3">a header element</header> can be nested inside another header element.</header>'; +var header3 = document.getElementById('header3'); +shouldBe('header3.parentNode.id', '"header2"'); +testParent.innerHTML = '<footer id="footer1">Test that <header id="header5">a header element</header> can be nested inside a footer element.</footer>'; +var header5 = document.getElementById('header5'); +shouldBe('header5.parentNode.id', '"footer1"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><header id="header4">This text should be bold.</header> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("header4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <header>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'header'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"HEADER"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/hgroup-element.html b/third_party/WebKit/LayoutTests/fast/html/hgroup-element.html index d312854f..f446732 100644 --- a/third_party/WebKit/LayoutTests/fast/html/hgroup-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/hgroup-element.html
@@ -4,6 +4,49 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/hgroup-element.js"></script> +<script> +description('Various tests for the hgroup element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<hgroup> closes <p>:'); +testParent.innerHTML = '<p>Test that <hgroup id="hgroup1"><h1>a hgroup element</h1></hgroup> closes <p>.</p>'; +var hgroup1 = document.getElementById('hgroup1'); +shouldBeFalse('hgroup1.parentNode.nodeName == "p"'); + +debug('<p> does not close <hgroup>:'); +testParent.innerHTML = '<hgroup>Test that <p id="p1">a p element</p> does not close a hgroup element.</hgroup>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"HGROUP"'); + +// Note: hgroup *should* have only h1-h6 elements, but *can* have any elements. +debug('<hgroup> can be nested inside <hgroup>:'); +testParent.innerHTML = '<hgroup id="hgroup2">Test that <hgroup id="hgroup3">a hgroup element</hgroup> can be nested inside another.</hgroup>'; +var hgroup3 = document.getElementById('hgroup3'); +shouldBe('hgroup3.parentNode.id', '"hgroup2"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><hgroup id="hgroup4"><h2>This text should be bold.</h2></hgroup> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("hgroup4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <hgroup>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'hgroup'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"HGROUP"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html b/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html index 4c05b42e..185a2ce7 100644 --- a/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html +++ b/third_party/WebKit/LayoutTests/fast/html/hidden-attr-dom.html
@@ -4,6 +4,35 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/hidden-attr-dom.js"></script> +<script> +description('Various tests for the the hidden IDL attribute.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('The IDL attribute reflects what is present in markup:'); +testParent.innerHTML = '<div id=h1 hidden></div><div id=h2 hidden=false></div><div id=h3 hidden=off></div><div id=s1></div>'; +var h1 = document.getElementById("h1"); +var h2 = document.getElementById("h2"); +var h3 = document.getElementById("h3"); +var s1 = document.getElementById("s1"); + +shouldBeTrue('h1.hidden'); +shouldBeTrue('h2.hidden'); +shouldBeTrue('h3.hidden'); +shouldBeFalse('s1.hidden'); + +debug('Changes via DOM Core are reflected through the IDL attribute:'); + +shouldBeFalse('(h1.removeAttribute("hidden"), h1.hidden)'); +shouldBeTrue('(h1.setAttribute("hidden", ""), h1.hidden)'); +shouldBeTrue('(h2.setAttribute("hidden", ""), h2.hidden)'); +shouldBeTrue('(s1.setAttribute("hidden", ""), s1.hidden)'); + +debug('Changes via IDL attribute are reflected in the core DOM:'); + +shouldBe('(h3.hidden = false, h3.getAttribute("hidden"))', 'null'); +shouldBe('(h3.hidden = true, h3.getAttribute("hidden"))', '""'); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/main-element.html b/third_party/WebKit/LayoutTests/fast/html/main-element.html index ccafcd64..5d0b754 100644 --- a/third_party/WebKit/LayoutTests/fast/html/main-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/main-element.html
@@ -4,6 +4,48 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/main-element.js"></script> +<script> +description('Various tests for the main element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<main> closes <p>:'); +testParent.innerHTML = '<p>Test that <main id="main1">an main element</main> closes <p>.</p>'; +var main1 = document.getElementById('main1'); +shouldBeFalse('main1.parentNode.nodeName == "p"'); + +debug('<p> does not close <main>:'); +testParent.innerHTML = '<main>Test that <p id="p1">a p element</p> does not close an main element.</main>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"MAIN"'); + +debug('<main> can be nested inside <main>:'); +testParent.innerHTML = '<main id="main2">Test that <main id="main3">an main element</main> can be nested inside another.</main>'; +var main3 = document.getElementById('main3'); +shouldBe('main3.parentNode.id', '"main2"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><main id="main4">This text should be bold.</main> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("main4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <main>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'main'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"MAIN"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/mark-element.html b/third_party/WebKit/LayoutTests/fast/html/mark-element.html index 15e798f..f0bd234 100644 --- a/third_party/WebKit/LayoutTests/fast/html/mark-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/mark-element.html
@@ -4,6 +4,30 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/mark-element.js"></script> +<script> +description('Various tests for the mark element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<p> closes <mark>:'); +testParent.innerHTML = '<mark>Test that <p id="paragraph1">a p element</p> closes <mark>.</p>'; +var paragraph1 = document.getElementById('paragraph1'); +shouldBeFalse('paragraph1.parentNode.nodeName == "mark"'); + +debug('<b> does not close <mark>:'); +testParent.innerHTML = '<mark>Test that <b id="b1">a b element</b> does not close a mark element.</mark>'; +var b1 = document.getElementById('b1'); +shouldBe('b1.parentNode.nodeName', '"MARK"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><mark id="mark2">This text should be bold.</mark> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("mark2")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/numbered-header-element.html b/third_party/WebKit/LayoutTests/fast/html/numbered-header-element.html index 53c94ee..9350c08 100644 --- a/third_party/WebKit/LayoutTests/fast/html/numbered-header-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/numbered-header-element.html
@@ -4,6 +4,246 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/numbered-header-element.js"></script> +<script> +// Test for WebKit Bug 15136 - HTML5 spec violation: </h1> doesn't end <h3> element in Webkit +// https://bugs.webkit.org/show_bug.cgi?id=15136 +// rdar://problem/5762882 + +description('Test that any numbered header element end tag can close any other open numbered header element.'); + +var testParent = document.createElement('div'); +testParent.id = 'test0'; +document.body.appendChild(testParent); + +// h1 + +debug('<h1> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h1>:'); +testParent.innerHTML = '<h1 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h1.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +// h2 + +debug('<h1> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h2>:'); +testParent.innerHTML = '<h2 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h2.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +// h3 + +debug('<h1> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h3>:'); +testParent.innerHTML = '<h3 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h3.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +// h4 + +debug('<h1> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h4>:'); +testParent.innerHTML = '<h4 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h4.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +// h5 + +debug('<h1> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h5>:'); +testParent.innerHTML = '<h5 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h5.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +// h6 + +debug('<h1> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h2> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h3> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h4> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h5> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +debug('<h6> closes <h6>:'); +testParent.innerHTML = '<h6 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h6.</p>'; +var h1 = document.getElementById('test2'); +shouldBeFalse('test2.parentNode.id == "test1"'); +shouldBeTrue('test2.parentNode.id == "test0"'); + +document.body.removeChild(testParent); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/TEMPLATE.html b/third_party/WebKit/LayoutTests/fast/html/script-tests/TEMPLATE.html deleted file mode 100644 index 397d741..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/TEMPLATE.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<body> -<script src="YOUR_JS_FILE_HERE"></script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/article-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/article-element.js deleted file mode 100644 index 5b3697e..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/article-element.js +++ /dev/null
@@ -1,41 +0,0 @@ -description('Various tests for the article element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<article> closes <p>:'); -testParent.innerHTML = '<p>Test that <article id="article1">an article element</article> closes <p>.</p>'; -var article1 = document.getElementById('article1'); -shouldBeFalse('article1.parentNode.nodeName == "p"'); - -debug('<p> does not close <article>:'); -testParent.innerHTML = '<article>Test that <p id="p1">a p element</p> does not close an article element.</article>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"ARTICLE"'); - -debug('<article> can be nested inside <article>:'); -testParent.innerHTML = '<article id="article2">Test that <article id="article3">an article element</article> can be nested inside another.</article>'; -var article3 = document.getElementById('article3'); -shouldBe('article3.parentNode.id', '"article2"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><article id="article4">This text should be bold.</article> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("article4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <article>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'article'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/aside-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/aside-element.js deleted file mode 100644 index 573b7842..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/aside-element.js +++ /dev/null
@@ -1,41 +0,0 @@ -description('Various tests for the aside element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<aside> closes <p>:'); -testParent.innerHTML = '<p>Test that <aside id="aside1">an aside element</aside> closes <p>.</p>'; -var aside1 = document.getElementById('aside1'); -shouldBeFalse('aside1.parentNode.nodeName == "p"'); - -debug('<p> does not close <aside>:'); -testParent.innerHTML = '<aside>Test that <p id="p1">a p element</p> does not close an aside element.</aside>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"ASIDE"'); - -debug('<aside> can be nested inside <aside>:'); -testParent.innerHTML = '<aside id="aside2">Test that <aside id="aside3">an aside element</aside> can be nested inside another.</aside>'; -var aside3 = document.getElementById('aside3'); -shouldBe('aside3.parentNode.id', '"aside2"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><aside id="aside4">This text should be bold.</aside> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("aside4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <aside>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'aside'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"ASIDE"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/disable-style-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/disable-style-element.js deleted file mode 100644 index 7f4c4401..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/disable-style-element.js +++ /dev/null
@@ -1,37 +0,0 @@ -description('Test the disabled property on a style element.'); - -var styleElement = document.getElementById('s'); -var console = document.getElementById('console'); -var testElement = document.createElement('div'); -testElement.innerText = "Test element"; -testElement.className = 'test'; -document.body.appendChild(testElement); - -shouldBeFalse('styleElement.disabled'); -shouldBe('window.getComputedStyle(testElement).color', '"rgb(0, 128, 0)"'); - -styleElement.disabled = true -shouldBeTrue('styleElement.disabled'); -shouldBe('window.getComputedStyle(testElement).color', '"rgb(255, 0, 0)"'); - -// Test reflection in the sheet. -shouldBeTrue('styleElement.sheet.disabled'); -styleElement.sheet.disabled = false -shouldBeFalse('styleElement.sheet.disabled'); -shouldBeFalse('styleElement.disabled'); -shouldBe('window.getComputedStyle(testElement).color', '"rgb(0, 128, 0)"'); - -// Test disconnected element -var newStyleElement = document.createElement('style'); -shouldBeFalse('newStyleElement.disabled'); -newStyleElement.disabled = true -shouldBeFalse('newStyleElement.disabled'); - -// Test non-CSS element -var otherStyle = document.getElementById('non-css'); -shouldBeFalse('otherStyle.disabled'); -otherStyle.disabled = true -shouldBeFalse('otherStyle.disabled'); - - -document.body.removeChild(testElement);
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/figcaption-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/figcaption-element.js deleted file mode 100644 index 1c73adf..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/figcaption-element.js +++ /dev/null
@@ -1,38 +0,0 @@ -description('Various tests for the figcaption element.'); - -function getStyleValue(id, propertyName) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(propertyName); -} - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<figcaption> default styling:'); -testParent.innerHTML = '<figcaption id="figcaption0">element</figure>'; -var emSize = getStyleValue("figcaption0","font-size"); -shouldBe('getStyleValue("figcaption0","display")', '"block"'); - -debug('<figcaption> closes <p>:'); -testParent.innerHTML = '<p>Test that <figcaption id="figcaption1">a figcaption element</figcaption> closes <p>.</p>'; -var figcaption1 = document.getElementById('figcaption1'); -shouldBeFalse('figcaption1.parentNode.nodeName == "p"'); - -debug('<p> does not close <figcaption>:'); -testParent.innerHTML = '<figcaption>Test that <p id="p1">a p element</p> does not close a figcaption element.</figcaption>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"FIGCAPTION"'); - -debug('<figcaption> can be nested inside <figcaption> or <footer>:'); -testParent.innerHTML = '<figcaption id="figcaption2">Test that <figcaption id="figcaption3">a figcaption element</figcaption> can be nested inside another figcaption element.</figcaption>'; -var figcaption3 = document.getElementById('figcaption3'); -shouldBe('figcaption3.parentNode.id', '"figcaption2"'); -testParent.innerHTML = '<footer id="footer1">Test that <figcaption id="figcaption5">a figcaption element</figcaption> can be nested inside a footer element.</footer>'; -var figcaption5 = document.getElementById('figcaption5'); -shouldBe('figcaption5.parentNode.id', '"footer1"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><figcaption id="figcaption4">This text should be bold.</figcaption> <span id="span1">This is also bold.</span></b>'; -shouldBe('getStyleValue("figcaption4","font-weight")', '"bold"'); -shouldBe('getStyleValue("span1","font-weight")', '"bold"'); -document.body.removeChild(testParent); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/figure-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/figure-element.js deleted file mode 100644 index acd57654..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/figure-element.js +++ /dev/null
@@ -1,42 +0,0 @@ -description('Various tests for the figure element.'); - -function getStyleValue(id, propertyName) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(propertyName); -} - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<figure> default styling:'); -testParent.innerHTML = '<figure id="figure0">element</figure>'; -var emSize = getStyleValue("figure0","font-size"); -shouldBe('getStyleValue("figure0","display")', '"block"'); -shouldBe('getStyleValue("figure0","margin-top")', 'emSize'); -shouldBe('getStyleValue("figure0","margin-right")', '"40px"'); -shouldBe('getStyleValue("figure0","margin-bottom")', 'emSize'); -shouldBe('getStyleValue("figure0","margin-left")', '"40px"'); - -debug('<figure> closes <p>:'); -testParent.innerHTML = '<p>Test that <figure id="figure1">a figure element</figure> closes <p>.</p>'; -var figure1 = document.getElementById('figure1'); -shouldBeFalse('figure1.parentNode.nodeName == "p"'); - -debug('<p> does not close <figure>:'); -testParent.innerHTML = '<figure>Test that <p id="p1">a p element</p> does not close a figure element.</figure>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"FIGURE"'); - -debug('<figure> can be nested inside <figure> or <footer>:'); -testParent.innerHTML = '<figure id="figure2">Test that <figure id="figure3">a figure element</figure> can be nested inside another figure element.</figure>'; -var figure3 = document.getElementById('figure3'); -shouldBe('figure3.parentNode.id', '"figure2"'); -testParent.innerHTML = '<footer id="footer1">Test that <figure id="figure5">a figure element</figure> can be nested inside a footer element.</footer>'; -var figure5 = document.getElementById('figure5'); -shouldBe('figure5.parentNode.id', '"footer1"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><figure id="figure4">This text should be bold.</figure> <span id="span1">This is also bold.</span></b>'; -shouldBe('getStyleValue("figure4","font-weight")', '"bold"'); -shouldBe('getStyleValue("span1","font-weight")', '"bold"'); -document.body.removeChild(testParent); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/footer-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/footer-element.js deleted file mode 100644 index 2cf93913..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/footer-element.js +++ /dev/null
@@ -1,44 +0,0 @@ -description('Various tests for the footer element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<footer> closes <p>:'); -testParent.innerHTML = '<p>Test that <footer id="footer1">a footer element</footer> closes <p>.</p>'; -var footer1 = document.getElementById('footer1'); -shouldBeFalse('footer1.parentNode.nodeName == "p"'); - -debug('<p> does not close <footer>:'); -testParent.innerHTML = '<footer>Test that <p id="p1">a p element</p> does not close a footer element.</footer>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"FOOTER"'); - -debug('<footer> can be nested inside <footer> or <header>:'); -testParent.innerHTML = '<footer id="footer2">Test that <footer id="footer3">a footer element</footer> can be nested inside another footer element.</footer>'; -var footer3 = document.getElementById('footer3'); -shouldBe('footer3.parentNode.id', '"footer2"'); -testParent.innerHTML = '<header id="header1">Test that <footer id="footer5">a footer element</footer> can be nested inside a header element.</header>'; -var footer5 = document.getElementById('footer5'); -shouldBe('footer5.parentNode.id', '"header1"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><footer id="footer4">This text should be bold.</footer> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("footer4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <footer>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'footer'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"FOOTER"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/header-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/header-element.js deleted file mode 100644 index 27a8467..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/header-element.js +++ /dev/null
@@ -1,44 +0,0 @@ -description('Various tests for the header element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<header> closes <p>:'); -testParent.innerHTML = '<p>Test that <header id="header1">a header element</header> closes <p>.</p>'; -var header1 = document.getElementById('header1'); -shouldBeFalse('header1.parentNode.nodeName == "p"'); - -debug('<p> does not close <header>:'); -testParent.innerHTML = '<header>Test that <p id="p1">a p element</p> does not close a header element.</header>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"HEADER"'); - -debug('<header> can be nested inside <header> or <footer>:'); -testParent.innerHTML = '<header id="header2">Test that <header id="header3">a header element</header> can be nested inside another header element.</header>'; -var header3 = document.getElementById('header3'); -shouldBe('header3.parentNode.id', '"header2"'); -testParent.innerHTML = '<footer id="footer1">Test that <header id="header5">a header element</header> can be nested inside a footer element.</footer>'; -var header5 = document.getElementById('header5'); -shouldBe('header5.parentNode.id', '"footer1"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><header id="header4">This text should be bold.</header> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("header4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <header>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'header'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"HEADER"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/hgroup-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/hgroup-element.js deleted file mode 100644 index afd226e..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/hgroup-element.js +++ /dev/null
@@ -1,42 +0,0 @@ -description('Various tests for the hgroup element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<hgroup> closes <p>:'); -testParent.innerHTML = '<p>Test that <hgroup id="hgroup1"><h1>a hgroup element</h1></hgroup> closes <p>.</p>'; -var hgroup1 = document.getElementById('hgroup1'); -shouldBeFalse('hgroup1.parentNode.nodeName == "p"'); - -debug('<p> does not close <hgroup>:'); -testParent.innerHTML = '<hgroup>Test that <p id="p1">a p element</p> does not close a hgroup element.</hgroup>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"HGROUP"'); - -// Note: hgroup *should* have only h1-h6 elements, but *can* have any elements. -debug('<hgroup> can be nested inside <hgroup>:'); -testParent.innerHTML = '<hgroup id="hgroup2">Test that <hgroup id="hgroup3">a hgroup element</hgroup> can be nested inside another.</hgroup>'; -var hgroup3 = document.getElementById('hgroup3'); -shouldBe('hgroup3.parentNode.id', '"hgroup2"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><hgroup id="hgroup4"><h2>This text should be bold.</h2></hgroup> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("hgroup4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <hgroup>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'hgroup'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"HGROUP"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/hidden-attr-dom.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/hidden-attr-dom.js deleted file mode 100644 index defee60..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/hidden-attr-dom.js +++ /dev/null
@@ -1,28 +0,0 @@ -description('Various tests for the the hidden IDL attribute.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('The IDL attribute reflects what is present in markup:'); -testParent.innerHTML = '<div id=h1 hidden></div><div id=h2 hidden=false></div><div id=h3 hidden=off></div><div id=s1></div>'; -var h1 = document.getElementById("h1"); -var h2 = document.getElementById("h2"); -var h3 = document.getElementById("h3"); -var s1 = document.getElementById("s1"); - -shouldBeTrue('h1.hidden'); -shouldBeTrue('h2.hidden'); -shouldBeTrue('h3.hidden'); -shouldBeFalse('s1.hidden'); - -debug('Changes via DOM Core are reflected through the IDL attribute:'); - -shouldBeFalse('(h1.removeAttribute("hidden"), h1.hidden)'); -shouldBeTrue('(h1.setAttribute("hidden", ""), h1.hidden)'); -shouldBeTrue('(h2.setAttribute("hidden", ""), h2.hidden)'); -shouldBeTrue('(s1.setAttribute("hidden", ""), s1.hidden)'); - -debug('Changes via IDL attribute are reflected in the core DOM:'); - -shouldBe('(h3.hidden = false, h3.getAttribute("hidden"))', 'null'); -shouldBe('(h3.hidden = true, h3.getAttribute("hidden"))', '""');
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/main-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/main-element.js deleted file mode 100644 index 70b690b..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/main-element.js +++ /dev/null
@@ -1,41 +0,0 @@ -description('Various tests for the main element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<main> closes <p>:'); -testParent.innerHTML = '<p>Test that <main id="main1">an main element</main> closes <p>.</p>'; -var main1 = document.getElementById('main1'); -shouldBeFalse('main1.parentNode.nodeName == "p"'); - -debug('<p> does not close <main>:'); -testParent.innerHTML = '<main>Test that <p id="p1">a p element</p> does not close an main element.</main>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"MAIN"'); - -debug('<main> can be nested inside <main>:'); -testParent.innerHTML = '<main id="main2">Test that <main id="main3">an main element</main> can be nested inside another.</main>'; -var main3 = document.getElementById('main3'); -shouldBe('main3.parentNode.id', '"main2"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><main id="main4">This text should be bold.</main> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("main4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <main>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'main'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"MAIN"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/mark-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/mark-element.js deleted file mode 100644 index 9eaf3ae..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/mark-element.js +++ /dev/null
@@ -1,23 +0,0 @@ -description('Various tests for the mark element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<p> closes <mark>:'); -testParent.innerHTML = '<mark>Test that <p id="paragraph1">a p element</p> closes <mark>.</p>'; -var paragraph1 = document.getElementById('paragraph1'); -shouldBeFalse('paragraph1.parentNode.nodeName == "mark"'); - -debug('<b> does not close <mark>:'); -testParent.innerHTML = '<mark>Test that <b id="b1">a b element</b> does not close a mark element.</mark>'; -var b1 = document.getElementById('b1'); -shouldBe('b1.parentNode.nodeName', '"MARK"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><mark id="mark2">This text should be bold.</mark> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("mark2")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent);
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/numbered-header-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/numbered-header-element.js deleted file mode 100644 index 277db89b..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/numbered-header-element.js +++ /dev/null
@@ -1,239 +0,0 @@ -// Test for WebKit Bug 15136 - HTML5 spec violation: </h1> doesn't end <h3> element in Webkit -// https://bugs.webkit.org/show_bug.cgi?id=15136 -// rdar://problem/5762882 - -description('Test that any numbered header element end tag can close any other open numbered header element.'); - -var testParent = document.createElement('div'); -testParent.id = 'test0'; -document.body.appendChild(testParent); - -// h1 - -debug('<h1> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h1>:'); -testParent.innerHTML = '<h1 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h1.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -// h2 - -debug('<h1> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h2>:'); -testParent.innerHTML = '<h2 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h2.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -// h3 - -debug('<h1> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h3>:'); -testParent.innerHTML = '<h3 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h3.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -// h4 - -debug('<h1> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h4>:'); -testParent.innerHTML = '<h4 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h4.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -// h5 - -debug('<h1> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h5>:'); -testParent.innerHTML = '<h5 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h5.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -// h6 - -debug('<h1> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h1><div id="test2"></div><p>Test that <h1> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h2> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h2><div id="test2"></div><p>Test that <h2> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h3> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h3><div id="test2"></div><p>Test that <h3> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h4> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h4><div id="test2"></div><p>Test that <h4> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h5> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h5><div id="test2"></div><p>Test that <h5> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -debug('<h6> closes <h6>:'); -testParent.innerHTML = '<h6 id="test1"></h6><div id="test2"></div><p>Test that <h6> closes <h6.</p>'; -var h1 = document.getElementById('test2'); -shouldBeFalse('test2.parentNode.id == "test1"'); -shouldBeTrue('test2.parentNode.id == "test0"'); - -document.body.removeChild(testParent);
diff --git a/third_party/WebKit/LayoutTests/fast/html/script-tests/section-element.js b/third_party/WebKit/LayoutTests/fast/html/script-tests/section-element.js deleted file mode 100644 index 82f96e18..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/script-tests/section-element.js +++ /dev/null
@@ -1,41 +0,0 @@ -description('Various tests for the section element.'); - -var testParent = document.createElement('div'); -document.body.appendChild(testParent); - -debug('<section> closes <p>:'); -testParent.innerHTML = '<p>Test that <section id="section1">a section element</section> closes <p>.</p>'; -var section1 = document.getElementById('section1'); -shouldBeFalse('section1.parentNode.nodeName == "p"'); - -debug('<p> does not close <section>:'); -testParent.innerHTML = '<section>Test that <p id="p1">a p element</p> does not close a section element.</section>'; -var p1 = document.getElementById('p1'); -shouldBe('p1.parentNode.nodeName', '"SECTION"'); - -debug('<section> can be nested inside <section>:'); -testParent.innerHTML = '<section id="section2">Test that <section id="section3">a section element</section> can be nested inside another.</section>'; -var section3 = document.getElementById('section3'); -shouldBe('section3.parentNode.id', '"section2"'); - -debug('Residual style:'); -testParent.innerHTML = '<b><section id="section4">This text should be bold.</section> <span id="span1">This is also bold.</span></b>'; -function getWeight(id) { - return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); -} -shouldBe('getWeight("section4")', '"bold"'); -shouldBe('getWeight("span1")', '"bold"'); -document.body.removeChild(testParent); - -debug('FormatBlock:'); -var editable = document.createElement('div'); -editable.innerHTML = '[<span id="span2">The text will be a child of <section>.</span>]'; -document.body.appendChild(editable); -editable.contentEditable = true; -var selection = window.getSelection(); -selection.selectAllChildren(editable); -document.execCommand('FormatBlock', false, 'section'); -selection.removeAllRanges(); -shouldBe('document.getElementById("span2").parentNode.nodeName', '"SECTION"'); -document.body.removeChild(editable); -
diff --git a/third_party/WebKit/LayoutTests/fast/html/section-element.html b/third_party/WebKit/LayoutTests/fast/html/section-element.html index b960227..7bd78ce8 100644 --- a/third_party/WebKit/LayoutTests/fast/html/section-element.html +++ b/third_party/WebKit/LayoutTests/fast/html/section-element.html
@@ -4,6 +4,48 @@ <script src="../../resources/js-test.js"></script> </head> <body> -<script src="script-tests/section-element.js"></script> +<script> +description('Various tests for the section element.'); + +var testParent = document.createElement('div'); +document.body.appendChild(testParent); + +debug('<section> closes <p>:'); +testParent.innerHTML = '<p>Test that <section id="section1">a section element</section> closes <p>.</p>'; +var section1 = document.getElementById('section1'); +shouldBeFalse('section1.parentNode.nodeName == "p"'); + +debug('<p> does not close <section>:'); +testParent.innerHTML = '<section>Test that <p id="p1">a p element</p> does not close a section element.</section>'; +var p1 = document.getElementById('p1'); +shouldBe('p1.parentNode.nodeName', '"SECTION"'); + +debug('<section> can be nested inside <section>:'); +testParent.innerHTML = '<section id="section2">Test that <section id="section3">a section element</section> can be nested inside another.</section>'; +var section3 = document.getElementById('section3'); +shouldBe('section3.parentNode.id', '"section2"'); + +debug('Residual style:'); +testParent.innerHTML = '<b><section id="section4">This text should be bold.</section> <span id="span1">This is also bold.</span></b>'; +function getWeight(id) { + return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight'); +} +shouldBe('getWeight("section4")', '"bold"'); +shouldBe('getWeight("span1")', '"bold"'); +document.body.removeChild(testParent); + +debug('FormatBlock:'); +var editable = document.createElement('div'); +editable.innerHTML = '[<span id="span2">The text will be a child of <section>.</span>]'; +document.body.appendChild(editable); +editable.contentEditable = true; +var selection = window.getSelection(); +selection.selectAllChildren(editable); +document.execCommand('FormatBlock', false, 'section'); +selection.removeAllRanges(); +shouldBe('document.getElementById("span2").parentNode.nodeName', '"SECTION"'); +document.body.removeChild(editable); + +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/workers/resources/worker-atomics-wait.js b/third_party/WebKit/LayoutTests/fast/workers/resources/worker-atomics-wait.js new file mode 100644 index 0000000..552235d0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/workers/resources/worker-atomics-wait.js
@@ -0,0 +1,10 @@ +self.addEventListener('message', function(e) { + var view = e.data; + try { + Atomics.wait(view, 0, 0, 0); + postMessage("PASS: Atomics.wait is allowed in a worker."); + } catch(e) { + postMessage("FAIL: Atomics.wait is not allowed in a worker."); + } + postMessage("DONE"); +});
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt new file mode 100644 index 0000000..f10bb142 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt
@@ -0,0 +1,4 @@ +Test that Atomics.wait is not allowed on the main thread. + +SharedArrayBuffers are not enabled -- skipping test. +
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait.html b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait.html new file mode 100644 index 0000000..bd47036 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<body> +<p>Test that Atomics.wait is not allowed on the main thread.</p> +<div id="result"></div> +<script type="text/javascript"> +function log(message) +{ + document.getElementById("result").innerHTML += message + "</br>"; +} + +if (window.testRunner) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); +} + +if (window.internals && internals.runtimeFlags.sharedArrayBufferEnabled && window.SharedArrayBuffer) { + var view = new Int32Array(new SharedArrayBuffer(4)); + try { + Atomics.wait(view, 0, 0, 0); + log("FAIL: Calling Atomics.wait on the main thread did not throw."); + } catch (e) { + log("PASS: Calling Atomics.wait on the main thread throws."); + } + + var worker = new Worker('resources/worker-atomics-wait.js'); + worker.postMessage(view); + + worker.onmessage = function(e) { + log(e.data); + if (e.data == 'DONE') { + if (window.testRunner) + testRunner.notifyDone(); + } + }; +} else { + log("SharedArrayBuffers are not enabled -- skipping test."); + if (window.testRunner) + testRunner.notifyDone(); +} + +</script> +</body> +</html> +
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/abspos-dialog-layout-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/abspos-dialog-layout-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/abspos-dialog-layout-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/abspos-dialog-layout-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/abspos-dialog-layout.html b/third_party/WebKit/LayoutTests/html/dialog/abspos-dialog-layout.html similarity index 98% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/abspos-dialog-layout.html rename to third_party/WebKit/LayoutTests/html/dialog/abspos-dialog-layout.html index e88d8f3..6d42d70 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/abspos-dialog-layout.html +++ b/third_party/WebKit/LayoutTests/html/dialog/abspos-dialog-layout.html
@@ -1,6 +1,6 @@ <!DOCTYPE html> <link href="resources/dialog-layout.css" rel="stylesheet"> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <dialog id="dialog">It is my dialog.</dialog> <div id="absolute-div"> <div id="relative-div"></div>
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-descendant-selector-expected.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-descendant-selector-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-descendant-selector-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-descendant-selector-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-descendant-selector.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-descendant-selector.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-descendant-selector.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-descendant-selector.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-does-not-inherit-expected.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-does-not-inherit-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-does-not-inherit-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-does-not-inherit-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-does-not-inherit.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-does-not-inherit.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-does-not-inherit.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-does-not-inherit.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-dynamic-style-change-expected.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-dynamic-style-change-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-dynamic-style-change-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-dynamic-style-change-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-dynamic-style-change.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-dynamic-style-change.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-dynamic-style-change.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-dynamic-style-change.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-in-flow-expected.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-in-flow-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-in-flow-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-in-flow-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-in-flow.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-in-flow.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-in-flow.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-in-flow.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-stacking-order-expected.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-stacking-order-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-stacking-order-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-stacking-order-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/backdrop-stacking-order.html b/third_party/WebKit/LayoutTests/html/dialog/backdrop-stacking-order.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/backdrop-stacking-order.html rename to third_party/WebKit/LayoutTests/html/dialog/backdrop-stacking-order.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/closed-dialog-does-not-block-mouse-events-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/closed-dialog-does-not-block-mouse-events-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html b/third_party/WebKit/LayoutTests/html/dialog/closed-dialog-does-not-block-mouse-events.html similarity index 95% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html rename to third_party/WebKit/LayoutTests/html/dialog/closed-dialog-does-not-block-mouse-events.html index 0b7ad1c..69935c2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/closed-dialog-does-not-block-mouse-events.html +++ b/third_party/WebKit/LayoutTests/html/dialog/closed-dialog-does-not-block-mouse-events.html
@@ -8,7 +8,7 @@ background: red; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <div id="div"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-multiple-times-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-multiple-times-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-multiple-times-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-multiple-times-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-multiple-times.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-multiple-times.html similarity index 90% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-multiple-times.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-multiple-times.html index 6abf6df..90685e8e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus-multiple-times.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus-multiple-times.html
@@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> -<script src="../../forms/resources/common.js"></script> +<script src="../../resources/js-test.js"></script> +<script src="../../fast/forms/resources/common.js"></script> <script> description('Tests autofocus is run every time a dialog is opened.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus.html index 421f7f0c2..113eecc 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-autofocus.html
@@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> -<script src="../../forms/resources/common.js"></script> +<script src="../../resources/js-test.js"></script> +<script src="../../fast/forms/resources/common.js"></script> <script> description('Tests autofocus when a modal dialog is opened.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-canceling-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-canceling-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-canceling.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-canceling.html index cdf0168..3ca9f50 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-canceling.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-canceling.html
@@ -20,7 +20,7 @@ background: yellow; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog id="bottom">
diff --git a/third_party/WebKit/LayoutTests/dialog/dialog-close-event-async.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-close-event-async.html similarity index 87% rename from third_party/WebKit/LayoutTests/dialog/dialog-close-event-async.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-close-event-async.html index cae2619..e113d84 100644 --- a/third_party/WebKit/LayoutTests/dialog/dialog-close-event-async.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-close-event-async.html
@@ -4,8 +4,8 @@ <title>dialog element: close()</title> <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> <link rel=help href="https://html.spec.whatwg.org/multipage/#the-dialog-element"> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> </head> <body> <dialog id="d1" open>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-close-event-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-close-event-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-close-event.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-close-event.html index ca843ec..1bd6161 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-close-event.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-close-event.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog></dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-enabled-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-enabled-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-enabled.html similarity index 84% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-enabled.html index 3f64751..5f56c45 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-enabled.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-enabled.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog id="mydialog"></dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-open-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-open-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-open-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-open-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-open.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-open.html similarity index 93% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-open.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-open.html index a760979..c0d82b37 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-open.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-open.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog id="mydialog">It's my dialog.</dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-return-value-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-return-value-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-return-value.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-return-value.html index e051e5b..34c0b81 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-return-value.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog id="test-dialog"></dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-scrolled-viewport-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-scrolled-viewport-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-scrolled-viewport.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-scrolled-viewport.html index 2ee7f26..15ae7bc 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-scrolled-viewport.html
@@ -14,7 +14,7 @@ position: fixed; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body style="height: 10000px; width: 10000px"> <div style="position: absolute; top: 5000px; left: 5000px; width: 20px;">
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/dialog-show-modal-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/dialog-show-modal-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal.html b/third_party/WebKit/LayoutTests/html/dialog/dialog-show-modal.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal.html rename to third_party/WebKit/LayoutTests/html/dialog/dialog-show-modal.html index 9f4c83f..0da8c81 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dialog-show-modal.html +++ b/third_party/WebKit/LayoutTests/html/dialog/dialog-show-modal.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog id="mydialog">It's my dialog.</dialog>
diff --git a/third_party/WebKit/LayoutTests/dialog/dialogs-with-no-backdrop-expected.html b/third_party/WebKit/LayoutTests/html/dialog/dialogs-with-no-backdrop-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/dialogs-with-no-backdrop-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/dialogs-with-no-backdrop-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/dialogs-with-no-backdrop.html b/third_party/WebKit/LayoutTests/html/dialog/dialogs-with-no-backdrop.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/dialogs-with-no-backdrop.html rename to third_party/WebKit/LayoutTests/html/dialog/dialogs-with-no-backdrop.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer-expected.html b/third_party/WebKit/LayoutTests/html/dialog/dont-share-style-to-top-layer-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/dont-share-style-to-top-layer-expected.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer.html b/third_party/WebKit/LayoutTests/html/dialog/dont-share-style-to-top-layer.html similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/dont-share-style-to-top-layer.html rename to third_party/WebKit/LayoutTests/html/dialog/dont-share-style-to-top-layer.html
diff --git a/third_party/WebKit/LayoutTests/dialog/element-removed-from-top-layer-has-original-position-expected.html b/third_party/WebKit/LayoutTests/html/dialog/element-removed-from-top-layer-has-original-position-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/element-removed-from-top-layer-has-original-position-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/element-removed-from-top-layer-has-original-position-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/element-removed-from-top-layer-has-original-position.html b/third_party/WebKit/LayoutTests/html/dialog/element-removed-from-top-layer-has-original-position.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/element-removed-from-top-layer-has-original-position.html rename to third_party/WebKit/LayoutTests/html/dialog/element-removed-from-top-layer-has-original-position.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/fixpos-dialog-layout-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/fixpos-dialog-layout-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout.html b/third_party/WebKit/LayoutTests/html/dialog/fixpos-dialog-layout.html similarity index 98% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout.html rename to third_party/WebKit/LayoutTests/html/dialog/fixpos-dialog-layout.html index b05e74a..25ade91f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/fixpos-dialog-layout.html +++ b/third_party/WebKit/LayoutTests/html/dialog/fixpos-dialog-layout.html
@@ -5,7 +5,7 @@ position: fixed; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <dialog id="dialog">It is my dialog.</dialog> <div id="absolute-div"> <div id="relative-div"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/form-method-dialog-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/form-method-dialog-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/form-method-dialog-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/form-method-dialog-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/form-method-dialog.html b/third_party/WebKit/LayoutTests/html/dialog/form-method-dialog.html similarity index 98% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/form-method-dialog.html rename to third_party/WebKit/LayoutTests/html/dialog/form-method-dialog.html index d3933c1..8815d81 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/form-method-dialog.html +++ b/third_party/WebKit/LayoutTests/html/dialog/form-method-dialog.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <style> /* Position on an integer offset to avoid rounding errors during the test to click on a coordinate. */ #image {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-does-not-match-disabled-selector-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-does-not-match-disabled-selector-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector.html b/third_party/WebKit/LayoutTests/html/dialog/inert-does-not-match-disabled-selector.html similarity index 92% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-does-not-match-disabled-selector.html index fd22bfa9f..ec40c3c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-does-not-match-disabled-selector.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-does-not-match-disabled-selector.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <style> button { color: green;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-focus-in-frames-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-focus-in-frames-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-focus-in-frames-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-focus-in-frames-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-focus-in-frames.html b/third_party/WebKit/LayoutTests/html/dialog/inert-focus-in-frames.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-focus-in-frames.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-focus-in-frames.html index 92fa36a..64815f7f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-focus-in-frames.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-focus-in-frames.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <script> description('Tests inert node focusing across frames and iframes.'); if (window.testRunner)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-inlines-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-inlines-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-inlines-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-inlines-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-inlines.html b/third_party/WebKit/LayoutTests/html/dialog/inert-inlines.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-inlines.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-inlines.html index 8d95ae6..e050ce0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-inlines.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-inlines.html
@@ -6,7 +6,7 @@ width: 50px; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <a id="a" href="javascript:void(0)">Click me</a>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-label-focus-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-label-focus-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-label-focus-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-label-focus-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-label-focus.html b/third_party/WebKit/LayoutTests/html/dialog/inert-label-focus.html similarity index 95% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-label-focus.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-label-focus.html index f98cc72..73fce09 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-label-focus.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-label-focus.html
@@ -1,6 +1,6 @@ <!DOCTYPE html> <html> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <label for="submit">Label for Submit</label> <dialog> <input id="text" type="text">
diff --git a/third_party/WebKit/LayoutTests/dialog/inert-node-is-not-highlighted-expected.html b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-not-highlighted-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/inert-node-is-not-highlighted-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-not-highlighted-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/inert-node-is-not-highlighted.html b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-not-highlighted.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/inert-node-is-not-highlighted.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-not-highlighted.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-uneditable-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-uneditable-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-uneditable.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-uneditable.html index 7256114..850171a7 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-uneditable.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-uneditable.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <span id="not-editable" contenteditable>I'm not editable.</span>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unfocusable-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unfocusable-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable.html b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unfocusable.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unfocusable.html index 9e2e6b4..1c62be0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unfocusable.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body id="body" tabindex="1"> <dialog id="top-dialog" tabindex="1" style="width: 100px; top: 30px"><button id="top-dialog-button">I get focus</button></dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unselectable-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unselectable-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable.html b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unselectable.html similarity index 89% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable.html rename to third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unselectable.html index a393da6..848a70b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable.html +++ b/third_party/WebKit/LayoutTests/html/dialog/inert-node-is-unselectable.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> Here is a text node you can't select.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-ancestor-is-inert-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-ancestor-is-inert-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-ancestor-is-inert-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-ancestor-is-inert-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-ancestor-is-inert.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-ancestor-is-inert.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-ancestor-is-inert.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-ancestor-is-inert.html index 554664cd..ea0d9c6 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-ancestor-is-inert.html +++ b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-ancestor-is-inert.html
@@ -23,7 +23,7 @@ display: none; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <div id="ancestor">
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-backdrop-expected.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-backdrop-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-backdrop-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-backdrop-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-backdrop.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-backdrop.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-backdrop.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-backdrop.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-blocks-mouse-events-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-blocks-mouse-events-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-blocks-mouse-events.html similarity index 97% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-blocks-mouse-events.html index a725e10..3c6db4ab 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-blocks-mouse-events.html +++ b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-blocks-mouse-events.html
@@ -22,7 +22,7 @@ background: red; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <div id="inert-div"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-inert-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-distributed-child-is-not-inert-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-inert-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-distributed-child-is-not-inert-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-inert.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-distributed-child-is-not-inert.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-inert.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-distributed-child-is-not-inert.html index eba625b..a0292a1 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/modal-dialog-distributed-child-is-not-inert.html +++ b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-distributed-child-is-not-inert.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog>
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-generated-content-expected.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-generated-content-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-generated-content-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-generated-content-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-generated-content.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-generated-content.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-generated-content.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-generated-content.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-in-replaced-renderer-expected.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-replaced-renderer-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-in-replaced-renderer-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-replaced-renderer-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-in-replaced-renderer.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-replaced-renderer.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-in-replaced-renderer.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-replaced-renderer.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-in-table-column-expected.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-table-column-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-in-table-column-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-table-column-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-in-table-column.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-table-column.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-in-table-column.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-in-table-column.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-scroll-height-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-scroll-height-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-scroll-height-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-scroll-height-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-scroll-height.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-scroll-height.html similarity index 88% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-scroll-height.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-scroll-height.html index c542817..68a364d92 100644 --- a/third_party/WebKit/LayoutTests/dialog/modal-dialog-scroll-height.html +++ b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-scroll-height.html
@@ -16,7 +16,7 @@ <dialog> <div class="spacer"></div> </dialog> -<script src="../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <script> document.querySelector('dialog').showModal();
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-sibling-expected.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-sibling-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-sibling-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-sibling-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/modal-dialog-sibling.html b/third_party/WebKit/LayoutTests/html/dialog/modal-dialog-sibling.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/modal-dialog-sibling.html rename to third_party/WebKit/LayoutTests/html/dialog/modal-dialog-sibling.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/multiple-centered-dialogs-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/multiple-centered-dialogs-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs.html b/third_party/WebKit/LayoutTests/html/dialog/multiple-centered-dialogs.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs.html rename to third_party/WebKit/LayoutTests/html/dialog/multiple-centered-dialogs.html index c629796..1a55c93b3 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/multiple-centered-dialogs.html +++ b/third_party/WebKit/LayoutTests/html/dialog/multiple-centered-dialogs.html
@@ -22,7 +22,7 @@ <dialog id="second-middle-dialog" style="left: 100px"></dialog> <dialog id="bottom-dialog"></dialog> </body> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <script> debug('Test that multiple dialogs are centered properly. You should see four ' + 'boxes: one on the top row, two on the middle, and one on the bottom.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-does-not-block-mouse-events-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-does-not-block-mouse-events-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-does-not-block-mouse-events.html similarity index 95% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html rename to third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-does-not-block-mouse-events.html index c6346bf..70a4dd7 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-does-not-block-mouse-events.html +++ b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-does-not-block-mouse-events.html
@@ -8,7 +8,7 @@ background: red; } </style> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <div id="div"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-layout-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-layout-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-layout.html similarity index 96% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html rename to third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-layout.html index 3738584..3c64438d 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/non-modal-dialog-layout.html +++ b/third_party/WebKit/LayoutTests/html/dialog/non-modal-dialog-layout.html
@@ -1,6 +1,6 @@ <!DOCTYPE html> <link href="resources/dialog-layout.css" rel="stylesheet"> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <div id="absolute-div"> <div id="relative-div"> <dialog id="dialog">It is my dialog.</dialog>
diff --git a/third_party/WebKit/LayoutTests/dialog/removed-element-is-removed-from-top-layer-expected.html b/third_party/WebKit/LayoutTests/html/dialog/removed-element-is-removed-from-top-layer-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/removed-element-is-removed-from-top-layer-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/removed-element-is-removed-from-top-layer-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/removed-element-is-removed-from-top-layer.html b/third_party/WebKit/LayoutTests/html/dialog/removed-element-is-removed-from-top-layer.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/removed-element-is-removed-from-top-layer.html rename to third_party/WebKit/LayoutTests/html/dialog/removed-element-is-removed-from-top-layer.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/resources/dialog-layout.css b/third_party/WebKit/LayoutTests/html/dialog/resources/dialog-layout.css similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/resources/dialog-layout.css rename to third_party/WebKit/LayoutTests/html/dialog/resources/dialog-layout.css
diff --git a/third_party/WebKit/LayoutTests/dialog/resources/dialog.css b/third_party/WebKit/LayoutTests/html/dialog/resources/dialog.css similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/resources/dialog.css rename to third_party/WebKit/LayoutTests/html/dialog/resources/dialog.css
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/resources/inert-focus-in-frames-frame1.html b/third_party/WebKit/LayoutTests/html/dialog/resources/inert-focus-in-frames-frame1.html similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/resources/inert-focus-in-frames-frame1.html rename to third_party/WebKit/LayoutTests/html/dialog/resources/inert-focus-in-frames-frame1.html
diff --git a/third_party/WebKit/LayoutTests/dialog/scrollable-after-close-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/scrollable-after-close-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/scrollable-after-close-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/scrollable-after-close-expected.txt
diff --git a/third_party/WebKit/LayoutTests/dialog/scrollable-after-close.html b/third_party/WebKit/LayoutTests/html/dialog/scrollable-after-close.html similarity index 93% rename from third_party/WebKit/LayoutTests/dialog/scrollable-after-close.html rename to third_party/WebKit/LayoutTests/html/dialog/scrollable-after-close.html index 567fba7..ed1d2d7c 100644 --- a/third_party/WebKit/LayoutTests/dialog/scrollable-after-close.html +++ b/third_party/WebKit/LayoutTests/html/dialog/scrollable-after-close.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<script src="../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <style> html, body { height: 100%; margin: 0; overflow: hidden; } #scroller {
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/show-modal-focusing-steps-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/show-modal-focusing-steps-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps.html b/third_party/WebKit/LayoutTests/html/dialog/show-modal-focusing-steps.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps.html rename to third_party/WebKit/LayoutTests/html/dialog/show-modal-focusing-steps.html index 41dde182..55a5f15 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps.html +++ b/third_party/WebKit/LayoutTests/html/dialog/show-modal-focusing-steps.html
@@ -1,8 +1,8 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> -<script src="../../forms/resources/common.js"></script> +<script src="../../resources/js-test.js"></script> +<script src="../../fast/forms/resources/common.js"></script> <script> description('Tests focus when a modal dialog is opened.');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/simulated-click-inert-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/simulated-click-inert-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/simulated-click-inert-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/simulated-click-inert-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/simulated-click-inert.html b/third_party/WebKit/LayoutTests/html/dialog/simulated-click-inert.html similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/simulated-click-inert.html rename to third_party/WebKit/LayoutTests/html/dialog/simulated-click-inert.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/submit-dialog-close-event-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/submit-dialog-close-event-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event.html b/third_party/WebKit/LayoutTests/html/dialog/submit-dialog-close-event.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event.html rename to third_party/WebKit/LayoutTests/html/dialog/submit-dialog-close-event.html index bbeb592..00ee2c8 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/submit-dialog-close-event.html +++ b/third_party/WebKit/LayoutTests/html/dialog/submit-dialog-close-event.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> </head> <body> <dialog>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/synthetic-click-inert-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/synthetic-click-inert-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert.html b/third_party/WebKit/LayoutTests/html/dialog/synthetic-click-inert.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert.html rename to third_party/WebKit/LayoutTests/html/dialog/synthetic-click-inert.html index ea67ee3..7f9f7a17 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/synthetic-click-inert.html +++ b/third_party/WebKit/LayoutTests/html/dialog/synthetic-click-inert.html
@@ -7,7 +7,7 @@ } </style> <body> -<script src="../../../resources/js-test.js"></script> +<script src="../../resources/js-test.js"></script> <button>Click me</button> <div id="div">Click me too</div> <dialog></dialog>
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-containing-block-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-containing-block-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-containing-block-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-containing-block-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-containing-block.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-containing-block.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-containing-block.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-containing-block.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-display-none-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-display-none-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-display-none-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-display-none-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-display-none.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-display-none.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-display-none.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-display-none.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-nesting-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-nesting-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-nesting-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-nesting-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-nesting.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-nesting.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-nesting.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-nesting.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-relative-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-position-relative-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-relative.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-position-relative.html index 6ae72e0..968c42e2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative.html +++ b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-relative.html
@@ -29,7 +29,7 @@ left: 200px; } </style> -<script src="../../../resources/check-layout.js"></script> +<script src="../../resources/check-layout.js"></script> </head> <body onload="checkLayout('dialog')"> <p>Bug <a href="http://webkit.org/b/106538">106538</a>: Top layer fails for inline elements
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static-expected.txt b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-static-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static-expected.txt rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-position-static-expected.txt
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-static.html similarity index 94% rename from third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-position-static.html index c549f7ca..fe69df49 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static.html +++ b/third_party/WebKit/LayoutTests/html/dialog/top-layer-position-static.html
@@ -29,7 +29,7 @@ left: 200px; } </style> -<script src="../../../resources/check-layout.js"></script> +<script src="../../resources/check-layout.js"></script> </head> <body onload="checkLayout('dialog')"> <p>Bug <a href="http://webkit.org/b/106538">106538</a>: Top layer fails for inline elements
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking-correct-order-remove-readd-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-correct-order-remove-readd-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking-correct-order-remove-readd-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-correct-order-remove-readd-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking-correct-order-remove-readd.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-correct-order-remove-readd.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking-correct-order-remove-readd.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-correct-order-remove-readd.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking-dynamic-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-dynamic-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking-dynamic-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-dynamic-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking-dynamic.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-dynamic.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking-dynamic.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-dynamic.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking-expected.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-expected.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking-expected.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking-expected.html
diff --git a/third_party/WebKit/LayoutTests/dialog/top-layer-stacking.html b/third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking.html similarity index 100% rename from third_party/WebKit/LayoutTests/dialog/top-layer-stacking.html rename to third_party/WebKit/LayoutTests/html/dialog/top-layer-stacking.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html b/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html index e36b44e..9b3b58f8 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/compiler-script-mapping.html
@@ -35,7 +35,7 @@ function uiLocation(script, line, column) { - var location = SDK.DebuggerModel.fromTarget(script.target()).createRawLocation(script, line, column); + var location = script.debuggerModel.createRawLocation(script, line, column); return Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location); } @@ -203,6 +203,7 @@ var script; var originalUISourceCode; var target = InspectorTest.mainTarget; + var debuggerModel = InspectorTest.debuggerModel; InspectorTest.addResult("Adding compiled.js"); InspectorTest.waitForUISourceCode(originalUISourceCodeAdded, "resources/compiled.js"); @@ -212,7 +213,7 @@ { InspectorTest.addResult("compiled.js UISourceCode arrived"); originalUISourceCode = uiSourceCode; - for (var s of Object.values(InspectorTest.debuggerModel.scripts)) { + for (var s of Object.values(debuggerModel.scripts)) { if (s.sourceURL.endsWith("compiled.js")) { InspectorTest.addResult("compiled.js script found"); script = s; @@ -238,9 +239,9 @@ InspectorTest.checkUILocation(uiSourceCode2, 7, 4, uiLocation(script, 1, 151)); InspectorTest.checkUILocation(originalUISourceCode, 1, 200, uiLocation(script, 1, 200)); - InspectorTest.checkRawLocation(script, 0, 42, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode1, 3, 10)); - InspectorTest.checkRawLocation(script, 1, 85, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 1, 0)); - InspectorTest.checkRawLocation(script, 1, 110, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode2, 5, 2)); + InspectorTest.checkRawLocation(script, 0, 42, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(debuggerModel, uiSourceCode1, 3, 10)); + InspectorTest.checkRawLocation(script, 1, 85, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(debuggerModel, uiSourceCode2, 1, 0)); + InspectorTest.checkRawLocation(script, 1, 110, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(debuggerModel, uiSourceCode2, 5, 2)); InspectorTest.addResult("Location checks passed. Requesting content"); uiSourceCode1.requestContent().then(didRequestContent1); @@ -277,12 +278,13 @@ InspectorTest.evaluateInPage(scriptSource); var target = InspectorTest.mainTarget; + var debuggerModel = InspectorTest.debuggerModel; var script; function compiledUISourceCodeAdded(uiSourceCode) { InspectorTest.addResult("compiled.js UISourceCode arrived"); - for (var s of Object.values(InspectorTest.debuggerModel.scripts)) { + for (var s of Object.values(debuggerModel.scripts)) { if (s.sourceMapURL && s.sourceMapURL.startsWith("data:application")) { InspectorTest.addResult("compiled.js script found"); script = s; @@ -295,7 +297,7 @@ { InspectorTest.addResult("source3.js UISourceCode arrived"); InspectorTest.checkUILocation(uiSourceCode, 2, 4, uiLocation(script, 0, 18)); - InspectorTest.checkRawLocation(script, 0, 18, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode, 2, 4)); + InspectorTest.checkRawLocation(script, 0, 18, Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(debuggerModel, uiSourceCode, 2, 4)); InspectorTest.addResult("Location checks passed. Requesting content"); uiSourceCode.requestContent().then(didRequestContent);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js index 46a1fa5..9dfe3af 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js
@@ -93,6 +93,7 @@ InspectorTest.dumpConsoleMessagesIntoArray = function(printOriginatingCommand, dumpClassNames, formatter) { + Common.settingForTest('messageLevelFilters2').set(SDK.ConsoleMessage.MessageLevel.Verbose); formatter = formatter || InspectorTest.prepareConsoleMessageText; var result = []; InspectorTest.disableConsoleViewport();
diff --git a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html index adec6b5..14d1c28 100644 --- a/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html +++ b/third_party/WebKit/LayoutTests/inspector-enabled/sources/debugger/script-formatter-breakpoints-4.html
@@ -44,7 +44,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Adding breakpoint."); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 11, "", true); }
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodesModal-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodesModal-expected.txt index 88e9a41..5efb821 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodesModal-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodesModal-expected.txt
@@ -48,7 +48,15 @@ } ] }, - "properties": [], + "properties": [ + { + "name": "modal", + "value": { + "type": "boolean", + "value": true + } + } + ], "domNode": "dialog" } {
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal-expected.txt new file mode 100644 index 0000000..4164b90 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal-expected.txt
@@ -0,0 +1,259 @@ +Open Dialog +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "dialog" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [ + { + "name": "modal", + "value": { + "type": "boolean", + "value": true + } + } + ], + "domNode": "dialog#modal" +} +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "button" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "contents" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [], + "domNode": "div" +} +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "dialog" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [ + { + "name": "modal", + "value": { + "type": "boolean", + "value": false + } + } + ], + "domNode": "div" +} +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "dialog" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [ + { + "name": "modal", + "value": { + "type": "boolean", + "value": true + } + } + ], + "domNode": "div" +} +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "alertdialog" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [ + { + "name": "live", + "value": { + "type": "token", + "value": "assertive" + } + }, + { + "name": "atomic", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "relevant", + "value": { + "type": "tokenList", + "value": "additions text" + } + }, + { + "name": "busy", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "modal", + "value": { + "type": "boolean", + "value": true + } + } + ], + "domNode": "div" +} +{ + "nodeId": "<string>", + "ignored": true, + "ignoredReasons": [ + { + "name": "notRendered", + "value": { + "type": "boolean", + "value": true + } + } + ], + "role": { + "type": "internalRole", + "value": "Ignored" + }, + "domNode": "dialog" +} +{ + "nodeId": "<string>", + "ignored": false, + "role": { + "type": "role", + "value": "dialog" + }, + "name": { + "type": "computedString", + "value": "", + "sources": [ + { + "type": "relatedElement", + "attribute": "aria-labelledby" + }, + { + "type": "attribute", + "attribute": "aria-label" + }, + { + "type": "attribute", + "attribute": "title" + } + ] + }, + "properties": [ + { + "name": "modal", + "value": { + "type": "boolean", + "value": false + } + } + ], + "domNode": "dialog" +} +
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal.html b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal.html new file mode 100644 index 0000000..e540ba9e --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-modal.html
@@ -0,0 +1,34 @@ +<html> +<head> +<script type="text/javascript" src="../../http/tests/inspector-protocol/dom-protocol-test.js"></script> +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> +<script type="text/javascript" src="./accessibility-dumpAccessibilityNodes.js"></script> +<script> + +function test() +{ + InspectorTest.sendCommand("DOM.getDocument", {}, (msg) => { + InspectorTest.dumpAccessibilityNodesBySelectorAndCompleteTest("[data-dump]", false, msg); + }); +} + +</script> +</head> +<body onLoad="runTest();"> + <dialog data-dump id="modal"> + <div data-dump role="button" aria-modal="true"> + </div> + <div data-dump role="dialog" aria-modal="false"> + </div> + <div data-dump role="dialog" aria-modal="true"> + </div> + <div data-dump role="alertdialog" aria-modal="true"> + </div> + <dialog data-dump>Closed Dialog</dialog> + <dialog data-dump open>Open Dialog</dialog> + </dialog> + <script> + document.getElementById('modal').showModal(); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument-expected.txt new file mode 100644 index 0000000..f7e8c1c --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument-expected.txt
@@ -0,0 +1,443 @@ +A +B +C +D +E + +{ + "nodes": [ + { + "nodeId": 4, + "parentId": 3, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "SCRIPT", + "localName": "script", + "nodeValue": "", + "childNodeCount": 0, + "children": [], + "attributes": [ + "type", + "text/javascript", + "src", + "../../http/tests/inspector-protocol/inspector-protocol-test.js" + ] + }, + { + "nodeId": 6, + "parentId": 5, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "\n\nfunction test()\n{\n InspectorTest.sendCommand(\"DOM.enable\", {});\n InspectorTest.sendCommandOrDie(\"DOM.getFlattenedDocument\", {\"depth\": -1, \"pierce\": true}, onDocument);\n\n function onDocument(response) {\n function stabilize(key, value) {\n var unstableKeys = [\"backendNodeId\", \"documentURL\", \"baseURL\", \"frameId\"];\n if (unstableKeys.indexOf(key) !== -1)\n return \"<\" + typeof(value) + \">\";\n return value;\n }\n InspectorTest.log(JSON.stringify(response, stabilize, 2));\n InspectorTest.completeTest();\n }\n}\n\n" + }, + { + "nodeId": 5, + "parentId": 3, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "SCRIPT", + "localName": "script", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 3, + "parentId": 2, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "HEAD", + "localName": "head", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [] + }, + { + "nodeId": 9, + "parentId": 8, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": " A\n " + }, + { + "nodeId": 11, + "parentId": 10, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": " B\n " + }, + { + "nodeId": 13, + "parentId": 12, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": " C\n " + }, + { + "nodeId": 15, + "parentId": 14, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": " D\n " + }, + { + "nodeId": 17, + "parentId": 16, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": " E\n " + }, + { + "nodeId": 16, + "parentId": 14, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [ + "id", + "E" + ] + }, + { + "nodeId": 14, + "parentId": 12, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [ + "id", + "D" + ] + }, + { + "nodeId": 12, + "parentId": 10, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [ + "id", + "C" + ] + }, + { + "nodeId": 10, + "parentId": 8, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [ + "id", + "B" + ] + }, + { + "nodeId": 8, + "parentId": 7, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [ + "id", + "A" + ] + }, + { + "nodeId": 23, + "parentId": 22, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "\n@font-face {\n font-family: 'ahem';\n src: url(../../../resources/Ahem.ttf);\n}\n" + }, + { + "nodeId": 22, + "parentId": 21, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "STYLE", + "localName": "style", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 21, + "parentId": 20, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "HEAD", + "localName": "head", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 26, + "parentId": 25, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "\nHello from the iframe.\n" + }, + { + "nodeId": 25, + "parentId": 24, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [ + "style", + "font-family: ahem;" + ] + }, + { + "nodeId": 24, + "parentId": 20, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "BODY", + "localName": "body", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 20, + "parentId": 19, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "HTML", + "localName": "html", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [], + "frameId": "<string>" + }, + { + "nodeId": 18, + "parentId": 7, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "IFRAME", + "localName": "iframe", + "nodeValue": "", + "childNodeCount": 0, + "children": [], + "attributes": [ + "src", + "../dom/resources/simple-iframe.html", + "width", + "400", + "height", + "200" + ], + "frameId": "<string>", + "contentDocument": { + "nodeId": 19, + "backendNodeId": "<number>", + "nodeType": 9, + "nodeName": "#document", + "localName": "", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "documentURL": "<string>", + "baseURL": "<string>", + "xmlVersion": "" + } + }, + { + "nodeId": 30, + "parentId": 29, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "\n:host {\n color: red;\n}\n" + }, + { + "nodeId": 29, + "parentId": 28, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "STYLE", + "localName": "style", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 31, + "parentId": 28, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 0, + "children": [], + "attributes": [] + }, + { + "nodeId": 33, + "parentId": 32, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "Hi from a template!" + }, + { + "nodeId": 32, + "parentId": 28, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "H1", + "localName": "h1", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [] + }, + { + "nodeId": 27, + "parentId": 7, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "DIV", + "localName": "div", + "nodeValue": "", + "childNodeCount": 0, + "children": [], + "attributes": [ + "id", + "shadow-host" + ], + "shadowRoots": [ + { + "nodeId": 28, + "backendNodeId": "<number>", + "nodeType": 11, + "nodeName": "#document-fragment", + "localName": "", + "nodeValue": "", + "childNodeCount": 3, + "children": [], + "shadowRootType": "open" + } + ] + }, + { + "nodeId": 35, + "parentId": 34, + "backendNodeId": "<number>", + "nodeType": 3, + "nodeName": "#text", + "localName": "", + "nodeValue": "\n var host = document.querySelector(\"#shadow-host\").createShadowRoot();\n var template = document.querySelector(\"#shadow-template\");\n host.appendChild(template.content);\n template.remove();\n window.onload = runTest;\n " + }, + { + "nodeId": 34, + "parentId": 7, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "SCRIPT", + "localName": "script", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "attributes": [ + "type", + "text/javascript" + ] + }, + { + "nodeId": 7, + "parentId": 2, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "BODY", + "localName": "body", + "nodeValue": "", + "childNodeCount": 4, + "children": [], + "attributes": [ + "class", + "body-class" + ] + }, + { + "nodeId": 2, + "parentId": 1, + "backendNodeId": "<number>", + "nodeType": 1, + "nodeName": "HTML", + "localName": "html", + "nodeValue": "", + "childNodeCount": 2, + "children": [], + "attributes": [], + "frameId": "<string>" + }, + { + "nodeId": 1, + "backendNodeId": "<number>", + "nodeType": 9, + "nodeName": "#document", + "localName": "", + "nodeValue": "", + "childNodeCount": 1, + "children": [], + "documentURL": "<string>", + "baseURL": "<string>", + "xmlVersion": "" + } + ] +} +
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument.html b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument.html new file mode 100644 index 0000000..ce76a3d --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getFlattenedDocument.html
@@ -0,0 +1,55 @@ +<html> +<head> +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> +<script> + +function test() +{ + InspectorTest.sendCommand("DOM.enable", {}); + InspectorTest.sendCommandOrDie("DOM.getFlattenedDocument", {"depth": -1, "pierce": true}, onDocument); + + function onDocument(response) { + function stabilize(key, value) { + var unstableKeys = ["backendNodeId", "documentURL", "baseURL", "frameId"]; + if (unstableKeys.indexOf(key) !== -1) + return "<" + typeof(value) + ">"; + return value; + } + InspectorTest.log(JSON.stringify(response, stabilize, 2)); + InspectorTest.completeTest(); + } +} + +</script> +<template id="shadow-template"> +<style> +:host { + color: red; +} +</style> +<div></div><h1>Hi from a template!</h1></div> +</template> +</head> +<body class="body-class"> + <div id="A"> A + <div id="B"> B + <div id="C"> C + <div id="D"> D + <div id="E"> E + </div> + </div> + </div> + </div> + </div> + + <iframe src="../dom/resources/simple-iframe.html" width="400" height="200"></iframe> + <div id="shadow-host"></div> + <script type="text/javascript"> + var host = document.querySelector("#shadow-host").createShadowRoot(); + var template = document.querySelector("#shadow-template"); + host.appendChild(template.content); + template.remove(); + window.onload = runTest; + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getNodeForLocation-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getNodeForLocation-expected.txt index 0093d2a..b081415 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getNodeForLocation-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-getNodeForLocation-expected.txt
@@ -9,5 +9,6 @@ nodeName : DIV nodeType : 1 nodeValue : + parentId : 4 }
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-traverse-frames-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-traverse-frames-expected.txt index bced7fb0..5202c3a 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-traverse-frames-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-child-nodes-traverse-frames-expected.txt
@@ -6,6 +6,7 @@ "nodes": [ { "nodeId": 14, + "parentId": 13, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -15,6 +16,7 @@ "children": [ { "nodeId": 15, + "parentId": 14, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -24,6 +26,7 @@ "children": [ { "nodeId": 16, + "parentId": 15, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -33,6 +36,7 @@ "children": [ { "nodeId": 17, + "parentId": 16, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "IFRAME", @@ -56,6 +60,7 @@ "children": [ { "nodeId": 19, + "parentId": 18, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "HTML", @@ -65,6 +70,7 @@ "children": [ { "nodeId": 20, + "parentId": 19, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "HEAD", @@ -76,6 +82,7 @@ }, { "nodeId": 21, + "parentId": 19, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "BODY", @@ -85,6 +92,7 @@ "children": [ { "nodeId": 22, + "parentId": 21, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV",
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes-expected.txt index 94f51bd..218da00 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom/dom-request-document-with-child-nodes-expected.txt
@@ -1,6 +1,7 @@ { "nodeId": 20, + "parentId": 15, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "BODY", @@ -10,6 +11,7 @@ "children": [ { "nodeId": 21, + "parentId": 20, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -19,6 +21,7 @@ "children": [ { "nodeId": 22, + "parentId": 21, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -28,6 +31,7 @@ "children": [ { "nodeId": 23, + "parentId": 22, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -37,6 +41,7 @@ "children": [ { "nodeId": 24, + "parentId": 23, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "IFRAME", @@ -60,6 +65,7 @@ "children": [ { "nodeId": 26, + "parentId": 25, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "HTML", @@ -69,6 +75,7 @@ "children": [ { "nodeId": 27, + "parentId": 26, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "HEAD", @@ -80,6 +87,7 @@ }, { "nodeId": 28, + "parentId": 26, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "BODY", @@ -89,6 +97,7 @@ "children": [ { "nodeId": 29, + "parentId": 28, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -112,6 +121,7 @@ "children": [ { "nodeId": 31, + "parentId": 30, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV", @@ -121,6 +131,7 @@ "children": [ { "nodeId": 32, + "parentId": 31, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "H1", @@ -130,6 +141,7 @@ "children": [ { "nodeId": 33, + "parentId": 32, "backendNodeId": "<number>", "nodeType": 3, "nodeName": "#text", @@ -152,6 +164,7 @@ }, { "nodeId": 34, + "parentId": 28, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "SCRIPT", @@ -161,6 +174,7 @@ "children": [ { "nodeId": 35, + "parentId": 34, "backendNodeId": "<number>", "nodeType": 3, "nodeName": "#text", @@ -200,6 +214,7 @@ }, { "nodeId": 36, + "parentId": 21, "backendNodeId": "<number>", "nodeType": 1, "nodeName": "DIV",
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html index 65d58ca5..bccc01d 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html
@@ -12,7 +12,7 @@ { mockTarget.debuggerModel.reset(); InspectorTest.addResult(" Resetting workspace."); - breakpointManager._debuggerWorkspaceBinding._reset(mockTarget); + breakpointManager._debuggerWorkspaceBinding._reset(mockTarget.debuggerModel); InspectorTest.testNetworkProject._reset(); } @@ -278,7 +278,7 @@ InspectorTest.addResult("\n Toggling source mapping."); var sourceMapping = createSourceMapping(uiSourceCodeA, uiSourceCodeB); mockTarget.debuggerModel.pushSourceMapping(sourceMapping); - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget, uiSourceCodeB, sourceMapping); + breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget.debuggerModel, uiSourceCodeB, sourceMapping); InspectorTest.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformedBeforeReload.bind(this)); function breakpointActionsPerformedBeforeReload() @@ -296,7 +296,7 @@ InspectorTest.addResult("\n Toggling source mapping."); var sourceMapping = createSourceMapping(uiSourceCodeA, uiSourceCodeB); mockTarget.debuggerModel.pushSourceMapping(sourceMapping); - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget, uiSourceCodeB, sourceMapping); + breakpointManager._debuggerWorkspaceBinding.setSourceMapping(mockTarget.debuggerModel, uiSourceCodeB, sourceMapping); InspectorTest.runAfterPendingBreakpointUpdates(breakpointManager, breakpointActionsPerformed.bind(this)); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js index e2940b4..7045105 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js
@@ -39,38 +39,20 @@ InspectorTest.createMockTarget = function(id, debuggerModelConstructor, capabilities) { capabilities = capabilities || InspectorTest._pageCapabilities; - var MockTarget = class extends SDK.Target { - constructor(name, connectionFactory) { - super(InspectorTest.testTargetManager, name, capabilities, connectionFactory, null); - this._inspectedURL = InspectorTest.mainTarget.inspectedURL(); - this.consoleModel = this.model(SDK.ConsoleModel); - this.model(SDK.NetworkManager); - this.resourceTreeModel = this.model(SDK.ResourceTreeModel); - this.resourceTreeModel._cachedResourcesProcessed = true; - this.resourceTreeModel._frameAttached("42", 0); - this.runtimeModel = this.model(SDK.RuntimeModel); - if (debuggerModelConstructor) { - this.debuggerModel = new debuggerModelConstructor(this); - this._modelByConstructor.set(SDK.DebuggerModel, this.debuggerModel); - } else { - this.debuggerModel = this.model(SDK.DebuggerModel); - } - this.model(SDK.DOMModel); - this.model(SDK.CSSModel); - this.subTargetsManager = this.model(SDK.SubTargetsManager); - this.cpuProfilerModel = this.model(SDK.CPUProfilerModel); - this.heapProfilerModel = this.model(SDK.HeapProfilerModel); - this.tracingManager = new SDK.TracingManager(this); - this.serviceWorkerManager = this.model(SDK.ServiceWorkerManager); - } - - _loadedWithCapabilities() - { - } - }; - - var target = new MockTarget("mock-target-" + id, (params) => new SDK.StubConnection(params)); - InspectorTest.testTargetManager.addTarget(target); + var target = InspectorTest.testTargetManager.createTarget("mock-target-" + id, capabilities & (~SDK.Target.Capability.JS), (params) => new SDK.StubConnection(params), null); + target._capabilitiesMask = capabilities; + target._inspectedURL = InspectorTest.mainTarget.inspectedURL(); + target.resourceTreeModel = target.model(SDK.ResourceTreeModel); + target.resourceTreeModel._cachedResourcesProcessed = true; + target.resourceTreeModel._frameAttached("42", 0); + target.runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.RuntimeModel)); + if (debuggerModelConstructor) { + target.debuggerModel = new debuggerModelConstructor(target); + target._modelByConstructor.set(SDK.DebuggerModel, target.debuggerModel); + InspectorTest.testTargetManager.modelAdded(target, SDK.DebuggerModel, target.debuggerModel); + } else { + target.debuggerModel = target.model(SDK.DebuggerModel); + } return target; } @@ -264,13 +246,13 @@ { var script = new SDK.Script(this, scriptId, url); this._scripts[scriptId] = script; - this._debuggerWorkspaceBinding._targetToData.get(this._target)._parsedScriptSource({data: script}); + this._debuggerWorkspaceBinding._debuggerModelToData.get(this)._parsedScriptSource({data: script}); } _registerScript(script) { this._scripts[script.scriptId] = script; - this._debuggerWorkspaceBinding._targetToData.get(this._target)._parsedScriptSource({data: script}); + this._debuggerWorkspaceBinding._debuggerModelToData.get(this)._parsedScriptSource({data: script}); } _scriptForURL(url) @@ -353,7 +335,7 @@ { InspectorTest.addResult(" Resetting debugger."); this._scripts = {}; - this._debuggerWorkspaceBinding._reset(this._target); + this._debuggerWorkspaceBinding._reset(this); } pushSourceMapping(sourceMapping) @@ -405,7 +387,7 @@ for (var i = 0; i < uiSourceCodes.length; ++i) { var uiSourceCode = uiSourceCodes[i]; if (uiSourceCode.url() === url) { - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCode, breakpointManager.defaultMapping); + breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target.debuggerModel, uiSourceCode, breakpointManager.defaultMapping); InspectorTest.uiSourceCodes[url] = uiSourceCode; return uiSourceCode; } @@ -422,7 +404,7 @@ var uiSourceCode = InspectorTest.testNetworkProject.addFile(contentProvider, null); InspectorTest.uiSourceCodes[url] = uiSourceCode; if (!doNotSetSourceMapping) { - breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCode, breakpointManager.defaultMapping); + breakpointManager._debuggerWorkspaceBinding.setSourceMapping(target.debuggerModel, uiSourceCode, breakpointManager.defaultMapping); breakpointManager._debuggerWorkspaceBinding.updateLocations(target.debuggerModel.scriptForId(url)); } return uiSourceCode; @@ -431,8 +413,8 @@ InspectorTest.createBreakpointManager = function(targetManager, debuggerWorkspaceBinding, persistentBreakpoints) { InspectorTest._pendingBreakpointUpdates = 0; - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_updateInDebugger", updateInDebugger, true); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didUpdateInDebugger", didUpdateInDebugger, true); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_updateInDebugger", updateInDebugger, true); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didUpdateInDebugger", didUpdateInDebugger, true); function updateInDebugger() {
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html index 4d65a690..166b9da 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/dynamic-scripts-breakpoints.html
@@ -40,7 +40,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 11, "", true); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html index d94beb4..c479ab4e 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/nodejs-set-breakpoint.html
@@ -16,7 +16,7 @@ function didShowScriptSource(sourceFrame) { InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_addResolvedLocation", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 1, "", true); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html index 7ebbad84..974c7d6 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-breakpoint.html
@@ -119,7 +119,7 @@ function setBreakpointAndWaitUntilPaused(sourceFrame, lineNumber, pausedCallback) { var expectedBreakpointId; - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); InspectorTest.setBreakpoint(sourceFrame, lineNumber, "", true); function didSetBreakpointInDebugger(callback, breakpointId)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html index 201e6adb..a0f7f98 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/set-conditional-breakpoint.html
@@ -92,7 +92,7 @@ function setBreakpoint(sourceFrame, lineNumber, condition, callback) { var expectedBreakpointId; - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); InspectorTest.setBreakpoint(sourceFrame, lineNumber, condition, true); function didSetBreakpointInDebugger(breakpointManagerCallback, breakpointId)
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html index 6be2c618..27a1341 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-model.html
@@ -17,7 +17,7 @@ InspectorTest.addSniffer(Snippets.ScriptSnippetModel.prototype, "_printRunScriptResult", dumpResult); Snippets.scriptSnippetModel.evaluateScriptSnippet(context, uiSourceCode); var target = context.target(); - var mapping = Snippets.scriptSnippetModel._mappingForTarget.get(target); + var mapping = Snippets.scriptSnippetModel._mappingForDebuggerModel.get(SDK.DebuggerModel.fromTarget(target)); var evaluationSourceURL = mapping._evaluationSourceURL(uiSourceCode); var snippetId = Snippets.scriptSnippetModel._snippetIdForUISourceCode.get(uiSourceCode); InspectorTest.addResult("Last evaluation source url for snippet: " + evaluationSourceURL); @@ -168,7 +168,7 @@ var context = UI.context.flavor(SDK.ExecutionContext); resetSnippetsSettings(); - var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.targetManager.targets()[0]); + var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.DebuggerModel.fromTarget(SDK.targetManager.targets()[0])); Snippets.scriptSnippetModel.project().createFile("", null, "", step2.bind(this)); @@ -241,7 +241,7 @@ } resetSnippetsSettings(); - var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.targetManager.targets()[0]); + var snippetScriptMapping = Snippets.scriptSnippetModel.snippetScriptMapping(SDK.DebuggerModel.fromTarget(SDK.targetManager.targets()[0])); Snippets.scriptSnippetModel.project().createFile("", null, "", step3.bind(this));
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html index 869502f..83e0bea 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/live-edit-breakpoints.html
@@ -59,7 +59,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -84,7 +84,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Undoing source editing:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.undoSourceEditing(javaScriptSourceFrame); } @@ -111,7 +111,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -136,7 +136,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); } @@ -163,7 +163,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -201,7 +201,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source again:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); } @@ -228,7 +228,7 @@ uiSourceCode = sourceFrame._uiSourceCode; InspectorTest.addResult("Setting breakpoint:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolved); InspectorTest.setBreakpoint(sourceFrame, 2, "", true); } @@ -266,7 +266,7 @@ dumpBreakpointStorageAndLocations(); InspectorTest.addResult("Committing edited source again:"); - InspectorTest.addSniffer(Bindings.BreakpointManager.TargetBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); + InspectorTest.addSniffer(Bindings.BreakpointManager.ModelBreakpoint.prototype, "_didSetBreakpointInDebugger", breakpointResolvedAgain); InspectorTest.commitSource(javaScriptSourceFrame); }
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html b/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html index 829976c..62a6bf8 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/debugger/resource-script-mapping.html
@@ -45,7 +45,7 @@ var rawLocation = InspectorTest.debuggerModel.createRawLocation(script, line, column); var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(rawLocation); InspectorTest.checkUILocation(uiSourceCode, line, column, uiLocation); - var reverseLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(InspectorTest.mainTarget, uiSourceCode, line, column); + var reverseLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(InspectorTest.debuggerModel, uiSourceCode, line, column); InspectorTest.checkRawLocation(script, line, column, reverseLocation); } InspectorTest.completeTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html index 77fb2c5..15ed3e34 100644 --- a/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html +++ b/third_party/WebKit/LayoutTests/inspector/sources/dont-diverge-script-evaluated-twice.html
@@ -26,7 +26,8 @@ function step3(uiSourceCode) { var mainTarget = SDK.targetManager.mainTarget(); - var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCode, mainTarget); + var debuggerModel = SDK.DebuggerModel.fromTarget(mainTarget); + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(uiSourceCode, debuggerModel); if (!scriptFile) { InspectorTest.addResult("[FAIL]: no script file for test.js"); InspectorTest.completeDebuggerTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/user-metrics-expected.txt b/third_party/WebKit/LayoutTests/inspector/user-metrics-expected.txt index 6ab094d7..cc4b3cc 100644 --- a/third_party/WebKit/LayoutTests/inspector/user-metrics-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/user-metrics-expected.txt
@@ -5,6 +5,8 @@ AnimationsPlaybackRateChanged : 11 AuditsStarted : 7 CommandEvaluatedInConsolePanel : 15 + ConnectToNodeJSDirectly : 20 + ConnectToNodeJSFromFrontend : 19 ConsoleEvaluated : 8 DOMPropertiesExpanded : 16 DeviceModeEnabled : 10
diff --git a/third_party/WebKit/LayoutTests/installedapp/idl.html b/third_party/WebKit/LayoutTests/installedapp/idl.html new file mode 100644 index 0000000..4111fe73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/installedapp/idl.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<link rel="help" href="https://github.com/WICG/get-installed-related-apps/blob/master/EXPLAINER.md"> +<script src=../resources/testharness.js></script> +<script src=../resources/testharnessreport.js></script> +<script src=../resources/WebIDLParser.js></script> +<script src=../resources/idlharness.js></script> +<script type="text/plain" id="untested"> + interface Navigator { + }; +</script> +<script type="text/plain" id="tested"> + [NoInterfaceObject] + interface RelatedApplication { + readonly attribute DOMString platform; + readonly attribute DOMString url; + readonly attribute DOMString id; + }; + partial interface Navigator { + Promise<RelatedApplication> getInstalledRelatedApps(); + }; +</script> +<script> + "use strict"; + var idl_array = new IdlArray(); + idl_array.add_untested_idls(document.querySelector("#untested").textContent); + idl_array.add_idls(document.querySelector('#tested').textContent); + idl_array.add_objects({ + Navigator: ['navigator'] + }); + idl_array.test(); +</script>
diff --git a/third_party/WebKit/LayoutTests/nfc/nfc-block-iframe.html b/third_party/WebKit/LayoutTests/nfc/nfc-block-iframe.html new file mode 100644 index 0000000..8ee6e38 --- /dev/null +++ b/third_party/WebKit/LayoutTests/nfc/nfc-block-iframe.html
@@ -0,0 +1,39 @@ +<!DOCTYPE html> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script src="../resources/mojo-helpers.js"></script> +<script src="resources/nfc-helpers.js"></script> +<script> +'use strict'; + +nfc_test(nfc => { + return new Promise((resolve,reject) => { + let iframeMockNFC = new nfc.MockNFC; + let iframe = document.createElement('iframe'); + iframe.src = 'resources/push-from-iframe.html'; + iframe.onload = () => { + iframe.contentWindow.gin.define( + "Mojo Service Registry", + [ 'content/public/renderer/frame_interfaces' ], + (frameInterfaces) => { + frameInterfaces.addInterfaceOverrideForTesting( + nfc.NFC.name, + handle => { iframeMockNFC.bindingSet.addBinding( + iframeMockNFC, handle); }); + iframe.contentWindow.postMessage('Ready', '*'); + }); + } + + document.body.appendChild(iframe); + + window.onmessage = message => { + if (message.data == 'Success') { + resolve(); + } else if (message.data == 'Failure') { + reject(); + } + } + }); +}, 'Test that WebNFC API is not accessible from iframe context.'); + +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js b/third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js index ff8f03e..6ff3778 100644 --- a/third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js +++ b/third_party/WebKit/LayoutTests/nfc/resources/nfc-helpers.js
@@ -406,7 +406,13 @@ }); return Promise.resolve({ + // Interface instance bound to main frame. mockNFC: mockNFC, + // Constructor for mock NFC class. + MockNFC: MockNFC, + // Loaded mojom interface. + NFC: nfc.NFC, + // Helper functions for comparing WebNFC structures. assertNFCMessagesEqual: assertNFCMessagesEqual, assertNFCPushOptionsEqual: assertNFCPushOptionsEqual, assertWebNFCMessagesEqual: assertWebNFCMessagesEqual,
diff --git a/third_party/WebKit/LayoutTests/nfc/resources/push-from-iframe.html b/third_party/WebKit/LayoutTests/nfc/resources/push-from-iframe.html new file mode 100644 index 0000000..cb7faed --- /dev/null +++ b/third_party/WebKit/LayoutTests/nfc/resources/push-from-iframe.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<script> +'use strict'; + +window.onmessage = message => { + if (message.data === 'Ready') { + let onSuccess = () => { parent.postMessage('Failure', '*'); }; + let onError = error => { + if (error.name == 'SecurityError') { + parent.postMessage('Success', '*'); + } else { + parent.postMessage('Failure', '*'); + } + } + navigator.nfc.push('Test').then(onSuccess, onError); + } +}; + +</script>
diff --git a/third_party/WebKit/LayoutTests/sensor/accelerometer.html b/third_party/WebKit/LayoutTests/sensor/accelerometer.html index 9339d358..98c6f5d 100644 --- a/third_party/WebKit/LayoutTests/sensor/accelerometer.html +++ b/third_party/WebKit/LayoutTests/sensor/accelerometer.html
@@ -24,10 +24,17 @@ buffer[2] += readsCount; } -function verify_sensor_reading(reading) { - return reading.x == kDefaultReadingX && - reading.y == kDefaultReadingY && - reading.z == kDefaultReadingZ; +function verify_sensor_reading(sensor, should_be_null) { + if (should_be_null) { + return sensor.x == null && + sensor.y == null && + sensor.z == null && + sensor.timestamp == null; + } + return sensor.x == kDefaultReadingX && + sensor.y == kDefaultReadingY && + sensor.z == kDefaultReadingZ && + sensor.timestamp != null; } runGenericSensorTests(Accelerometer, update_sensor_reading, verify_sensor_reading);
diff --git a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html index 63b1883..33e9a8b 100644 --- a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html +++ b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
@@ -24,5 +24,14 @@ return reading.illuminance == kDefaultReadingValue; } +function verify_sensor_reading(sensor, should_be_null) { + if (should_be_null) { + return sensor.illuminance == null && + sensor.timestamp == null; + } + return sensor.illuminance == kDefaultReadingValue && + sensor.timestamp != null; +} + runGenericSensorTests(AmbientLightSensor, update_sensor_reading, verify_sensor_reading); </script>
diff --git a/third_party/WebKit/LayoutTests/sensor/gyroscope.html b/third_party/WebKit/LayoutTests/sensor/gyroscope.html index 584824f..fc0250a 100644 --- a/third_party/WebKit/LayoutTests/sensor/gyroscope.html +++ b/third_party/WebKit/LayoutTests/sensor/gyroscope.html
@@ -24,10 +24,17 @@ buffer[2] += readsCount; } -function verify_sensor_reading(reading) { - return reading.x == kDefaultReadingX && - reading.y == kDefaultReadingY && - reading.z == kDefaultReadingZ; +function verify_sensor_reading(sensor, should_be_null) { + if (should_be_null) { + return sensor.x == null && + sensor.y == null && + sensor.z == null && + sensor.timestamp == null; + } + return sensor.x == kDefaultReadingX && + sensor.y == kDefaultReadingY && + sensor.z == kDefaultReadingZ && + sensor.timestamp != null; } runGenericSensorTests(Gyroscope, update_sensor_reading, verify_sensor_reading);
diff --git a/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html b/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html index 891d1e7..2ea7abc 100644 --- a/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html +++ b/third_party/WebKit/LayoutTests/sensor/idl-Accelerometer.html
@@ -5,8 +5,5 @@ test(function() { // Test that Accelerometer interface exists assert_true('Accelerometer' in window); - // Test that AccelerometerReading interface exists - assert_true('AccelerometerReading' in window); -}, 'Test that the Accelerometer and AccelerometerReading interfaces' - + ' are present.'); +}, 'Test that the Accelerometer interface is present'); </script>
diff --git a/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html b/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html index 660772f..cf43db9 100644 --- a/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html +++ b/third_party/WebKit/LayoutTests/sensor/idl-AmbientLightSensor.html
@@ -6,9 +6,6 @@ test(function() { // Test that AmbientLightSensor interface exists assert_true('AmbientLightSensor' in window); - // Test that AmbientLightSensorReading interface exists - assert_true('AmbientLightSensorReading' in window); -}, 'Test that the AmbientLightSensor and AmbientLightSensorReading interfaces' - + ' are present.'); +}, 'Test that the AmbientLightSensor interface is present'); </script>
diff --git a/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html b/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html index 3030632..976ddf8 100644 --- a/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html +++ b/third_party/WebKit/LayoutTests/sensor/idl-Gyroscope.html
@@ -5,7 +5,5 @@ test(function() { // Test that Gyroscope interface exists assert_true('Gyroscope' in window); - // Test that GyroscopeReading interface exists - assert_true('GyroscopeReading' in window); -}, 'Test that the Gyroscope and GyroscopeReading interfaces are present.'); +}, 'Test that the Gyroscope interface is present.'); </script>
diff --git a/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html b/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html index 62a7bdc..f7f8eed 100644 --- a/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html +++ b/third_party/WebKit/LayoutTests/sensor/idl-Magnetometer.html
@@ -6,9 +6,6 @@ test(function() { // Test that Magnetometer interface exists assert_true('Magnetometer' in window); - // Test that MagnetometerReading interface exists - assert_true('MagnetometerReading' in window); -}, 'Test that the Magnetometer and MagnetometerReading interfaces' - + ' are present.'); +}, 'Test that the Magnetometer interface is present.'); </script>
diff --git a/third_party/WebKit/LayoutTests/sensor/magnetometer.html b/third_party/WebKit/LayoutTests/sensor/magnetometer.html index 3ad97e5..14f429e0 100644 --- a/third_party/WebKit/LayoutTests/sensor/magnetometer.html +++ b/third_party/WebKit/LayoutTests/sensor/magnetometer.html
@@ -24,10 +24,17 @@ buffer[2] += readsCount; } -function verify_sensor_reading(reading) { - return reading.x == kDefaultReadingValueX && - reading.y == kDefaultReadingValueY && - reading.z == kDefaultReadingValueZ; +function verify_sensor_reading(sensor, should_be_null) { + if (should_be_null) { + return sensor.x == null && + sensor.y == null && + sensor.z == null && + sensor.timestamp == null; + } + return sensor.x == kDefaultReadingValueX && + sensor.y == kDefaultReadingValueY && + sensor.z == kDefaultReadingValueZ && + sensor.timestamp != null; } runGenericSensorTests(Magnetometer, update_sensor_reading, verify_sensor_reading);
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js index 82c6ce6..3f671e4 100644 --- a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js +++ b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
@@ -170,9 +170,9 @@ .then((mockSensor) => { return new Promise((resolve, reject) => { let wrapper = new CallbackWrapper(() => { - assert_true(verifyReading(sensorObject.reading)); + assert_true(verifyReading(sensorObject)); sensorObject.stop(); - assert_equals(sensorObject.reading, null); + assert_true(verifyReading(sensorObject, true /*should be null*/)); resolve(mockSensor); }, reject); @@ -204,7 +204,7 @@ .then(mockSensor => { return new Promise((resolve, reject) => { let wrapper = new CallbackWrapper(() => { - assert_true(verifyReading(sensorObject.reading)); + assert_true(verifyReading(sensorObject)); resolve(mockSensor); }, reject); @@ -246,24 +246,19 @@ .then((mockSensor) => { return new Promise((resolve, reject) => { let wrapper = new CallbackWrapper(() => { - // Reading value is correct. - assert_true(verifyReading(sensor1.reading)); + // Reading values are correct for both sensors. + assert_true(verifyReading(sensor1)); + assert_true(verifyReading(sensor2)); - // Both sensors share the same reading instance. - let reading = sensor1.reading; - assert_equals(reading, sensor2.reading); - - // After first sensor stops its reading is null, reading for second - // sensor sensor remains. + // After first sensor stops its reading values are null, + // reading values for the second sensor sensor remain. sensor1.stop(); - assert_equals(sensor1.reading, null); - assert_true(verifyReading(sensor2.reading)); + assert_true(verifyReading(sensor1, true /*should be null*/)); + assert_true(verifyReading(sensor2)); sensor2.stop(); - assert_equals(sensor2.reading, null); + assert_true(verifyReading(sensor2, true /*should be null*/)); - // Cached reading remains. - assert_true(verifyReading(reading)); resolve(mockSensor); }, reject);
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt new file mode 100644 index 0000000..43d4b94b --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/fast/workers/worker-atomics-wait-expected.txt
@@ -0,0 +1,6 @@ +Test that Atomics.wait is not allowed on the main thread. + +PASS: Calling Atomics.wait on the main thread throws. +PASS: Atomics.wait is allowed in a worker. +DONE +
diff --git a/third_party/WebKit/LayoutTests/vr/multiple_requestAnimationFrame_called.html b/third_party/WebKit/LayoutTests/vr/multiple_requestAnimationFrame_called.html new file mode 100644 index 0000000..1aa923b --- /dev/null +++ b/third_party/WebKit/LayoutTests/vr/multiple_requestAnimationFrame_called.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script src="../resources/mojo-helpers.js"></script> +<script src="resources/fake-vr-displays.js"></script> +<script src="resources/mock-vr-service.js"></script> +<script> +let fakeDisplays = fakeVRDisplays(); + +vr_test( (t) => { + return navigator.getVRDisplays().then( (displays) => { + let display = displays[0]; + let onAnimationFrame3_time = -1; + function onAnimationFrame() { + display.requestAnimationFrame(onAnimationFrame3); + } + + function onAnimationFrame2() { + display.requestAnimationFrame(onAnimationFrame4); + } + + function onAnimationFrame3(time) { + onAnimationFrame3_time = time; + } + + function onAnimationFrame4(time) { + t.step(function() { + assert_equals(time, onAnimationFrame3_time); + }); + t.done(); + } + + display.requestAnimationFrame(onAnimationFrame); + display.requestAnimationFrame(onAnimationFrame2); + }, (err) => { + t.step( () => { + assert_unreached("getVRDisplays rejected"); + }); + t.done(); + }); +}, [fakeDisplays["Pixel"]], +"multiple requestAnimationFrame requests call the correct callbacks"); + +</script>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass-expected.txt deleted file mode 100644 index 5296132..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad allpass filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Allpass filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass.html index 9305e2d..2fb3260 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-allpass.html
@@ -2,46 +2,37 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad allpass filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad allpass filter"); + // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); - var filterParameters = [{cutoff : 0, q : 10, gain : 1 }, + let filterParameters = [{cutoff : 0, q : 10, gain : 1 }, {cutoff : 1, q : 10, gain : 1 }, {cutoff : .5, q : 0, gain : 1 }, {cutoff : 0.25, q : 10, gain : 1 }, ]; createTestAndRun(context, "allpass", { + should: should, threshold: 3.9337e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass-expected.txt deleted file mode 100644 index 0bb97d4a..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad bandpass filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Bandpass filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass.html index 8eeb209e..9e9a241 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-bandpass.html
@@ -2,48 +2,39 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad bandpass filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad bandpass filter."); + // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 0, gain : 1 }, + let filterParameters = [{cutoff : 0, q : 0, gain : 1 }, {cutoff : 1, q : 0, gain : 1 }, {cutoff : 0.5, q : 0, gain : 1 }, {cutoff : 0.25, q : 1, gain : 1 }, ]; createTestAndRun(context, "bandpass", { + should: should, threshold: 2.2501e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass-expected.txt deleted file mode 100644 index f3e6fb58..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad highpass filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Highpass filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass.html index 2c1ad0eaa..1eb86e5 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highpass.html
@@ -2,47 +2,37 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad highpass filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad highpass filter"); // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 1, gain : 1 }, + let filterParameters = [{cutoff : 0, q : 1, gain : 1 }, {cutoff : 1, q : 1, gain : 1 }, {cutoff : 0.25, q : 1, gain : 1 }, ]; createTestAndRun(context, "highpass", { + should: should, threshold: 1.5487e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf-expected.txt deleted file mode 100644 index 4e86343..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad highshelf filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Highshelf filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf.html index 10002c7..7480684 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-highshelf.html
@@ -2,47 +2,38 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad highshelf filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad highshelf filter"); + // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 10, gain : 10 }, + let filterParameters = [{cutoff : 0, q : 10, gain : 10 }, {cutoff : 1, q : 10, gain : 10 }, {cutoff : 0.25, q : 10, gain : 10 }, ]; createTestAndRun(context, "highshelf", { + should: should, threshold: 5.6633e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass-expected.txt deleted file mode 100644 index 86bf013..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad lowpass filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Lowpass filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass.html index 2e17982..18d9af0 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowpass.html
@@ -2,34 +2,26 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad lowpass filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad lowpass filter"); + // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 1, gain : 1 }, + let filterParameters = [{cutoff : 0, q : 1, gain : 1 }, {cutoff : 1, q : 1, gain : 1 }, {cutoff : 0.25, q : 1, gain : 1 }, {cutoff : 0.25, q : 1, gain : 1, detune : 100 }, @@ -37,14 +29,13 @@ ]; createTestAndRun(context, "lowpass", { + should: should, threshold: 9.7869e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf-expected.txt deleted file mode 100644 index 97f5002..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad lowshelf filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Lowshelf filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf.html index a72b005..f111149 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-lowshelf.html
@@ -2,47 +2,38 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad lowshelf filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; +audit.define("test", function (task, should) { + task.describe("Biquad lowshelf filter"); // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 10, gain : 10 }, + let filterParameters = [{cutoff : 0, q : 10, gain : 10 }, {cutoff : 1, q : 10, gain : 10 }, {cutoff : 0.25, q : 10, gain : 10 }, ]; createTestAndRun(context, "lowshelf", { + should: should, threshold: 3.8349e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch-expected.txt deleted file mode 100644 index df4635a..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad notch filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Notch filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch.html index 21dfe0f..f0ed46d 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-notch.html
@@ -2,29 +2,21 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad notch filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; - +audit.define("test", function (task, should) { + task.describe("Biquad notch filter"); + // Create offline audio context. var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); @@ -35,14 +27,13 @@ ]; createTestAndRun(context, "notch", { + should: should, threshold: 1.9669e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking-expected.txt b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking-expected.txt deleted file mode 100644 index 4e83627..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests Biquad peaking filter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Rendered output did not have infinities or NaNs. -PASS Peaking filter response is correct. -PASS Test signal was correctly filtered. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking.html b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking.html index 4abacdc..743fc38 100644 --- a/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking.html +++ b/third_party/WebKit/LayoutTests/webaudio/BiquadFilter/biquad-peaking.html
@@ -2,48 +2,41 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> <script src="../resources/biquad-filters.js"></script> <script src="../resources/biquad-testing.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests Biquad peaking filter."); +let audit = Audit.createTaskRunner(); -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } +audit.define("test", function (task, should) { + task.describe("Biquad peaking filter"); window.jsTestIsAsync = true; // Create offline audio context. - var context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); + let context = new OfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate); // The filters we want to test. - var filterParameters = [{cutoff : 0, q : 10, gain : 10 }, + let filterParameters = [{cutoff : 0, q : 10, gain : 10 }, {cutoff : 1, q : 10, gain : 10 }, {cutoff : .5, q : 0, gain : 10 }, {cutoff : 0.25, q : 10, gain : 10 }, ]; createTestAndRun(context, "peaking", { + should: should, threshold: 5.8234e-8, filterParameters: filterParameters - }); -} + }).then(task.done.bind(task)); +}); -runTest(); -successfullyParsed = true; - +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic-expected.txt deleted file mode 100644 index 7369d8c..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -Basic tests for ChannelMerger. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS context.createChannelMerger() did not throw an exception. -PASS context.createChannelMerger(0) threw IndexSizeError: Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (0) is outside the range [1, 32].. -PASS context.createChannelMerger(32) did not throw an exception. -PASS context.createChannelMerger(33) threw IndexSizeError: Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (33) is outside the range [1, 32].. -PASS merger.channelCount is equal to 1. -PASS merger.channelCount = 3 threw InvalidStateError: Failed to set the 'channelCount' property on 'AudioNode': ChannelMerger: channelCount cannot be changed from 1. -PASS merger.channelCountMode is equal to "explicit". -PASS merger.channelCountMode = "max" threw InvalidStateError: Failed to set the 'channelCountMode' property on 'AudioNode': ChannelMerger: channelCountMode cannot be changed from 'explicit'. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic.html index 2da39a3..521079a1 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-basic.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> <script src="../resources/audio-testing.js"></script> </head> <body> <script> - description("Basic tests for ChannelMerger."); - window.jsTestIsAsync = true; var audit = Audit.createTaskRunner(); @@ -62,7 +61,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle-expected.txt deleted file mode 100644 index 618e15a..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -Test if ChannelMergerNode runs correctly in a cycle. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS ChannerMergerNode passed cyclic audio graph test. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle.html index 913d7e6..1cd3476 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-cycle.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> <script src="../resources/audio-testing.js"></script> </head> <body> <script> - description("Test if ChannelMergerNode runs correctly in a cycle."); - window.jsTestIsAsync = true; // This specific sample rate is chosen to avoid the round/truncation error // in delay time. See: crbug.com/448801 @@ -60,6 +59,7 @@ // the stereo channel will be summed to mono resulting in 0.5. var expected_left = []; var expected_right = []; + var success = true; for (var i = 0; i < renderLength; i++) { // Note that the delayed channel will be zero for the first 128 samples @@ -69,35 +69,22 @@ expected_right[i] = (i < renderingQuantum * 2) ? 0.0 : 0.5; } - for (i = 0; i < buffer.numberOfChannels; i++) { - var actual_left = buffer.getChannelData(0); - var actual_right = buffer.getChannelData(1); - for (var j = 0; j < renderLength; j++) { - if (expected_left[j] !== actual_left[j]) { - testFailed('The value ' + actual_left[j] + - 'in the left channel did not match the expected value ' + - expected_left[j] + ' at the index ' + j + '.'); - done(); - return; - } - if (expected_right[j] !== actual_right[j]) { - testFailed('The value ' + actual_left[j] + - 'in the right channel did not match the expected value ' + - expected_left[j] + ' at the index ' + j + '.'); - done(); - return; - } - } - } + var actual_left = buffer.getChannelData(0); + var actual_right = buffer.getChannelData(1); + success = Should("Left channel", actual_left) + .beEqualToArray(expected_left) && success; + success = Should("Right channel", actual_right) + .beEqualToArray(expected_right) && success; - testPassed("ChannerMergerNode passed cyclic audio graph test."); + Should("ChannelMergerNode cyclic audio graph test", success) + .summarize("passed", "failed"); + done(); }); }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect-expected.txt deleted file mode 100644 index 99229e5..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -Test ChannelMergerNode behavior on dynamic input change. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Channel #0 contains only the constant 1. -PASS Channel #1 contains all the expected values in the correct order: [1,0]. -PASS The index of first zero in the channel #1 is equal to 11008. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect.html index d6e9d600..29516451 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-disconnect.html
@@ -2,15 +2,14 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> <script src="../resources/audio-testing.js"></script> </head> <body> <script> - description('Test ChannelMergerNode behavior on dynamic input change.'); - window.jsTestIsAsync = true; var renderQuantum = 128; @@ -70,7 +69,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-expected.txt deleted file mode 100644 index 750df7b..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-expected.txt +++ /dev/null
@@ -1,29 +0,0 @@ -Test input handling behavior of ChannelMergerNode. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Channel #0 contains only the constant 0. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 1. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #0 contains only the constant 1.5. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 0. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #0 contains only the constant 1. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 0. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #0 contains only the constant 1. -PASS Channel #1 contains only the constant -1. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default-expected.txt deleted file mode 100644 index ad43193..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default-expected.txt +++ /dev/null
@@ -1,30 +0,0 @@ -Test input handling of ChannelMergerNode (non-default). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS Channel #0 contains only the constant 0. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 0. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #6 contains only the constant 1. -PASS Channel #0 contains only the constant 0. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 0. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #6 contains only the constant 1.5. -PASS Channel #0 contains only the constant 0. -PASS Channel #1 contains only the constant 0. -PASS Channel #2 contains only the constant 0. -PASS Channel #3 contains only the constant 0. -PASS Channel #4 contains only the constant 0. -PASS Channel #5 contains only the constant 0. -PASS Channel #6 contains only the constant 1. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html index abc0959..efb49add 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input-non-default.html
@@ -2,7 +2,8 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> <script src="../resources/audio-testing.js"></script> <script src="../resources/merger-testing.js"></script> @@ -10,8 +11,6 @@ <body> <script> - description('Test input handling of ChannelMergerNode (non-default).'); - window.jsTestIsAsync = true; var audit = Audit.createTaskRunner(); @@ -74,7 +73,6 @@ }); audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html index ceef300..4031f90 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelMerger/audiochannelmerger-input.html
@@ -2,7 +2,8 @@ <html> <head> - <script src="../../resources/js-test.js"></script> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> <script src="../resources/audio-testing.js"></script> <script src="../resources/merger-testing.js"></script> @@ -10,8 +11,6 @@ <body> <script> - description('Test input handling behavior of ChannelMergerNode.'); - window.jsTestIsAsync = true; var audit = Audit.createTaskRunner(); @@ -108,7 +107,6 @@ audit.defineTask('finish', function (done) { - finishJSTest(); done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter-expected.txt b/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter-expected.txt deleted file mode 100644 index 2ad4a3706..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -Tests AudioChannelSplitter. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Exception been thrown for numberOfOutputs <= 0. -PASS Exception been thrown for numberOfOutputs >= 32. -PASS AudioChannelSplitter created successfully with numberOfOutputs = 32. -PASS AudioChannelSplitter has 32 outputs when it is created with numberOfOutputs = 32. -PASS AudioChannelSplitter has one input. -PASS AudioChannelSplitter created successfully with empty parameter. -PASS AudioChannelSplitter has 6 outputs when it is created with empty parameter. -PASS ChannelSplitterNode Object is available. -PASS Correctly exchanged left and right channels. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter.html b/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter.html index f3cab43..efda359 100644 --- a/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter.html +++ b/third_party/WebKit/LayoutTests/webaudio/ChannelSplitter/audiochannelsplitter.html
@@ -6,18 +6,16 @@ <html> <head> -<script src="../../resources/js-test.js"></script> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> <script src="../resources/audit-util.js"></script> -<script src="../resources/audio-testing.js"></script> +<script src="../resources/audit.js"></script> </head> <body> -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests AudioChannelSplitter."); +var audit = Audit.createTaskRunner(); var sampleRate = 44100.0; var lengthInSampleFrames = 512; @@ -44,8 +42,7 @@ // checkResult() checks that the rendered buffer is stereo and that the left channel is all -1 and right channel all +1. // In other words, we've reversed the order of the two channels. -function checkResult(event) { - var buffer = event.renderedBuffer; +function checkResult(buffer, should) { var success = true; @@ -53,82 +50,61 @@ var bufferDataL = buffer.getChannelData(0); var bufferDataR = buffer.getChannelData(1); - // Go through every sample and make sure it's all -1 for the left-channel, and all +1 for the right-channel. - for (var i = 0; i < buffer.length; ++i) { - if (bufferDataL[i] != -1 || bufferDataR[i] != 1) { - success = false; - break; - } - } + success = should(bufferDataL, "Left channel") + .beConstantValueOf(-1) && success; + success = should(bufferDataR, "Right channel") + .beConstantValueOf(1) && success; } else { success = false; } - if (success) { - testPassed("Correctly exchanged left and right channels."); - } else { - testFailed("Error on exchanging left and right channels."); - } - - finishJSTest(); + should(success, "Left and right channels were exchanged") + .message("correctly", "incorrectly"); } -function runTest() { - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - } - - window.jsTestIsAsync = true; +audit.define("construction", function (task, should) { + task.describe("Construction of ChannelSplitterNode"); // Create stereo offline audio context. context = new OfflineAudioContext(2, lengthInSampleFrames, sampleRate); - try { - var splitternode = context.createChannelSplitter(0); - testFailed("Exception should be thrown for numberOfOutputs <= 0."); - } catch(e) { - testPassed("Exception been thrown for numberOfOutputs <= 0."); - } + var splitternode; + should(() => { + var splitternode = context.createChannelSplitter(0); + }, "createChannelSplitter(0)") + .throw("IndexSizeError"); - try { - var splitternode = context.createChannelSplitter(33); - testFailed("Exception should be thrown for numerOfOutputs >= 32."); - } catch(e) { - testPassed("Exception been thrown for numberOfOutputs >= 32."); - } + should(() => { + splitternode = context.createChannelSplitter(33); + }, "createChannelSplitter(33)") + .throw("IndexSizeError"); - try { - var splitternode = context.createChannelSplitter(32); - testPassed("AudioChannelSplitter created successfully with numberOfOutputs = 32."); - if (splitternode.numberOfOutputs === 32) - testPassed("AudioChannelSplitter has 32 outputs when it is created with numberOfOutputs = 32."); - else - testFailed("AudioChannelSplitter should have 32 outputs when it is created with numberOfOutputs = 32."); + should(() => { + splitternode = context.createChannelSplitter(32); + }, "splitternode = context.createChannelSplitter(32)") + .notThrow(); - if (splitternode.numberOfInputs === 1) - testPassed("AudioChannelSplitter has one input."); - else - testFailed("AudioChannelSplitter should have one input."); - } catch(e) { - testFailed("Failed to create AudioChannelSplitter with numberOfInputs = 32."); - } + should(splitternode.numberOfOutputs, + "splitternode.numberOfOutputs") + .beEqualTo(32); + should(splitternode.numberOfInputs, + "splitternode.numberOfInputs") + .beEqualTo(1) - try { - var splitternode = context.createChannelSplitter(); - testPassed("AudioChannelSplitter created successfully with empty parameter."); - if (splitternode.numberOfOutputs === 6) - testPassed("AudioChannelSplitter has 6 outputs when it is created with empty parameter."); - else - testFailed("AudioChannelSplitter should have 6 outputs when it is created with empty parameter."); + should(() => { + splitternode = context.createChannelSplitter(); + }, "splitternode = context.createChannelSplitter()") + .notThrow(); - if (splitternode.toString().indexOf("ChannelSplitterNode") > -1) - testPassed("ChannelSplitterNode Object is available."); - else - testFailed("ChannelSplitterNode Object is not available."); - } catch(e) { - testFailed("Failed to create AudioChannelSplitter with empty parameter."); - } + should(splitternode.numberOfOutputs, + "splitternode.numberOfOutputs") + .beEqualTo(6); + + task.done(); +}); + +audit.define("functionality", function (task, should) { + task.describe("Functionality of ChannelSplitterNode"); // Create a stereo buffer, with all +1 values in left channel, all -1 in right channel. sourceBuffer = createStereoBufferWithDCOffset(lengthInSampleFrames, sampleRate, 1); @@ -150,11 +126,12 @@ sourceNode.start(0); - context.oncomplete = checkResult; - context.startRendering(); -} + context.startRendering() + .then(buffer => checkResult(buffer, should)) + .then(task.done.bind(task)); +}); -runTest(); +audit.run(); </script>
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js b/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js index dea7b1c..747d844e 100644 --- a/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js +++ b/third_party/WebKit/LayoutTests/webaudio/resources/biquad-testing.js
@@ -76,8 +76,10 @@ signal[k].start(timeStep * k); } - context.oncomplete = checkFilterResponse(filterType, testParameters); - context.startRendering(); + return context.startRendering() + .then(buffer => { + checkFilterResponse(buffer, filterType, testParameters); + }); } function addSignal(dest, src, destOffset) { @@ -116,67 +118,51 @@ return result; } -function checkFilterResponse(filterType, testParameters) { - return function(event) { - var filterParameters = testParameters.filterParameters; - var maxAllowedError = testParameters.threshold; - renderedBuffer = event.renderedBuffer; - renderedData = renderedBuffer.getChannelData(0); +function checkFilterResponse(renderedBuffer, filterType, testParameters) { + var filterParameters = testParameters.filterParameters; + var maxAllowedError = testParameters.threshold; + var should = testParameters.should; - reference = generateReference(filterType, filterParameters); - - var len = Math.min(renderedData.length, reference.length); + renderedData = renderedBuffer.getChannelData(0); - var success = true; + reference = generateReference(filterType, filterParameters); - // Maximum error between rendered data and expected data - var maxError = 0; + var len = Math.min(renderedData.length, reference.length); - // Sample offset where the maximum error occurred. - var maxPosition = 0; + var success = true; - // Number of infinities or NaNs that occurred in the rendered data. - var invalidNumberCount = 0; + // Maximum error between rendered data and expected data + var maxError = 0; - if (nFilters != filterParameters.length) { - testFailed("Test wanted " + filterParameters.length + " filters but only " + maxFilters + " allowed."); - success = false; + // Sample offset where the maximum error occurred. + var maxPosition = 0; + + // Number of infinities or NaNs that occurred in the rendered data. + var invalidNumberCount = 0; + + should(nFilters, "Number of filters tested") + .beEqualTo(filterParameters.length); + + // Compare the rendered signal with our reference, keeping + // track of the maximum difference (and the offset of the max + // difference.) Check for bad numbers in the rendered output + // too. There shouldn't be any. + for (var k = 0; k < len; ++k) { + var err = Math.abs(renderedData[k] - reference[k]); + if (err > maxError) { + maxError = err; + maxPosition = k; } - - // Compare the rendered signal with our reference, keeping - // track of the maximum difference (and the offset of the max - // difference.) Check for bad numbers in the rendered output - // too. There shouldn't be any. - for (var k = 0; k < len; ++k) { - var err = Math.abs(renderedData[k] - reference[k]); - if (err > maxError) { - maxError = err; - maxPosition = k; - } - if (!isValidNumber(renderedData[k])) { - ++invalidNumberCount; - } + if (!isValidNumber(renderedData[k])) { + ++invalidNumberCount; } - - if (invalidNumberCount > 0) { - testFailed("Rendered output has " + invalidNumberCount + " infinities or NaNs."); - success = false; - } else { - testPassed("Rendered output did not have infinities or NaNs."); - } - - if (maxError <= maxAllowedError) { - testPassed(filterTypeName[filterType] + " response is correct."); - } else { - testFailed(filterTypeName[filterType] + " response is incorrect. Max err = " + maxError + " at " + maxPosition + ". Threshold = " + maxAllowedError); - success = false; - } - - if (success) { - testPassed("Test signal was correctly filtered."); - } else { - testFailed("Test signal was not correctly filtered."); - } - finishJSTest(); } + + should(invalidNumberCount, + "Number of non-finite values in the rendered output") + .beEqualTo(0); + + should(maxError, + "Max error in " + filterTypeName[filterType] + " response") + .beLessThanOrEqualTo(maxAllowedError); }
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 50e669f..cf04b88 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -8,20 +8,12 @@ interface Accelerometer : Sensor attribute @@toStringTag getter includesGravity - getter reading - method constructor -interface AccelerometerReading : SensorReading - attribute @@toStringTag getter x getter y getter z method constructor interface AmbientLightSensor : Sensor attribute @@toStringTag - getter reading - method constructor -interface AmbientLightSensorReading : SensorReading - attribute @@toStringTag getter illuminance method constructor interface AnalyserNode : AudioNode @@ -1957,10 +1949,6 @@ method constructor interface Gyroscope : Sensor attribute @@toStringTag - getter reading - method constructor -interface GyroscopeReading : SensorReading - attribute @@toStringTag getter x getter y getter z @@ -3829,10 +3817,6 @@ setter onstatechange interface Magnetometer : Sensor attribute @@toStringTag - getter reading - method constructor -interface MagnetometerReading : SensorReading - attribute @@toStringTag getter x getter y getter z @@ -5019,12 +5003,6 @@ method pipeThrough method pipeTo method tee -interface RelatedApplication - attribute @@toStringTag - getter id - getter platform - getter url - method constructor interface RelatedEvent : Event attribute @@toStringTag getter relatedTarget @@ -6261,8 +6239,8 @@ getter onactivate getter onchange getter onerror - getter reading getter state + getter timestamp method constructor method start method stop @@ -6273,10 +6251,6 @@ attribute @@toStringTag getter error method constructor -interface SensorReading - attribute @@toStringTag - getter timeStamp - method constructor interface ServiceWorker : EventTarget attribute @@toStringTag getter onerror
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h index 951117d6..8fdb3a4 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
@@ -22,6 +22,7 @@ const String& source, const String& fileName); + ScriptModule() {} ScriptModule(const ScriptModule& module) : m_module(module.m_module) {} ~ScriptModule();
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp index 8f84ae2..4dcdb81 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
@@ -25,7 +25,8 @@ data.GetParameter()->deref(); } -static void weakCallback(const v8::WeakCallbackInfo<ScriptState>& data) { +static void contextCollectedCallback( + const v8::WeakCallbackInfo<ScriptState>& data) { data.GetParameter()->clearContext(); data.SetSecondPassCallback(derefCallback); } @@ -38,7 +39,7 @@ m_perContextData(V8PerContextData::create(context)) { DCHECK(m_world); - m_context.setWeak(this, &weakCallback); + m_context.setWeak(this, &contextCollectedCallback); context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this); }
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp index d66e6be..edee432 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -116,7 +116,7 @@ return exception->toStringForConsole(); } } - return emptyString(); + return emptyString; } namespace {
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp index 906e829..6286d78 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -55,7 +55,10 @@ V8PerIsolateData::V8PerIsolateData(WebTaskRunner* taskRunner) : m_isolateHolder(WTF::makeUnique<gin::IsolateHolder>( - taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr)), + taskRunner ? taskRunner->toSingleThreadTaskRunner() : nullptr, + gin::IsolateHolder::kSingleThread, + isMainThread() ? gin::IsolateHolder::kDisallowAtomicsWait + : gin::IsolateHolder::kAllowAtomicsWait)), m_stringCache(WTF::wrapUnique(new StringCache(isolate()))), m_hiddenValue(V8HiddenValue::create()), m_privateProperty(V8PrivateProperty::create()),
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h index b6009b8..6be2547 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.h
@@ -280,7 +280,7 @@ template <> inline String V8StringResource<TreatNullAsEmptyString>::fallbackString() const { - return emptyString(); + return emptyString; } template <>
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp index 0d13046..81a625b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -55,7 +55,7 @@ "responseText"); ScriptString text = xmlHttpRequest->responseText(exceptionState); if (text.isEmpty()) { - v8SetReturnValueString(info, emptyString(), info.GetIsolate()); + v8SetReturnValueString(info, emptyString, info.GetIsolate()); return; } v8SetReturnValue(info, text.v8Value());
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp index 4942770..d4cfa6b6 100644 --- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp
@@ -312,7 +312,7 @@ file->type(), lastModified, size); writeUint32(static_cast<uint32_t>(index)); } else { - writeUTF8String(file->hasBackingFile() ? file->path() : emptyString()); + writeUTF8String(file->hasBackingFile() ? file->path() : emptyString); writeUTF8String(file->name()); writeUTF8String(file->webkitRelativePath()); writeUTF8String(file->uuid());
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py index ad1fbc02..87d1d6a3 100755 --- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py +++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
@@ -156,7 +156,7 @@ const char* cssPropertyName = getPropertyName(id); const char* propertyNamePointer = cssPropertyName; if (!propertyNamePointer) - return emptyString(); + return emptyString; char* resultPointer = result; while (char character = *propertyNamePointer++) {
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h index 76d2285..f9cec13 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
@@ -49,7 +49,7 @@ static CSSFontFaceSrcValue* createLocal( const String& absoluteResource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { - return new CSSFontFaceSrcValue(emptyString(), absoluteResource, true, + return new CSSFontFaceSrcValue(emptyString, absoluteResource, true, shouldCheckContentSecurityPolicy); }
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h index 461b1b00..3cf65c87 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -1901,25 +1901,25 @@ inline CSSIdentifierValue::CSSIdentifierValue(EOverflow e) : CSSValue(IdentifierClass) { switch (e) { - case EOverflow::Visible: + case EOverflow::kVisible: m_valueID = CSSValueVisible; break; - case EOverflow::Hidden: + case EOverflow::kHidden: m_valueID = CSSValueHidden; break; - case EOverflow::Scroll: + case EOverflow::kScroll: m_valueID = CSSValueScroll; break; - case EOverflow::Auto: + case EOverflow::kAuto: m_valueID = CSSValueAuto; break; - case EOverflow::Overlay: + case EOverflow::kOverlay: m_valueID = CSSValueOverlay; break; - case EOverflow::PagedX: + case EOverflow::kWebkitPagedX: m_valueID = CSSValueWebkitPagedX; break; - case EOverflow::PagedY: + case EOverflow::kWebkitPagedY: m_valueID = CSSValueWebkitPagedY; break; } @@ -1929,25 +1929,25 @@ inline EOverflow CSSIdentifierValue::convertTo() const { switch (m_valueID) { case CSSValueVisible: - return EOverflow::Visible; + return EOverflow::kVisible; case CSSValueHidden: - return EOverflow::Hidden; + return EOverflow::kHidden; case CSSValueScroll: - return EOverflow::Scroll; + return EOverflow::kScroll; case CSSValueAuto: - return EOverflow::Auto; + return EOverflow::kAuto; case CSSValueOverlay: - return EOverflow::Overlay; + return EOverflow::kOverlay; case CSSValueWebkitPagedX: - return EOverflow::PagedX; + return EOverflow::kWebkitPagedX; case CSSValueWebkitPagedY: - return EOverflow::PagedY; + return EOverflow::kWebkitPagedY; default: break; } ASSERT_NOT_REACHED(); - return EOverflow::Visible; + return EOverflow::kVisible; } template <>
diff --git a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp index 53d9242..bdff583 100644 --- a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp +++ b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp
@@ -100,7 +100,7 @@ if (offset != input.length()) return; m_syntaxComponents.push_back( - CSSSyntaxComponent(CSSSyntaxType::TokenStream, emptyString(), false)); + CSSSyntaxComponent(CSSSyntaxType::TokenStream, emptyString, false)); return; }
diff --git a/third_party/WebKit/Source/core/css/FontFace.cpp b/third_party/WebKit/Source/core/css/FontFace.cpp index 87adc29..790bd98 100644 --- a/third_party/WebKit/Source/core/css/FontFace.cpp +++ b/third_party/WebKit/Source/core/css/FontFace.cpp
@@ -362,7 +362,7 @@ default: NOTREACHED(); } - return emptyString(); + return emptyString; } void FontFace::setLoadStatus(LoadStatusType status) {
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp index 3693f7e..9314b06a 100644 --- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp +++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
@@ -351,7 +351,7 @@ for (int i = 0; i < longhandCount; i++) { int index = m_propertySet.findPropertyIndex(shorthand.properties()[i]); if (index == -1) - return emptyString(); + return emptyString; PropertyValueForSerializer value = m_propertySet.propertyAt(index); hasImportant |= value.isImportant(); @@ -360,14 +360,14 @@ } if (hasImportant && hasNonImportant) - return emptyString(); + return emptyString; if (longhands[0]->isCSSWideKeyword() || longhands[0]->isPendingSubstitutionValue()) { bool success = true; for (int i = 1; i < longhandCount; i++) { if (!longhands[i]->equals(*longhands[0])) { - // This should just return emptyString() but some shorthands currently + // This should just return emptyString but some shorthands currently // allow 'initial' for their longhands. success = false; break; @@ -386,12 +386,12 @@ for (int i = 0; i < longhandCount; i++) { const CSSValue& value = *longhands[i]; if (!allowInitial && value.isInitialValue()) - return emptyString(); + return emptyString; if (value.isInheritedValue() || value.isUnsetValue() || value.isPendingSubstitutionValue()) - return emptyString(); + return emptyString; if (value.isVariableReferenceValue()) - return emptyString(); + return emptyString; } return String(); @@ -600,7 +600,7 @@ (numericValue->isIdentifierValue() && toCSSIdentifierValue(numericValue)->getValueID() != CSSValueNormal) || numericValue->isValueList()) - return emptyString(); + return emptyString; StringBuilder result; appendFontLonghandValueIfNotNormal(CSSPropertyFontStyle, result); @@ -609,7 +609,7 @@ if (val->isIdentifierValue() && (toCSSIdentifierValue(val)->getValueID() != CSSValueSmallCaps && toCSSIdentifierValue(val)->getValueID() != CSSValueNormal)) - return emptyString(); + return emptyString; appendFontLonghandValueIfNotNormal(CSSPropertyFontVariantCaps, result); appendFontLonghandValueIfNotNormal(CSSPropertyFontWeight, result);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp index cfd0007..dae63bff1 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.cpp
@@ -41,7 +41,7 @@ CSSParserContext* CSSParserContext::create(CSSParserMode mode, SelectorProfile profile, UseCounter* useCounter) { - return new CSSParserContext(KURL(), emptyString(), mode, mode, profile, + return new CSSParserContext(KURL(), emptyString, mode, mode, profile, Referrer(), false, false, DoNotCheckContentSecurityPolicy, useCounter); } @@ -49,8 +49,8 @@ // static CSSParserContext* CSSParserContext::create(const Document& document, UseCounter* useCounter) { - return CSSParserContext::create(document, KURL(), emptyString(), - DynamicProfile, useCounter); + return CSSParserContext::create(document, KURL(), emptyString, DynamicProfile, + useCounter); } // static
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h index 818a7c46..33381ec 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h
@@ -45,7 +45,7 @@ static CSSParserContext* create(const Document&, UseCounter*); static CSSParserContext* create(const Document&, const KURL& baseURLOverride = KURL(), - const String& charset = emptyString(), + const String& charset = emptyString, SelectorProfile = DynamicProfile, UseCounter* = nullptr);
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index deae8c986..990fd70 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -2019,6 +2019,24 @@ break; } + case CSSPropertyWebkitUserModify: { + switch (valueID) { + case CSSValueReadOnly: + context->useCounter()->count(UseCounter::CSSValueUserModifyReadOnly); + break; + case CSSValueReadWrite: + context->useCounter()->count(UseCounter::CSSValueUserModifyReadWrite); + break; + case CSSValueReadWritePlaintextOnly: + context->useCounter()->count( + UseCounter::CSSValueUserModifyReadWritePlaintextOnly); + break; + default: + NOTREACHED(); + } + break; + } + default: break; }
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp index d396c29c..a261919 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -231,8 +231,8 @@ if (isHTMLFrameElementBase(element)) { // Frames cannot overflow (they are always the size we ask them to be). // Some compositing code paths may try to draw scrollbars anyhow. - style.setOverflowX(EOverflow::Visible); - style.setOverflowY(EOverflow::Visible); + style.setOverflowX(EOverflow::kVisible); + style.setOverflowY(EOverflow::kVisible); return; } @@ -251,18 +251,18 @@ if (isHTMLMarqueeElement(element)) { // For now, <marquee> requires an overflow clip to work properly. - style.setOverflowX(EOverflow::Hidden); - style.setOverflowY(EOverflow::Hidden); + style.setOverflowX(EOverflow::kHidden); + style.setOverflowY(EOverflow::kHidden); return; } if (isHTMLTextAreaElement(element)) { // Textarea considers overflow visible as auto. - style.setOverflowX(style.overflowX() == EOverflow::Visible - ? EOverflow::Auto + style.setOverflowX(style.overflowX() == EOverflow::kVisible + ? EOverflow::kAuto : style.overflowX()); - style.setOverflowY(style.overflowY() == EOverflow::Visible - ? EOverflow::Auto + style.setOverflowY(style.overflowY() == EOverflow::kVisible + ? EOverflow::kAuto : style.overflowY()); return; } @@ -275,8 +275,8 @@ } static void adjustOverflow(ComputedStyle& style) { - DCHECK(style.overflowX() != EOverflow::Visible || - style.overflowY() != EOverflow::Visible); + DCHECK(style.overflowX() != EOverflow::kVisible || + style.overflowY() != EOverflow::kVisible); if (style.display() == EDisplay::Table || style.display() == EDisplay::InlineTable) { @@ -285,34 +285,34 @@ // a table is not a block container box the rules for resolving conflicting // x and y values in CSS Overflow Module Level 3 do not apply. Arguably // overflow-x and overflow-y aren't allowed on tables but all UAs allow it. - if (style.overflowX() != EOverflow::Hidden) - style.setOverflowX(EOverflow::Visible); - if (style.overflowY() != EOverflow::Hidden) - style.setOverflowY(EOverflow::Visible); + if (style.overflowX() != EOverflow::kHidden) + style.setOverflowX(EOverflow::kVisible); + if (style.overflowY() != EOverflow::kHidden) + style.setOverflowY(EOverflow::kVisible); // If we are left with conflicting overflow values for the x and y axes on a // table then resolve both to OverflowVisible. This is interoperable // behaviour but is not specced anywhere. - if (style.overflowX() == EOverflow::Visible) - style.setOverflowY(EOverflow::Visible); - else if (style.overflowY() == EOverflow::Visible) - style.setOverflowX(EOverflow::Visible); - } else if (style.overflowX() == EOverflow::Visible && - style.overflowY() != EOverflow::Visible) { + if (style.overflowX() == EOverflow::kVisible) + style.setOverflowY(EOverflow::kVisible); + else if (style.overflowY() == EOverflow::kVisible) + style.setOverflowX(EOverflow::kVisible); + } else if (style.overflowX() == EOverflow::kVisible && + style.overflowY() != EOverflow::kVisible) { // If either overflow value is not visible, change to auto. // FIXME: Once we implement pagination controls, overflow-x should default // to hidden if overflow-y is set to -webkit-paged-x or -webkit-page-y. For // now, we'll let it default to auto so we can at least scroll through the // pages. - style.setOverflowX(EOverflow::Auto); - } else if (style.overflowY() == EOverflow::Visible && - style.overflowX() != EOverflow::Visible) { - style.setOverflowY(EOverflow::Auto); + style.setOverflowX(EOverflow::kAuto); + } else if (style.overflowY() == EOverflow::kVisible && + style.overflowX() != EOverflow::kVisible) { + style.setOverflowY(EOverflow::kAuto); } // Menulists should have visible overflow if (style.appearance() == MenulistPart) { - style.setOverflowX(EOverflow::Visible); - style.setOverflowY(EOverflow::Visible); + style.setOverflowX(EOverflow::kVisible); + style.setOverflowY(EOverflow::kVisible); } } @@ -433,8 +433,8 @@ style.setIsStackingContext(true); } - if (style.overflowX() != EOverflow::Visible || - style.overflowY() != EOverflow::Visible) + if (style.overflowX() != EOverflow::kVisible || + style.overflowY() != EOverflow::kVisible) adjustOverflow(style); if (doesNotInheritTextDecoration(style, element))
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp index a8426997..00a1398 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -801,7 +801,7 @@ nullAtom, toCSSCustomIdentValue(functionValue->item(0)).value(), nullAtom); const AtomicString& value = state.element()->getAttribute(attr); - string = value.isNull() ? emptyString() : value.getString(); + string = value.isNull() ? emptyString : value.getString(); } else { string = toCSSStringValue(*item).value(); }
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index e2fdb57..7f86007 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -567,8 +567,8 @@ // Document::inheritHtmlAndBodyElementStyles will set the final overflow // style values, but they should initially be auto to avoid premature // scrollbar removal in PaintLayerScrollableArea::updateAfterStyleChange. - documentStyle->setOverflowX(EOverflow::Auto); - documentStyle->setOverflowY(EOverflow::Auto); + documentStyle->setOverflowX(EOverflow::kAuto); + documentStyle->setOverflowY(EOverflow::kAuto); document.setupFontBuilder(*documentStyle);
diff --git a/third_party/WebKit/Source/core/dom/AttrTest.cpp b/third_party/WebKit/Source/core/dom/AttrTest.cpp index c86b523..03b115a 100644 --- a/third_party/WebKit/Source/core/dom/AttrTest.cpp +++ b/third_party/WebKit/Source/core/dom/AttrTest.cpp
@@ -34,8 +34,8 @@ TEST_F(AttrTest, InitialValueState) { Attr* attr = createAttribute(); EXPECT_EQ(emptyAtom, attr->value()); - EXPECT_EQ(emptyString(), attr->toNode()->nodeValue()); - EXPECT_EQ(emptyString(), attr->textContent()); + EXPECT_EQ(emptyString, attr->toNode()->nodeValue()); + EXPECT_EQ(emptyString, attr->textContent()); } TEST_F(AttrTest, SetValue) {
diff --git a/third_party/WebKit/Source/core/dom/BUILD.gn b/third_party/WebKit/Source/core/dom/BUILD.gn index d744cfc..92ce567 100644 --- a/third_party/WebKit/Source/core/dom/BUILD.gn +++ b/third_party/WebKit/Source/core/dom/BUILD.gn
@@ -181,6 +181,8 @@ "MessagePort.cpp", "Modulator.cpp", "Modulator.h", + "ModuleScript.cpp", + "ModuleScript.h", "MutationCallback.h", "MutationObserver.cpp", "MutationObserver.h",
diff --git a/third_party/WebKit/Source/core/dom/CharacterData.cpp b/third_party/WebKit/Source/core/dom/CharacterData.cpp index 6605cf0..47bd7ca 100644 --- a/third_party/WebKit/Source/core/dom/CharacterData.cpp +++ b/third_party/WebKit/Source/core/dom/CharacterData.cpp
@@ -41,7 +41,7 @@ } void CharacterData::setData(const String& data) { - const String& nonNullData = !data.isNull() ? data : emptyString(); + const String& nonNullData = !data.isNull() ? data : emptyString; if (m_data == nonNullData) return;
diff --git a/third_party/WebKit/Source/core/dom/CharacterData.h b/third_party/WebKit/Source/core/dom/CharacterData.h index 7f93e29..ff68eca 100644 --- a/third_party/WebKit/Source/core/dom/CharacterData.h +++ b/third_party/WebKit/Source/core/dom/CharacterData.h
@@ -58,7 +58,7 @@ protected: CharacterData(TreeScope& treeScope, const String& text, ConstructionType type) - : Node(&treeScope, type), m_data(!text.isNull() ? text : emptyString()) { + : Node(&treeScope, type), m_data(!text.isNull() ? text : emptyString) { DCHECK(type == CreateOther || type == CreateText || type == CreateEditingText); }
diff --git a/third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp b/third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp index a2cbc2a..0c6fe5a 100644 --- a/third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp +++ b/third_party/WebKit/Source/core/dom/DOMURLUtilsReadOnly.cpp
@@ -56,18 +56,18 @@ if (kurl.hasPort()) return String::number(kurl.port()); - return emptyString(); + return emptyString; } String DOMURLUtilsReadOnly::search(const KURL& kurl) { String query = kurl.query(); - return query.isEmpty() ? emptyString() : "?" + query; + return query.isEmpty() ? emptyString : "?" + query; } String DOMURLUtilsReadOnly::hash(const KURL& kurl) { String fragmentIdentifier = kurl.fragmentIdentifier(); if (fragmentIdentifier.isEmpty()) - return emptyString(); + return emptyString; return AtomicString(String("#" + fragmentIdentifier)); }
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index f04516c..6366ad7 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -677,7 +677,7 @@ const StringOrDictionary& stringOrOptions, ExceptionState& exceptionState) { if (stringOrOptions.isNull()) - return emptyString(); + return emptyString; if (stringOrOptions.isString()) { UseCounter::count(document, @@ -690,13 +690,14 @@ ElementCreationOptions impl; V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl, exceptionState); + if (exceptionState.hadException()) + return emptyString; + if (impl.hasIs()) return impl.is(); - - return toCoreString(dict.v8Value()->ToString()); } - return emptyString(); + return emptyString; } // https://dom.spec.whatwg.org/#dom-document-createelement @@ -1812,8 +1813,8 @@ } EOverflowAnchor overflowAnchor = EOverflowAnchor::kAuto; - EOverflow overflowX = EOverflow::Auto; - EOverflow overflowY = EOverflow::Auto; + EOverflow overflowX = EOverflow::kAuto; + EOverflow overflowY = EOverflow::kAuto; float columnGap = 0; if (overflowStyle) { overflowAnchor = overflowStyle->overflowAnchor(); @@ -1821,10 +1822,10 @@ overflowY = overflowStyle->overflowY(); // Visible overflow on the viewport is meaningless, and the spec says to // treat it as 'auto': - if (overflowX == EOverflow::Visible) - overflowX = EOverflow::Auto; - if (overflowY == EOverflow::Visible) - overflowY = EOverflow::Auto; + if (overflowX == EOverflow::kVisible) + overflowX = EOverflow::kAuto; + if (overflowY == EOverflow::kVisible) + overflowY = EOverflow::kAuto; if (overflowAnchor == EOverflowAnchor::kVisible) overflowAnchor = EOverflowAnchor::kAuto; // Column-gap is (ab)used by the current paged overflow implementation (in @@ -5386,7 +5387,7 @@ if (!initializer.hasSecurityContext()) { // No source for a security context. // This can occur via document.implementation.createDocument(). - m_cookieURL = KURL(ParsedURLString, emptyString()); + m_cookieURL = KURL(ParsedURLString, emptyString); setSecurityOrigin(SecurityOrigin::createUnique()); initContentSecurityPolicy(); // Unique security origins cannot have a suborigin
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 427d768..cef1413 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -988,7 +988,7 @@ void postTask(TaskType, const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>, - const String& taskNameForInstrumentation = emptyString()) + const String& taskNameForInstrumentation = emptyString) override; // Executes the task on context's thread asynchronously. void tasksWereSuspended() final;
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 7e63fa9..c865d2a 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3066,12 +3066,12 @@ foundMultipleTextNodes = true; unsigned length = text->data().length(); if (length > std::numeric_limits<unsigned>::max() - totalLength) - return emptyString(); + return emptyString; totalLength += length; } if (!firstTextNode) - return emptyString(); + return emptyString; if (firstTextNode && !foundMultipleTextNodes) { firstTextNode->atomize();
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index 044b4d30..17a044f 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -104,7 +104,7 @@ TaskType, const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>, - const String& taskNameForInstrumentation = emptyString()) = 0; + const String& taskNameForInstrumentation = emptyString) = 0; // Gets the DOMTimerCoordinator which maintains the "active timer // list" of tasks created by setTimeout and setInterval. The
diff --git a/third_party/WebKit/Source/core/dom/IconURL.cpp b/third_party/WebKit/Source/core/dom/IconURL.cpp index 88ac9b4..d7971283 100644 --- a/third_party/WebKit/Source/core/dom/IconURL.cpp +++ b/third_party/WebKit/Source/core/dom/IconURL.cpp
@@ -42,7 +42,7 @@ url.setPort(documentURL.port()); url.setPath("/favicon.ico"); - IconURL result(url, Vector<IntSize>(), emptyString(), Favicon); + IconURL result(url, Vector<IntSize>(), emptyString, Favicon); result.m_isDefaultIcon = true; return result; }
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp new file mode 100644 index 0000000..0ab530f --- /dev/null +++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -0,0 +1,11 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "core/dom/ModuleScript.h" + +namespace blink { + +DEFINE_TRACE(ModuleScript) {} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.h b/third_party/WebKit/Source/core/dom/ModuleScript.h new file mode 100644 index 0000000..5efe745b --- /dev/null +++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -0,0 +1,98 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ModuleScript_h +#define ModuleScript_h + +#include "bindings/core/v8/ScriptModule.h" +#include "core/CoreExport.h" +#include "platform/heap/Handle.h" +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/weborigin/KURL.h" +#include "public/platform/WebURLRequest.h" + +namespace blink { + +// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-instantiation-state +enum class ModuleInstantiationState { + Uninstantiated, + Errored, + Instantiated, +}; + +// ModuleScript is a model object for the "module script" spec concept. +// https://html.spec.whatwg.org/multipage/webappapis.html#module-script +class CORE_EXPORT ModuleScript final + : public GarbageCollectedFinalized<ModuleScript> { + public: + static ModuleScript* create( + ScriptModule record, + const KURL& baseURL, + const String& nonce, + ParserDisposition parserState, + WebURLRequest::FetchCredentialsMode credentialsMode) { + return new ModuleScript(record, baseURL, nonce, parserState, + credentialsMode); + } + ~ModuleScript() = default; + + ScriptModule& record() { return m_record; } + void clearRecord() { m_record = ScriptModule(); } + const KURL& baseURL() const { return m_baseURL; } + + ParserDisposition parserState() const { return m_parserState; } + WebURLRequest::FetchCredentialsMode credentialsMode() const { + return m_credentialsMode; + } + const String& nonce() const { return m_nonce; } + + ModuleInstantiationState instantiationState() const { + return m_instantiationState; + } + + DECLARE_TRACE(); + + private: + ModuleScript(ScriptModule record, + const KURL& baseURL, + const String& nonce, + ParserDisposition parserState, + WebURLRequest::FetchCredentialsMode credentialsMode) + : m_record(record), + m_baseURL(baseURL), + m_nonce(nonce), + m_parserState(parserState), + m_credentialsMode(credentialsMode) {} + + // Note: A "module script"'s "setttings object" is ommitted, as we currently + // always have access to the corresponding Modulator when operating on a + // ModuleScript instance. + // https://html.spec.whatwg.org/multipage/webappapis.html#settings-object + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-module-record + ScriptModule m_record; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-base-url + const KURL m_baseURL; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-instantiation-state + ModuleInstantiationState m_instantiationState = + ModuleInstantiationState::Uninstantiated; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-instantiation-error + // TODO(kouhei): Add a corresponding member. + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-nonce + const String m_nonce; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-parser + const ParserDisposition m_parserState; + + // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-credentials-mode + const WebURLRequest::FetchCredentialsMode m_credentialsMode; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/dom/PseudoElement.cpp b/third_party/WebKit/Source/core/dom/PseudoElement.cpp index fbdcc29..c0df72d 100644 --- a/third_party/WebKit/Source/core/dom/PseudoElement.cpp +++ b/third_party/WebKit/Source/core/dom/PseudoElement.cpp
@@ -77,7 +77,7 @@ case PseudoIdBefore: return before; default: - return emptyString(); + return emptyString; } }
diff --git a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp index 565e7cc..fdbe3523 100644 --- a/third_party/WebKit/Source/core/dom/SelectorQuery.cpp +++ b/third_party/WebKit/Source/core/dom/SelectorQuery.cpp
@@ -625,7 +625,7 @@ return it->value.get(); CSSSelectorList selectorList = CSSParser::parseSelector( - CSSParserContext::create(document, KURL(), emptyString(), + CSSParserContext::create(document, KURL(), emptyString, CSSParserContext::StaticProfile), nullptr, selectors);
diff --git a/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp b/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp index e64ebf2..28dde3ab 100644 --- a/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp +++ b/third_party/WebKit/Source/core/dom/SelectorQueryTest.cpp
@@ -22,7 +22,7 @@ "<body><style>span::before { content: 'X' }</style><span></span></body>"); CSSSelectorList selectorList = CSSParser::parseSelector( - CSSParserContext::create(*document, KURL(), emptyString(), + CSSParserContext::create(*document, KURL(), emptyString, CSSParserContext::StaticProfile), nullptr, "span::before"); std::unique_ptr<SelectorQuery> query = @@ -31,7 +31,7 @@ EXPECT_EQ(nullptr, elm); selectorList = CSSParser::parseSelector( - CSSParserContext::create(*document, KURL(), emptyString(), + CSSParserContext::create(*document, KURL(), emptyString, CSSParserContext::StaticProfile), nullptr, "span"); query = SelectorQuery::adopt(std::move(selectorList)); @@ -49,7 +49,7 @@ document->body()->beginParsingChildren(); CSSSelectorList selectorList = CSSParser::parseSelector( - CSSParserContext::create(*document, KURL(), emptyString(), + CSSParserContext::create(*document, KURL(), emptyString, CSSParserContext::StaticProfile), nullptr, "p:last-of-type"); std::unique_ptr<SelectorQuery> query =
diff --git a/third_party/WebKit/Source/core/dom/Text.cpp b/third_party/WebKit/Source/core/dom/Text.cpp index 325cfb8..04845a1 100644 --- a/third_party/WebKit/Source/core/dom/Text.cpp +++ b/third_party/WebKit/Source/core/dom/Text.cpp
@@ -85,7 +85,7 @@ document().didMergeTextNodes(*this, *nextText, offset); // Empty nextText for layout update. - nextText->setDataWithoutUpdate(emptyString()); + nextText->setDataWithoutUpdate(emptyString); nextText->updateTextLayoutObject(0, nextTextData.length()); // Restore nextText for mutation event.
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp index 7836f45..6678945 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -438,9 +438,9 @@ document().focusedElement(), InputEvent::InputType::DeleteComposedCharacterBackward, nullAtom, InputEvent::EventCancelable::NotCancelable); - dispatchCompositionUpdateEvent(frame(), emptyString()); + dispatchCompositionUpdateEvent(frame(), emptyString); insertTextDuringCompositionWithEvents( - frame(), emptyString(), 0, + frame(), emptyString, 0, TypingCommand::TextCompositionType::TextCompositionCancel); // Event handler might destroy document. if (!isAvailable()) @@ -451,7 +451,7 @@ TypingCommand::closeTyping(m_frame); // No DOM update after 'compositionend'. - dispatchCompositionEndEvent(frame(), emptyString()); + dispatchCompositionEndEvent(frame(), emptyString); } void InputMethodController::cancelCompositionIfSelectionIsInvalid() { @@ -542,7 +542,7 @@ if (text.isEmpty()) { if (hasComposition()) { Editor::RevealSelectionScope revealSelectionScope(&editor()); - replaceComposition(emptyString()); + replaceComposition(emptyString); } else { // It's weird to call |setComposition()| with empty text outside // composition, however some IME (e.g. Japanese IBus-Anthy) did this, so
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp index 717609f..fd5cc2a 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -947,12 +947,12 @@ underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); editable->focus(); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("foo", underlines, 0, 3); EXPECT_STREQ("beforeinput.isComposing:true;input.isComposing:true;", document().title().utf8().data()); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().finishComposingText(InputMethodController::KeepSelection); // Last pair of InputEvent should also be inside composition scope. EXPECT_STREQ("beforeinput.isComposing:true;input.isComposing:true;", @@ -966,13 +966,13 @@ Vector<CompositionUnderline> underlines; underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("hell", underlines, 4, 4); EXPECT_STREQ("beforeinput.data:hell;input.data:hell;", document().title().utf8().data()); // Replace the existing composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("hello", underlines, 0, 0); EXPECT_STREQ("beforeinput.data:hello;input.data:hello;", document().title().utf8().data()); @@ -985,13 +985,13 @@ Vector<CompositionUnderline> underlines; underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("hello", underlines, 5, 5); EXPECT_STREQ("beforeinput.data:hello;input.data:hello;", document().title().utf8().data()); // Confirm the ongoing composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().finishComposingText(InputMethodController::KeepSelection); EXPECT_STREQ( "beforeinput.data:hello;input.data:hello;compositionend.data:hello;", @@ -1005,13 +1005,13 @@ Vector<CompositionUnderline> underlines; underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("hello", underlines, 5, 5); EXPECT_STREQ("beforeinput.data:hello;input.data:hello;", document().title().utf8().data()); // Delete the existing composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("", underlines, 0, 0); EXPECT_STREQ("beforeinput.data:;compositionend.data:;", document().title().utf8().data()); @@ -1025,19 +1025,19 @@ underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); // Insert new text without previous composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); document().updateStyleAndLayout(); controller().commitText("hello", underlines, 0); EXPECT_STREQ("beforeinput.data:hello;input.data:hello;", document().title().utf8().data()); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("n", underlines, 1, 1); EXPECT_STREQ("beforeinput.data:n;input.data:n;", document().title().utf8().data()); // Insert new text with previous composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); document().updateStyleAndLayout(); controller().commitText("hello", underlines, 1); EXPECT_STREQ( @@ -1053,18 +1053,18 @@ underlines.push_back(CompositionUnderline(0, 5, Color(255, 0, 0), false, 0)); // Insert empty text without previous composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); document().updateStyleAndLayout(); controller().commitText("", underlines, 0); EXPECT_STREQ("", document().title().utf8().data()); - document().setTitle(emptyString()); + document().setTitle(emptyString); controller().setComposition("n", underlines, 1, 1); EXPECT_STREQ("beforeinput.data:n;input.data:n;", document().title().utf8().data()); // Insert empty text with previous composition. - document().setTitle(emptyString()); + document().setTitle(emptyString); document().updateStyleAndLayout(); controller().commitText("", underlines, 1); EXPECT_STREQ("beforeinput.data:;compositionend.data:;",
diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp index ebc2af3..ee0ac64 100644 --- a/third_party/WebKit/Source/core/editing/Position.cpp +++ b/third_party/WebKit/Source/core/editing/Position.cpp
@@ -600,7 +600,7 @@ return "afterAnchor"; } NOTREACHED(); - return emptyString(); + return emptyString; } #ifndef NDEBUG
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index c49d842..183403d 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -476,8 +476,8 @@ const ComputedStyle* style = layoutBox.style(); if (!style) return 0; - if (!(style->overflowY() == EOverflow::Scroll || - style->overflowY() == EOverflow::Auto || + if (!(style->overflowY() == EOverflow::kScroll || + style->overflowY() == EOverflow::kAuto || hasEditableStyle(*focusedElement))) return 0; int height = std::min<int>(layoutBox.clientHeight().toInt(),
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index 5fca9b6..3b826f4 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -1412,7 +1412,7 @@ static String createPlainText(const EphemeralRangeTemplate<Strategy>& range, const TextIteratorBehavior& behavior) { if (range.isNull()) - return emptyString(); + return emptyString; DocumentLifecycle::DisallowTransitionScope disallowTransition( range.startPosition().document()->lifecycle()); @@ -1421,7 +1421,7 @@ behavior); if (it.atEnd()) - return emptyString(); + return emptyString; // The initial buffer size can be critical for performance: // https://bugs.webkit.org/show_bug.cgi?id=81192 @@ -1434,7 +1434,7 @@ it.text().appendTextToStringBuilder(builder); if (builder.isEmpty()) - return emptyString(); + return emptyString; return builder.toString(); }
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp index 9fdefaf..d330d230 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextState.cpp
@@ -63,7 +63,7 @@ SECURITY_DCHECK(position <= static_cast<unsigned>(this->length())); SECURITY_DCHECK(position + length <= static_cast<unsigned>(this->length())); if (!length) - return emptyString(); + return emptyString; if (m_singleCharacterBuffer) { DCHECK_EQ(position, 0u); DCHECK_EQ(length, 1u);
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp index eaf5c8b..b0924e7 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
@@ -184,7 +184,7 @@ if (DocumentMarkerDescription* details = toDocumentMarkerDescription(m_details.get())) return details->description(); - return emptyString(); + return emptyString; } bool DocumentMarker::activeMatch() const {
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h index 8a4ecdc..34d0f267 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
@@ -63,7 +63,7 @@ void addMarker(const Position& start, const Position& end, DocumentMarker::MarkerType, - const String& description = emptyString(), + const String& description = emptyString, uint32_t hash = 0); void addTextMatchMarker(const EphemeralRange&, bool activeMatch); void addCompositionMarker(const Position& start,
diff --git a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp index c5d1638..9447499b 100644 --- a/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp +++ b/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp
@@ -261,18 +261,18 @@ EAbsoluteURLs shouldResolveURLs, Node* constrainingAncestor) { if (startPosition.isNull() || endPosition.isNull()) - return emptyString(); + return emptyString; RELEASE_ASSERT(startPosition.compareTo(endPosition) <= 0); bool collapsed = startPosition == endPosition; if (collapsed) - return emptyString(); + return emptyString; Node* commonAncestor = Strategy::commonAncestor(*startPosition.computeContainerNode(), *endPosition.computeContainerNode()); if (!commonAncestor) - return emptyString(); + return emptyString; Document* document = startPosition.document();
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp index cb219a6..dde08406 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -804,10 +804,21 @@ m_spellCheckRequester->cancelCheck(); TextControlElement* textControlElement = toTextControlElement(e); HTMLElement* innerEditor = textControlElement->innerEditorElement(); + removeSpellingAndGrammarMarkers(*innerEditor); +} + +void SpellChecker::removeSpellingAndGrammarMarkers(const HTMLElement& element, + ElementsType elementsType) { + // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets + // needs to be audited. See http://crbug.com/590369 for more details. + frame().document()->updateStyleAndLayoutTreeForNode(&element); + DocumentMarker::MarkerTypes markerTypes(DocumentMarker::Spelling); markerTypes.add(DocumentMarker::Grammar); - for (Node& node : NodeTraversal::inclusiveDescendantsOf(*innerEditor)) - frame().document()->markers().removeMarkers(&node, markerTypes); + for (Node& node : NodeTraversal::inclusiveDescendantsOf(element)) { + if (elementsType == ElementsType::kAll || !hasEditableStyle(node)) + frame().document()->markers().removeMarkers(&node, markerTypes); + } } void SpellChecker::replaceMisspelledRange(const String& text) {
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h index 3d6ba6f..1df14ed 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h
@@ -73,6 +73,9 @@ void replaceMisspelledRange(const String&); void removeSpellingMarkers(); void removeSpellingMarkersUnderWords(const Vector<String>& words); + enum class ElementsType { kAll, kOnlyNonEditable }; + void removeSpellingAndGrammarMarkers(const HTMLElement&, + ElementsType = ElementsType::kAll); void spellCheckAfterBlur(); void didEndEditingOnTextField(Element*);
diff --git a/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.cpp b/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.cpp index 7dc20393..737812d 100644 --- a/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.cpp +++ b/third_party/WebKit/Source/core/events/ApplicationCacheErrorEvent.cpp
@@ -36,7 +36,7 @@ return errorUnknown; } NOTREACHED(); - return emptyString(); + return emptyString; } ApplicationCacheErrorEvent::ApplicationCacheErrorEvent(
diff --git a/third_party/WebKit/Source/core/events/EventListener.h b/third_party/WebKit/Source/core/events/EventListener.h index d42f559..0691c9d 100644 --- a/third_party/WebKit/Source/core/events/EventListener.h +++ b/third_party/WebKit/Source/core/events/EventListener.h
@@ -44,7 +44,7 @@ virtual ~EventListener() {} virtual bool operator==(const EventListener&) const = 0; virtual void handleEvent(ExecutionContext*, Event*) = 0; - virtual const String& code() const { return emptyString(); } + virtual const String& code() const { return emptyString; } virtual bool belongsToTheCurrentWorld(ExecutionContext*) const { return false; }
diff --git a/third_party/WebKit/Source/core/events/InputEvent.cpp b/third_party/WebKit/Source/core/events/InputEvent.cpp index 800d5d5..c4679d3c 100644 --- a/third_party/WebKit/Source/core/events/InputEvent.cpp +++ b/third_party/WebKit/Source/core/events/InputEvent.cpp
@@ -68,7 +68,7 @@ if (it >= std::begin(kInputTypeStringNameMap) && it < std::end(kInputTypeStringNameMap)) return AtomicString(it->stringName); - return emptyString(); + return emptyString; } InputEvent::InputType convertStringToInputType(const String& stringName) {
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp index 7e94256..9c7026c 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -112,9 +112,10 @@ return frame()->tree().top()->domWindow(); } -External* DOMWindow::external() const { - DEFINE_STATIC_LOCAL(Persistent<External>, external, (new External)); - return external; +External* DOMWindow::external() { + if (!m_external) + m_external = new External; + return m_external; } DOMWindow* DOMWindow::anonymousIndexedGetter(uint32_t index) const { @@ -446,6 +447,7 @@ DEFINE_TRACE(DOMWindow) { visitor->trace(m_frame); visitor->trace(m_location); + visitor->trace(m_external); EventTargetWithInlineData::trace(visitor); }
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.h b/third_party/WebKit/Source/core/frame/DOMWindow.h index db614866..f306e14 100644 --- a/third_party/WebKit/Source/core/frame/DOMWindow.h +++ b/third_party/WebKit/Source/core/frame/DOMWindow.h
@@ -207,7 +207,7 @@ // Obsolete APIs void captureEvents() {} void releaseEvents() {} - External* external() const; + External* external(); // FIXME: This handles both window[index] and window.frames[index]. However, // the spec exposes window.frames[index] across origins but not @@ -267,6 +267,7 @@ private: Member<Frame> m_frame; mutable Member<Location> m_location; + Member<External> m_external; // Set to true when close() has been called. Needed for // |window.closed| determinism; having it return 'true'
diff --git a/third_party/WebKit/Source/core/frame/Deprecation.cpp b/third_party/WebKit/Source/core/frame/Deprecation.cpp index e19e368..424a3c0 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.cpp +++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -130,7 +130,7 @@ "6390764217040896"); default: - return emptyString(); + return emptyString; } }
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index e8d7bb64..93a42bb 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -730,15 +730,15 @@ EOverflow overflowY = style->overflowY(); if (!shouldIgnoreOverflowHidden()) { - if (overflowX == EOverflow::Hidden) + if (overflowX == EOverflow::kHidden) hMode = ScrollbarAlwaysOff; - if (overflowY == EOverflow::Hidden) + if (overflowY == EOverflow::kHidden) vMode = ScrollbarAlwaysOff; } - if (overflowX == EOverflow::Scroll) + if (overflowX == EOverflow::kScroll) hMode = ScrollbarAlwaysOn; - if (overflowY == EOverflow::Scroll) + if (overflowY == EOverflow::kScroll) vMode = ScrollbarAlwaysOn; } @@ -3777,9 +3777,9 @@ // anything to override that setting, http://crbug.com/426447 LayoutObject* viewport = viewportLayoutObject(); if (viewport && !shouldIgnoreOverflowHidden()) { - if (viewport->style()->overflowX() == EOverflow::Hidden) + if (viewport->style()->overflowX() == EOverflow::kHidden) horizontalMode = ScrollbarAlwaysOff; - if (viewport->style()->overflowY() == EOverflow::Hidden) + if (viewport->style()->overflowY() == EOverflow::kHidden) verticalMode = ScrollbarAlwaysOff; }
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index 5c0ed1c..d0dd9e1 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -746,7 +746,7 @@ String LocalFrame::selectedTextForClipboard() const { if (!document()) - return emptyString(); + return emptyString; DCHECK(!document()->needsLayoutTreeUpdate()); return selection().selectedTextForClipboard(); }
diff --git a/third_party/WebKit/Source/core/frame/NavigatorID.cpp b/third_party/WebKit/Source/core/frame/NavigatorID.cpp index 090ff7b..99e6522 100644 --- a/third_party/WebKit/Source/core/frame/NavigatorID.cpp +++ b/third_party/WebKit/Source/core/frame/NavigatorID.cpp
@@ -68,7 +68,7 @@ *platformName = String(uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) - : emptyString()); + : emptyString); } return *platformName; #endif
diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp index b088046..a0d94549 100644 --- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp
@@ -302,7 +302,7 @@ skipWhile<UChar, isIntegrityCharacter>(position, end); if (position == begin || (position != end && *position != '?')) { - digest = emptyString(); + digest = emptyString; return false; }
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index d044bd9..cf718c5 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1447,6 +1447,10 @@ WebNFCCancelPush = 1794, WebNFCWatch = 1795, WebNFCCancelWatch = 1796, + AudioParamCancelAndHoldAtTime = 1797, + CSSValueUserModifyReadOnly = 1798, + CSSValueUserModifyReadWrite = 1799, + CSSValueUserModifyReadWritePlaintextOnly = 1800, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in index 6ae73c6..d7670e9 100644 --- a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in +++ b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in
@@ -43,6 +43,7 @@ aria-labelledby aria-level aria-live +aria-modal aria-multiline aria-multiselectable aria-orientation
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index deaffb10..e34b2e7 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -46,6 +46,7 @@ #include "core/dom/shadow/ShadowRoot.h" #include "core/editing/EditingUtilities.h" #include "core/editing/serializers/Serialization.h" +#include "core/editing/spellcheck/SpellChecker.h" #include "core/events/EventListener.h" #include "core/events/KeyboardEvent.h" #include "core/frame/Settings.h" @@ -436,6 +437,8 @@ if (adjustedFocusedElementInTreeScope() == this) blur(); } else if (params.name == contenteditableAttr) { + document().frame()->spellChecker().removeSpellingAndGrammarMarkers( + *this, SpellChecker::ElementsType::kOnlyNonEditable); if (adjustedFocusedElementInTreeScope() != this) return; // The attribute change may cause supportsFocus() to return false
diff --git a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp index 137234d..fdbe2cb9 100644 --- a/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
@@ -84,7 +84,7 @@ String HTMLFormControlElement::formEnctype() const { const AtomicString& formEnctypeAttr = fastGetAttribute(formenctypeAttr); if (formEnctypeAttr.isNull()) - return emptyString(); + return emptyString; return FormSubmission::Attributes::parseEncodingType(formEnctypeAttr); } @@ -95,7 +95,7 @@ String HTMLFormControlElement::formMethod() const { const AtomicString& formMethodAttr = fastGetAttribute(formmethodAttr); if (formMethodAttr.isNull()) - return emptyString(); + return emptyString; return FormSubmission::Attributes::methodString( FormSubmission::Attributes::parseMethodType(formMethodAttr)); }
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp index 9a425115..4d8f1db9 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -59,7 +59,7 @@ SubframeLoadingDisabler::SubtreeRootSet& SubframeLoadingDisabler::disabledSubtreeRoots() { - DEFINE_STATIC_LOCAL(SubtreeRootSet, nodes, (new SubtreeRootSet)); + DEFINE_STATIC_LOCAL(SubtreeRootSet, nodes, ()); return nodes; }
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h index e284c03..e49a47aa 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h +++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h
@@ -151,7 +151,12 @@ } private: - using SubtreeRootSet = HeapHashCountedSet<Member<Node>>; + // The use of UntracedMember<Node> is safe as all SubtreeRootSet + // references are on the stack and reachable in case a conservative + // GC hits. + // TODO(sof): go back to HeapHashSet<> once crbug.com/684551 has been + // resolved. + using SubtreeRootSet = HashCountedSet<UntracedMember<Node>>; CORE_EXPORT static SubtreeRootSet& disabledSubtreeRoots();
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp index af78e1d..fd79a56 100644 --- a/third_party/WebKit/Source/core/html/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLInputElement.cpp
@@ -1023,7 +1023,7 @@ return m_nonAttributeValue; } NOTREACHED(); - return emptyString(); + return emptyString; } String HTMLInputElement::valueOrDefaultLabel() const {
diff --git a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp index 5956706..5b382d2 100644 --- a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp
@@ -304,7 +304,7 @@ KeyframeEffect* keyframeEffect = KeyframeEffect::create(m_mover, effectModel, timing); Animation* player = m_mover->document().timeline().play(keyframeEffect); - player->setId(emptyString()); + player->setId(emptyString); player->setOnfinish(new AnimationFinished(this)); m_player = player;
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp index cbf2407..c192931f 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -714,7 +714,7 @@ // 4.8.10.3 switch (support) { case MIMETypeRegistry::IsNotSupported: - canPlay = emptyString(); + canPlay = emptyString; break; case MIMETypeRegistry::MayBeSupported: canPlay = "maybe";
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp index 1187ce6..69c6ee7 100644 --- a/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMediaElementTest.cpp
@@ -87,7 +87,7 @@ default: NOTREACHED(); } - return emptyString(); + return emptyString; } TEST_P(HTMLMediaElementTest, preloadType) {
diff --git a/third_party/WebKit/Source/core/html/TextControlElement.cpp b/third_party/WebKit/Source/core/html/TextControlElement.cpp index ab28711..1286574a 100644 --- a/third_party/WebKit/Source/core/html/TextControlElement.cpp +++ b/third_party/WebKit/Source/core/html/TextControlElement.cpp
@@ -79,7 +79,7 @@ if (!insertionPoint->isConnected()) return InsertionDone; String initialValue = value(); - setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString() + setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString : initialValue); return InsertionDone; } @@ -773,7 +773,7 @@ DCHECK(!openShadowRoot()); HTMLElement* innerEditor = innerEditorElement(); if (!innerEditor || !isTextControl()) - return emptyString(); + return emptyString; StringBuilder result; for (Node& node : NodeTraversal::inclusiveDescendantsOf(*innerEditor)) {
diff --git a/third_party/WebKit/Source/core/html/forms/BaseTemporalInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseTemporalInputType.cpp index 4167030b..ccdf044 100644 --- a/third_party/WebKit/Source/core/html/forms/BaseTemporalInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/BaseTemporalInputType.cpp
@@ -174,7 +174,7 @@ } String BaseTemporalInputType::sanitizeValue(const String& proposedValue) const { - return typeMismatchFor(proposedValue) ? emptyString() : proposedValue; + return typeMismatchFor(proposedValue) ? emptyString : proposedValue; } bool BaseTemporalInputType::supportsReadOnly() const {
diff --git a/third_party/WebKit/Source/core/html/forms/ChooserOnlyTemporalInputTypeView.cpp b/third_party/WebKit/Source/core/html/forms/ChooserOnlyTemporalInputTypeView.cpp index 3139a55..26e8be5d 100644 --- a/third_party/WebKit/Source/core/html/forms/ChooserOnlyTemporalInputTypeView.cpp +++ b/third_party/WebKit/Source/core/html/forms/ChooserOnlyTemporalInputTypeView.cpp
@@ -124,7 +124,7 @@ void ChooserOnlyTemporalInputTypeView::didChooseValue(double value) { DCHECK(std::isfinite(value) || std::isnan(value)); if (std::isnan(value)) - element().setValue(emptyString(), DispatchInputAndChangeEvent); + element().setValue(emptyString, DispatchInputAndChangeEvent); else element().setValueAsNumber(value, ASSERT_NO_EXCEPTION, DispatchInputAndChangeEvent);
diff --git a/third_party/WebKit/Source/core/html/forms/DateInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateInputType.cpp index 3a0bca7..a7b34b9 100644 --- a/third_party/WebKit/Source/core/html/forms/DateInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateInputType.cpp
@@ -100,7 +100,7 @@ const DateTimeFieldsState& dateTimeFieldsState) const { if (!dateTimeFieldsState.hasDayOfMonth() || !dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear()) - return emptyString(); + return emptyString; return String::format("%04u-%02u-%02u", dateTimeFieldsState.year(), dateTimeFieldsState.month(),
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp index ccfb5176..4591ddb7 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp
@@ -87,19 +87,18 @@ FormControlState DateTimeFieldsState::saveFormControlState() const { FormControlState state; - state.append(hasYear() ? String::number(m_year) : emptyString()); - state.append(hasMonth() ? String::number(m_month) : emptyString()); - state.append(hasDayOfMonth() ? String::number(m_dayOfMonth) : emptyString()); - state.append(hasHour() ? String::number(m_hour) : emptyString()); - state.append(hasMinute() ? String::number(m_minute) : emptyString()); - state.append(hasSecond() ? String::number(m_second) : emptyString()); - state.append(hasMillisecond() ? String::number(m_millisecond) - : emptyString()); - state.append(hasWeekOfYear() ? String::number(m_weekOfYear) : emptyString()); + state.append(hasYear() ? String::number(m_year) : emptyString); + state.append(hasMonth() ? String::number(m_month) : emptyString); + state.append(hasDayOfMonth() ? String::number(m_dayOfMonth) : emptyString); + state.append(hasHour() ? String::number(m_hour) : emptyString); + state.append(hasMinute() ? String::number(m_minute) : emptyString); + state.append(hasSecond() ? String::number(m_second) : emptyString); + state.append(hasMillisecond() ? String::number(m_millisecond) : emptyString); + state.append(hasWeekOfYear() ? String::number(m_weekOfYear) : emptyString); if (hasAMPM()) state.append(m_ampm == AMPMValueAM ? "A" : "P"); else - state.append(emptyString()); + state.append(emptyString); return state; }
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp index 86babf9..7b9ef24 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -129,7 +129,7 @@ if (!dateTimeFieldsState.hasDayOfMonth() || !dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear() || !dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM()) - return emptyString(); + return emptyString; if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond()) {
diff --git a/third_party/WebKit/Source/core/html/forms/FormController.cpp b/third_party/WebKit/Source/core/html/forms/FormController.cpp index 975daedb..e5776ac 100644 --- a/third_party/WebKit/Source/core/html/forms/FormController.cpp +++ b/third_party/WebKit/Source/core/html/forms/FormController.cpp
@@ -61,7 +61,7 @@ DCHECK(!isFailure()); stateVector.push_back(String::number(m_values.size())); for (const auto& value : m_values) - stateVector.push_back(value.isNull() ? emptyString() : value); + stateVector.push_back(value.isNull() ? emptyString : value); } FormControlState FormControlState::deserialize(
diff --git a/third_party/WebKit/Source/core/html/forms/InputType.cpp b/third_party/WebKit/Source/core/html/forms/InputType.cpp index d336e71..1e6830e7 100644 --- a/third_party/WebKit/Source/core/html/forms/InputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/InputType.cpp
@@ -337,13 +337,13 @@ // The order of the following checks is meaningful. e.g. We'd like to show the // badInput message even if the control has other validation errors. if (inputTypeView.hasBadInput()) - return std::make_pair(badInputText(), emptyString()); + return std::make_pair(badInputText(), emptyString); if (valueMissing(value)) - return std::make_pair(valueMissingText(), emptyString()); + return std::make_pair(valueMissingText(), emptyString); if (typeMismatch()) - return std::make_pair(typeMismatchText(), emptyString()); + return std::make_pair(typeMismatchText(), emptyString); if (patternMismatch(value)) { // https://html.spec.whatwg.org/multipage/forms.html#attr-input-pattern @@ -356,32 +356,32 @@ element().fastGetAttribute(titleAttr).getString()); } - if (element().tooLong()) + if (element().tooLong()) { return std::make_pair(locale().validationMessageTooLongText( value.length(), element().maxLength()), - emptyString()); + emptyString); + } - if (element().tooShort()) + if (element().tooShort()) { return std::make_pair(locale().validationMessageTooShortText( value.length(), element().minLength()), - emptyString()); + emptyString); + } if (!isSteppable()) - return std::make_pair(emptyString(), emptyString()); + return std::make_pair(emptyString, emptyString); const Decimal numericValue = parseToNumberOrNaN(value); if (!numericValue.isFinite()) - return std::make_pair(emptyString(), emptyString()); + return std::make_pair(emptyString, emptyString); StepRange stepRange(createStepRange(RejectAny)); if (numericValue < stepRange.minimum()) - return std::make_pair(rangeUnderflowText(stepRange.minimum()), - emptyString()); + return std::make_pair(rangeUnderflowText(stepRange.minimum()), emptyString); if (numericValue > stepRange.maximum()) - return std::make_pair(rangeOverflowText(stepRange.maximum()), - emptyString()); + return std::make_pair(rangeOverflowText(stepRange.maximum()), emptyString); if (stepRange.stepMismatch(numericValue)) { DCHECK(stepRange.hasStep()); @@ -391,25 +391,27 @@ ? candidate1 + stepRange.step() : candidate1 - stepRange.step(); if (!candidate2.isFinite() || candidate2 < stepRange.minimum() || - candidate2 > stepRange.maximum()) + candidate2 > stepRange.maximum()) { return std::make_pair( locale().queryString( WebLocalizedString::ValidationStepMismatchCloseToLimit, localizedCandidate1), - emptyString()); + emptyString); + } String localizedCandidate2 = localizeValue(serialize(candidate2)); - if (candidate1 < candidate2) + if (candidate1 < candidate2) { return std::make_pair( locale().queryString(WebLocalizedString::ValidationStepMismatch, localizedCandidate1, localizedCandidate2), - emptyString()); + emptyString); + } return std::make_pair( locale().queryString(WebLocalizedString::ValidationStepMismatch, localizedCandidate2, localizedCandidate1), - emptyString()); + emptyString); } - return std::make_pair(emptyString(), emptyString()); + return std::make_pair(emptyString, emptyString); } Decimal InputType::parseToNumber(const String&,
diff --git a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp index cea0716..0d77b5aa 100644 --- a/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/MonthInputType.cpp
@@ -138,7 +138,7 @@ String MonthInputType::formatDateTimeFieldsState( const DateTimeFieldsState& dateTimeFieldsState) const { if (!dateTimeFieldsState.hasMonth() || !dateTimeFieldsState.hasYear()) - return emptyString(); + return emptyString; return String::format("%04u-%02u", dateTimeFieldsState.year(), dateTimeFieldsState.month()); }
diff --git a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp index 1248a65..2094e3a6 100644 --- a/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp +++ b/third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp
@@ -286,7 +286,7 @@ double value) { DCHECK(std::isfinite(value) || std::isnan(value)); if (std::isnan(value)) - element().setValue(emptyString(), DispatchInputAndChangeEvent); + element().setValue(emptyString, DispatchInputAndChangeEvent); else element().setValueAsNumber(value, ASSERT_NO_EXCEPTION, DispatchInputAndChangeEvent);
diff --git a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp index b708493..d2a3b17 100644 --- a/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/NumberInputType.cpp
@@ -238,7 +238,7 @@ return proposedValue; return std::isfinite(parseToDoubleForNumberType(proposedValue)) ? proposedValue - : emptyString(); + : emptyString; } void NumberInputType::warnIfValueIsInvalid(const String& value) const {
diff --git a/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp b/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp index c055d73..c5b9281 100644 --- a/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/TimeInputType.cpp
@@ -127,7 +127,7 @@ const DateTimeFieldsState& dateTimeFieldsState) const { if (!dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM()) - return emptyString(); + return emptyString; if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond()) { return String::format(
diff --git a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp index 93e1d237..d343f21c 100644 --- a/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/WeekInputType.cpp
@@ -97,7 +97,7 @@ String WeekInputType::formatDateTimeFieldsState( const DateTimeFieldsState& dateTimeFieldsState) const { if (!dateTimeFieldsState.hasYear() || !dateTimeFieldsState.hasWeekOfYear()) - return emptyString(); + return emptyString; return String::format("%04u-W%02u", dateTimeFieldsState.year(), dateTimeFieldsState.weekOfYear()); }
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp index 2b5e155..7ea5576 100644 --- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp +++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -122,7 +122,7 @@ if (match(tagImpl, videoTag)) return videoTag.localName(); NOTREACHED(); - return emptyString(); + return emptyString; } static bool mediaAttributeMatches(const MediaValuesCached& mediaValues, @@ -443,7 +443,7 @@ // FIXME: Its not clear that this if is needed, the loader probably ignores // charset for image requests anyway. if (match(m_tagImpl, imgTag) || match(m_tagImpl, videoTag)) - return emptyString(); + return emptyString; return m_charset; }
diff --git a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp index 0cb7f72..04ec94b 100644 --- a/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp +++ b/third_party/WebKit/Source/core/html/parser/TextResourceDecoder.cpp
@@ -434,7 +434,7 @@ if (!m_checkedForBOM) { DCHECK_EQ(0u, lengthOfBOM); m_buffer.append(data, len); - return emptyString(); + return emptyString; } } DCHECK_LE(lengthOfBOM, m_buffer.size() + len); @@ -443,7 +443,7 @@ if (m_contentType == CSSContent && !m_checkedForCSSCharset) { if (!checkForCSSCharset(data, len, movedDataToBuffer)) - return emptyString(); + return emptyString; } // We check XML declaration in HTML content only if there is enough data @@ -452,7 +452,7 @@ m_contentType == XMLContent) && !m_checkedForXMLCharset) { if (!checkForXMLCharset(data, len, movedDataToBuffer)) - return emptyString(); + return emptyString; } const char* dataForDecode = data + lengthOfBOM;
diff --git a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp index 58909e1..8b3f309 100644 --- a/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp +++ b/third_party/WebKit/Source/core/html/parser/XSSAuditor.cpp
@@ -311,7 +311,7 @@ if (protocolIsJavaScript(stripped)) return stripped; } - return emptyString(); + return emptyString; } XSSAuditor::XSSAuditor()
diff --git a/third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp b/third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp index 90c0a2d0..38d5e27 100644 --- a/third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp +++ b/third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp
@@ -846,7 +846,7 @@ String DateTimeEditElement::value() const { if (!m_editControlOwner) - return emptyString(); + return emptyString; return m_editControlOwner->formatDateTimeFieldsState( valueAsDateTimeFieldsState()); }
diff --git a/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.cpp b/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.cpp index 4b0c00da..614d3129 100644 --- a/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.cpp +++ b/third_party/WebKit/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
@@ -198,7 +198,7 @@ } String DateTimeNumericFieldElement::value() const { - return m_hasValue ? formatValue(m_value) : emptyString(); + return m_hasValue ? formatValue(m_value) : emptyString; } int DateTimeNumericFieldElement::valueAsInteger() const {
diff --git a/third_party/WebKit/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp b/third_party/WebKit/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp index 73d5f09..345b0633 100644 --- a/third_party/WebKit/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp +++ b/third_party/WebKit/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
@@ -141,7 +141,7 @@ } String DateTimeSymbolicFieldElement::value() const { - return hasValue() ? m_symbols[m_selectedIndex] : emptyString(); + return hasValue() ? m_symbols[m_selectedIndex] : emptyString; } int DateTimeSymbolicFieldElement::valueAsInteger() const {
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp index fd86d75..bb6da9e9 100644 --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -32,6 +32,7 @@ #include "bindings/core/v8/ExceptionState.h" #include "core/InputTypeNames.h" #include "core/dom/ClientRect.h" +#include "core/dom/TaskRunnerHelper.h" #include "core/dom/Text.h" #include "core/dom/shadow/ShadowRoot.h" #include "core/events/MouseEvent.h" @@ -134,8 +135,10 @@ : MediaControlDivElement(mediaControls, MediaControlsPanel), m_isDisplayed(false), m_opaque(true), - m_transitionTimer(this, &MediaControlPanelElement::transitionTimerFired) { -} + m_transitionTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, + &mediaControls.document()), + this, + &MediaControlPanelElement::transitionTimerFired) {} MediaControlPanelElement* MediaControlPanelElement::create( MediaControls& mediaControls) {
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h index d01eccce1..875fde9 100644 --- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h +++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
@@ -63,7 +63,7 @@ bool m_isDisplayed; bool m_opaque; - Timer<MediaControlPanelElement> m_transitionTimer; + TaskRunnerTimer<MediaControlPanelElement> m_transitionTimer; }; // ----------------------------
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp index b8ed066..33662c86 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -100,7 +100,7 @@ } static const String& horizontalKeyword() { - return emptyString(); + return emptyString; } static const String& verticalGrowingLeftKeyword() { @@ -273,7 +273,7 @@ return verticalGrowingRightKeyword(); default: NOTREACHED(); - return emptyString(); + return emptyString; } } @@ -406,7 +406,7 @@ return rightKeyword(); default: NOTREACHED(); - return emptyString(); + return emptyString; } } @@ -1103,7 +1103,7 @@ return; if (!lineIsAuto() || m_cueSize != 100 || m_writingDirection != Horizontal) - m_regionId = emptyString(); + m_regionId = emptyString; } void VTTCue::applyUserOverrideCSSProperties() {
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp index 6d589565..d8aec262 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
@@ -385,7 +385,7 @@ void VTTParser::resetCueValues() { m_currentId = emptyAtom; - m_currentSettings = emptyString(); + m_currentSettings = emptyString; m_currentStartTime = 0; m_currentEndTime = 0; m_currentContent.clear();
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp index 57b1c10f..772bca0 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
@@ -84,7 +84,7 @@ } VTTRegion::VTTRegion() - : m_id(emptyString()), + : m_id(emptyString), m_width(defaultWidth), m_heightInLines(defaultHeightInLines), m_regionAnchor(FloatPoint(defaultAnchorPointX, defaultAnchorPointY)), @@ -165,7 +165,7 @@ ExceptionState& exceptionState) { DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up")); - if (value != emptyString() && value != upScrollValueKeyword) { + if (value != emptyString && value != upScrollValueKeyword) { exceptionState.throwDOMException( SyntaxError, "The value provided ('" + value + "') is invalid. The 'scroll' property must be either "
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp index 60a0bef..9e10b1f4 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp
@@ -46,7 +46,7 @@ VTTScanner scanner16(data16); EXPECT_FALSE(scanner16.isAtEnd()); - VTTScanner scannerEmpty(emptyString()); + VTTScanner scannerEmpty(emptyString); EXPECT_TRUE(scannerEmpty.isAtEnd()); }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp index 8cfe3a1..9703b2a 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -494,6 +494,29 @@ return Response::OK(); } +Response InspectorDOMAgent::getFlattenedDocument( + Maybe<int> depth, + Maybe<bool> pierce, + std::unique_ptr<protocol::Array<protocol::DOM::Node>>* nodes) { + if (!enabled()) + return Response::Error("Document not enabled"); + + if (!m_document) + return Response::Error("Document is not available"); + + discardFrontendBindings(); + + int sanitizedDepth = depth.fromMaybe(-1); + if (sanitizedDepth == -1) + sanitizedDepth = INT_MAX; + + nodes->reset(new protocol::Array<protocol::DOM::Node>()); + (*nodes)->addItem(buildObjectForNode( + m_document.get(), sanitizedDepth, pierce.fromMaybe(false), + m_documentNodeToIdMap.get(), nodes->get())); + return Response::OK(); +} + void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId, int depth, bool pierce) { @@ -520,7 +543,7 @@ } std::unique_ptr<protocol::Array<protocol::DOM::Node>> children = - buildArrayForContainerChildren(node, depth, pierce, nodeMap); + buildArrayForContainerChildren(node, depth, pierce, nodeMap, nullptr); frontend()->setChildNodes(nodeId, std::move(children)); } @@ -1540,7 +1563,8 @@ Node* node, int depth, bool pierce, - NodeToIdMap* nodesMap) { + NodeToIdMap* nodesMap, + protocol::Array<protocol::DOM::Node>* flattenResult) { int id = bind(node, nodesMap); String localName; String nodeValue; @@ -1589,8 +1613,8 @@ : nullptr) value->setFrameId(IdentifiersFactory::frameId(frame)); if (Document* doc = frameOwner->contentDocument()) { - value->setContentDocument( - buildObjectForNode(doc, pierce ? depth : 0, pierce, nodesMap)); + value->setContentDocument(buildObjectForNode( + doc, pierce ? depth : 0, pierce, nodesMap, flattenResult)); } } @@ -1606,8 +1630,8 @@ protocol::Array<protocol::DOM::Node>::create(); for (ShadowRoot* root = &shadow->youngestShadowRoot(); root; root = root->olderShadowRoot()) { - shadowRoots->addItem( - buildObjectForNode(root, pierce ? depth : 0, pierce, nodesMap)); + shadowRoots->addItem(buildObjectForNode( + root, pierce ? depth : 0, pierce, nodesMap, flattenResult)); } value->setShadowRoots(std::move(shadowRoots)); forcePushChildren = true; @@ -1617,15 +1641,16 @@ HTMLLinkElement& linkElement = toHTMLLinkElement(*element); if (linkElement.isImport() && linkElement.import() && innerParentNode(linkElement.import()) == linkElement) { - value->setImportedDocument( - buildObjectForNode(linkElement.import(), 0, pierce, nodesMap)); + value->setImportedDocument(buildObjectForNode( + linkElement.import(), 0, pierce, nodesMap, flattenResult)); } forcePushChildren = true; } if (isHTMLTemplateElement(*element)) { - value->setTemplateContent(buildObjectForNode( - toHTMLTemplateElement(*element).content(), 0, pierce, nodesMap)); + value->setTemplateContent( + buildObjectForNode(toHTMLTemplateElement(*element).content(), 0, + pierce, nodesMap, flattenResult)); forcePushChildren = true; } @@ -1680,7 +1705,8 @@ if (forcePushChildren && !depth) depth = 1; std::unique_ptr<protocol::Array<protocol::DOM::Node>> children = - buildArrayForContainerChildren(node, depth, pierce, nodesMap); + buildArrayForContainerChildren(node, depth, pierce, nodesMap, + flattenResult); if (children->length() > 0 || depth) // Push children along with shadow in any case. value->setChildren(std::move(children)); @@ -1704,10 +1730,12 @@ } std::unique_ptr<protocol::Array<protocol::DOM::Node>> -InspectorDOMAgent::buildArrayForContainerChildren(Node* container, - int depth, - bool pierce, - NodeToIdMap* nodesMap) { +InspectorDOMAgent::buildArrayForContainerChildren( + Node* container, + int depth, + bool pierce, + NodeToIdMap* nodesMap, + protocol::Array<protocol::DOM::Node>* flattenResult) { std::unique_ptr<protocol::Array<protocol::DOM::Node>> children = protocol::Array<protocol::DOM::Node>::create(); if (depth == 0) { @@ -1716,7 +1744,14 @@ Node* firstChild = container->firstChild(); if (firstChild && firstChild->getNodeType() == Node::kTextNode && !firstChild->nextSibling()) { - children->addItem(buildObjectForNode(firstChild, 0, pierce, nodesMap)); + std::unique_ptr<protocol::DOM::Node> childNode = + buildObjectForNode(firstChild, 0, pierce, nodesMap, flattenResult); + childNode->setParentId(bind(container, nodesMap)); + if (flattenResult) { + flattenResult->addItem(std::move(childNode)); + } else { + children->addItem(std::move(childNode)); + } m_childrenRequested.insert(bind(container, nodesMap)); } return children; @@ -1727,7 +1762,15 @@ m_childrenRequested.insert(bind(container, nodesMap)); while (child) { - children->addItem(buildObjectForNode(child, depth, pierce, nodesMap)); + std::unique_ptr<protocol::DOM::Node> childNode = + buildObjectForNode(child, depth, pierce, nodesMap, flattenResult); + childNode->setParentId(bind(container, nodesMap)); + if (flattenResult) { + flattenResult->addItem(std::move(childNode)); + } else { + children->addItem(std::move(childNode)); + } + m_childrenRequested.insert(bind(container, nodesMap)); child = innerNextSibling(child); } return children;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h index fe54d8c..0d9d187 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
@@ -118,6 +118,10 @@ Response getDocument(Maybe<int> depth, Maybe<bool> traverseFrames, std::unique_ptr<protocol::DOM::Node>* root) override; + Response getFlattenedDocument( + Maybe<int> depth, + Maybe<bool> pierce, + std::unique_ptr<protocol::Array<protocol::DOM::Node>>* nodes) override; Response collectClassNamesFromSubtree( int nodeId, std::unique_ptr<protocol::Array<String>>* classNames) override; @@ -291,17 +295,21 @@ void invalidateFrameOwnerElement(LocalFrame*); - std::unique_ptr<protocol::DOM::Node> buildObjectForNode(Node*, - int depth, - bool traverseFrames, - NodeToIdMap*); + std::unique_ptr<protocol::DOM::Node> buildObjectForNode( + Node*, + int depth, + bool traverseFrames, + NodeToIdMap*, + protocol::Array<protocol::DOM::Node>* flattenResult = nullptr); std::unique_ptr<protocol::Array<String>> buildArrayForElementAttributes( Element*); std::unique_ptr<protocol::Array<protocol::DOM::Node>> - buildArrayForContainerChildren(Node* container, - int depth, - bool traverseFrames, - NodeToIdMap* nodesMap); + buildArrayForContainerChildren( + Node* container, + int depth, + bool traverseFrames, + NodeToIdMap* nodesMap, + protocol::Array<protocol::DOM::Node>* flattenResult); std::unique_ptr<protocol::Array<protocol::DOM::Node>> buildArrayForPseudoElements(Element*, NodeToIdMap* nodesMap); std::unique_ptr<protocol::Array<protocol::DOM::BackendNode>>
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp index f5a503c..f0a5b5b 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
@@ -81,11 +81,11 @@ while (true) { pos = content.reverseFind(name, pos); if (pos == kNotFound) - return emptyString(); + return emptyString; // Check for a /\/[\/*][@#][ \t]/ regexp (length of 4) before found name. if (pos < 4) - return emptyString(); + return emptyString; pos -= 4; if (content[pos] != '/') continue; @@ -102,7 +102,7 @@ if (multiline) { closingCommentPos = content.find("*/", equalSignPos + 1); if (closingCommentPos == kNotFound) - return emptyString(); + return emptyString; } break; @@ -123,7 +123,7 @@ String disallowedChars("\"' \t"); for (unsigned i = 0; i < match.length(); ++i) { if (disallowedChars.find(match[i]) != kNotFound) - return emptyString(); + return emptyString; } return match; @@ -985,7 +985,7 @@ static String styleSheetURL(CSSStyleSheet* pageStyleSheet) { if (pageStyleSheet && !pageStyleSheet->contents()->baseURL().isEmpty()) return pageStyleSheet->contents()->baseURL().getString(); - return emptyString(); + return emptyString; } String InspectorStyleSheet::finalURL() {
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index 6e63064..f06ae7e 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -2030,6 +2030,7 @@ "type": "object", "properties": [ { "name": "nodeId", "$ref": "NodeId", "description": "Node identifier that is passed into the rest of the DOM messages as the <code>nodeId</code>. Backend will only push node with given <code>id</code> once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client." }, + { "name": "parentId", "$ref": "NodeId", "optional": true, "description": "The id of the parent node if any.", "experimental": true }, { "name": "backendNodeId", "$ref": "BackendNodeId", "description": "The BackendNodeId for this node.", "experimental": true }, { "name": "nodeType", "type": "integer", "description": "<code>Node</code>'s nodeType." }, { "name": "nodeName", "type": "string", "description": "<code>Node</code>'s nodeName." }, @@ -2168,6 +2169,17 @@ "description": "Returns the root DOM node (and optionally the subtree) to the caller." }, { + "name": "getFlattenedDocument", + "parameters": [ + { "name": "depth", "type": "integer", "optional": true, "description": "The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.", "experimental": true }, + { "name": "pierce", "type": "boolean", "optional": true, "description": "Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).", "experimental": true } + ], + "returns": [ + { "name": "nodes", "type": "array", "items": { "$ref": "Node" }, "description": "Resulting node." } + ], + "description": "Returns the root DOM node (and optionally the subtree) to the caller." + }, + { "name": "collectClassNamesFromSubtree", "parameters": [ { "name": "nodeId", "$ref": "NodeId", "description": "Id of the node to collect class names." } @@ -4311,7 +4323,7 @@ { "id": "AXWidgetStates", "type": "string", - "enum": [ "checked", "expanded", "pressed", "selected" ], + "enum": [ "checked", "expanded", "modal", "pressed", "selected" ], "description": "States which apply to widgets." }, {
diff --git a/third_party/WebKit/Source/core/layout/BUILD.gn b/third_party/WebKit/Source/core/layout/BUILD.gn index 885a01e..e7214cb 100644 --- a/third_party/WebKit/Source/core/layout/BUILD.gn +++ b/third_party/WebKit/Source/core/layout/BUILD.gn
@@ -312,14 +312,11 @@ "ng/ng_inline_node.h", "ng/ng_layout_inline_items_builder.cc", "ng/ng_layout_inline_items_builder.h", - "ng/ng_layout_input_node.cc", "ng/ng_layout_input_node.h", "ng/ng_layout_opportunity_iterator.cc", "ng/ng_layout_opportunity_iterator.h", "ng/ng_layout_opportunity_tree_node.cc", "ng/ng_layout_opportunity_tree_node.h", - "ng/ng_legacy_block_layout_algorithm.cc", - "ng/ng_legacy_block_layout_algorithm.h", "ng/ng_length_utils.cc", "ng/ng_length_utils.h", "ng/ng_line_builder.cc",
diff --git a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp index 7927dbe4..cf414144 100644 --- a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp +++ b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
@@ -374,8 +374,8 @@ : child.styleRef().logicalMinHeight(); bool overflowIsVisible = isRowAxis - ? child.styleRef().overflowInlineDirection() == EOverflow::Visible - : child.styleRef().overflowBlockDirection() == EOverflow::Visible; + ? child.styleRef().overflowInlineDirection() == EOverflow::kVisible + : child.styleRef().overflowBlockDirection() == EOverflow::kVisible; if (!childSize.isAuto() || (childMinSize.isAuto() && overflowIsVisible)) return minContentForChild(child);
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp index ebf74c5..6eb9de4 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -939,14 +939,14 @@ } int LayoutBox::verticalScrollbarWidth() const { - if (!hasOverflowClip() || style()->overflowY() == EOverflow::Overlay) + if (!hasOverflowClip() || style()->overflowY() == EOverflow::kOverlay) return 0; return getScrollableArea()->verticalScrollbarWidth(); } int LayoutBox::horizontalScrollbarHeight() const { - if (!hasOverflowClip() || style()->overflowX() == EOverflow::Overlay) + if (!hasOverflowClip() || style()->overflowX() == EOverflow::kOverlay) return 0; return getScrollableArea()->horizontalScrollbarHeight(); @@ -3215,8 +3215,8 @@ // height if they have overflow set to visible or hidden or if // they are replaced elements, and a 0px height if they have not. LayoutTableCell* cell = toLayoutTableCell(cb); - if (style()->overflowY() != EOverflow::Visible && - style()->overflowY() != EOverflow::Hidden && + if (style()->overflowY() != EOverflow::kVisible && + style()->overflowY() != EOverflow::kHidden && !shouldBeConsideredAsReplaced() && (!cell->style()->logicalHeight().isAuto() || !cell->table()->style()->logicalHeight().isAuto()))
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h index 28fa7fd..1c096ae 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.h +++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -1001,13 +1001,14 @@ virtual void stopAutoscroll() {} DISABLE_CFI_PERF bool hasAutoVerticalScrollbar() const { - return hasOverflowClip() && (style()->overflowY() == EOverflow::Auto || - style()->overflowY() == EOverflow::PagedY || - style()->overflowY() == EOverflow::Overlay); + return hasOverflowClip() && + (style()->overflowY() == EOverflow::kAuto || + style()->overflowY() == EOverflow::kWebkitPagedY || + style()->overflowY() == EOverflow::kOverlay); } DISABLE_CFI_PERF bool hasAutoHorizontalScrollbar() const { - return hasOverflowClip() && (style()->overflowX() == EOverflow::Auto || - style()->overflowX() == EOverflow::Overlay); + return hasOverflowClip() && (style()->overflowX() == EOverflow::kAuto || + style()->overflowX() == EOverflow::kOverlay); } DISABLE_CFI_PERF bool scrollsOverflow() const { return scrollsOverflowX() || scrollsOverflowY(); @@ -1025,11 +1026,11 @@ pixelSnappedScrollHeight() != pixelSnappedClientHeight(); } virtual bool scrollsOverflowX() const { - return hasOverflowClip() && (style()->overflowX() == EOverflow::Scroll || + return hasOverflowClip() && (style()->overflowX() == EOverflow::kScroll || hasAutoHorizontalScrollbar()); } virtual bool scrollsOverflowY() const { - return hasOverflowClip() && (style()->overflowY() == EOverflow::Scroll || + return hasOverflowClip() && (style()->overflowY() == EOverflow::kScroll || hasAutoVerticalScrollbar()); }
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp index 7d04c86..2d3120b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -1226,7 +1226,7 @@ // percentage min size, but we have an indefinite size in that axis. minExtent = std::max(LayoutUnit(), minExtent); } else if (min.isAuto() && !child.styleRef().containsSize() && - mainAxisOverflowForChild(child) == EOverflow::Visible && + mainAxisOverflowForChild(child) == EOverflow::kVisible && !(isColumnFlow() && child.isFlexibleBox())) { // TODO(cbiesinger): For now, we do not handle min-height: auto for nested // column flexboxes. We need to implement
diff --git a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp index 05cace5f..d62d3e4 100644 --- a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
@@ -186,7 +186,7 @@ void LayoutMenuList::updateFromElement() { HTMLSelectElement* select = selectElement(); HTMLOptionElement* option = select->optionToBeShown(); - String text = emptyString(); + String text = emptyString; m_optionStyle.clear(); if (select->isMultiple()) {
diff --git a/third_party/WebKit/Source/core/layout/LayoutQuote.cpp b/third_party/WebKit/Source/core/layout/LayoutQuote.cpp index d5c5f0d..9322b7d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutQuote.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutQuote.cpp
@@ -285,14 +285,14 @@ switch (m_type) { case NO_OPEN_QUOTE: case NO_CLOSE_QUOTE: - return emptyString(); + return emptyString; case CLOSE_QUOTE: return quotesData()->getCloseQuote(m_depth - 1).impl(); case OPEN_QUOTE: return quotesData()->getOpenQuote(m_depth).impl(); } ASSERT_NOT_REACHED(); - return emptyString(); + return emptyString; } const QuotesData* LayoutQuote::quotesData() const {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index b0a6337f4..b4048d9 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -1486,9 +1486,7 @@ return nullptr; // If we hit a colspan back up to a real cell. - LayoutTableSection::CellStruct& prevCell = - section->cellAt(cell->rowIndex(), effCol - 1); - return prevCell.primaryCell(); + return section->primaryCellAt(cell->rowIndex(), effCol - 1); } LayoutTableCell* LayoutTable::cellAfter(const LayoutTableCell* cell) const {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index fa380f8..489ab1b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -258,9 +258,9 @@ // <TR><TD>1 <TD rowspan="2">2 <TD>3 <TD>4 // <TR><TD colspan="2">5 // </TABLE> - while (m_cCol < numCols(insertionRow) && - (cellAt(insertionRow, m_cCol).hasCells() || - cellAt(insertionRow, m_cCol).inColSpan)) + unsigned nCols = numCols(insertionRow); + while (m_cCol < nCols && (cellAt(insertionRow, m_cCol).hasCells() || + cellAt(insertionRow, m_cCol).inColSpan)) m_cCol++; updateLogicalHeightForCell(m_grid[insertionRow], cell); @@ -272,9 +272,10 @@ unsigned col = m_cCol; // tell the cell where it is bool inColSpan = false; + unsigned colSize = columns.size(); while (cSpan) { unsigned currentSpan; - if (m_cCol >= columns.size()) { + if (m_cCol >= colSize) { table()->appendEffectiveColumn(cSpan); currentSpan = cSpan; } else { @@ -1103,8 +1104,8 @@ LayoutObject* cellDescendant) { if (!cell.style()->logicalHeight().isSpecified()) return false; - if (cellDescendant->style()->overflowY() == EOverflow::Visible || - cellDescendant->style()->overflowY() == EOverflow::Hidden) + if (cellDescendant->style()->overflowY() == EOverflow::kVisible || + cellDescendant->style()->overflowY() == EOverflow::kHidden) return true; return cellDescendant->isBox() && toLayoutBox(cellDescendant)->shouldBeConsideredAsReplaced(); @@ -1152,7 +1153,8 @@ for (unsigned r = 0; r < totalRows; r++) { LayoutTableRow* rowLayoutObject = m_grid[r].rowLayoutObject; - for (unsigned c = 0; c < numCols(r); c++) { + unsigned nCols = numCols(r); + for (unsigned c = 0; c < nCols; c++) { CellStruct& cs = cellAt(r, c); LayoutTableCell* cell = cs.primaryCell(); @@ -1272,7 +1274,8 @@ #endif // Now that our height has been determined, add in overflow from cells. for (unsigned r = 0; r < totalRows; r++) { - for (unsigned c = 0; c < numCols(r); c++) { + unsigned nCols = numCols(r); + for (unsigned c = 0; c < nCols; c++) { CellStruct& cs = cellAt(r, c); LayoutTableCell* cell = cs.primaryCell(); if (!cell || cs.inColSpan) @@ -1313,7 +1316,8 @@ continue; rowLayouter->clearChildNeedsOverflowRecalcAfterStyleChange(); bool rowChildrenOverflowChanged = false; - for (unsigned c = 0; c < numCols(r); c++) { + unsigned nCols = numCols(r); + for (unsigned c = 0; c < nCols; c++) { CellStruct& cs = cellAt(r, c); LayoutTableCell* cell = cs.primaryCell(); if (!cell || cs.inColSpan || !cell->needsOverflowRecalcAfterStyleChange()) @@ -1366,7 +1370,8 @@ bool allHidden = true; unsigned r = side == BorderBefore ? 0 : m_grid.size() - 1; - for (unsigned c = 0; c < numCols(r); c++) { + unsigned nCols = numCols(r); + for (unsigned c = 0; c < nCols; c++) { const CellStruct& current = cellAt(r, c); if (current.inColSpan || !current.hasCells()) continue; @@ -1687,7 +1692,8 @@ unsigned result = 0; for (unsigned r = 0; r < m_grid.size(); ++r) { - for (unsigned c = result; c < numCols(r); ++c) { + unsigned nCols = numCols(r); + for (unsigned c = result; c < nCols; ++c) { const CellStruct& cell = cellAt(r, c); if (cell.hasCells() || cell.inColSpan) result = c; @@ -1805,11 +1811,9 @@ // Now iterate over the spanned rows and columns. for (unsigned hitRow = rowSpan.start(); hitRow < rowSpan.end(); ++hitRow) { - for (unsigned hitColumn = columnSpan.start(); hitColumn < columnSpan.end(); - ++hitColumn) { - if (hitColumn >= numCols(hitRow)) - break; - + unsigned nCols = numCols(hitRow); + for (unsigned hitColumn = columnSpan.start(); + hitColumn < nCols && hitColumn < columnSpan.end(); ++hitColumn) { CellStruct& current = cellAt(hitRow, hitColumn); // If the cell is empty, there's nothing to do
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.h b/third_party/WebKit/Source/core/layout/LayoutTableSection.h index 52e5d5d..f7d6d1d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
@@ -218,10 +218,10 @@ return m_grid[row].row[effectiveColumn]; } LayoutTableCell* primaryCellAt(unsigned row, unsigned effectiveColumn) { - if (effectiveColumn >= numCols(row)) + Row& rowVector = m_grid[row].row; + if (effectiveColumn >= rowVector.size()) return nullptr; - CellStruct& c = m_grid[row].row[effectiveColumn]; - return c.primaryCell(); + return rowVector[effectiveColumn].primaryCell(); } const LayoutTableCell* primaryCellAt(unsigned row, unsigned effectiveColumn) const {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp b/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp index 67d63bd..405ec8e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTextControl.cpp
@@ -127,8 +127,8 @@ // We are able to have a horizontal scrollbar if the overflow style is // scroll, or if its auto and there's no word wrap. - if (style()->overflowInlineDirection() == EOverflow::Scroll || - (style()->overflowInlineDirection() == EOverflow::Auto && + if (style()->overflowInlineDirection() == EOverflow::kScroll || + (style()->overflowInlineDirection() == EOverflow::kAuto && innerEditor->layoutObject()->style()->overflowWrap() == NormalOverflowWrap)) logicalHeight += scrollbarThickness();
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp index dcf9c0f..f0ea860 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
@@ -332,9 +332,9 @@ if (inputElement()->shouldRevealPassword()) textBlockStyle->setTextSecurity(TSNONE); - textBlockStyle->setOverflowX(EOverflow::Scroll); + textBlockStyle->setOverflowX(EOverflow::kScroll); // overflow-y:visible doesn't work because overflow-x:scroll makes a layer. - textBlockStyle->setOverflowY(EOverflow::Scroll); + textBlockStyle->setOverflowY(EOverflow::kScroll); RefPtr<ComputedStyle> noScrollbarStyle = ComputedStyle::create(); noScrollbarStyle->setStyleType(PseudoIdScrollbar); noScrollbarStyle->setDisplay(EDisplay::None);
diff --git a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp index a684c82c..6e082fd93 100644 --- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp +++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
@@ -236,7 +236,7 @@ // the content is already overflowing before autosizing kicks in. for (; block; block = block->containingBlock()) { const ComputedStyle& style = block->styleRef(); - if (style.overflowY() >= EOverflow::Scroll) + if (style.overflowY() >= EOverflow::kScroll) return false; if (style.height().isSpecified() || style.maxHeight().isSpecified() || block->isOutOfFlowPositioned()) {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index f7e50974..8aae66ee 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -131,10 +131,9 @@ NGLogicalOffset adjusted_origin_point = AdjustToTopEdgeAlignmentRule(*space, origin_point); - NGLayoutOpportunityIterator* opportunity_iter = - space->LayoutOpportunities(adjusted_origin_point); + NGLayoutOpportunityIterator opportunity_iter(space, adjusted_origin_point); NGLayoutOpportunity opportunity; - NGLayoutOpportunity opportunity_candidate = opportunity_iter->Next(); + NGLayoutOpportunity opportunity_candidate = opportunity_iter.Next(); while (!opportunity_candidate.IsEmpty()) { opportunity = opportunity_candidate; @@ -143,7 +142,8 @@ auto fragment_inline_size = fragment.InlineSize() + margins.InlineSum(); if (opportunity.size.inline_size >= fragment_inline_size) break; - opportunity_candidate = opportunity_iter->Next(); + + opportunity_candidate = opportunity_iter.Next(); } return opportunity; } @@ -260,8 +260,7 @@ NGBlockNode* first_child, NGConstraintSpace* constraint_space, NGBreakToken* break_token) - : NGLayoutAlgorithm(kBlockLayoutAlgorithm), - style_(style), + : style_(style), first_child_(first_child), constraint_space_(constraint_space), break_token_(break_token), @@ -719,16 +718,4 @@ return space_builder_->ToConstraintSpace(); } -DEFINE_TRACE(NGBlockLayoutAlgorithm) { - NGLayoutAlgorithm::trace(visitor); - visitor->trace(first_child_); - visitor->trace(constraint_space_); - visitor->trace(break_token_); - visitor->trace(builder_); - visitor->trace(space_builder_); - visitor->trace(space_for_current_child_); - visitor->trace(current_child_); - visitor->trace(fragmentainer_mapper_); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h index daf2b69..f3d1040 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
@@ -8,6 +8,8 @@ #include "core/CoreExport.h" #include "core/layout/ng/ng_block_node.h" #include "core/layout/ng/ng_box_fragment.h" +#include "core/layout/ng/ng_break_token.h" +#include "core/layout/ng/ng_column_mapper.h" #include "core/layout/ng/ng_layout_algorithm.h" #include "core/layout/ng/ng_units.h" #include "wtf/RefPtr.h" @@ -16,8 +18,6 @@ class ComputedStyle; class NGBlockBreakToken; -class NGBreakToken; -class NGColumnMapper; class NGConstraintSpace; class NGConstraintSpaceBuilder; class NGFragment; @@ -44,8 +44,6 @@ bool ComputeMinAndMaxContentSizes(MinAndMaxContentSizes*) const override; NGPhysicalFragment* Layout() override; - DECLARE_VIRTUAL_TRACE(); - private: NGBoxStrut CalculateMargins(const NGConstraintSpace& space, const ComputedStyle& style); @@ -123,21 +121,21 @@ RefPtr<const ComputedStyle> style_; - Member<NGBlockNode> first_child_; - Member<NGConstraintSpace> constraint_space_; + Persistent<NGBlockNode> first_child_; + Persistent<NGConstraintSpace> constraint_space_; // The break token from which we are currently resuming layout. - Member<NGBreakToken> break_token_; + Persistent<NGBreakToken> break_token_; - Member<NGFragmentBuilder> builder_; - Member<NGConstraintSpaceBuilder> space_builder_; - Member<NGConstraintSpace> space_for_current_child_; - Member<NGBlockNode> current_child_; + Persistent<NGFragmentBuilder> builder_; + Persistent<NGConstraintSpaceBuilder> space_builder_; + Persistent<NGConstraintSpace> space_for_current_child_; + Persistent<NGBlockNode> current_child_; // Mapper from the fragmented flow coordinate space coordinates to visual // coordinates. Only set on fragmentation context roots, such as multicol // containers. Keeps track of the current fragmentainer. - Member<NGColumnMapper> fragmentainer_mapper_; + Persistent<NGColumnMapper> fragmentainer_mapper_; NGBoxStrut border_and_padding_; LayoutUnit content_size_;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc index e531bfd..2e0d816 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -13,6 +13,7 @@ #include "core/layout/ng/ng_constraint_space.h" #include "core/layout/ng/ng_constraint_space_builder.h" #include "core/layout/ng/ng_fragment_builder.h" +#include "core/layout/ng/ng_inline_layout_algorithm.h" #include "core/layout/ng/ng_inline_node.h" #include "core/layout/ng/ng_length_utils.h" #include "core/layout/ng/ng_writing_mode.h" @@ -79,19 +80,29 @@ NGBlockNode::~NGBlockNode() {} NGPhysicalFragment* NGBlockNode::Layout(NGConstraintSpace* constraint_space) { - // We can either use the new layout code to do the layout and then copy the - // resulting size to the LayoutObject, or use the old layout code and - // synthesize a fragment. - if (CanUseNewLayout()) { - NGLayoutAlgorithm* algorithm = - NGLayoutInputNode::AlgorithmForInputNode(this, constraint_space); - fragment_ = toNGPhysicalBoxFragment(algorithm->Layout()); - CopyFragmentDataToLayoutBox(*constraint_space); - } else { + // Use the old layout code and synthesize a fragment. + if (!CanUseNewLayout()) { DCHECK(layout_box_); fragment_ = RunOldLayout(*constraint_space); + return fragment_; } + NGPhysicalFragment* fragment; + + if (HasInlineChildren()) { + fragment = + NGInlineLayoutAlgorithm(GetLayoutObject(), &Style(), + toNGInlineNode(FirstChild()), constraint_space) + .Layout(); + } else { + fragment = NGBlockLayoutAlgorithm(GetLayoutObject(), &Style(), + toNGBlockNode(FirstChild()), + constraint_space, CurrentBreakToken()) + .Layout(); + } + + fragment_ = toNGPhysicalBoxFragment(fragment); + CopyFragmentDataToLayoutBox(*constraint_space); return fragment_; }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc index bcd6426..d125236 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
@@ -83,9 +83,9 @@ .SetAvailableSize(available_size) .SetPercentageResolutionSize(percentage_size) .SetIsInlineDirectionTriggersScrollbar( - box.styleRef().overflowInlineDirection() == EOverflow::Auto) + box.styleRef().overflowInlineDirection() == EOverflow::kAuto) .SetIsBlockDirectionTriggersScrollbar( - box.styleRef().overflowBlockDirection() == EOverflow::Auto) + box.styleRef().overflowBlockDirection() == EOverflow::kAuto) .SetIsFixedSizeInline(fixed_inline) .SetIsFixedSizeBlock(fixed_block) .SetIsShrinkToFit( @@ -107,13 +107,6 @@ // TODO(layout-ng): Implement. } -NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( - const WTF::Optional<NGLogicalOffset>& opt_origin_point) { - NGLayoutOpportunityIterator* iterator = - new NGLayoutOpportunityIterator(this, opt_origin_point); - return iterator; -} - String NGConstraintSpace::ToString() const { return String::format("Offset: %s,%s Size: %sx%s MarginStrut: %s", bfc_offset_.inline_offset.toString().ascii().data(),
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h index 09f55f8..35622c7f 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
@@ -16,7 +16,6 @@ class LayoutBox; class NGBoxFragment; -class NGLayoutOpportunityIterator; enum NGFragmentationType { kFragmentNone, @@ -109,9 +108,6 @@ // size, or add an exclusion. void Subtract(const NGBoxFragment*); - NGLayoutOpportunityIterator* LayoutOpportunities( - const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt); - NGMarginStrut MarginStrut() const { return margin_strut_; } NGLogicalOffset BfcOffset() const { return bfc_offset_; }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc index 49117713..0c36c54 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_test.cc
@@ -36,9 +36,10 @@ size.block_size = LayoutUnit(400); auto* space = ConstructConstraintSpace(kHorizontalTopBottom, TextDirection::kLtr, size); - auto* iterator = space->LayoutOpportunities(); - EXPECT_EQ("0,0 600x400", OpportunityToString(iterator->Next())); - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + + NGLayoutOpportunityIterator iterator(space); + EXPECT_EQ("0,0 600x400", OpportunityToString(iterator.Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopRightExclusion) { @@ -54,13 +55,14 @@ exclusion.rect.offset = {/* inline_offset */ LayoutUnit(500), /* block_offset */ LayoutUnit(0)}; space->AddExclusion(exclusion); - auto* iterator = space->LayoutOpportunities(); + + NGLayoutOpportunityIterator iterator(space); // First opportunity should be to the left of the exclusion. - EXPECT_EQ("0,0 500x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,0 500x400", OpportunityToString(iterator.Next())); // Second opportunity should be below the exclusion. - EXPECT_EQ("0,100 600x300", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,100 600x300", OpportunityToString(iterator.Next())); // There should be no third opportunity. - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } TEST(NGConstraintSpaceTest, LayoutOpportunitiesTopLeftExclusion) { @@ -76,13 +78,14 @@ exclusion.rect.offset = {/* inline_offset */ LayoutUnit(0), /* block_offset */ LayoutUnit(0)}; space->AddExclusion(exclusion); - auto* iterator = space->LayoutOpportunities(); + + NGLayoutOpportunityIterator iterator(space); // First opportunity should be to the right of the exclusion. - EXPECT_EQ("100,0 500x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("100,0 500x400", OpportunityToString(iterator.Next())); // Second opportunity should be below the exclusion. - EXPECT_EQ("0,100 600x300", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,100 600x300", OpportunityToString(iterator.Next())); // There should be no third opportunity. - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } // Verifies that Layout Opportunity iterator produces 7 layout opportunities @@ -127,20 +130,21 @@ exclusion2.rect.offset = {/* inline_offset */ LayoutUnit(500), /* block_offset */ LayoutUnit(350)}; space->AddExclusion(exclusion2); - auto* iterator = space->LayoutOpportunities(); + + NGLayoutOpportunityIterator iterator(space); // 1st Start point - EXPECT_EQ("0,0 600x200", OpportunityToString(iterator->Next())); - EXPECT_EQ("0,0 150x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,0 600x200", OpportunityToString(iterator.Next())); + EXPECT_EQ("0,0 150x400", OpportunityToString(iterator.Next())); // 2nd Start point - EXPECT_EQ("250,0 350x350", OpportunityToString(iterator->Next())); - EXPECT_EQ("250,0 250x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("250,0 350x350", OpportunityToString(iterator.Next())); + EXPECT_EQ("250,0 250x400", OpportunityToString(iterator.Next())); // 3rd Start point - EXPECT_EQ("550,0 50x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("550,0 50x400", OpportunityToString(iterator.Next())); // 4th Start point - EXPECT_EQ("0,300 600x50", OpportunityToString(iterator->Next())); - EXPECT_EQ("0,300 500x100", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,300 600x50", OpportunityToString(iterator.Next())); + EXPECT_EQ("0,300 500x100", OpportunityToString(iterator.Next())); // Iterator is exhausted. - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } // This test is the same as LayoutOpportunitiesTwoInMiddle with the only @@ -176,24 +180,24 @@ exclusion2.rect.offset = {/* inline_offset */ LayoutUnit(500), /* block_offset */ LayoutUnit(350)}; space->AddExclusion(exclusion2); + const NGLogicalOffset origin_point = {LayoutUnit(0), LayoutUnit(200)}; const NGLogicalOffset leader_point = {LayoutUnit(250), LayoutUnit(300)}; - auto* iterator = - new NGLayoutOpportunityIterator(space, origin_point, leader_point); + NGLayoutOpportunityIterator iterator(space, origin_point, leader_point); // 1st Start Point - EXPECT_EQ("250,200 350x150", OpportunityToString(iterator->Next())); - EXPECT_EQ("250,200 250x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("250,200 350x150", OpportunityToString(iterator.Next())); + EXPECT_EQ("250,200 250x400", OpportunityToString(iterator.Next())); // 2nd Start Point - EXPECT_EQ("550,200 50x400", OpportunityToString(iterator->Next())); + EXPECT_EQ("550,200 50x400", OpportunityToString(iterator.Next())); // 3rd Start Point - EXPECT_EQ("0,300 600x50", OpportunityToString(iterator->Next())); - EXPECT_EQ("0,300 500x300", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,300 600x50", OpportunityToString(iterator.Next())); + EXPECT_EQ("0,300 500x300", OpportunityToString(iterator.Next())); // 4th Start Point - EXPECT_EQ("0,400 600x200", OpportunityToString(iterator->Next())); + EXPECT_EQ("0,400 600x200", OpportunityToString(iterator.Next())); // TODO(glebl): The opportunity below should not be generated. - EXPECT_EQ("250,400 350x200", OpportunityToString(iterator->Next())); + EXPECT_EQ("250,400 350x200", OpportunityToString(iterator.Next())); // Iterator is exhausted. - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } // Verifies that Layout Opportunity iterator ignores the exclusion that is not // within constraint space. @@ -222,9 +226,10 @@ exclusion.rect.offset = {/* inline_offset */ LayoutUnit(0), /* block_offset */ LayoutUnit(150)}; space->AddExclusion(exclusion); - auto* iterator = space->LayoutOpportunities(); - EXPECT_EQ("0,0 600x100", OpportunityToString(iterator->Next())); - EXPECT_EQ("(empty)", OpportunityToString(iterator->Next())); + + NGLayoutOpportunityIterator iterator(space); + EXPECT_EQ("0,0 600x100", OpportunityToString(iterator.Next())); + EXPECT_EQ("(empty)", OpportunityToString(iterator.Next())); } } // namespace
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc index a6cd530..e308c50 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc
@@ -23,8 +23,7 @@ NGInlineNode* first_child, NGConstraintSpace* constraint_space, NGBreakToken* break_token) - : NGLayoutAlgorithm(kInlineLayoutAlgorithm), - style_(style), + : style_(style), first_child_(first_child), constraint_space_(constraint_space), break_token_(break_token), @@ -65,12 +64,4 @@ return child_space; } -DEFINE_TRACE(NGInlineLayoutAlgorithm) { - NGLayoutAlgorithm::trace(visitor); - visitor->trace(first_child_); - visitor->trace(constraint_space_); - visitor->trace(break_token_); - visitor->trace(builder_); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.h index e37ba0d..5a58fe5 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.h
@@ -6,14 +6,15 @@ #define NGInlineLayoutAlgorithm_h #include "core/CoreExport.h" +#include "core/layout/ng/ng_break_token.h" #include "core/layout/ng/ng_layout_algorithm.h" +#include "platform/heap/Handle.h" #include "wtf/RefPtr.h" namespace blink { class ComputedStyle; class LayoutObject; -class NGBreakToken; class NGConstraintSpace; class NGFragmentBuilder; class NGInlineNode; @@ -41,8 +42,6 @@ NGPhysicalFragment* Layout() override; - DECLARE_VIRTUAL_TRACE(); - private: // Read-only Getters. const ComputedStyle& Style() const { return *style_; } @@ -50,10 +49,10 @@ NGConstraintSpace* CreateConstraintSpaceForChild(const NGInlineNode&) const; RefPtr<const ComputedStyle> style_; - Member<NGInlineNode> first_child_; - Member<NGConstraintSpace> constraint_space_; - Member<NGBreakToken> break_token_; - Member<NGFragmentBuilder> builder_; + Persistent<NGInlineNode> first_child_; + Persistent<NGConstraintSpace> constraint_space_; + Persistent<NGBreakToken> break_token_; + Persistent<NGFragmentBuilder> builder_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_node_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_inline_node_test.cc index 8a797d9..5bb6c78 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_inline_node_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_node_test.cc
@@ -69,9 +69,9 @@ NGConstraintSpace* constraint_space = NGConstraintSpaceBuilder(kHorizontalTopBottom).ToConstraintSpace(); NGLineBuilder line_builder(node, constraint_space); - NGTextLayoutAlgorithm* algorithm = - new NGTextLayoutAlgorithm(node, constraint_space); - algorithm->LayoutInline(&line_builder); + + NGTextLayoutAlgorithm algorithm(node, constraint_space); + algorithm.LayoutInline(&line_builder); NGFragmentBuilder fragment_builder(NGPhysicalFragment::kFragmentBox, /* layout_object */ nullptr);
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h index 59df65e..b3fc836 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
@@ -6,32 +6,19 @@ #define NGLayoutAlgorithm_h #include "core/CoreExport.h" -#include "platform/heap/Handle.h" #include "wtf/Allocator.h" #include "wtf/Noncopyable.h" namespace blink { struct MinAndMaxContentSizes; -class NGConstraintSpace; class NGPhysicalFragment; -enum NGLayoutStatus { kNotFinished, kChildAlgorithmRequired, kNewFragment }; - -enum NGLayoutAlgorithmType { - kBlockLayoutAlgorithm, - kInlineLayoutAlgorithm, - kLegacyBlockLayoutAlgorithm, - kTextLayoutAlgorithm -}; - // Base class for all LayoutNG algorithms. -class CORE_EXPORT NGLayoutAlgorithm - : public GarbageCollectedFinalized<NGLayoutAlgorithm> { - WTF_MAKE_NONCOPYABLE(NGLayoutAlgorithm); +class CORE_EXPORT NGLayoutAlgorithm { + STACK_ALLOCATED(); public: - NGLayoutAlgorithm(NGLayoutAlgorithmType type) : type_(type) {} virtual ~NGLayoutAlgorithm() {} // Actual layout function. Lays out the children and descendents within the @@ -40,8 +27,6 @@ // TODO(layout-dev): attempt to make this function const. virtual NGPhysicalFragment* Layout() = 0; - enum MinAndMaxState { kSuccess, kPending, kNotImplemented }; - // Computes the min-content and max-content intrinsic sizes for the given box. // The result will not take any min-width, max-width or width properties into // account. Implementations can return false, in which case the caller is @@ -51,13 +36,6 @@ virtual bool ComputeMinAndMaxContentSizes(MinAndMaxContentSizes*) const { return false; } - - DEFINE_INLINE_VIRTUAL_TRACE() {} - - NGLayoutAlgorithmType algorithmType() const { return type_; } - - private: - NGLayoutAlgorithmType type_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc index 0a1ea0cc..30334e0 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc
@@ -17,7 +17,7 @@ String NGLayoutInlineItemsBuilder::ToString() { if (has_pending_newline_) - ProcessPendingNewline(emptyString(), nullptr); + ProcessPendingNewline(emptyString, nullptr); return text_.toString(); } @@ -167,7 +167,7 @@ DCHECK(character != spaceCharacter && character != tabulationCharacter && character != newlineCharacter && character != zeroWidthSpaceCharacter); if (has_pending_newline_) - ProcessPendingNewline(emptyString(), nullptr); + ProcessPendingNewline(emptyString, nullptr); text_.append(character); unsigned end_offset = text_.length(); @@ -178,7 +178,7 @@ void NGLayoutInlineItemsBuilder::AppendAsOpaqueToSpaceCollapsing( UChar character) { if (has_pending_newline_) - ProcessPendingNewline(emptyString(), nullptr); + ProcessPendingNewline(emptyString, nullptr); text_.append(character); unsigned end_offset = text_.length();
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc deleted file mode 100644 index dcb0e27..0000000 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "core/layout/ng/ng_layout_input_node.h" - -#include "core/layout/ng/ng_block_layout_algorithm.h" -#include "core/layout/ng/ng_block_node.h" -#include "core/layout/ng/ng_constraint_space.h" -#include "core/layout/ng/ng_inline_layout_algorithm.h" -#include "core/layout/ng/ng_inline_node.h" -#include "core/layout/ng/ng_layout_algorithm.h" -#include "core/layout/ng/ng_legacy_block_layout_algorithm.h" -#include "core/style/ComputedStyle.h" - -namespace blink { - -NGLayoutAlgorithm* NGLayoutInputNode::AlgorithmForInputNode( - NGLayoutInputNode* input_node, - NGConstraintSpace* constraint_space) { - // At least for now, this should never be called on LegacyInline - // children. However, there will be other kinds of input_node so - // it makes sense to do this here. - DCHECK(input_node->Type() == kLegacyBlock); - NGBlockNode* block = toNGBlockNode(input_node); - if (!block->CanUseNewLayout()) - return new NGLegacyBlockLayoutAlgorithm(block, constraint_space); - const ComputedStyle& style = block->Style(); - LayoutObject* layout_object = input_node->GetLayoutObject(); - if (block->HasInlineChildren()) { - NGInlineNode* child = toNGInlineNode(block->FirstChild()); - return new NGInlineLayoutAlgorithm(layout_object, &style, child, - constraint_space); - } - NGBlockNode* child = toNGBlockNode(block->FirstChild()); - // TODO(layout-ng): The break token should be passed as an argument to this - // method instead of getting it from the NGBlockNode - NGBreakToken* token = block->CurrentBreakToken(); - return new NGBlockLayoutAlgorithm(layout_object, &style, child, - constraint_space, token); -} -}
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.h index 6e502df..f18a786 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.h
@@ -13,7 +13,6 @@ class LayoutObject; class NGConstraintSpace; class NGPhysicalFragment; -class NGLayoutAlgorithm; // Represents the input to a layout algorithm for a given node. The layout // engine should use the style, node type to determine which type of layout @@ -38,9 +37,6 @@ return static_cast<NGLayoutInputNodeType>(type_); } - static NGLayoutAlgorithm* AlgorithmForInputNode(NGLayoutInputNode*, - NGConstraintSpace*); - DEFINE_INLINE_VIRTUAL_TRACE() {} protected:
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc index 20eb67a..b9c30899 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.cc
@@ -245,7 +245,8 @@ NGLogicalOffset origin_point = opt_origin_point ? opt_origin_point.value() : NGLogicalOffset(); NGLayoutOpportunity initial_opportunity = - CreateLayoutOpportunityFromConstraintSpace(*space, origin_point); + CreateLayoutOpportunityFromConstraintSpace(*constraint_space_, + origin_point); opportunity_tree_root_ = new NGLayoutOpportunityTreeNode(initial_opportunity); if (opt_leader_point) {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h index d0795238..77344c1 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
@@ -18,8 +18,9 @@ typedef NGLogicalRect NGLayoutOpportunity; typedef Vector<NGLayoutOpportunity> NGLayoutOpportunities; -class CORE_EXPORT NGLayoutOpportunityIterator final - : public GarbageCollectedFinalized<NGLayoutOpportunityIterator> { +class CORE_EXPORT NGLayoutOpportunityIterator final { + STACK_ALLOCATED(); + public: // Default constructor. // @@ -40,11 +41,6 @@ // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. const NGLayoutOpportunity Next(); - DEFINE_INLINE_VIRTUAL_TRACE() { - visitor->trace(constraint_space_); - visitor->trace(opportunity_tree_root_); - } - private: // Mutable Getters. NGLayoutOpportunityTreeNode* MutableOpportunityTreeRoot() { @@ -56,11 +52,11 @@ return opportunity_tree_root_.get(); } - Member<NGConstraintSpace> constraint_space_; + Persistent<NGConstraintSpace> constraint_space_; NGLayoutOpportunities opportunities_; NGLayoutOpportunities::const_iterator opportunity_iter_; - Member<NGLayoutOpportunityTreeNode> opportunity_tree_root_; + Persistent<NGLayoutOpportunityTreeNode> opportunity_tree_root_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.cc deleted file mode 100644 index c19654d..0000000 --- a/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.cc +++ /dev/null
@@ -1,27 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "core/layout/ng/ng_legacy_block_layout_algorithm.h" - -#include "core/layout/ng/ng_physical_box_fragment.h" - -namespace blink { - -NGLegacyBlockLayoutAlgorithm::NGLegacyBlockLayoutAlgorithm( - NGBlockNode* block, - const NGConstraintSpace* constraint_space) - : NGLayoutAlgorithm(kLegacyBlockLayoutAlgorithm), - block_(block), - constraint_space_(constraint_space) {} - -NGPhysicalFragment* NGLegacyBlockLayoutAlgorithm::Layout() { - return block_->RunOldLayout(*constraint_space_); -} - -DEFINE_TRACE(NGLegacyBlockLayoutAlgorithm) { - NGLayoutAlgorithm::trace(visitor); - visitor->trace(block_); - visitor->trace(constraint_space_); -} -}
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.h deleted file mode 100644 index 189aaf5..0000000 --- a/third_party/WebKit/Source/core/layout/ng/ng_legacy_block_layout_algorithm.h +++ /dev/null
@@ -1,32 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef NGLegacyBlockLayoutAlgorithm_h -#define NGLegacyBlockLayoutAlgorithm_h - -#include "core/CoreExport.h" -#include "core/layout/ng/ng_block_node.h" -#include "core/layout/ng/ng_constraint_space.h" -#include "core/layout/ng/ng_layout_algorithm.h" -#include "wtf/RefPtr.h" - -namespace blink { - -// A class for legacy block layout (blocks that can't be handled by NG yet). -// Defers to the old layout method of the block -class CORE_EXPORT NGLegacyBlockLayoutAlgorithm : public NGLayoutAlgorithm { - public: - NGLegacyBlockLayoutAlgorithm(NGBlockNode*, const NGConstraintSpace*); - - NGPhysicalFragment* Layout() override; - - DECLARE_VIRTUAL_TRACE(); - - private: - Member<NGBlockNode> block_; - Member<const NGConstraintSpace> constraint_space_; -}; -} - -#endif // NGLegacyBlockLayoutAlgorithm_h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc index eaecb75..6c41377 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_length_utils.cc
@@ -43,6 +43,8 @@ LengthResolveType type) { DCHECK(!length.isMaxSizeNone()); DCHECK_GE(constraint_space.AvailableSize().inline_size, LayoutUnit()); + DCHECK_GE(constraint_space.PercentageResolutionSize().inline_size, + LayoutUnit()); if (type == LengthResolveType::kMinSize && length.isAuto()) return LayoutUnit();
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc index 64a1c1f..d3503ca 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.cc
@@ -19,8 +19,7 @@ NGInlineNode* inline_box, NGConstraintSpace* constraint_space, NGBreakToken* break_token) - : NGLayoutAlgorithm(kTextLayoutAlgorithm), - inline_box_(inline_box), + : inline_box_(inline_box), constraint_space_(constraint_space), break_token_(break_token) { DCHECK(inline_box_); @@ -68,11 +67,4 @@ line_builder->CreateLine(); } -DEFINE_TRACE(NGTextLayoutAlgorithm) { - NGLayoutAlgorithm::trace(visitor); - visitor->trace(inline_box_); - visitor->trace(constraint_space_); - visitor->trace(break_token_); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.h index 0287a0dd..61b0bd13 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_text_layout_algorithm.h
@@ -6,11 +6,12 @@ #define NGInlineLayoutAlgorithm_h #include "core/CoreExport.h" +#include "core/layout/ng/ng_break_token.h" #include "core/layout/ng/ng_layout_algorithm.h" +#include "platform/heap/Handle.h" namespace blink { -class NGBreakToken; class NGConstraintSpace; class NGInlineNode; class NGLineBuilder; @@ -34,22 +35,14 @@ NGPhysicalFragment* Layout() override; void LayoutInline(NGLineBuilder*); - DECLARE_VIRTUAL_TRACE(); - private: - Member<NGInlineNode> inline_box_; - Member<NGConstraintSpace> constraint_space_; - Member<NGBreakToken> break_token_; + Persistent<NGInlineNode> inline_box_; + Persistent<NGConstraintSpace> constraint_space_; + Persistent<NGBreakToken> break_token_; friend class NGInlineNodeTest; }; -DEFINE_TYPE_CASTS(NGTextLayoutAlgorithm, - NGLayoutAlgorithm, - algorithm, - algorithm->algorithmType() == kTextLayoutAlgorithm, - algorithm.algorithmType() == kTextLayoutAlgorithm); - } // namespace blink #endif // NGInlineLayoutAlgorithm_h
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp index 2e544acd..d1d8068 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -215,9 +215,10 @@ // clipped. When the svg is stand-alone (isDocumentElement() == true) the // viewport clipping should always be applied, noting that the window // scrollbars should be hidden if overflow=hidden. - return style()->overflowX() == EOverflow::Hidden || - style()->overflowX() == EOverflow::Auto || - style()->overflowX() == EOverflow::Scroll || this->isDocumentElement(); + return style()->overflowX() == EOverflow::kHidden || + style()->overflowX() == EOverflow::kAuto || + style()->overflowX() == EOverflow::kScroll || + this->isDocumentElement(); } LayoutRect LayoutSVGRoot::visualOverflowRect() const {
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp index 97111d8c..b8891670 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp
@@ -374,8 +374,8 @@ // itself to the initial viewport size. ASSERT(!object->isDocumentElement()); - return object->style()->overflowX() == EOverflow::Hidden || - object->style()->overflowX() == EOverflow::Scroll; + return object->style()->overflowX() == EOverflow::kHidden || + object->style()->overflowX() == EOverflow::kScroll; } void SVGLayoutSupport::adjustVisualRectWithResources(
diff --git a/third_party/WebKit/Source/core/loader/BUILD.gn b/third_party/WebKit/Source/core/loader/BUILD.gn index 45f7b26..e0e57be8 100644 --- a/third_party/WebKit/Source/core/loader/BUILD.gn +++ b/third_party/WebKit/Source/core/loader/BUILD.gn
@@ -62,6 +62,7 @@ "appcache/ApplicationCache.h", "appcache/ApplicationCacheHost.cpp", "appcache/ApplicationCacheHost.h", + "modulescript/ModuleScriptFetchRequest.h", "resource/CSSStyleSheetResource.cpp", "resource/CSSStyleSheetResource.h", "resource/DocumentResource.cpp",
diff --git a/third_party/WebKit/Source/core/loader/FormSubmission.cpp b/third_party/WebKit/Source/core/loader/FormSubmission.cpp index e7bb534..c985b0e 100644 --- a/third_party/WebKit/Source/core/loader/FormSubmission.cpp +++ b/third_party/WebKit/Source/core/loader/FormSubmission.cpp
@@ -129,7 +129,7 @@ return "dialog"; } NOTREACHED(); - return emptyString(); + return emptyString; } void FormSubmission::Attributes::copyFrom(const Attributes& other) {
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index f90f72c..524988a 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -212,7 +212,7 @@ } void FrameLoader::init() { - ResourceRequest initialRequest(KURL(ParsedURLString, emptyString())); + ResourceRequest initialRequest(KURL(ParsedURLString, emptyString)); initialRequest.setRequestContext(WebURLRequest::RequestContextInternal); initialRequest.setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTypeTopLevel
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h new file mode 100644 index 0000000..d2bc85b --- /dev/null +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptFetchRequest.h
@@ -0,0 +1,69 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ModuleScriptFetchRequest_h +#define ModuleScriptFetchRequest_h + +#include "platform/loader/fetch/ResourceLoaderOptions.h" +#include "platform/weborigin/KURL.h" +#include "platform/weborigin/Referrer.h" +#include "public/platform/WebURLRequest.h" +#include "wtf/text/WTFString.h" + +namespace blink { + +// A ModuleScriptFetchRequest is a "parameter object" for +// Modulator::fetch{,New}SingleModule to avoid the methods having too many +// arguments. +// In terms of spec, a ModuleScriptFetchRequest carries most of the arguments +// for "fetch a single module script" algorithm: +// https://html.spec.whatwg.org/#fetch-a-single-module-script +class ModuleScriptFetchRequest final { + STACK_ALLOCATED(); + + public: + ModuleScriptFetchRequest(const KURL& url, + const String& nonce, + ParserDisposition parserState, + WebURLRequest::FetchCredentialsMode credentialsMode) + : ModuleScriptFetchRequest(url, + nonce, + parserState, + credentialsMode, + Referrer::noReferrer()) {} + ~ModuleScriptFetchRequest() = default; + + const KURL& url() const { return m_url; } + const String& nonce() const { return m_nonce; } + const ParserDisposition& parserState() const { return m_parserState; } + WebURLRequest::FetchCredentialsMode credentialsMode() const { + return m_credentialsMode; + } + const AtomicString& referrer() const { return m_referrer; } + + private: + // Referrer is set only for internal module script fetch algorithms triggered + // from ModuleTreeLinker to fetch descendant module scripts. + friend class ModuleTreeLinker; + ModuleScriptFetchRequest(const KURL& url, + const String& nonce, + ParserDisposition parserState, + WebURLRequest::FetchCredentialsMode credentialsMode, + const String& referrer) + : m_url(url), + m_nonce(nonce), + m_parserState(parserState), + m_credentialsMode(credentialsMode), + m_referrer(referrer) {} + + const KURL m_url; + const String m_nonce; + const ParserDisposition m_parserState; + const WebURLRequest::FetchCredentialsMode m_credentialsMode; + const AtomicString m_referrer; +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/page/CreateWindow.cpp b/third_party/WebKit/Source/core/page/CreateWindow.cpp index 856b00a..0945a6c4 100644 --- a/third_party/WebKit/Source/core/page/CreateWindow.cpp +++ b/third_party/WebKit/Source/core/page/CreateWindow.cpp
@@ -185,7 +185,7 @@ ASSERT(activeFrame); KURL completedURL = urlString.isEmpty() - ? KURL(ParsedURLString, emptyString()) + ? KURL(ParsedURLString, emptyString) : firstFrame.document()->completeURL(urlString); if (!completedURL.isEmpty() && !completedURL.isValid()) { // Don't expose client code to invalid URLs.
diff --git a/third_party/WebKit/Source/core/page/PagePopupController.cpp b/third_party/WebKit/Source/core/page/PagePopupController.cpp index 11f197cb..c5fe74e 100644 --- a/third_party/WebKit/Source/core/page/PagePopupController.cpp +++ b/third_party/WebKit/Source/core/page/PagePopupController.cpp
@@ -79,7 +79,7 @@ String PagePopupController::formatMonth(int year, int zeroBaseMonth) { if (!m_popupClient) - return emptyString(); + return emptyString; DateComponents date; date.setMonthsSinceEpoch((year - 1970) * 12.0 + zeroBaseMonth); return m_popupClient->locale().formatDateTime(date, Locale::FormatTypeMedium); @@ -87,7 +87,7 @@ String PagePopupController::formatShortMonth(int year, int zeroBaseMonth) { if (!m_popupClient) - return emptyString(); + return emptyString; DateComponents date; date.setMonthsSinceEpoch((year - 1970) * 12.0 + zeroBaseMonth); return m_popupClient->locale().formatDateTime(date, Locale::FormatTypeShort); @@ -97,7 +97,7 @@ int weekNumber, const String& localizedDateString) { if (!m_popupClient) - return emptyString(); + return emptyString; DateComponents week; bool setWeekResult = week.setWeek(year, weekNumber); DCHECK(setWeekResult);
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp index 63f72a1a..95db920 100644 --- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp +++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -330,21 +330,21 @@ switch (type) { case WebFocusTypeLeft: return (container->layoutObject()->style()->overflowX() != - EOverflow::Hidden && + EOverflow::kHidden && container->layoutBox()->scrollLeft() > 0); case WebFocusTypeUp: return (container->layoutObject()->style()->overflowY() != - EOverflow::Hidden && + EOverflow::kHidden && container->layoutBox()->scrollTop() > 0); case WebFocusTypeRight: return (container->layoutObject()->style()->overflowX() != - EOverflow::Hidden && + EOverflow::kHidden && container->layoutBox()->scrollLeft() + container->layoutBox()->clientWidth() < container->layoutBox()->scrollWidth()); case WebFocusTypeDown: return (container->layoutObject()->style()->overflowY() != - EOverflow::Hidden && + EOverflow::kHidden && container->layoutBox()->scrollTop() + container->layoutBox()->clientHeight() < container->layoutBox()->scrollHeight()); @@ -627,10 +627,10 @@ if (!candidateRect.intersects(parentRect)) { if (((type == WebFocusTypeLeft || type == WebFocusTypeRight) && parentNode.layoutObject()->style()->overflowX() == - EOverflow::Hidden) || + EOverflow::kHidden) || ((type == WebFocusTypeUp || type == WebFocusTypeDown) && parentNode.layoutObject()->style()->overflowY() == - EOverflow::Hidden)) + EOverflow::kHidden)) return false; } if (parentNode == candidate.enclosingScrollableBox)
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 8e915fe..8eef9f1 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -627,9 +627,9 @@ EOverflow overflowStyle = (orientation == HorizontalScrollbar) ? box().style()->overflowX() : box().style()->overflowY(); - return (overflowStyle == EOverflow::Scroll || - overflowStyle == EOverflow::Auto || - overflowStyle == EOverflow::Overlay); + return (overflowStyle == EOverflow::kScroll || + overflowStyle == EOverflow::kAuto || + overflowStyle == EOverflow::kOverlay); } bool PaintLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const { @@ -756,9 +756,9 @@ // Our proprietary overflow: overlay value doesn't trigger a layout. if ((horizontalScrollbarShouldChange && - box().style()->overflowX() != EOverflow::Overlay) || + box().style()->overflowX() != EOverflow::kOverlay) || (verticalScrollbarShouldChange && - box().style()->overflowY() != EOverflow::Overlay)) { + box().style()->overflowY() != EOverflow::kOverlay)) { if ((verticalScrollbarShouldChange && box().isHorizontalWritingMode()) || (horizontalScrollbarShouldChange && !box().isHorizontalWritingMode())) { @@ -981,14 +981,14 @@ // With overflow: scroll, scrollbars are always visible but may be disabled. // When switching to another value, we need to re-enable them (see bug 11985). if (hasHorizontalScrollbar() && oldStyle && - oldStyle->overflowX() == EOverflow::Scroll && - box().style()->overflowX() != EOverflow::Scroll) { + oldStyle->overflowX() == EOverflow::kScroll && + box().style()->overflowX() != EOverflow::kScroll) { horizontalScrollbar()->setEnabled(true); } if (hasVerticalScrollbar() && oldStyle && - oldStyle->overflowY() == EOverflow::Scroll && - box().style()->overflowY() != EOverflow::Scroll) { + oldStyle->overflowY() == EOverflow::kScroll && + box().style()->overflowY() != EOverflow::kScroll) { verticalScrollbar()->setEnabled(true); }
diff --git a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp index d04b1ea..0e45043 100644 --- a/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp +++ b/third_party/WebKit/Source/core/paint/TableSectionPainter.cpp
@@ -189,7 +189,9 @@ // precedence due to cell position is respected. for (unsigned r = dirtiedRows.end(); r > dirtiedRows.start(); r--) { unsigned row = r - 1; - for (unsigned c = dirtiedColumns.end(); c > dirtiedColumns.start(); c--) { + unsigned nCols = m_layoutTableSection.numCols(row); + for (unsigned c = std::min(dirtiedColumns.end(), nCols); + c > dirtiedColumns.start(); c--) { unsigned col = c - 1; const LayoutTableCell* cell = m_layoutTableSection.primaryCellAt(row, col); @@ -302,9 +304,9 @@ shouldPaintSelfOutline(paintInfoForDescendants.phase)) TableRowPainter(*row).paintOutline(paintInfoForDescendants, paintOffset); - for (unsigned c = dirtiedColumns.start(); c < dirtiedColumns.end(); c++) { - if (c >= m_layoutTableSection.numCols(r)) - break; + unsigned nCols = m_layoutTableSection.numCols(r); + for (unsigned c = dirtiedColumns.start(); + c < nCols && c < dirtiedColumns.end(); c++) { const LayoutTableSection::CellStruct& current = m_layoutTableSection.cellAt(r, c); for (LayoutTableCell* cell : current.cells) {
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index 31a9f125..88dd1e2 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -1465,7 +1465,7 @@ } // overflow-x - static EOverflow initialOverflowX() { return EOverflow::Visible; } + static EOverflow initialOverflowX() { return EOverflow::kVisible; } EOverflow overflowX() const { return static_cast<EOverflow>(m_nonInheritedData.m_overflowX); } @@ -1474,7 +1474,7 @@ } // overflow-y - static EOverflow initialOverflowY() { return EOverflow::Visible; } + static EOverflow initialOverflowY() { return EOverflow::kVisible; } EOverflow overflowY() const { return static_cast<EOverflow>(m_nonInheritedData.m_overflowY); } @@ -3381,11 +3381,12 @@ // It's sufficient to just check one direction, since it's illegal to have // visible on only one overflow value. bool isOverflowVisible() const { - DCHECK(overflowX() != EOverflow::Visible || overflowX() == overflowY()); - return overflowX() == EOverflow::Visible; + DCHECK(overflowX() != EOverflow::kVisible || overflowX() == overflowY()); + return overflowX() == EOverflow::kVisible; } bool isOverflowPaged() const { - return overflowY() == EOverflow::PagedX || overflowY() == EOverflow::PagedY; + return overflowY() == EOverflow::kWebkitPagedX || + overflowY() == EOverflow::kWebkitPagedY; } // Visibility utility functions. @@ -3584,8 +3585,10 @@ // If the pagination axis is parallel with the writing mode inline axis, // columns may be laid out along the inline axis, just like for regular // multicol. Otherwise, we need to lay out along the block axis. - if (isOverflowPaged()) - return (overflowY() == EOverflow::PagedX) == isHorizontalWritingMode(); + if (isOverflowPaged()) { + return (overflowY() == EOverflow::kWebkitPagedX) == + isHorizontalWritingMode(); + } return false; }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index 8e36d77..eb1521a 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -145,13 +145,13 @@ // Random visual rendering model attributes. Not inherited. enum class EOverflow : unsigned { - Visible, - Hidden, - Scroll, - Auto, - Overlay, - PagedX, - PagedY + kVisible, + kHidden, + kScroll, + kAuto, + kOverlay, + kWebkitPagedX, + kWebkitPagedY }; enum class EVerticalAlign : unsigned {
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp index b727b9b..f3f588b5 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp +++ b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
@@ -71,8 +71,8 @@ TEST(ComputedStyleTest, Preserve3dForceStackingContext) { RefPtr<ComputedStyle> style = ComputedStyle::create(); style->setTransformStyle3D(TransformStyle3DPreserve3D); - style->setOverflowX(EOverflow::Hidden); - style->setOverflowY(EOverflow::Hidden); + style->setOverflowX(EOverflow::kHidden); + style->setOverflowY(EOverflow::kHidden); style->updateIsStackingContext(false, false); EXPECT_EQ(TransformStyle3DFlat, style->usedTransformStyle3D()); EXPECT_TRUE(style->isStackingContext());
diff --git a/third_party/WebKit/Source/core/style/QuotesData.cpp b/third_party/WebKit/Source/core/style/QuotesData.cpp index 5b088c6..0eafa382 100644 --- a/third_party/WebKit/Source/core/style/QuotesData.cpp +++ b/third_party/WebKit/Source/core/style/QuotesData.cpp
@@ -40,7 +40,7 @@ const String QuotesData::getOpenQuote(int index) const { ASSERT(index >= 0); if (!m_quotePairs.size() || index < 0) - return emptyString(); + return emptyString; if ((size_t)index >= m_quotePairs.size()) return m_quotePairs.back().first; return m_quotePairs.at(index).first; @@ -49,7 +49,7 @@ const String QuotesData::getCloseQuote(int index) const { ASSERT(index >= -1); if (!m_quotePairs.size() || index < 0) - return emptyString(); + return emptyString; if ((size_t)index >= m_quotePairs.size()) return m_quotePairs.back().second; return m_quotePairs.at(index).second;
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp index 09b2ab8..a93258a 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGAnimationElement.cpp
@@ -559,11 +559,11 @@ // For to-animations the from value is the current accumulated value from // lower priority animations. // The value is not static and is determined during the animation. - m_animationValid = calculateFromAndToValues(emptyString(), to); + m_animationValid = calculateFromAndToValues(emptyString, to); } else if (animationMode == FromByAnimation) { m_animationValid = calculateFromAndByValues(from, by); } else if (animationMode == ByAnimation) { - m_animationValid = calculateFromAndByValues(emptyString(), by); + m_animationValid = calculateFromAndByValues(emptyString, by); } else if (animationMode == ValuesAnimation) { m_animationValid = m_values.size() >= 1 && (calcMode == CalcModePaced ||
diff --git a/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp b/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp index 3feca34..f32cb9f 100644 --- a/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp +++ b/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp
@@ -52,7 +52,7 @@ } ASSERT(m_value < maxInternalEnumValue()); - return emptyString(); + return emptyString; } void SVGEnumerationBase::setValue(unsigned short value) {
diff --git a/third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp b/third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp index e17adc2..e896db0 100644 --- a/third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp +++ b/third_party/WebKit/Source/core/svg/SVGPathParserTest.cpp
@@ -20,7 +20,7 @@ output = builder.result(); // Coerce a null result to empty. if (output.isNull()) - output = emptyString(); + output = emptyString; return hadError; }
diff --git a/third_party/WebKit/Source/core/svg/SVGTransform.cpp b/third_party/WebKit/Source/core/svg/SVGTransform.cpp index 98e1590f..0518512 100644 --- a/third_party/WebKit/Source/core/svg/SVGTransform.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTransform.cpp
@@ -153,7 +153,7 @@ size_t argumentCount = 0; switch (m_transformType) { case kSvgTransformUnknown: - return emptyString(); + return emptyString; case kSvgTransformMatrix: { arguments[argumentCount++] = m_matrix.a(); arguments[argumentCount++] = m_matrix.b();
diff --git a/third_party/WebKit/Source/core/testing/DictionaryTest.cpp b/third_party/WebKit/Source/core/testing/DictionaryTest.cpp index 07dea6b73..6a73fe1 100644 --- a/third_party/WebKit/Source/core/testing/DictionaryTest.cpp +++ b/third_party/WebKit/Source/core/testing/DictionaryTest.cpp
@@ -173,12 +173,12 @@ ExecutionContext* executionContext = scriptState->getExecutionContext(); DictionaryIterator iterator = iterable.getIterator(executionContext); if (iterator.isNull()) - return emptyString(); + return emptyString; bool firstLoop = true; while (iterator.next(executionContext, exceptionState)) { if (exceptionState.hadException()) - return emptyString(); + return emptyString; if (firstLoop) firstLoop = false;
diff --git a/third_party/WebKit/Source/core/testing/NullExecutionContext.h b/third_party/WebKit/Source/core/testing/NullExecutionContext.h index a4617fff..c78bd05 100644 --- a/third_party/WebKit/Source/core/testing/NullExecutionContext.h +++ b/third_party/WebKit/Source/core/testing/NullExecutionContext.h
@@ -32,7 +32,7 @@ TaskType, const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>, - const String& taskNameForInstrumentation = emptyString()) override; + const String& taskNameForInstrumentation = emptyString) override; EventTarget* errorEventTarget() override { return nullptr; } EventQueue* getEventQueue() const override { return m_queue.get(); }
diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h index 7e27a16..da334a1 100644 --- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h +++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.h
@@ -24,7 +24,7 @@ void postTask(TaskType, const WebTraceLocation&, std::unique_ptr<ExecutionContextTask>, - const String& taskNameForInstrumentation = emptyString()) final; + const String& taskNameForInstrumentation = emptyString) final; virtual ScriptWrappable* getScriptWrappable() const = 0; virtual WorkerOrWorkletScriptController* scriptController() = 0;
diff --git a/third_party/WebKit/Source/core/xml/XSLStyleSheet.h b/third_party/WebKit/Source/core/xml/XSLStyleSheet.h index 2745381..f057d2da 100644 --- a/third_party/WebKit/Source/core/xml/XSLStyleSheet.h +++ b/third_party/WebKit/Source/core/xml/XSLStyleSheet.h
@@ -98,7 +98,7 @@ void setDisabled(bool b) override { m_isDisabled = b; } Node* ownerNode() const override { return m_ownerNode; } String href() const override { return m_originalURL; } - String title() const override { return emptyString(); } + String title() const override { return emptyString; } void clearOwnerNode() override { m_ownerNode = nullptr; } KURL baseURL() const override { return m_finalURL; }
diff --git a/third_party/WebKit/Source/devtools/BUILD.gn b/third_party/WebKit/Source/devtools/BUILD.gn index f3f90ba..106a8d6a 100644 --- a/third_party/WebKit/Source/devtools/BUILD.gn +++ b/third_party/WebKit/Source/devtools/BUILD.gn
@@ -555,7 +555,6 @@ "front_end/timeline/CountersGraph.js", "front_end/timeline/EventsTimelineTreeView.js", "front_end/timeline/invalidationsTree.css", - "front_end/timeline/MemoryCountersGraph.js", "front_end/timeline/module.json", "front_end/timeline/TimelineController.js", "front_end/timeline/TimelineDetailsView.js", @@ -597,6 +596,7 @@ "front_end/ui/FilterBar.js", "front_end/ui/ForwardedInputEventHandler.js", "front_end/ui/Geometry.js", + "front_end/ui/GlassPane.js", "front_end/ui/HistoryInput.js", "front_end/ui/Icon.js", "front_end/ui/infobar.css",
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark.png b/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark.png new file mode 100644 index 0000000..3a80164 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark.png Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark_2x.png b/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark_2x.png new file mode 100644 index 0000000..237e4199 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/Images/checkboxCheckmark_2x.png Binary files differ
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/checkboxCheckmark.svg b/third_party/WebKit/Source/devtools/front_end/Images/src/checkboxCheckmark.svg new file mode 100644 index 0000000..b54a738 --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/Images/src/checkboxCheckmark.svg
@@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="11" + height="11" + id="svg3283" + version="1.1" + inkscape:version="0.48.4 r9939" + sodipodi:docname="New document 4"> + <defs + id="defs3285" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.839192" + inkscape:cx="1.4668053" + inkscape:cy="9.4825906" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1280" + inkscape:window-height="747" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata3288"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1041.3622)"> + <path + d="m 3.65,1048.5722 -1.44,-2.03 -1.21,1.21 2.55,3.61 6.45,-7.67 -1.12,-1.33 z" + id="path3689" + inkscape:connector-curvature="0" /> + </g> +</svg>
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes b/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes index d2ae55d4..5146cee 100644 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes +++ b/third_party/WebKit/Source/devtools/front_end/Images/src/optimize_png.hashes
@@ -2,6 +2,7 @@ "securityIcons.svg": "27676f7c1f1542659c7c49a8052259dc", "resourceGlyphs.svg": "ae5287ef4b10714c8858b5384c348b6a", "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28", + "checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "d884babbd1c785b92eb46ee736c95541", "toolbarButtonGlyphs.svg": "2b963249c94071016f109403ec246f00",
diff --git a/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes b/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes index d2ae55d4..5146cee 100644 --- a/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes +++ b/third_party/WebKit/Source/devtools/front_end/Images/src/svg2png.hashes
@@ -2,6 +2,7 @@ "securityIcons.svg": "27676f7c1f1542659c7c49a8052259dc", "resourceGlyphs.svg": "ae5287ef4b10714c8858b5384c348b6a", "breakpointConditional.svg": "4cf90210b2af2ed84db2f60b07bcde28", + "checkboxCheckmark.svg": "f039bf85cee42ad5c30ca3bfdce7912a", "errorWave.svg": "e183fa242a22ed4784a92f6becbc2c45", "smallIcons.svg": "d884babbd1c785b92eb46ee736c95541", "toolbarButtonGlyphs.svg": "2b963249c94071016f109403ec246f00",
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js index fe3f432..20cf7f5 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BlackboxManager.js
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {SDK.TargetManager.Observer} * @unrestricted + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ Bindings.BlackboxManager = class { /** @@ -27,7 +27,7 @@ /** @type {!Map<string, boolean>} */ this._isBlackboxedURLCache = new Map(); - SDK.targetManager.observeTargets(this); + SDK.targetManager.observeModels(SDK.DebuggerModel, this); } /** @@ -46,24 +46,19 @@ /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel) - this._setBlackboxPatterns(debuggerModel); + modelAdded(debuggerModel) { + this._setBlackboxPatterns(debuggerModel); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel) { - this._debuggerModelData.delete(debuggerModel); - this._isBlackboxedURLCache.clear(); - } + modelRemoved(debuggerModel) { + this._debuggerModelData.delete(debuggerModel); + this._isBlackboxedURLCache.clear(); } /** @@ -279,7 +274,7 @@ /** @type {!Array<!Promise>} */ var promises = []; - for (var debuggerModel of SDK.DebuggerModel.instances()) { + for (var debuggerModel of SDK.targetManager.models(SDK.DebuggerModel)) { promises.push(this._setBlackboxPatterns(debuggerModel)); for (var scriptId in debuggerModel.scripts) { var script = debuggerModel.scripts[scriptId];
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js index a1fbf21..34f65e47 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js
@@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {SDK.TargetManager.Observer} * @unrestricted + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ Bindings.BreakpointManager = class extends Common.Object { /** @@ -56,9 +56,10 @@ this._workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAdded, this); this._workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); - this._debuggerWorkspaceBinding.addEventListener(Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); + this._debuggerWorkspaceBinding.addEventListener( + Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this); - targetManager.observeTargets(this, SDK.Target.Capability.JS); + targetManager.observeModels(SDK.DebuggerModel, this); } /** @@ -75,19 +76,18 @@ /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel && !this._breakpointsActive) + modelAdded(debuggerModel) { + if (!this._breakpointsActive) debuggerModel.setBreakpointsActive(this._breakpointsActive); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { + modelRemoved(debuggerModel) { } /** @@ -172,12 +172,12 @@ _uiSourceCodeMappingChanged(event) { var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data.uiSourceCode); var isIdentity = /** @type {boolean} */ (event.data.isIdentity); - var target = /** @type {!SDK.Target} */ (event.data.target); + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data.debuggerModel); if (isIdentity) return; var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || []; for (var i = 0; i < breakpoints.length; ++i) - breakpoints[i]._updateInDebuggerForTarget(target); + breakpoints[i]._updateInDebuggerForModel(debuggerModel); } /** @@ -266,19 +266,18 @@ * @return {!Promise<!Array<!Workspace.UILocation>>} */ possibleBreakpoints(uiSourceCode, textRange) { - var targets = this._targetManager.targets(SDK.Target.Capability.JS); - if (!targets.length) + var debuggerModels = this._targetManager.models(SDK.DebuggerModel); + if (!debuggerModels.length) return Promise.resolve([]); - for (var target of targets) { + for (var debuggerModel of debuggerModels) { var startLocation = this._debuggerWorkspaceBinding.uiLocationToRawLocation( - target, uiSourceCode, textRange.startLine, textRange.startColumn); + debuggerModel, uiSourceCode, textRange.startLine, textRange.startColumn); if (!startLocation) continue; var endLocation = this._debuggerWorkspaceBinding.uiLocationToRawLocation( - target, uiSourceCode, textRange.endLine, textRange.endColumn); + debuggerModel, uiSourceCode, textRange.endLine, textRange.endColumn); if (!endLocation) continue; - var debuggerModel = SDK.DebuggerModel.fromTarget(target); return debuggerModel.getPossibleBreakpoints(startLocation, endLocation).then(toUILocations.bind(this)); } return Promise.resolve([]); @@ -384,6 +383,17 @@ breakpoints[i].remove(); } + /** + * @param {!Set.<!Bindings.BreakpointManager.Breakpoint>} selectedBreakpoints + */ + removeOtherBreakpoints(selectedBreakpoints) { + var allBreakpoints = this._allBreakpoints(); + allBreakpoints.forEach(breakpoint => { + if (!selectedBreakpoints.has(breakpoint)) + breakpoint.remove(); + }); + } + _projectRemoved(event) { var project = /** @type {!Workspace.Project} */ (event.data); var uiSourceCodes = project.uiSourceCodes(); @@ -463,7 +473,7 @@ return; this._breakpointsActive = active; - var debuggerModels = SDK.DebuggerModel.instances(); + var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); for (var i = 0; i < debuggerModels.length; ++i) debuggerModels[i].setBreakpointsActive(active); @@ -487,8 +497,8 @@ /** - * @implements {SDK.TargetManager.Observer} * @unrestricted + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ Bindings.BreakpointManager.Breakpoint = class { /** @@ -517,36 +527,30 @@ /** @type {!Workspace.UILocation|undefined} */ this._fakePrimaryLocation; this._currentState = null; - /** @type {!Map.<!SDK.Target, !Bindings.BreakpointManager.TargetBreakpoint>}*/ - this._targetBreakpoints = new Map(); + /** @type {!Map.<!SDK.DebuggerModel, !Bindings.BreakpointManager.ModelBreakpoint>}*/ + this._modelBreakpoints = new Map(); this._updateState(condition, enabled); - this._breakpointManager._targetManager.observeTargets(this); + this._breakpointManager._targetManager.observeModels(SDK.DebuggerModel, this); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (!debuggerModel) - return; + modelAdded(debuggerModel) { var debuggerWorkspaceBinding = this._breakpointManager._debuggerWorkspaceBinding; - this._targetBreakpoints.set( - target, new Bindings.BreakpointManager.TargetBreakpoint(debuggerModel, this, debuggerWorkspaceBinding)); + this._modelBreakpoints.set( + debuggerModel, new Bindings.BreakpointManager.ModelBreakpoint(debuggerModel, this, debuggerWorkspaceBinding)); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (!debuggerModel) - return; - var targetBreakpoint = this._targetBreakpoints.remove(target); - targetBreakpoint._cleanUpAfterDebuggerIsGone(); - targetBreakpoint._removeEventListeners(); + modelRemoved(debuggerModel) { + var modelBreakpoint = this._modelBreakpoints.remove(debuggerModel); + modelBreakpoint._cleanUpAfterDebuggerIsGone(); + modelBreakpoint._removeEventListeners(); } /** @@ -663,9 +667,9 @@ _updateBreakpoint() { this._removeFakeBreakpointAtPrimaryLocation(); this._fakeBreakpointAtPrimaryLocation(); - var targetBreakpoints = this._targetBreakpoints.valuesArray(); - for (var i = 0; i < targetBreakpoints.length; ++i) - targetBreakpoints[i]._scheduleUpdateInDebugger(); + var modelBreakpoints = this._modelBreakpoints.valuesArray(); + for (var i = 0; i < modelBreakpoints.length; ++i) + modelBreakpoints[i]._scheduleUpdateInDebugger(); } /** @@ -675,21 +679,21 @@ this._isRemoved = true; var removeFromStorage = !keepInStorage; this._removeFakeBreakpointAtPrimaryLocation(); - var targetBreakpoints = this._targetBreakpoints.valuesArray(); - for (var i = 0; i < targetBreakpoints.length; ++i) { - targetBreakpoints[i]._scheduleUpdateInDebugger(); - targetBreakpoints[i]._removeEventListeners(); + var modelBreakpoints = this._modelBreakpoints.valuesArray(); + for (var i = 0; i < modelBreakpoints.length; ++i) { + modelBreakpoints[i]._scheduleUpdateInDebugger(); + modelBreakpoints[i]._removeEventListeners(); } this._breakpointManager._removeBreakpoint(this, removeFromStorage); - this._breakpointManager._targetManager.unobserveTargets(this); + this._breakpointManager._targetManager.unobserveModels(SDK.DebuggerModel, this); } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - _updateInDebuggerForTarget(target) { - this._targetBreakpoints.get(target)._scheduleUpdateInDebugger(); + _updateInDebuggerForModel(debuggerModel) { + this._modelBreakpoints.get(debuggerModel)._scheduleUpdateInDebugger(); } /** @@ -721,23 +725,22 @@ _resetLocations() { this._removeFakeBreakpointAtPrimaryLocation(); - var targetBreakpoints = this._targetBreakpoints.valuesArray(); - for (var i = 0; i < targetBreakpoints.length; ++i) - targetBreakpoints[i]._resetLocations(); + var modelBreakpoints = this._modelBreakpoints.valuesArray(); + for (var i = 0; i < modelBreakpoints.length; ++i) + modelBreakpoints[i]._resetLocations(); } }; /** * @unrestricted */ -Bindings.BreakpointManager.TargetBreakpoint = class extends SDK.SDKObject { +Bindings.BreakpointManager.ModelBreakpoint = class { /** * @param {!SDK.DebuggerModel} debuggerModel * @param {!Bindings.BreakpointManager.Breakpoint} breakpoint * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, breakpoint, debuggerWorkspaceBinding) { - super(debuggerModel.target()); this._debuggerModel = debuggerModel; this._breakpoint = breakpoint; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; @@ -791,7 +794,7 @@ var uiSourceCode = this._breakpoint.uiSourceCode(); if (!uiSourceCode) return false; - var scriptFile = this._debuggerWorkspaceBinding.scriptFile(uiSourceCode, this.target()); + var scriptFile = this._debuggerWorkspaceBinding.scriptFile(uiSourceCode, this._debuggerModel); return !!scriptFile && scriptFile.hasDivergedFromVM(); } @@ -799,7 +802,7 @@ * @param {function()} callback */ _updateInDebugger(callback) { - if (this.target().isDisposed()) { + if (this._debuggerModel.target().isDisposed()) { this._cleanUpAfterDebuggerIsGone(); callback(); return; @@ -811,7 +814,8 @@ var condition = this._breakpoint.condition(); var debuggerLocation = uiSourceCode ? - this._debuggerWorkspaceBinding.uiLocationToRawLocation(this.target(), uiSourceCode, lineNumber, columnNumber) : + this._debuggerWorkspaceBinding.uiLocationToRawLocation( + this._debuggerModel, uiSourceCode, lineNumber, columnNumber) : null; var newState; if (this._breakpoint._isRemoved || !this._breakpoint.enabled() || this._scriptDiverged()) {
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js index 6aea107d..d4a9c03 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -39,7 +39,6 @@ * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, workspace, networkProject, debuggerWorkspaceBinding) { - this._target = debuggerModel.target(); this._debuggerModel = debuggerModel; this._workspace = workspace; this._networkProject = networkProject; @@ -56,7 +55,7 @@ /** @type {!Map.<string, !Workspace.UISourceCode>} */ this._stubUISourceCodes = new Map(); - var projectId = Bindings.CompilerScriptMapping.projectIdForTarget(this._target); + var projectId = Bindings.CompilerScriptMapping.projectIdForTarget(this._debuggerModel.target()); this._stubProject = new Bindings.ContentProviderBasedProject( workspace, projectId, Workspace.projectTypes.Service, '', true /* isServiceProject */); this._eventListeners = [ @@ -287,14 +286,14 @@ * @param {!Workspace.UISourceCode} uiSourceCode */ _bindUISourceCode(uiSourceCode) { - this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); + this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); } /** * @param {!Workspace.UISourceCode} uiSourceCode */ _unbindUISourceCode(uiSourceCode) { - this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, null); + this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, null); } /** @@ -314,7 +313,7 @@ _loadSourceMapForScript(script) { // script.sourceURL can be a random string, but is generally an absolute path -> complete it to inspected page url for // relative links. - var scriptURL = Common.ParsedURL.completeURL(this._target.inspectedURL(), script.sourceURL); + var scriptURL = Common.ParsedURL.completeURL(this._debuggerModel.target().inspectedURL(), script.sourceURL); if (!scriptURL) return Promise.resolve(/** @type {?SDK.TextSourceMap} */ (null));
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js index 84ebe85a..2a81701d 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** - * @implements {SDK.TargetManager.Observer} * @unrestricted + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ Bindings.DebuggerWorkspaceBinding = class extends Common.Object { /** @@ -14,39 +14,33 @@ super(); this._workspace = workspace; - // FIXME: Migrate from _targetToData to _debuggerModelToData. - /** @type {!Map.<!SDK.Target, !Bindings.DebuggerWorkspaceBinding.TargetData>} */ - this._targetToData = new Map(); - targetManager.observeTargets(this); - + /** @type {!Map.<!SDK.DebuggerModel, !Bindings.DebuggerWorkspaceBinding.ModelData>} */ + this._debuggerModelToData = new Map(); targetManager.addModelListener( SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, this); targetManager.addModelListener( SDK.DebuggerModel, SDK.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this); workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved, this._uiSourceCodeRemoved, this); workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this._projectRemoved, this); + targetManager.observeModels(SDK.DebuggerModel, this); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel) - this._targetToData.set(target, new Bindings.DebuggerWorkspaceBinding.TargetData(debuggerModel, this)); + modelAdded(debuggerModel) { + this._debuggerModelToData.set(debuggerModel, new Bindings.DebuggerWorkspaceBinding.ModelData(debuggerModel, this)); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { - if (!SDK.DebuggerModel.fromTarget(target)) - return; - var targetData = this._targetToData.get(target); - targetData._dispose(); - this._targetToData.remove(target); + modelRemoved(debuggerModel) { + var modelData = this._debuggerModelToData.get(debuggerModel); + modelData._dispose(); + this._debuggerModelToData.remove(debuggerModel); } /** @@ -54,9 +48,9 @@ */ _uiSourceCodeRemoved(event) { var uiSourceCode = /** @type {!Workspace.UISourceCode} */ (event.data); - var targetDatas = this._targetToData.valuesArray(); - for (var i = 0; i < targetDatas.length; ++i) - targetDatas[i]._uiSourceCodeRemoved(uiSourceCode); + var modelDatas = this._debuggerModelToData.valuesArray(); + for (var i = 0; i < modelDatas.length; ++i) + modelDatas[i]._uiSourceCodeRemoved(uiSourceCode); } /** @@ -64,11 +58,11 @@ */ _projectRemoved(event) { var project = /** @type {!Workspace.Project} */ (event.data); - var targetDatas = this._targetToData.valuesArray(); + var modelDatas = this._debuggerModelToData.valuesArray(); var uiSourceCodes = project.uiSourceCodes(); - for (var i = 0; i < targetDatas.length; ++i) { + for (var i = 0; i < modelDatas.length; ++i) { for (var j = 0; j < uiSourceCodes.length; ++j) - targetDatas[i]._uiSourceCodeRemoved(uiSourceCodes[j]); + modelDatas[i]._uiSourceCodeRemoved(uiSourceCodes[j]); } } @@ -92,12 +86,12 @@ } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel * @param {!Workspace.UISourceCode} uiSourceCode * @param {?Bindings.DebuggerSourceMapping} sourceMapping */ - setSourceMapping(target, uiSourceCode, sourceMapping) { - var data = this._targetToData.get(target); + setSourceMapping(debuggerModel, uiSourceCode, sourceMapping) { + var data = this._debuggerModelToData.get(debuggerModel); if (data) data._setSourceMapping(uiSourceCode, sourceMapping); } @@ -150,10 +144,10 @@ var script = location.script(); if (!script) return null; - var target = location.target(); + var debuggerModel = location.debuggerModel; this._ensureInfoForScript(script); var liveLocation = this.createLiveLocation(location, updateDelegate, locationPool); - this._registerCallFrameLiveLocation(target, liveLocation); + this._registerCallFrameLiveLocation(debuggerModel, liveLocation); return liveLocation; } @@ -168,17 +162,17 @@ } /** - * @param {!SDK.Target} target + * @param {?SDK.DebuggerModel} debuggerModel * @param {!Workspace.UISourceCode} uiSourceCode * @param {number} lineNumber * @param {number} columnNumber * @return {?SDK.DebuggerModel.Location} */ - uiLocationToRawLocation(target, uiSourceCode, lineNumber, columnNumber) { - var targetData = this._targetToData.get(target); - return targetData ? /** @type {?SDK.DebuggerModel.Location} */ ( - targetData._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber)) : - null; + uiLocationToRawLocation(debuggerModel, uiSourceCode, lineNumber, columnNumber) { + var modelData = debuggerModel ? this._debuggerModelToData.get(debuggerModel) : null; + return modelData ? /** @type {?SDK.DebuggerModel.Location} */ ( + modelData._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber)) : + null; } /** @@ -189,9 +183,9 @@ */ uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { var result = []; - var targetDatas = this._targetToData.valuesArray(); - for (var i = 0; i < targetDatas.length; ++i) { - var rawLocation = targetDatas[i]._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); + var modelDatas = this._debuggerModelToData.valuesArray(); + for (var i = 0; i < modelDatas.length; ++i) { + var rawLocation = modelDatas[i]._uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); if (rawLocation) result.push(rawLocation); } @@ -205,8 +199,9 @@ normalizeUILocation(uiLocation) { var target = Bindings.NetworkProject.targetForUISourceCode(uiLocation.uiSourceCode); if (target) { - var rawLocation = - this.uiLocationToRawLocation(target, uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber); + var rawLocation = this.uiLocationToRawLocation( + SDK.DebuggerModel.fromTarget(target), uiLocation.uiSourceCode, uiLocation.lineNumber, + uiLocation.columnNumber); if (rawLocation) return this.rawLocationToUILocation(rawLocation); } @@ -219,9 +214,9 @@ * @return {boolean} */ uiLineHasMapping(uiSourceCode, lineNumber) { - var targetDatas = this._targetToData.valuesArray(); - for (var i = 0; i < targetDatas.length; ++i) { - if (!targetDatas[i]._uiLineHasMapping(uiSourceCode, lineNumber)) + var modelDatas = this._debuggerModelToData.valuesArray(); + for (var i = 0; i < modelDatas.length; ++i) { + if (!modelDatas[i]._uiLineHasMapping(uiSourceCode, lineNumber)) return false; } return true; @@ -229,12 +224,12 @@ /** * @param {!Workspace.UISourceCode} uiSourceCode - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel * @return {?Bindings.ResourceScriptFile} */ - scriptFile(uiSourceCode, target) { - var targetData = this._targetToData.get(target); - return targetData ? targetData._resourceMapping.scriptFile(uiSourceCode) : null; + scriptFile(uiSourceCode, debuggerModel) { + var modelData = this._debuggerModelToData.get(debuggerModel); + return modelData ? modelData._resourceMapping.scriptFile(uiSourceCode) : null; } /** @@ -242,20 +237,20 @@ * @return {?SDK.TextSourceMap} */ sourceMapForScript(script) { - var targetData = this._targetToData.get(script.target()); - if (!targetData) + var modelData = this._debuggerModelToData.get(script.debuggerModel); + if (!modelData) return null; - return targetData._compilerMapping.sourceMapForScript(script); + return modelData._compilerMapping.sourceMapForScript(script); } /** * @param {!SDK.Script} script */ maybeLoadSourceMap(script) { - var targetData = this._targetToData.get(script.target()); - if (!targetData) + var modelData = this._debuggerModelToData.get(script.debuggerModel); + if (!modelData) return; - targetData._compilerMapping.maybeLoadSourceMap(script); + modelData._compilerMapping.maybeLoadSourceMap(script); } /** @@ -263,16 +258,16 @@ */ _globalObjectCleared(event) { var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data); - this._reset(debuggerModel.target()); + this._reset(debuggerModel); } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - _reset(target) { - var targetData = this._targetToData.get(target); - targetData.callFrameLocations.valuesArray().forEach((location) => this._removeLiveLocation(location)); - targetData.callFrameLocations.clear(); + _reset(debuggerModel) { + var modelData = this._debuggerModelToData.get(debuggerModel); + modelData.callFrameLocations.valuesArray().forEach((location) => this._removeLiveLocation(location)); + modelData.callFrameLocations.clear(); } /** @@ -299,11 +294,11 @@ } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel * @param {!Bindings.DebuggerWorkspaceBinding.Location} location */ - _registerCallFrameLiveLocation(target, location) { - var locations = this._targetToData.get(target).callFrameLocations; + _registerCallFrameLiveLocation(debuggerModel, location) { + var locations = this._debuggerModelToData.get(debuggerModel).callFrameLocations; locations.add(location); } @@ -321,7 +316,7 @@ */ _debuggerResumed(event) { var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data); - this._reset(debuggerModel.target()); + this._reset(debuggerModel); } }; @@ -331,7 +326,7 @@ /** * @unrestricted */ -Bindings.DebuggerWorkspaceBinding.TargetData = class { +Bindings.DebuggerWorkspaceBinding.ModelData = class { /** * @param {!SDK.DebuggerModel} debuggerModel * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding @@ -405,7 +400,7 @@ this._debuggerWorkspaceBinding.dispatchEventToListeners( Bindings.DebuggerWorkspaceBinding.Events.SourceMappingChanged, { uiSourceCode: uiSourceCode, - target: this._debuggerModel.target(), + debuggerModel: this._debuggerModel, isIdentity: sourceMapping ? sourceMapping.isIdentity() : false }); }
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js index 37b06eb..0d060767 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js
@@ -107,7 +107,7 @@ script[Bindings.DefaultScriptMapping._uiSourceCodeSymbol] = uiSourceCode; this._project.addUISourceCodeWithProvider(uiSourceCode, script, null); - this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.target(), uiSourceCode, this); + this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); this._debuggerWorkspaceBinding.pushSourceMapping(script, this); }
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js index 054424f5..54e72ff 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/NetworkProject.js
@@ -391,7 +391,7 @@ * @return {?Workspace.UISourceCode} */ static uiSourceCodeForScriptURL(workspace, url, script) { - var target = script.target(); + var target = script.debuggerModel.target(); var frame = SDK.ResourceTreeFrame.fromScript(script); return workspace.uiSourceCode(Bindings.NetworkProject.projectId(target, frame, false), url) || workspace.uiSourceCode(Bindings.NetworkProject.projectId(target, frame, true), url);
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js b/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js index 1e2d36e..591ba99 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js
@@ -48,10 +48,13 @@ SDK.multitargetConsoleModel.addEventListener( SDK.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this); SDK.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded, this); + // TODO(dgozman): setImmediate because we race with DebuggerWorkspaceBinding on ParsedScriptSource event delivery. SDK.targetManager.addModelListener( - SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this); + SDK.DebuggerModel, SDK.DebuggerModel.Events.ParsedScriptSource, + event => setImmediate(this._parsedScriptSource.bind(this, event))); SDK.targetManager.addModelListener( - SDK.DebuggerModel, SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this); + SDK.DebuggerModel, SDK.DebuggerModel.Events.FailedToParseScriptSource, + event => setImmediate(this._parsedScriptSource.bind(this, event))); SDK.targetManager.addModelListener( SDK.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); @@ -138,7 +141,7 @@ var rawLocation = this._rawLocation(message); if (!rawLocation) continue; - if (script.target() === message.target() && script.scriptId === rawLocation.scriptId) + if (script.debuggerModel.target() === message.target() && script.scriptId === rawLocation.scriptId) this._addConsoleMessageToScript(message, rawLocation); else pendingMessages.push(message);
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js index 578d420..7c506733e 100644 --- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js
@@ -38,7 +38,6 @@ * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding */ constructor(debuggerModel, workspace, debuggerWorkspaceBinding) { - this._target = debuggerModel.target(); this._debuggerModel = debuggerModel; this._workspace = workspace; this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; @@ -222,7 +221,7 @@ this._setScriptFile(uiSourceCode, scriptFile); for (var i = 0; i < scripts.length; ++i) this._debuggerWorkspaceBinding.updateLocations(scripts[i]); - this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); + this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); this._boundUISourceCodes.add(uiSourceCode); } @@ -235,7 +234,7 @@ scriptFile.dispose(); this._setScriptFile(uiSourceCode, null); } - this._debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, null); + this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, null); this._boundUISourceCodes.delete(uiSourceCode); } @@ -413,15 +412,6 @@ _mappingCheckedForTest() { } - /** - * @return {?SDK.Target} - */ - target() { - if (!this._script) - return null; - return this._script.target(); - } - dispose() { this._uiSourceCode.removeEventListener( Workspace.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this);
diff --git a/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js index e1c38f0..5766f5c 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/components/DOMBreakpointsSidebarPane.js
@@ -56,7 +56,7 @@ mainElement.appendChild(createTextNode( String.sprintf('Paused on %s', Components.DOMBreakpointsSidebarPane.BreakpointTypeNouns[auxData['type']]))); - var domModel = SDK.DOMModel.fromTarget(details.target()); + var domModel = SDK.DOMModel.fromTarget(details.debuggerModel.target()); if (domModel) { var subElement = messageWrapper.createChild('div', 'status-sub monospace'); var node = domModel.nodeForId(auxData['nodeId']);
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js index 169b669..43311d4d6 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js +++ b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
@@ -169,9 +169,9 @@ info.fallback = fallbackAnchor; info.liveLocation = Bindings.debuggerWorkspaceBinding.createLiveLocation( rawLocation, this._updateAnchor.bind(this, anchor), - /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.target()))); + /** @type {!Bindings.LiveLocationPool} */ (this._locationPoolByTarget.get(rawLocation.debuggerModel.target()))); - var anchors = /** @type {!Array<!Element>} */ (this._anchorsByTarget.get(rawLocation.target())); + var anchors = /** @type {!Array<!Element>} */ (this._anchorsByTarget.get(rawLocation.debuggerModel.target())); anchors.push(anchor); return anchor; } @@ -198,8 +198,8 @@ */ linkifyRawLocation(rawLocation, fallbackUrl, classes) { return this.linkifyScriptLocation( - rawLocation.target(), rawLocation.scriptId, fallbackUrl, rawLocation.lineNumber, rawLocation.columnNumber, - classes); + rawLocation.debuggerModel.target(), rawLocation.scriptId, fallbackUrl, rawLocation.lineNumber, + rawLocation.columnNumber, classes); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/components/module.json b/third_party/WebKit/Source/devtools/front_end/components/module.json index 41e850a..23882e4b 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/module.json +++ b/third_party/WebKit/Source/devtools/front_end/components/module.json
@@ -1,14 +1,6 @@ { "extensions": [ { - "type": "setting", - "category": "Console", - "title": "Enable custom formatters", - "settingName": "customFormatters", - "settingType": "boolean", - "defaultValue": false - }, - { "type": "@Components.DOMPresentationUtils.MarkerDecorator", "factoryName": "Components.DOMPresentationUtils.GenericDecorator", "marker": "breakpoint-marker",
diff --git a/third_party/WebKit/Source/devtools/front_end/components/objectPropertiesSection.css b/third_party/WebKit/Source/devtools/front_end/components/objectPropertiesSection.css index 180bf45..70e1f29 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/objectPropertiesSection.css +++ b/third_party/WebKit/Source/devtools/front_end/components/objectPropertiesSection.css
@@ -56,11 +56,3 @@ display: flex; flex-direction: row; } - -.object-properties-section-root-element::before { - -webkit-mask-position: -4px -97px !important; -} - -.object-properties-section-root-element.expanded::before { - -webkit-mask-position: -20px -97px !important; -}
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js index 0ca856d..12e5c1fd 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -43,6 +43,8 @@ this._gutterContainer = this.listItemElement.createChild('div', 'gutter-container'); this._gutterContainer.addEventListener('click', this._showContextMenu.bind(this)); + var gutterMenuIcon = UI.Icon.create('largeicon-menu', 'gutter-menu-icon'); + this._gutterContainer.appendChild(gutterMenuIcon); this._decorationsElement = this._gutterContainer.createChild('div', 'hidden'); this._elementCloseTag = elementCloseTag;
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/elementsTreeOutline.css b/third_party/WebKit/Source/devtools/front_end/elements/elementsTreeOutline.css index 72a14ef8..b7b85bfba 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/elementsTreeOutline.css +++ b/third_party/WebKit/Source/devtools/front_end/elements/elementsTreeOutline.css
@@ -321,26 +321,22 @@ .elements-disclosure .gutter-container { position: absolute; top: 0; -} - -.elements-disclosure li.selected .gutter-container:not(.has-decorations) { - left: 0px; - width: 16.25px; - height: 18px; - transform: rotate(-90deg) translateX(-13px) scale(0.8); - transform-origin: 0% 0%; - -webkit-mask-image: url(Images/toolbarButtonGlyphs.png); - -webkit-mask-position: -201px -27px; - -webkit-mask-size: 352px 168px; - background-color: white; + left: 0; cursor: pointer; } -@media (-webkit-min-device-pixel-ratio: 1.1) { -.elements-disclosure li.selected .gutter-container:not(.has-decorations) { - -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png); +.gutter-menu-icon { + display: none; + transform: rotate(-90deg) scale(0.8); + background-color: white; + position: relative; + left: -7px; + top: -3px; } -} /* media */ + +.elements-disclosure li.selected .gutter-container:not(.has-decorations) .gutter-menu-icon { + display: block; +} /** Guide line */ li.selected {
diff --git a/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js b/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js index 156a1ca..e947a4dbd 100644 --- a/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js +++ b/third_party/WebKit/Source/devtools/front_end/host/UserMetrics.js
@@ -80,7 +80,9 @@ CommandEvaluatedInConsolePanel: 15, DOMPropertiesExpanded: 16, ResizedViewInResponsiveMode: 17, - TimelinePageReloadStarted: 18 + TimelinePageReloadStarted: 18, + ConnectToNodeJSFromFrontend: 19, + ConnectToNodeJSDirectly: 20, }; Host.UserMetrics._PanelCodes = {
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js index a0f1454f..41c7f04 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/CPUProfileView.js
@@ -159,7 +159,7 @@ resolvedTitle = this._anonymousConsoleProfileIdToTitle[data.id]; delete this._anonymousConsoleProfileIdToTitle[data.id]; } - var profile = new Profiler.CPUProfileHeader(data.scriptLocation.target(), this, resolvedTitle); + var profile = new Profiler.CPUProfileHeader(data.scriptLocation.debuggerModel.target(), this, resolvedTitle); profile.setProtocolProfile(cpuProfile); this.addProfile(profile); this._addMessageToConsole( @@ -174,7 +174,7 @@ */ _addMessageToConsole(type, scriptLocation, messageText) { var script = scriptLocation.script(); - var target = scriptLocation.target(); + var target = scriptLocation.debuggerModel.target(); var message = new SDK.ConsoleMessage( target, SDK.ConsoleMessage.MessageSource.ConsoleAPI, SDK.ConsoleMessage.MessageLevel.Verbose, messageText, type, undefined, undefined, undefined, undefined, [{
diff --git a/third_party/WebKit/Source/devtools/front_end/quick_open/FilteredListWidget.js b/third_party/WebKit/Source/devtools/front_end/quick_open/FilteredListWidget.js index 7b9266ec6..d1f59e3d 100644 --- a/third_party/WebKit/Source/devtools/front_end/quick_open/FilteredListWidget.js +++ b/third_party/WebKit/Source/devtools/front_end/quick_open/FilteredListWidget.js
@@ -119,7 +119,7 @@ showAsDialog() { this._dialog = new UI.Dialog(); this._dialog.setWrapsContent(true); - this._dialog.setPosition(undefined, 22); + this._dialog.setPosition(null, 22); this.show(this._dialog.element); this._dialog.show(); this._updateShowMatchingItems();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js index 634bc730a..e126914 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -40,6 +40,7 @@ target.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); this._agent = target.debuggerAgent(); + this._runtimeModel = target.runtimeModel; /** @type {?SDK.DebuggerPausedDetails} */ this._debuggerPausedDetails = null; @@ -67,19 +68,6 @@ } /** - * @return {!Array<!SDK.DebuggerModel>} - */ - static instances() { - var result = []; - for (var target of SDK.targetManager.targets()) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel) - result.push(debuggerModel); - } - return result; - } - - /** * @param {?SDK.Target} target * @return {?SDK.DebuggerModel} */ @@ -670,7 +658,7 @@ if (!result) callback(null); else - callback(this.target().runtimeModel.createRemoteObject(result), exceptionDetails); + callback(this._runtimeModel.createRemoteObject(result), exceptionDetails); } this.selectedCallFrame().evaluate( @@ -993,7 +981,7 @@ /** * @unrestricted */ -SDK.DebuggerModel.Location = class extends SDK.SDKObject { +SDK.DebuggerModel.Location = class { /** * @param {!SDK.DebuggerModel} debuggerModel * @param {string} scriptId @@ -1001,8 +989,7 @@ * @param {number=} columnNumber */ constructor(debuggerModel, scriptId, lineNumber, columnNumber) { - super(debuggerModel.target()); - this._debuggerModel = debuggerModel; + this.debuggerModel = debuggerModel; this.scriptId = scriptId; this.lineNumber = lineNumber; this.columnNumber = columnNumber || 0; @@ -1028,18 +1015,18 @@ * @return {?SDK.Script} */ script() { - return this._debuggerModel.scriptForId(this.scriptId); + return this.debuggerModel.scriptForId(this.scriptId); } continueToLocation() { - this._debuggerModel._agent.continueToLocation(this.payload()); + this.debuggerModel._agent.continueToLocation(this.payload()); } /** * @return {string} */ id() { - return this.target().id() + ':' + this.scriptId + ':' + this.lineNumber + ':' + this.columnNumber; + return this.debuggerModel.target().id() + ':' + this.scriptId + ':' + this.lineNumber + ':' + this.columnNumber; } }; @@ -1047,17 +1034,14 @@ /** * @unrestricted */ -SDK.DebuggerModel.CallFrame = class extends SDK.SDKObject { +SDK.DebuggerModel.CallFrame = class { /** * @param {!SDK.DebuggerModel} debuggerModel * @param {!SDK.Script} script * @param {!Protocol.Debugger.CallFrame} payload */ constructor(debuggerModel, script, payload) { - var target = debuggerModel.target(); - super(target); this.debuggerModel = debuggerModel; - this._debuggerAgent = debuggerModel._agent; this._script = script; this._payload = payload; this._location = SDK.DebuggerModel.Location.fromPayload(debuggerModel, payload.location); @@ -1121,14 +1105,15 @@ * @return {?SDK.RemoteObject} */ thisObject() { - return this._payload.this ? this.target().runtimeModel.createRemoteObject(this._payload.this) : null; + return this._payload.this ? this.debuggerModel._runtimeModel.createRemoteObject(this._payload.this) : null; } /** * @return {?SDK.RemoteObject} */ returnValue() { - return this._payload.returnValue ? this.target().runtimeModel.createRemoteObject(this._payload.returnValue) : null; + return this._payload.returnValue ? this.debuggerModel._runtimeModel.createRemoteObject(this._payload.returnValue) : + null; } /** @@ -1175,7 +1160,7 @@ } callback(result, exceptionDetails); } - this._debuggerAgent.evaluateOnCallFrame( + this.debuggerModel._agent.evaluateOnCallFrame( this._payload.callFrameId, code, objectGroup, includeCommandLineAPI, silent, returnByValue, generatePreview, didEvaluateOnCallFrame); } @@ -1196,7 +1181,7 @@ if (callback) callback(error); } - this._debuggerAgent.restartFrame(this._payload.callFrameId, protocolCallback.bind(this)); + this.debuggerModel._agent.restartFrame(this._payload.callFrameId, protocolCallback.bind(this)); } }; @@ -1288,7 +1273,7 @@ object() { if (this._object) return this._object; - var runtimeModel = this._callFrame.target().runtimeModel; + var runtimeModel = this._callFrame.debuggerModel._runtimeModel; var declarativeScope = this._type !== Protocol.Debugger.ScopeType.With && this._type !== Protocol.Debugger.ScopeType.Global; @@ -1315,7 +1300,7 @@ /** * @unrestricted */ -SDK.DebuggerPausedDetails = class extends SDK.SDKObject { +SDK.DebuggerPausedDetails = class { /** * @param {!SDK.DebuggerModel} debuggerModel * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames @@ -1325,7 +1310,6 @@ * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace */ constructor(debuggerModel, callFrames, reason, auxData, breakpointIds, asyncStackTrace) { - super(debuggerModel.target()); this.debuggerModel = debuggerModel; this.callFrames = SDK.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel, callFrames); this.reason = reason; @@ -1342,7 +1326,8 @@ if (this.reason !== SDK.DebuggerModel.BreakReason.Exception && this.reason !== SDK.DebuggerModel.BreakReason.PromiseRejection) return null; - return this.target().runtimeModel.createRemoteObject(/** @type {!Protocol.Runtime.RemoteObject} */ (this.auxData)); + return this.debuggerModel._runtimeModel.createRemoteObject( + /** @type {!Protocol.Runtime.RemoteObject} */ (this.auxData)); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js index 6ec78f51..c02c26fc 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Script.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Script.js
@@ -98,7 +98,7 @@ * @param {string} source */ static _reportDeprecatedCommentIfNeeded(script, source) { - var consoleModel = script.target().consoleModel; + var consoleModel = script.debuggerModel.target().consoleModel; if (!consoleModel) return; var linesToCheck = 5; @@ -116,19 +116,13 @@ var text = Common.UIString( '\'//@ sourceURL\' and \'//@ sourceMappingURL\' are deprecated, please use \'//# sourceURL=\' and \'//# sourceMappingURL=\' instead.'); var msg = new SDK.ConsoleMessage( - script.target(), SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Warning, text, undefined, - undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, script.scriptId); + script.debuggerModel.target(), SDK.ConsoleMessage.MessageSource.JS, SDK.ConsoleMessage.MessageLevel.Warning, + text, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, + script.scriptId); consoleModel.addMessage(msg); } /** - * @return {!SDK.Target} - */ - target() { - return this.debuggerModel.target(); - } - - /** * @return {boolean} */ isContentScript() { @@ -139,7 +133,7 @@ * @return {?SDK.ExecutionContext} */ executionContext() { - return this.target().runtimeModel.executionContext(this._executionContextId); + return this.debuggerModel.target().runtimeModel.executionContext(this._executionContextId); } /** @@ -177,7 +171,7 @@ var callback; var promise = new Promise(fulfill => callback = fulfill); - this.target().debuggerAgent().getScriptSource(this.scriptId, didGetScriptSource.bind(this)); + this.debuggerModel.target().debuggerAgent().getScriptSource(this.scriptId, didGetScriptSource.bind(this)); return promise; /** @@ -225,7 +219,8 @@ if (this.scriptId) { // Script failed to parse. - this.target().debuggerAgent().searchInContent(this.scriptId, query, caseSensitive, isRegex, innerCallback); + this.debuggerModel.target().debuggerAgent().searchInContent( + this.scriptId, query, caseSensitive, isRegex, innerCallback); } else { callback([]); } @@ -266,7 +261,7 @@ newSource = this._appendSourceURLCommentIfNeeded(newSource); if (this.scriptId) { - this.target().debuggerAgent().setScriptSource( + this.debuggerModel.target().debuggerAgent().setScriptSource( this.scriptId, newSource, undefined, didEditScriptSource.bind(this)); } else { callback('Script failed to parse'); @@ -327,7 +322,7 @@ * @this {SDK.Script} */ function setBlackboxedRanges(fulfill, reject) { - this.target().debuggerAgent().setBlackboxedRanges(this.scriptId, positions, callback); + this.debuggerModel.target().debuggerAgent().setBlackboxedRanges(this.scriptId, positions, callback); /** * @param {?Protocol.Error} error */
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js index 5b49b92..5d29300 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
@@ -23,8 +23,6 @@ this._capabilitiesMask = capabilitiesMask; this._parentTarget = parentTarget; this._id = SDK.Target._nextId++; - - /** @type {!Map.<function(new:SDK.SDKModel, !SDK.Target), !SDK.SDKModel>} */ this._modelByConstructor = new Map(); } @@ -145,17 +143,20 @@ var capabilities = SDK.SDKModel._capabilitiesByModelClass.get(modelClass); if (capabilities === undefined) throw 'Model class is not registered'; - if ((this._capabilitiesMask & capabilities) === capabilities) - this._modelByConstructor.set(modelClass, new modelClass(this)); + if ((this._capabilitiesMask & capabilities) === capabilities) { + var model = new modelClass(this); + this._modelByConstructor.set(modelClass, model); + this._targetManager.modelAdded(this, modelClass, model); + } } return this._modelByConstructor.get(modelClass) || null; } /** - * @return {!Array<!SDK.SDKModel>} + * @return {!Map<function(new:SDK.SDKModel, !SDK.Target), !SDK.SDKModel>} */ models() { - return this._modelByConstructor.valuesArray(); + return this._modelByConstructor; } /** @@ -245,16 +246,6 @@ dispose() { } - - /** - * @param {!Common.Event} event - */ - _targetDisposed(event) { - var target = /** @type {!SDK.Target} */ (event.data); - if (target !== this._target) - return; - this.dispose(); - } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js index 992546e..d5492ce 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/TargetManager.js
@@ -17,6 +17,10 @@ this._observerCapabiliesMaskSymbol = Symbol('observerCapabilitiesMask'); /** @type {!Map<symbol, !Array<{modelClass: !Function, thisObject: (!Object|undefined), listener: function(!Common.Event)}>>} */ this._modelListeners = new Map(); + /** @type {!Map<function(new:SDK.SDKModel,!SDK.Target), !Array<!SDK.SDKModelObserver>>} */ + this._modelObservers = new Map(); + /** @type {!Set<!SDK.Target>} */ + this._pendingTargets = new Set(); this._isSuspended = false; } @@ -27,7 +31,7 @@ this.dispatchEventToListeners(SDK.TargetManager.Events.SuspendStateChanged); for (var i = 0; i < this._targets.length; ++i) { - for (var model of this._targets[i].models()) + for (var model of this._targets[i].models().values()) model.suspendModel(); } } @@ -43,7 +47,7 @@ var promises = []; for (var i = 0; i < this._targets.length; ++i) { - for (var model of this._targets[i].models()) + for (var model of this._targets[i].models().values()) promises.push(model.resumeModel()); } return Promise.all(promises); @@ -62,6 +66,21 @@ } /** + * @param {function(new:T,!SDK.Target)} modelClass + * @return {!Array<!T>} + * @template T + */ + models(modelClass) { + var result = []; + for (var i = 0; i < this._targets.length; ++i) { + var model = this._targets[i].model(modelClass); + if (model) + result.push(model); + } + return result; + } + + /** * @return {string} */ inspectedURL() { @@ -92,6 +111,61 @@ } /** + * @param {function(new:T,!SDK.Target)} modelClass + * @param {!SDK.SDKModelObserver<T>} observer + * @template T + */ + observeModels(modelClass, observer) { + if (!this._modelObservers.has(modelClass)) + this._modelObservers.set(modelClass, []); + this._modelObservers.get(modelClass).push(observer); + for (var model of this.models(modelClass)) + observer.modelAdded(model); + } + + /** + * @param {function(new:T,!SDK.Target)} modelClass + * @param {!SDK.SDKModelObserver<T>} observer + * @template T + */ + unobserveModels(modelClass, observer) { + if (!this._modelObservers.has(modelClass)) + return; + var observers = this._modelObservers.get(modelClass); + observers.remove(observer); + if (!observers.length) + this._modelObservers.delete(modelClass); + } + + /** + * @param {!SDK.Target} target + * @param {function(new:SDK.SDKModel,!SDK.Target)} modelClass + * @param {!SDK.SDKModel} model + */ + modelAdded(target, modelClass, model) { + if (this._pendingTargets.has(target)) + return; + if (!this._modelObservers.has(modelClass)) + return; + for (var observer of this._modelObservers.get(modelClass).slice()) + observer.modelAdded(model); + } + + /** + * @param {!SDK.Target} target + * @param {function(new:SDK.SDKModel,!SDK.Target)} modelClass + * @param {!SDK.SDKModel} model + */ + _modelRemoved(target, modelClass, model) { + if (this._pendingTargets.has(target)) + return; + if (!this._modelObservers.has(modelClass)) + return; + for (var observer of this._modelObservers.get(modelClass).slice()) + observer.modelRemoved(model); + } + + /** * @param {!Function} modelClass * @param {symbol} eventType * @param {function(!Common.Event)} listener @@ -163,6 +237,7 @@ */ createTarget(name, capabilitiesMask, connectionFactory, parentTarget) { var target = new SDK.Target(this, name, capabilitiesMask, connectionFactory, parentTarget); + this._pendingTargets.add(target); /** @type {!SDK.ConsoleModel} */ target.consoleModel = /** @type {!SDK.ConsoleModel} */ (target.model(SDK.ConsoleModel)); @@ -189,7 +264,49 @@ target.serviceWorkerManager = target.model(SDK.ServiceWorkerManager); - this.addTarget(target); + // Force creation of models which have observers. + for (var modelClass of this._modelObservers.keys()) + target.model(modelClass); + this._pendingTargets.delete(target); + + this._targets.push(target); + + /** + * @param {!SDK.ResourceTreeModel.Events} sourceEvent + * @param {!SDK.TargetManager.Events} targetEvent + * @return {!Common.EventTarget.EventDescriptor} + * @this {SDK.TargetManager} + */ + function setupRedispatch(sourceEvent, targetEvent) { + return resourceTreeModel.addEventListener(sourceEvent, this._redispatchEvent.bind(this, targetEvent)); + } + + if (this._targets.length === 1 && resourceTreeModel) { + resourceTreeModel[SDK.TargetManager._listenersSymbol] = [ + setupRedispatch.call( + this, SDK.ResourceTreeModel.Events.MainFrameNavigated, SDK.TargetManager.Events.MainFrameNavigated), + setupRedispatch.call(this, SDK.ResourceTreeModel.Events.Load, SDK.TargetManager.Events.Load), + setupRedispatch.call( + this, SDK.ResourceTreeModel.Events.PageReloadRequested, SDK.TargetManager.Events.PageReloadRequested), + setupRedispatch.call(this, SDK.ResourceTreeModel.Events.WillReloadPage, SDK.TargetManager.Events.WillReloadPage) + ]; + } + var copy = this._observersForTarget(target); + for (var i = 0; i < copy.length; ++i) + copy[i].targetAdded(target); + + for (var modelClass of target.models().keys()) + this.modelAdded(target, modelClass, target.models().get(modelClass)); + + for (var pair of this._modelListeners) { + var listeners = pair[1]; + for (var i = 0; i < listeners.length; ++i) { + var model = target.model(listeners[i].modelClass); + if (model) + model.addEventListener(/** @type {symbol} */ (pair[0]), listeners[i].listener, listeners[i].thisObject); + } + } + return target; } @@ -205,46 +322,6 @@ /** * @param {!SDK.Target} target */ - addTarget(target) { - this._targets.push(target); - var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target); - if (this._targets.length === 1 && resourceTreeModel) { - resourceTreeModel[SDK.TargetManager._listenersSymbol] = [ - setupRedispatch.call( - this, SDK.ResourceTreeModel.Events.MainFrameNavigated, SDK.TargetManager.Events.MainFrameNavigated), - setupRedispatch.call(this, SDK.ResourceTreeModel.Events.Load, SDK.TargetManager.Events.Load), - setupRedispatch.call( - this, SDK.ResourceTreeModel.Events.PageReloadRequested, SDK.TargetManager.Events.PageReloadRequested), - setupRedispatch.call(this, SDK.ResourceTreeModel.Events.WillReloadPage, SDK.TargetManager.Events.WillReloadPage) - ]; - } - var copy = this._observersForTarget(target); - for (var i = 0; i < copy.length; ++i) - copy[i].targetAdded(target); - - for (var pair of this._modelListeners) { - var listeners = pair[1]; - for (var i = 0; i < listeners.length; ++i) { - var model = target.model(listeners[i].modelClass); - if (model) - model.addEventListener(/** @type {symbol} */ (pair[0]), listeners[i].listener, listeners[i].thisObject); - } - } - - /** - * @param {!SDK.ResourceTreeModel.Events} sourceEvent - * @param {!SDK.TargetManager.Events} targetEvent - * @return {!Common.EventTarget.EventDescriptor} - * @this {SDK.TargetManager} - */ - function setupRedispatch(sourceEvent, targetEvent) { - return resourceTreeModel.addEventListener(sourceEvent, this._redispatchEvent.bind(this, targetEvent)); - } - } - - /** - * @param {!SDK.Target} target - */ removeTarget(target) { if (!this._targets.includes(target)) return; @@ -254,6 +331,9 @@ if (treeModelListeners) Common.EventTarget.removeEventListeners(treeModelListeners); + for (var modelClass of target.models().keys()) + this._modelRemoved(target, modelClass, target.models().get(modelClass)); + var copy = this._observersForTarget(target); for (var i = 0; i < copy.length; ++i) copy[i].targetRemoved(target); @@ -331,6 +411,7 @@ this, Common.UIString('Node'), SDK.Target.Capability.Target, this._createMainConnection.bind(this), null); target.subTargetsManager = new SDK.SubTargetsManager(target); target.setInspectedURL('Node'); + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSFromFrontend); return; } @@ -341,6 +422,7 @@ SDK.Target.Capability.Target; } else if (Runtime.queryParam('v8only')) { capabilities = SDK.Target.Capability.JS; + Host.userMetrics.actionTaken(Host.UserMetrics.Action.ConnectToNodeJSDirectly); } var target = this.createTarget(Common.UIString('Main'), capabilities, this._createMainConnection.bind(this), null); @@ -405,6 +487,24 @@ }; /** + * @interface + * @template T + */ +SDK.SDKModelObserver = function() {}; + +SDK.SDKModelObserver.prototype = { + /** + * @param {!T} model + */ + modelAdded(model) {}, + + /** + * @param {!T} model + */ + modelRemoved(model) {}, +}; + +/** * @type {!SDK.TargetManager} */ SDK.targetManager = new SDK.TargetManager();
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/module.json b/third_party/WebKit/Source/devtools/front_end/sdk/module.json index 0e4c4b4..5e4ea05 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/module.json +++ b/third_party/WebKit/Source/devtools/front_end/sdk/module.json
@@ -87,6 +87,14 @@ "settingName": "showMetricsRulers", "settingType": "boolean", "defaultValue": false + }, + { + "type": "setting", + "category": "Console", + "title": "Enable custom formatters", + "settingName": "customFormatters", + "settingType": "boolean", + "defaultValue": false } ], "scripts": [
diff --git a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js index 951401e..38d66abb 100644 --- a/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js +++ b/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js
@@ -28,8 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** - * @implements {SDK.TargetManager.Observer} * @unrestricted + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} */ Snippets.ScriptSnippetModel = class extends Common.Object { /** @@ -43,40 +43,37 @@ /** @type {!Map.<!Workspace.UISourceCode, string>} */ this._snippetIdForUISourceCode = new Map(); - /** @type {!Map.<!SDK.Target, !Snippets.SnippetScriptMapping>} */ - this._mappingForTarget = new Map(); + /** @type {!Map.<!SDK.DebuggerModel, !Snippets.SnippetScriptMapping>} */ + this._mappingForDebuggerModel = new Map(); this._snippetStorage = new Snippets.SnippetStorage('script', 'Script snippet #'); this._lastSnippetEvaluationIndexSetting = Common.settings.createSetting('lastSnippetEvaluationIndex', 0); this._project = new Snippets.SnippetsProject(workspace, this); this._loadSnippets(); - SDK.targetManager.observeTargets(this); + SDK.targetManager.observeModels(SDK.DebuggerModel, this); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (debuggerModel) - this._mappingForTarget.set(target, new Snippets.SnippetScriptMapping(debuggerModel, this)); + modelAdded(debuggerModel) { + this._mappingForDebuggerModel.set(debuggerModel, new Snippets.SnippetScriptMapping(debuggerModel, this)); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { - if (SDK.DebuggerModel.fromTarget(target)) - this._mappingForTarget.remove(target); + modelRemoved(debuggerModel) { + this._mappingForDebuggerModel.remove(debuggerModel); } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel * @return {!Snippets.SnippetScriptMapping|undefined} */ - snippetScriptMapping(target) { - return this._mappingForTarget.get(target); + snippetScriptMapping(debuggerModel) { + return this._mappingForDebuggerModel.get(debuggerModel); } /** @@ -180,7 +177,7 @@ var breakpointLocations = this._removeBreakpoints(uiSourceCode); this._releaseSnippetScript(uiSourceCode); this._restoreBreakpoints(uiSourceCode, breakpointLocations); - this._mappingForTarget.valuesArray().forEach(function(mapping) { + this._mappingForDebuggerModel.valuesArray().forEach(function(mapping) { mapping._restoreBreakpoints(uiSourceCode, breakpointLocations); }); } @@ -206,8 +203,9 @@ var target = executionContext.target(); var runtimeModel = target.runtimeModel; + var debuggerModel = /** @type {!SDK.DebuggerModel} */ (SDK.DebuggerModel.fromTarget(target)); var evaluationIndex = this._nextEvaluationIndex(); - var mapping = this._mappingForTarget.get(target); + var mapping = this._mappingForDebuggerModel.get(debuggerModel); mapping._setEvaluationIndex(evaluationIndex, uiSourceCode); var evaluationUrl = mapping._evaluationSourceURL(uiSourceCode); uiSourceCode.requestContent().then(compileSnippet.bind(this)); @@ -227,7 +225,7 @@ * @this {Snippets.ScriptSnippetModel} */ function compileCallback(scriptId, exceptionDetails) { - var mapping = this._mappingForTarget.get(target); + var mapping = this._mappingForDebuggerModel.get(debuggerModel); if (mapping.evaluationIndex(uiSourceCode) !== evaluationIndex) return; @@ -324,7 +322,7 @@ * @param {!Workspace.UISourceCode} uiSourceCode */ _releaseSnippetScript(uiSourceCode) { - this._mappingForTarget.valuesArray().forEach(function(mapping) { + this._mappingForDebuggerModel.valuesArray().forEach(function(mapping) { mapping._releaseSnippetScript(uiSourceCode); }); } @@ -355,7 +353,6 @@ * @param {!Snippets.ScriptSnippetModel} scriptSnippetModel */ constructor(debuggerModel, scriptSnippetModel) { - this._target = debuggerModel.target(); this._debuggerModel = debuggerModel; this._scriptSnippetModel = scriptSnippetModel; /** @type {!Object.<string, !Workspace.UISourceCode>} */ @@ -447,7 +444,7 @@ */ _addScript(script, uiSourceCode) { console.assert(!this._scriptForUISourceCode.get(uiSourceCode)); - Bindings.debuggerWorkspaceBinding.setSourceMapping(this._target, uiSourceCode, this); + Bindings.debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this); this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode; this._scriptForUISourceCode.set(uiSourceCode, script); Bindings.debuggerWorkspaceBinding.pushSourceMapping(script, this);
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js index 1ec97df..405feb8a 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptBreakpointsSidebarPane.js
@@ -204,6 +204,10 @@ } var removeAllTitle = Common.UIString('Remove all breakpoints'); contextMenu.appendItem(removeAllTitle, this._breakpointManager.removeAllBreakpoints.bind(this._breakpointManager)); + var removeOtherTitle = Common.UIString('Remove other breakpoints'); + contextMenu.appendItem( + removeOtherTitle, + this._breakpointManager.removeOtherBreakpoints.bind(this._breakpointManager, new Set(breakpoints))); contextMenu.show(); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js index a04ab1f..2444ac3 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js
@@ -24,39 +24,37 @@ } /** - * @return {?SDK.Target} + * @return {?SDK.RuntimeModel} */ - _findTarget() { - var targets = SDK.targetManager.targets(); + _findRuntimeModel() { + var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); var sourceCode = this._sourceFrame.uiSourceCode(); - for (var i = 0; i < targets.length; ++i) { - var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode, targets[i]); + for (var i = 0; i < debuggerModels.length; ++i) { + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(sourceCode, debuggerModels[i]); if (scriptFile) - return targets[i]; + return debuggerModels[i].target().runtimeModel; } - return SDK.targetManager.mainTarget(); + return SDK.targetManager.mainTarget() ? SDK.targetManager.mainTarget().runtimeModel : null; } _compile() { - var target = this._findTarget(); - if (!target) + var runtimeModel = this._findRuntimeModel(); + if (!runtimeModel) return; - var runtimeModel = target.runtimeModel; var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); if (!currentExecutionContext) return; this._compiling = true; var code = this._sourceFrame.textEditor.text(); - runtimeModel.compileScript(code, '', false, currentExecutionContext.id, compileCallback.bind(this, target)); + runtimeModel.compileScript(code, '', false, currentExecutionContext.id, compileCallback.bind(this)); /** - * @param {!SDK.Target} target * @param {!Protocol.Runtime.ScriptId=} scriptId * @param {?Protocol.Runtime.ExceptionDetails=} exceptionDetails * @this {Sources.JavaScriptCompiler} */ - function compileCallback(target, scriptId, exceptionDetails) { + function compileCallback(scriptId, exceptionDetails) { this._compiling = false; if (this._recompileScheduled) { delete this._recompileScheduled;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js index ba9737d..89ab2af 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -71,8 +71,8 @@ /** @type {!Map<!Bindings.BreakpointManager.Breakpoint, !Sources.JavaScriptSourceFrame.BreakpointDecoration>} */ this._decorationByBreakpoint = new Map(); - /** @type {!Map.<!SDK.Target, !Bindings.ResourceScriptFile>}*/ - this._scriptFileForTarget = new Map(); + /** @type {!Map.<!SDK.DebuggerModel, !Bindings.ResourceScriptFile>}*/ + this._scriptFileForDebuggerModel = new Map(); Common.moduleSetting('skipStackFramesPattern').addChangeListener(this._showBlackboxInfobarIfNeeded, this); Common.moduleSetting('skipContentScripts').addChangeListener(this._showBlackboxInfobarIfNeeded, this); @@ -126,7 +126,7 @@ infobar.createDetailsRowMessage( Common.UIString('Debugger will skip stepping through this script, and will not stop on exceptions')); - var scriptFile = this._scriptFileForTarget.size ? this._scriptFileForTarget.valuesArray()[0] : null; + var scriptFile = this._scriptFileForDebuggerModel.size ? this._scriptFileForDebuggerModel.valuesArray()[0] : null; if (scriptFile && scriptFile.hasSourceMapURL()) infobar.createDetailsRowMessage(Common.UIString('Source map found, but ignored for blackboxed file.')); infobar.createDetailsRowMessage(); @@ -273,8 +273,8 @@ if (this._debuggerSourceCode.project().type() === Workspace.projectTypes.Network && Common.moduleSetting('jsSourceMapsEnabled').get() && !Bindings.blackboxManager.isBlackboxedUISourceCode(this._debuggerSourceCode)) { - if (this._scriptFileForTarget.size) { - var scriptFile = this._scriptFileForTarget.valuesArray()[0]; + if (this._scriptFileForDebuggerModel.size) { + var scriptFile = this._scriptFileForDebuggerModel.valuesArray()[0]; var addSourceMapURLLabel = Common.UIString.capitalize('Add ^source ^map\u2026'); contextMenu.appendItem(addSourceMapURLLabel, addSourceMapURL.bind(null, scriptFile)); contextMenu.appendSeparator(); @@ -290,7 +290,7 @@ * @param {!Common.Event} event */ _workingCopyChanged(event) { - if (this._supportsEnabledBreakpointsWhileEditing() || this._scriptFileForTarget.size) + if (this._supportsEnabledBreakpointsWhileEditing() || this._scriptFileForDebuggerModel.size) return; if (this.uiSourceCode().isDirty()) @@ -307,7 +307,7 @@ if (this._supportsEnabledBreakpointsWhileEditing()) return; - if (!this._scriptFileForTarget.size) + if (!this._scriptFileForDebuggerModel.size) this._restoreBreakpointsAfterEditing(); } @@ -336,7 +336,7 @@ } _restoreBreakpointsIfConsistentScripts() { - var scriptFiles = this._scriptFileForTarget.valuesArray(); + var scriptFiles = this._scriptFileForDebuggerModel.valuesArray(); for (var i = 0; i < scriptFiles.length; ++i) { if (scriptFiles[i].hasDivergedFromVM() || scriptFiles[i].isMergingToVM()) return; @@ -883,7 +883,7 @@ return false; if (this._muted) return true; - var scriptFiles = this._scriptFileForTarget.valuesArray(); + var scriptFiles = this._scriptFileForDebuggerModel.valuesArray(); for (var i = 0; i < scriptFiles.length; ++i) { if (scriptFiles[i].isDivergingFromVM() || scriptFiles[i].isMergingToVM()) return true; @@ -1013,7 +1013,8 @@ this._updateScriptFiles(); this._refreshBreakpoints(); - var canLiveCompileJavascript = this._scriptFileForTarget.size || this._debuggerSourceCode.extension() === 'js' || + var canLiveCompileJavascript = this._scriptFileForDebuggerModel.size || + this._debuggerSourceCode.extension() === 'js' || this._debuggerSourceCode.project().type() === Workspace.projectTypes.Snippets; if (!!canLiveCompileJavascript !== !!this._compiler) this._compiler = canLiveCompileJavascript ? new Sources.JavaScriptCompiler(this) : null; @@ -1043,10 +1044,10 @@ * @param {!Common.Event} event */ _onSourceMappingChanged(event) { - var data = /** @type {{target: !SDK.Target, uiSourceCode: !Workspace.UISourceCode}} */ (event.data); + var data = /** @type {{debuggerModel: !SDK.DebuggerModel, uiSourceCode: !Workspace.UISourceCode}} */ (event.data); if (this._debuggerSourceCode !== data.uiSourceCode) return; - this._updateScriptFile(data.target); + this._updateScriptFile(data.debuggerModel); this._updateLinesWithoutMappingHighlight(); } @@ -1062,20 +1063,20 @@ } _updateScriptFiles() { - for (var target of SDK.targetManager.targets()) { - var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debuggerSourceCode, target); + for (var debuggerModel of SDK.targetManager.models(SDK.DebuggerModel)) { + var scriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debuggerSourceCode, debuggerModel); if (scriptFile) - this._updateScriptFile(target); + this._updateScriptFile(debuggerModel); } } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - _updateScriptFile(target) { - var oldScriptFile = this._scriptFileForTarget.get(target); - var newScriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debuggerSourceCode, target); - this._scriptFileForTarget.remove(target); + _updateScriptFile(debuggerModel) { + var oldScriptFile = this._scriptFileForDebuggerModel.get(debuggerModel); + var newScriptFile = Bindings.debuggerWorkspaceBinding.scriptFile(this._debuggerSourceCode, debuggerModel); + this._scriptFileForDebuggerModel.delete(debuggerModel); if (oldScriptFile) { oldScriptFile.removeEventListener(Bindings.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); oldScriptFile.removeEventListener( @@ -1084,7 +1085,7 @@ this._restoreBreakpointsIfConsistentScripts(); } if (newScriptFile) - this._scriptFileForTarget.set(target, newScriptFile); + this._scriptFileForDebuggerModel.set(debuggerModel, newScriptFile); if (newScriptFile) { newScriptFile.addEventListener(Bindings.ResourceScriptFile.Events.DidMergeToVM, this._didMergeToVM, this); @@ -1119,7 +1120,7 @@ for (var breakpointLocation of breakpointLocations) this._addBreakpoint(breakpointLocation.uiLocation, breakpointLocation.breakpoint); - var scriptFiles = this._scriptFileForTarget.valuesArray(); + var scriptFiles = this._scriptFileForDebuggerModel.valuesArray(); for (var i = 0; i < scriptFiles.length; ++i) scriptFiles[i].checkMapping();
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js index 6955edd..543c477 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/ScriptFormatterEditorAction.js
@@ -97,7 +97,7 @@ /** * @implements {Sources.SourcesView.EditorAction} - * @implements {SDK.TargetManager.Observer} + * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} * @unrestricted */ Sources.ScriptFormatterEditorAction = class { @@ -117,34 +117,28 @@ /** @type {!Set.<string>} */ this._pathsToFormatOnLoad = new Set(); - /** @type {!Map.<!SDK.Target, !Sources.FormatterScriptMapping>} */ - this._scriptMappingByTarget = new Map(); + /** @type {!Map.<!SDK.DebuggerModel, !Sources.FormatterScriptMapping>} */ + this._scriptMappingByDebuggerModel = new Map(); this._workspace = Workspace.workspace; - SDK.targetManager.observeTargets(this); + SDK.targetManager.observeModels(SDK.DebuggerModel, this); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetAdded(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (!debuggerModel) - return; - this._scriptMappingByTarget.set(target, new Sources.FormatterScriptMapping(debuggerModel, this)); + modelAdded(debuggerModel) { + this._scriptMappingByDebuggerModel.set(debuggerModel, new Sources.FormatterScriptMapping(debuggerModel, this)); debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); } /** * @override - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - targetRemoved(target) { - var debuggerModel = SDK.DebuggerModel.fromTarget(target); - if (!debuggerModel) - return; - this._scriptMappingByTarget.remove(target); - this._cleanForTarget(target); + modelRemoved(debuggerModel) { + this._scriptMappingByDebuggerModel.remove(debuggerModel); + this._cleanForModel(debuggerModel); debuggerModel.removeEventListener(SDK.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this); } @@ -264,16 +258,16 @@ } /** - * @param {!SDK.Target} target + * @param {!SDK.DebuggerModel} debuggerModel */ - _cleanForTarget(target) { + _cleanForModel(debuggerModel) { var uiSourceCodes = this._formatData.keysArray(); for (var i = 0; i < uiSourceCodes.length; ++i) { - Bindings.debuggerWorkspaceBinding.setSourceMapping(target, uiSourceCodes[i], null); + Bindings.debuggerWorkspaceBinding.setSourceMapping(debuggerModel, uiSourceCodes[i], null); var formatData = this._formatData.get(uiSourceCodes[i]); var scripts = []; for (var j = 0; j < formatData.scripts.length; ++j) { - if (formatData.scripts[j].target() === target) + if (formatData.scripts[j].debuggerModel === debuggerModel) this._uiSourceCodes.remove(formatData.scripts[j]); else scripts.push(formatData.scripts[j]); @@ -294,7 +288,7 @@ */ _debuggerReset(event) { var debuggerModel = /** @type {!SDK.DebuggerModel} */ (event.data); - this._cleanForTarget(debuggerModel.target()); + this._cleanForModel(debuggerModel); } /** @@ -312,7 +306,7 @@ if (uiSourceCode.contentType() === Common.resourceTypes.Document) { var scripts = []; - var debuggerModels = SDK.DebuggerModel.instances(); + var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); for (var i = 0; i < debuggerModels.length; ++i) scripts.pushAll(debuggerModels[i].scriptsForSourceURL(uiSourceCode.url())); return scripts.filter(isInlineScript); @@ -374,15 +368,16 @@ for (var i = 0; i < scripts.length; ++i) { this._uiSourceCodes.set(scripts[i], formattedUISourceCode); var scriptMapping = - /** @type {!Sources.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(scripts[i].target())); + /** @type {!Sources.FormatterScriptMapping} */ ( + this._scriptMappingByDebuggerModel.get(scripts[i].debuggerModel)); Bindings.debuggerWorkspaceBinding.pushSourceMapping(scripts[i], scriptMapping); } - var targets = SDK.targetManager.targets(); - for (var i = 0; i < targets.length; ++i) { + var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); + for (var i = 0; i < debuggerModels.length; ++i) { var scriptMapping = - /** @type {!Sources.FormatterScriptMapping} */ (this._scriptMappingByTarget.get(targets[i])); - Bindings.debuggerWorkspaceBinding.setSourceMapping(targets[i], formattedUISourceCode, scriptMapping); + /** @type {!Sources.FormatterScriptMapping} */ (this._scriptMappingByDebuggerModel.get(debuggerModels[i])); + Bindings.debuggerWorkspaceBinding.setSourceMapping(debuggerModels[i], formattedUISourceCode, scriptMapping); } this._showIfNeeded(uiSourceCode, formattedUISourceCode, formatterMapping); }
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js index 11fc49fa..1a382a9 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -252,9 +252,8 @@ */ Sources.SourceMapNamesResolver._resolveExpression = function( callFrame, uiSourceCode, lineNumber, startColumnNumber, endColumnNumber) { - var target = callFrame.target(); - var rawLocation = - Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(target, uiSourceCode, lineNumber, startColumnNumber); + var rawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation( + callFrame.debuggerModel, uiSourceCode, lineNumber, startColumnNumber); if (!rawLocation) return Promise.resolve(''); @@ -318,8 +317,9 @@ * @param {?Protocol.Runtime.RemoteObject} evaluateResult */ function onEvaluated(callback, evaluateResult) { - var remoteObject = - evaluateResult ? callFrame.target().runtimeModel.createRemoteObject(evaluateResult) : callFrame.thisObject(); + var remoteObject = evaluateResult ? + callFrame.debuggerModel.target().runtimeModel.createRemoteObject(evaluateResult) : + callFrame.thisObject(); callback(remoteObject); } };
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js index ba9854d0..3be12c0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js +++ b/third_party/WebKit/Source/devtools/front_end/sources/SourcesPanel.js
@@ -296,10 +296,10 @@ if (!this._paused) this._setAsCurrentPanel(); - if (UI.context.flavor(SDK.Target) === details.target()) - this._showDebuggerPausedDetails(details); + if (UI.context.flavor(SDK.Target) === debuggerModel.target()) + this._showDebuggerPausedDetails(/** @type {!SDK.DebuggerPausedDetails} */ (details)); else if (!this._paused) - UI.context.setFlavor(SDK.Target, details.target()); + UI.context.setFlavor(SDK.Target, debuggerModel.target()); } /** @@ -514,7 +514,7 @@ return; if (debuggerModel.isPaused()) return; - var debuggerModels = SDK.DebuggerModel.instances(); + var debuggerModels = SDK.targetManager.models(SDK.DebuggerModel); for (var i = 0; i < debuggerModels.length; ++i) { if (debuggerModels[i].isPaused()) { UI.context.setFlavor(SDK.Target, debuggerModels[i].target()); @@ -650,7 +650,7 @@ // Always use 0 column. var rawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation( - executionContext.target(), uiLocation.uiSourceCode, uiLocation.lineNumber, 0); + SDK.DebuggerModel.fromTarget(executionContext.target()), uiLocation.uiSourceCode, uiLocation.lineNumber, 0); if (!rawLocation) return;
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js b/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js index 8ed9011f..c1bec7d4 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/CountersGraph.js
@@ -38,12 +38,11 @@ */ constructor(delegate, model) { super(); - this.element.id = 'memory-graphs-container'; this._delegate = delegate; this._model = model; - this._calculator = new Timeline.CounterGraphCalculator(this._model); + this._calculator = new Timeline.CountersGraph.Calculator(this._model); // Create selectors this._infoWidget = new UI.HBox(); @@ -70,6 +69,53 @@ this._counters = []; this._counterUI = []; + + this._countersByName = {}; + this._countersByName['jsHeapSizeUsed'] = this._createCounter( + Common.UIString('JS Heap'), Common.UIString('JS Heap: %s'), 'hsl(220, 90%, 43%)', Number.bytesToString); + this._countersByName['documents'] = + this._createCounter(Common.UIString('Documents'), Common.UIString('Documents: %s'), 'hsl(0, 90%, 43%)'); + this._countersByName['nodes'] = + this._createCounter(Common.UIString('Nodes'), Common.UIString('Nodes: %s'), 'hsl(120, 90%, 43%)'); + this._countersByName['jsEventListeners'] = + this._createCounter(Common.UIString('Listeners'), Common.UIString('Listeners: %s'), 'hsl(38, 90%, 43%)'); + this._gpuMemoryCounter = this._createCounter( + Common.UIString('GPU Memory'), Common.UIString('GPU Memory [KB]: %s'), 'hsl(300, 90%, 43%)', + Number.bytesToString); + this._countersByName['gpuMemoryUsedKB'] = this._gpuMemoryCounter; + } + + /** + * @override + */ + refreshRecords() { + this.reset(); + var events = this._model.mainThreadEvents(); + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.name !== TimelineModel.TimelineModel.RecordType.UpdateCounters) + continue; + + var counters = event.args.data; + if (!counters) + return; + for (var name in counters) { + var counter = this._countersByName[name]; + if (counter) + counter.appendSample(event.startTime, counters[name]); + } + + var gpuMemoryLimitCounterName = 'gpuMemoryLimitKB'; + if (gpuMemoryLimitCounterName in counters) + this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]); + } + this.scheduleRefresh(); + } + + /** + * @override + */ + extensionDataAdded() { } _createCurrentValuesBar() { @@ -84,7 +130,7 @@ * @param {function(number):string=} formatter * @return {!Timeline.CountersGraph.Counter} */ - createCounter(uiName, uiValueTemplate, color, formatter) { + _createCounter(uiName, uiValueTemplate, color, formatter) { var counter = new Timeline.CountersGraph.Counter(); this._counters.push(counter); this._counterUI.push( @@ -101,14 +147,6 @@ } /** - * @protected - * @return {!TimelineModel.TimelineModel} - */ - model() { - return this._model; - } - - /** * @override */ dispose() { @@ -224,18 +262,6 @@ this._refreshCurrentValues(); } - /** - * @override - */ - refreshRecords() { - } - - /** - * @override - */ - extensionDataAdded() { - } - _clear() { var ctx = this._canvas.getContext('2d'); ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); @@ -321,7 +347,7 @@ } /** - * @param {!Timeline.CounterGraphCalculator} calculator + * @param {!Timeline.CountersGraph.Calculator} calculator */ _calculateVisibleIndexes(calculator) { var start = calculator.minimumBoundary(); @@ -358,18 +384,18 @@ */ Timeline.CountersGraph.CounterUI = class { /** - * @param {!Timeline.CountersGraph} memoryCountersPane + * @param {!Timeline.CountersGraph} countersPane * @param {string} title * @param {string} currentValueLabel * @param {string} graphColor * @param {!Timeline.CountersGraph.Counter} counter * @param {(function(number): string)|undefined} formatter */ - constructor(memoryCountersPane, title, currentValueLabel, graphColor, counter, formatter) { - this._memoryCountersPane = memoryCountersPane; + constructor(countersPane, title, currentValueLabel, graphColor, counter, formatter) { + this._countersPane = countersPane; this.counter = counter; this._formatter = formatter || Number.withThousandsSeparator; - var container = memoryCountersPane._infoWidget.element.createChild('div', 'memory-counter-selector-info'); + var container = countersPane._infoWidget.element.createChild('div', 'memory-counter-selector-info'); this._setting = Common.settings.createSetting('timelineCountersGraph-' + title, true); this._filter = new UI.ToolbarCheckbox(title, title, this._setting); @@ -383,7 +409,7 @@ container.appendChild(this._filter.element); this._range = this._filter.element.createChild('span', 'range'); - this._value = memoryCountersPane._currentValuesBar.createChild('span', 'memory-counter-value'); + this._value = countersPane._currentValuesBar.createChild('span', 'memory-counter-value'); this._value.style.color = graphColor; this.graphColor = graphColor; this.limitColor = Common.Color.parse(graphColor).setAlpha(0.3).asString(Common.Color.Format.RGBA); @@ -391,7 +417,7 @@ this._verticalPadding = 10; this._currentValueLabel = currentValueLabel; - this._marker = memoryCountersPane._canvasContainer.createChild('div', 'memory-counter-marker'); + this._marker = countersPane._canvasContainer.createChild('div', 'memory-counter-marker'); this._marker.style.backgroundColor = graphColor; this._clearCurrentValueAndMarker(); } @@ -415,7 +441,7 @@ */ _toggleCounterGraph(event) { this._value.classList.toggle('hidden', !this._filter.checked()); - this._memoryCountersPane.refresh(); + this._countersPane.refresh(); } /** @@ -523,7 +549,7 @@ * @implements {PerfUI.TimelineGrid.Calculator} * @unrestricted */ -Timeline.CounterGraphCalculator = class { +Timeline.CountersGraph.Calculator = class { /** * @param {!TimelineModel.TimelineModel} model */ @@ -559,7 +585,7 @@ */ setDisplayWindow(clientWidth, paddingLeft) { this._paddingLeft = paddingLeft || 0; - this._workingArea = clientWidth - Timeline.CounterGraphCalculator._minWidth - this._paddingLeft; + this._workingArea = clientWidth - Timeline.CountersGraph.Calculator._minWidth - this._paddingLeft; } /** @@ -605,4 +631,4 @@ } }; -Timeline.CounterGraphCalculator._minWidth = 5; +Timeline.CountersGraph.Calculator._minWidth = 5;
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js b/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js deleted file mode 100644 index a1e0139..0000000 --- a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js +++ /dev/null
@@ -1,88 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/** - * @implements {Timeline.TimelineModeView} - * @unrestricted - */ -Timeline.MemoryCountersGraph = class extends Timeline.CountersGraph { - /** - * @param {!Timeline.TimelineModeViewDelegate} delegate - * @param {!TimelineModel.TimelineModel} model - */ - constructor(delegate, model) { - super(delegate, model); - this._countersByName = {}; - this._countersByName['jsHeapSizeUsed'] = this.createCounter( - Common.UIString('JS Heap'), Common.UIString('JS Heap: %s'), 'hsl(220, 90%, 43%)', Number.bytesToString); - this._countersByName['documents'] = - this.createCounter(Common.UIString('Documents'), Common.UIString('Documents: %s'), 'hsl(0, 90%, 43%)'); - this._countersByName['nodes'] = - this.createCounter(Common.UIString('Nodes'), Common.UIString('Nodes: %s'), 'hsl(120, 90%, 43%)'); - this._countersByName['jsEventListeners'] = - this.createCounter(Common.UIString('Listeners'), Common.UIString('Listeners: %s'), 'hsl(38, 90%, 43%)'); - this._gpuMemoryCounter = this.createCounter( - Common.UIString('GPU Memory'), Common.UIString('GPU Memory [KB]: %s'), 'hsl(300, 90%, 43%)', - Number.bytesToString); - this._countersByName['gpuMemoryUsedKB'] = this._gpuMemoryCounter; - } - - /** - * @override - */ - refreshRecords() { - this.reset(); - var events = this.model().mainThreadEvents(); - for (var i = 0; i < events.length; ++i) { - var event = events[i]; - if (event.name !== TimelineModel.TimelineModel.RecordType.UpdateCounters) - continue; - - var counters = event.args.data; - if (!counters) - return; - for (var name in counters) { - var counter = this._countersByName[name]; - if (counter) - counter.appendSample(event.startTime, counters[name]); - } - - var gpuMemoryLimitCounterName = 'gpuMemoryLimitKB'; - if (gpuMemoryLimitCounterName in counters) - this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]); - } - this.scheduleRefresh(); - } - - /** - * @override - */ - extensionDataAdded() { - } -};
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js index 91b805f..a39ba22 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -499,7 +499,7 @@ this._filters); this._addModeView(this._flameChart); if (showMemory) - this._addModeView(new Timeline.MemoryCountersGraph(this, this._model)); + this._addModeView(new Timeline.CountersGraph(this, this._model)); } else { var innerView; switch (viewMode) {
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/module.json b/third_party/WebKit/Source/devtools/front_end/timeline/module.json index 8847473..72cc526 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/module.json +++ b/third_party/WebKit/Source/devtools/front_end/timeline/module.json
@@ -141,7 +141,6 @@ "scripts": [ "CountersGraph.js", "ExtensionTracingSession.js", - "MemoryCountersGraph.js", "TimelineController.js", "TimelineDetailsView.js", "TimelineLoader.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js index f4379fb..9fa8219f 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
@@ -39,11 +39,16 @@ this.contentElement.createChild('content'); this.contentElement.tabIndex = 0; - this.contentElement.addEventListener('focus', this._onFocus.bind(this), false); - this._keyDownBound = this._onKeyDown.bind(this); - - this._wrapsContent = false; + this.contentElement.addEventListener('focus', this.focus.bind(this), false); + this.contentElement.addEventListener('keydown', this._onKeyDown.bind(this), false); this._dimmed = false; + this._wrapsContent = false; + this._maxSize = null; + /** @type {?number} */ + this._positionX = null; + /** @type {?number} */ + this._positionY = null; + /** @type {!Map<!HTMLElement, number>} */ this._tabIndexMap = new Map(); } @@ -56,44 +61,25 @@ } /** - * @param {!UI.Widget} view - */ - static setModalHostView(view) { - UI.Dialog._modalHostView = view; - } - - /** - * FIXME: make utility method in Dialog, so clients use it instead of this getter. - * Method should be like Dialog.showModalElement(position params, reposition callback). - * @return {?UI.Widget} - */ - static modalHostView() { - return UI.Dialog._modalHostView; - } - - static modalHostRepositioned() { - if (UI.Dialog._instance) - UI.Dialog._instance._position(); - } - - /** * @override + * @suppressGlobalPropertiesCheck + * TODO(dgozman): pass document in constructor. */ show() { if (UI.Dialog._instance) UI.Dialog._instance.detach(); UI.Dialog._instance = this; - var document = /** @type {!Document} */ (UI.Dialog._modalHostView.element.ownerDocument); this._disableTabIndexOnElements(document); - this._glassPane = new UI.GlassPane(document, this._dimmed); - this._glassPane.element.addEventListener('click', this._onGlassPaneClick.bind(this), false); - this.element.ownerDocument.body.addEventListener('keydown', this._keyDownBound, false); - - super.show(this._glassPane.element); - - this._position(); + this._glassPane = new UI.GlassPane(document, this._dimmed, true /* blockPointerEvents*/, event => { + this.detach(); + event.consume(true); + }); + this._glassPane.show(); + super.show(this._glassPane.contentElement); + this._glassPane.setContentPosition(this._positionX, this._positionY); + this._glassPane.setMaxContentSize(this._effectiveMaxSize()); this._focusRestorer = new UI.WidgetFocusRestorer(this); } @@ -103,10 +89,8 @@ detach() { this._focusRestorer.restore(); - this.element.ownerDocument.body.removeEventListener('keydown', this._keyDownBound, false); super.detach(); - - this._glassPane.dispose(); + this._glassPane.hide(); delete this._glassPane; this._restoreTabIndexOnElements(); @@ -121,12 +105,12 @@ } /** - * @param {number=} positionX - * @param {number=} positionY + * @param {?number} positionX + * @param {?number} positionY */ setPosition(positionX, positionY) { - this._defaultPositionX = positionX; - this._defaultPositionY = positionY; + this._positionX = positionX; + this._positionY = positionY; } /** @@ -137,11 +121,20 @@ } /** + * @return {?UI.Size} + */ + _effectiveMaxSize() { + if (!this._wrapsContent) + return this._maxSize; + return new UI.Size(this.contentElement.offsetWidth, this.contentElement.offsetHeight).clipTo(this._maxSize); + } + + /** * @param {boolean} wraps */ setWrapsContent(wraps) { - this.element.classList.toggle('wraps-content', wraps); this._wrapsContent = wraps; + this.element.classList.toggle('wraps-content', wraps); } /** @@ -152,8 +145,9 @@ } contentResized() { - if (this._wrapsContent) - this._position(); + if (!this._wrapsContent || !this._glassPane) + return; + this._glassPane.setMaxContentSize(this._effectiveMaxSize()); } /** @@ -182,58 +176,6 @@ /** * @param {!Event} event */ - _onFocus(event) { - this.focus(); - } - - /** - * @param {!Event} event - */ - _onGlassPaneClick(event) { - if (!this.element.isSelfOrAncestor(/** @type {?Node} */ (event.target))) - this.detach(); - } - - _position() { - var container = UI.Dialog._modalHostView.element; - - var width = container.offsetWidth - 10; - var height = container.offsetHeight - 10; - - if (this._wrapsContent) { - width = Math.min(width, this.contentElement.offsetWidth); - height = Math.min(height, this.contentElement.offsetHeight); - } - - if (this._maxSize) { - width = Math.min(width, this._maxSize.width); - height = Math.min(height, this._maxSize.height); - } - - var positionX; - if (typeof this._defaultPositionX === 'number') { - positionX = this._defaultPositionX; - } else { - positionX = (container.offsetWidth - width) / 2; - positionX = Number.constrain(positionX, 0, container.offsetWidth - width); - } - - var positionY; - if (typeof this._defaultPositionY === 'number') { - positionY = this._defaultPositionY; - } else { - positionY = (container.offsetHeight - height) / 2; - positionY = Number.constrain(positionY, 0, container.offsetHeight - height); - } - - this.element.style.width = width + 'px'; - this.element.style.height = height + 'px'; - this.element.positionAt(positionX, positionY, container); - } - - /** - * @param {!Event} event - */ _onKeyDown(event) { if (event.keyCode === UI.KeyboardShortcut.Keys.Esc.code) { event.consume(true); @@ -241,10 +183,3 @@ } } }; - - -/** @type {?Element} */ -UI.Dialog._previousFocusedElement = null; - -/** @type {?UI.Widget} */ -UI.Dialog._modalHostView = null;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js b/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js index f6e0f5b..d4e94f94 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Geometry.js
@@ -346,6 +346,16 @@ this.width = width; this.height = height; } + + /** + * @param {?UI.Size} size + * @return {!UI.Size} + */ + clipTo(size) { + if (!size) + return this; + return new UI.Size(Math.min(this.width, size.width), Math.min(this.height, size.height)); + } }; /**
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js b/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js new file mode 100644 index 0000000..835b6af --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/ui/GlassPane.js
@@ -0,0 +1,208 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +UI.GlassPane = class { + /** + * @param {!Document} document + * @param {boolean} dimmed + * @param {boolean} blockPointerEvents + * @param {function(!Event)} onClickOutside + */ + constructor(document, dimmed, blockPointerEvents, onClickOutside) { + this._element = createElementWithClass('div', 'glass-pane'); + this._element.style.backgroundColor = dimmed ? 'rgba(255, 255, 255, 0.5)' : 'transparent'; + if (!blockPointerEvents) + this._element.style.pointerEvents = 'none'; + this._onMouseDown = event => { + if (!this.contentElement.isSelfOrAncestor(/** @type {?Node} */ (event.target))) + onClickOutside.call(null, event); + }; + + this.contentElement = this._element.createChild('div', 'glass-pane-content'); + this._document = document; + this._visible = false; + /** @type {?UI.Size} */ + this._maxSize = null; + /** @type {?number} */ + this._positionX = null; + /** @type {?number} */ + this._positionY = null; + /** @type {?AnchorBox} */ + this._anchorBox = null; + this._anchorBehavior = UI.GlassPane.AnchorBehavior.PreferTop; + } + + /** + * @param {?UI.Size} size + */ + setMaxContentSize(size) { + this._maxSize = size; + this._positionContent(); + } + + /** + * @param {?number} x + * @param {?number} y + * Position is relative to root element. + */ + setContentPosition(x, y) { + this._positionX = x; + this._positionY = y; + this._positionContent(); + } + + /** + * @param {?AnchorBox} anchorBox + * Anchor box is relative to the document. + */ + setContentAnchorBox(anchorBox) { + this._anchorBox = anchorBox; + this._positionContent(); + } + + /** + * @param {!UI.GlassPane.AnchorBehavior} behavior + */ + setAnchorBehavior(behavior) { + this._anchorBehavior = behavior; + } + + show() { + if (this._visible) + return; + this._visible = true; + // Deliberately starts with 3000 to hide other z-indexed elements below. + this._element.style.zIndex = 3000 + 1000 * UI.GlassPane._panes.size; + this._document.body.appendChild(this._element); + this._document.body.addEventListener('mousedown', this._onMouseDown, true); + UI.GlassPane._panes.add(this); + } + + hide() { + if (!this._visible) + return; + UI.GlassPane._panes.delete(this); + this._document.body.removeEventListener('mousedown', this._onMouseDown, true); + this._document.body.removeChild(this._element); + this._visible = false; + } + + /** + * @return {boolean} + */ + visible() { + return this._visible; + } + + _positionContent() { + if (!this._visible) + return; + + var gutterSize = 5; + var container = UI.GlassPane._containers.get(this._document); + var containerWidth = container.offsetWidth; + var containerHeight = container.offsetHeight; + + var width = containerWidth - gutterSize * 2; + var height = containerHeight - gutterSize * 2; + var positionX = gutterSize; + var positionY = gutterSize; + + if (this._maxSize) { + width = Math.min(width, this._maxSize.width); + height = Math.min(height, this._maxSize.height); + } + + if (this._anchorBox) { + var anchorBox = this._anchorBox.relativeToElement(container); + var behavior = this._anchorBehavior; + + if (behavior === UI.GlassPane.AnchorBehavior.PreferTop || behavior === UI.GlassPane.AnchorBehavior.PreferBottom) { + var top = anchorBox.y - gutterSize; + var bottom = containerHeight - anchorBox.y - anchorBox.height - gutterSize; + if (behavior === UI.GlassPane.AnchorBehavior.PreferTop && top < height && bottom >= height) + behavior = UI.GlassPane.AnchorBehavior.PreferBottom; + if (behavior === UI.GlassPane.AnchorBehavior.PreferBottom && bottom < height && top >= height) + behavior = UI.GlassPane.AnchorBehavior.PreferTop; + + positionX = Math.max(gutterSize, Math.min(anchorBox.x, containerWidth - width - gutterSize)); + width = Math.min(width, containerWidth - positionX - gutterSize); + if (behavior === UI.GlassPane.AnchorBehavior.PreferTop) { + positionY = Math.max(gutterSize, anchorBox.y - height); + height = Math.min(height, anchorBox.y - positionY); + } else { + positionY = anchorBox.y + anchorBox.height; + height = Math.min(height, containerHeight - positionY - gutterSize); + } + } else { + var left = anchorBox.x - gutterSize; + var right = containerWidth - anchorBox.x - anchorBox.width - gutterSize; + if (behavior === UI.GlassPane.AnchorBehavior.PreferLeft && left < width && right >= width) + behavior = UI.GlassPane.AnchorBehavior.PreferRight; + if (behavior === UI.GlassPane.AnchorBehavior.PreferRight && right < width && left >= width) + behavior = UI.GlassPane.AnchorBehavior.PreferLeft; + + positionY = Math.max(gutterSize, Math.min(anchorBox.y, containerHeight - height - gutterSize)); + height = Math.min(height, containerHeight - positionY - gutterSize); + if (behavior === UI.GlassPane.AnchorBehavior.PreferLeft) { + positionX = Math.max(gutterSize, anchorBox.x - width); + width = Math.min(width, anchorBox.x - positionX); + } else { + positionX = anchorBox.x + anchorBox.width; + width = Math.min(width, containerWidth - positionX - gutterSize); + } + } + } else { + positionX = this._positionX !== null ? this._positionX : (containerWidth - width) / 2; + positionY = this._positionY !== null ? this._positionY : (containerHeight - height) / 2; + width = Math.min(width, containerWidth - positionX - gutterSize); + height = Math.min(height, containerHeight - positionY - gutterSize); + } + + this.contentElement.style.width = width + 'px'; + this.contentElement.style.height = height + 'px'; + this.contentElement.positionAt(positionX, positionY, container); + } + + /** + * @param {!Element} element + */ + static setContainer(element) { + UI.GlassPane._containers.set(/** @type {!Document} */ (element.ownerDocument), element); + UI.GlassPane.containerMoved(element); + } + + /** + * @param {!Document} document + * @return {!Element} + */ + static container(document) { + return UI.GlassPane._containers.get(document); + } + + /** + * @param {!Element} element + */ + static containerMoved(element) { + for (var pane of UI.GlassPane._panes) { + if (pane._document === element.ownerDocument) + pane._positionContent(); + } + } +}; + +/** + * @enum {symbol} + */ +UI.GlassPane.AnchorBehavior = { + PreferTop: Symbol('PreferTop'), + PreferBottom: Symbol('PreferBottom'), + PreferLeft: Symbol('PreferLeft'), + PreferRight: Symbol('PreferRight'), +}; + +/** @type {!Map<!Document, !Element>} */ +UI.GlassPane._containers = new Map(); +/** @type {!Set<!UI.GlassPane>} */ +UI.GlassPane._panes = new Set();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Icon.js b/third_party/WebKit/Source/devtools/front_end/ui/Icon.js index 69b8e95..2edea712 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Icon.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Icon.js
@@ -111,7 +111,12 @@ 'smallicon-triangle-down': {x: -20, y: -98, width: 10, height: 8, spritesheet: 'largeicons', isMask: true}, 'smallicon-triangle-up': {x: -4, y: -111, width: 10, height: 8, spritesheet: 'largeicons', isMask: true}, 'smallicon-arrow-in-circle': {x: -10, y: -127, width: 11, height: 11, spritesheet: 'largeicons', isMask: true}, - 'smallicon-cross': {x: -177, y: -98, width: 10, height: 10, spritesheet: 'largeicons'}, + 'smallicon-cross': {x: -177, y: -98, width: 9, height: 9, spritesheet: 'largeicons'}, + 'smallicon-red-cross-hover': {x: -96, y: -96, width: 14, height: 14, spritesheet: 'largeicons'}, + 'smallicon-red-cross-active': {x: -111, y: -96, width: 14, height: 14, spritesheet: 'largeicons'}, + 'smallicon-gray-cross-hover': {x: -143, y: -96, width: 13, height: 13, spritesheet: 'largeicons'}, + 'smallicon-gray-cross-active': {x: -160, y: -96, width: 13, height: 13, spritesheet: 'largeicons'}, + 'smallicon-inline-breakpoint': {x: -140, y: -20, width: 10, height: 10, spritesheet: 'smallicons'}, 'smallicon-inline-breakpoint-conditional': {x: -160, y: -20, width: 10, height: 10, spritesheet: 'smallicons'}, 'smallicon-file': {x: -64, y: -24, width: 12, height: 14, spritesheet: 'largeicons'},
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js index c964632..1b989e9 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/InspectorView.js
@@ -34,7 +34,7 @@ UI.InspectorView = class extends UI.VBox { constructor() { super(); - UI.Dialog.setModalHostView(this); + UI.GlassPane.setContainer(this.element); this.setMinimumSize(240, 72); // DevTools sidebar is a vertical split of panels tabbed pane and a drawer. @@ -268,7 +268,7 @@ * @override */ onResize() { - UI.Dialog.modalHostRepositioned(); + UI.GlassPane.containerMoved(this.element); } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js index 7953b7a..375a9c0d1 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Popover.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Popover.js
@@ -165,7 +165,7 @@ // Skinny tooltips are not pretty, their arrow location is not nice. preferredWidth = Math.max(preferredWidth, 50); // Position relative to main DevTools element. - const container = UI.Dialog.modalHostView().element; + const container = UI.GlassPane.container(/** @type {!Document} */ (this._containerElement.ownerDocument)); const totalWidth = container.offsetWidth; const totalHeight = container.offsetHeight;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js index 2081f99..ed7e23c 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SoftContextMenu.js
@@ -82,8 +82,9 @@ } // Re-position menu in case it does not fit. - var hostLeft = UI.Dialog.modalHostView().element.totalOffsetLeft(); - var hostRight = hostLeft + UI.Dialog.modalHostView().element.offsetWidth; + var containerElement = UI.GlassPane.container(document); + var hostLeft = containerElement.totalOffsetLeft(); + var hostRight = hostLeft + containerElement.offsetWidth; if (hostRight < this.element.offsetLeft + this.element.offsetWidth) { var left = this._parentMenu ? this._parentMenu.element.offsetLeft - this.element.offsetWidth + subMenuOverlap : hostRight - this.element.offsetWidth; @@ -92,13 +93,12 @@ // Move submenus upwards if it does not fit. if (this._parentMenu && document.body.offsetHeight < this.element.offsetTop + this.element.offsetHeight) { - y = Math.max( - UI.Dialog.modalHostView().element.totalOffsetTop(), document.body.offsetHeight - this.element.offsetHeight); + y = Math.max(containerElement.totalOffsetTop(), document.body.offsetHeight - this.element.offsetHeight); this.element.style.top = y + 'px'; } - var maxHeight = UI.Dialog.modalHostView().element.offsetHeight; - maxHeight -= y - UI.Dialog.modalHostView().element.totalOffsetTop(); + var maxHeight = containerElement.offsetHeight; + maxHeight -= y - containerElement.totalOffsetTop(); this.element.style.maxHeight = maxHeight + 'px'; this._focus();
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js index 33cd18b..9c5a8ba 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -53,97 +53,64 @@ * @param {!UI.SuggestBoxDelegate} suggestBoxDelegate * @param {number=} maxItemsHeight * @param {boolean=} captureEnter + * @suppressGlobalPropertiesCheck */ constructor(suggestBoxDelegate, maxItemsHeight, captureEnter) { this._suggestBoxDelegate = suggestBoxDelegate; this._maxItemsHeight = maxItemsHeight; - this._maybeHideBound = this._maybeHide.bind(this); - this._hideBound = this.hide.bind(this); - this._container = createElementWithClass('div', 'suggest-box-container'); + this._captureEnter = captureEnter; this._rowHeight = 17; + this._userInteracted = false; + this._userEnteredText = ''; + /** @type {?string} */ + this._onlyCompletion = null; + /** @type {!UI.ListControl<!UI.SuggestBox.Suggestion>} */ this._list = new UI.ListControl(this, UI.ListMode.EqualHeightItems); this._element = this._list.element; this._element.classList.add('suggest-box'); - this._container.appendChild(this._element); - this._element.addEventListener('mousedown', this._onBoxMouseDown.bind(this), true); - this._userInteracted = false; - this._captureEnter = captureEnter; - this._hasVerticalScroll = false; - this._userEnteredText = ''; + this._element.addEventListener('mousedown', event => event.preventDefault(), true); - /** @type {?UI.SuggestBox.Overlay} */ - this._overlay = null; - /** @type {?AnchorBox} */ - this._lastAnchorBox = null; - this._lastItemCount = 0; - this._hideTimeoutId = 0; - /** @type {?Element} */ - this._bodyElement = null; - /** @type {?string} */ - this._onlyCompletion = null; + // TODO(dgozman): take document in constructor. + this._glassPane = + new UI.GlassPane(document, false /* dimmed */, false /* blockPointerEvents */, this.hide.bind(this)); + this._glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PreferBottom); + var shadowRoot = UI.createShadowRootWithCoreStyles(this._glassPane.contentElement, 'ui/suggestBox.css'); + shadowRoot.appendChild(this._element); } /** * @return {boolean} */ visible() { - return !!this._container.parentElement; + return this._glassPane.visible(); } /** * @param {!AnchorBox} anchorBox */ setPosition(anchorBox) { - this._updateBoxPosition(anchorBox, this._list.length()); - } - - /** - * @param {!AnchorBox} anchorBox - * @param {number} length - */ - _updateBoxPosition(anchorBox, length) { - console.assert(this._overlay); - if (this._lastAnchorBox && this._lastAnchorBox.equals(anchorBox) && this._lastItemCount === length) - return; - this._lastItemCount = length; - this._lastAnchorBox = anchorBox; - - // Position relative to main DevTools element. - var container = UI.Dialog.modalHostView().element; - anchorBox = anchorBox.relativeToElement(container); - var totalHeight = container.offsetHeight; - var aboveHeight = anchorBox.y; - var underHeight = totalHeight - anchorBox.y - anchorBox.height; - - this._overlay.setLeftOffset(anchorBox.x); - - var under = underHeight >= aboveHeight; - if (under) - this._overlay.setVerticalOffset(anchorBox.y + anchorBox.height, true); - else - this._overlay.setVerticalOffset(totalHeight - anchorBox.y, false); - - var spacer = 6; - var maxHeight = Math.min( - Math.max(underHeight, aboveHeight) - spacer, - this._maxItemsHeight ? this._maxItemsHeight * this._rowHeight : Infinity); - var height = this._rowHeight * length; - this._hasVerticalScroll = height > maxHeight; - this._element.style.height = Math.min(maxHeight, height) + 'px'; + this._glassPane.setContentAnchorBox(anchorBox); } /** * @param {!UI.SuggestBox.Suggestions} items */ - _updateWidth(items) { - if (this._hasVerticalScroll) { - this._element.style.width = '100vw'; - return; - } + _updateMaxSize(items) { + var maxWidth = this._maxWidth(items); + var length = this._maxItemsHeight ? Math.min(this._maxItemsHeight, items.length) : items.length; + var maxHeight = length * this._rowHeight; + this._glassPane.setMaxContentSize(new UI.Size(maxWidth, maxHeight)); + } + + /** + * @param {!UI.SuggestBox.Suggestions} items + * @return {number} + */ + _maxWidth(items) { + var kMaxWidth = 300; if (!items.length) - return; - // If there are no scrollbars, set the width to the width of the largest row. + return kMaxWidth; var maxItem; var maxLength = -Infinity; for (var i = 0; i < items.length; i++) { @@ -153,41 +120,14 @@ maxItem = items[i]; } } - this._element.style.width = - UI.measurePreferredSize( - this.createElementForItem(/** @type {!UI.SuggestBox.Suggestion} */ (maxItem)), this._element) - .width + - 'px'; + var element = this.createElementForItem(/** @type {!UI.SuggestBox.Suggestion} */ (maxItem)); + return Math.min(kMaxWidth, UI.measurePreferredSize(element, this._element).width); } - /** - * @param {!Event} event - */ - _onBoxMouseDown(event) { - if (this._hideTimeoutId) { - window.clearTimeout(this._hideTimeoutId); - this._hideTimeoutId = 0; - } - event.preventDefault(); - } - - _maybeHide() { - if (!this._hideTimeoutId) - this._hideTimeoutId = window.setTimeout(this._hideBound, 0); - } - - /** - * // FIXME: make SuggestBox work for multiple documents. - * @suppressGlobalPropertiesCheck - */ _show() { if (this.visible()) return; - this._bodyElement = document.body; - this._bodyElement.addEventListener('mousedown', this._maybeHideBound, true); - this._element.ownerDocument.defaultView.addEventListener('resize', this._hideBound, false); - this._overlay = new UI.SuggestBox.Overlay(); - this._overlay.setContentElement(this._container); + this._glassPane.show(); this._rowHeight = UI.measurePreferredSize(this.createElementForItem({title: '1', subtitle: '12'}), this._element).height; } @@ -195,15 +135,8 @@ hide() { if (!this.visible()) return; - this._userInteracted = false; - this._bodyElement.removeEventListener('mousedown', this._maybeHideBound, true); - this._element.ownerDocument.defaultView.removeEventListener('resize', this._hideBound, false); - this._bodyElement = null; - this._container.remove(); - this._overlay.dispose(); - this._overlay = null; - this._lastAnchorBox = null; + this._glassPane.hide(); } /** @@ -349,8 +282,8 @@ this._userEnteredText = userEnteredText; this._show(); - this._updateBoxPosition(anchorBox, completions.length); - this._updateWidth(completions); + this._updateMaxSize(completions); + this._glassPane.setContentAnchorBox(anchorBox); this._list.invalidateItemHeight(); this._list.replaceAllItems(completions); @@ -431,64 +364,3 @@ * @typedef {!Array<!UI.SuggestBox.Suggestion>} */ UI.SuggestBox.Suggestions; - -UI.SuggestBox.Overlay = class { - /** - * // FIXME: make SuggestBox work for multiple documents. - * @suppressGlobalPropertiesCheck - */ - constructor() { - this.element = createElementWithClass('div', 'suggest-box-overlay'); - var root = UI.createShadowRootWithCoreStyles(this.element, 'ui/suggestBox.css'); - this._leftSpacerElement = root.createChild('div', 'suggest-box-left-spacer'); - this._horizontalElement = root.createChild('div', 'suggest-box-horizontal'); - this._topSpacerElement = this._horizontalElement.createChild('div', 'suggest-box-top-spacer'); - this._bottomSpacerElement = this._horizontalElement.createChild('div', 'suggest-box-bottom-spacer'); - this._resize(); - document.body.appendChild(this.element); - } - - /** - * @param {number} offset - */ - setLeftOffset(offset) { - this._leftSpacerElement.style.flexBasis = offset + 'px'; - } - - /** - * @param {number} offset - * @param {boolean} isTopOffset - */ - setVerticalOffset(offset, isTopOffset) { - this.element.classList.toggle('under-anchor', isTopOffset); - - if (isTopOffset) { - this._bottomSpacerElement.style.flexBasis = 'auto'; - this._topSpacerElement.style.flexBasis = offset + 'px'; - } else { - this._bottomSpacerElement.style.flexBasis = offset + 'px'; - this._topSpacerElement.style.flexBasis = 'auto'; - } - } - - /** - * @param {!Element} element - */ - setContentElement(element) { - this._horizontalElement.insertBefore(element, this._bottomSpacerElement); - } - - _resize() { - var container = UI.Dialog.modalHostView().element; - var containerBox = container.boxInWindow(container.ownerDocument.defaultView); - - this.element.style.left = containerBox.x + 'px'; - this.element.style.top = containerBox.y + 'px'; - this.element.style.height = containerBox.height + 'px'; - this.element.style.width = containerBox.width + 'px'; - } - - dispose() { - this.element.remove(); - } -};
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js index 80c23c5..121478bf 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -123,8 +123,9 @@ var document = button.element.ownerDocument; document.documentElement.addEventListener('mouseup', mouseUp, false); - var optionsGlassPane = new UI.GlassPane(document); - var optionsBar = new UI.Toolbar('fill', optionsGlassPane.element); + var optionsGlassPane = new UI.GlassPane(document, false /* dimmed */, true /* blockPointerEvents */, event => {}); + optionsGlassPane.show(); + var optionsBar = new UI.Toolbar('fill', optionsGlassPane.contentElement); optionsBar._contentElement.classList.add('floating'); const buttonHeight = 26; @@ -167,7 +168,7 @@ function mouseUp(e) { if (e.which !== 1) return; - optionsGlassPane.dispose(); + optionsGlassPane.hide(); document.documentElement.removeEventListener('mouseup', mouseUp, false); for (var i = 0; i < buttons.length; ++i) {
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js b/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js index 9b8d07d1..165d2b54 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/Tooltip.js
@@ -113,7 +113,7 @@ this._tooltipLastOpened = instant ? now : now + UI.Tooltip.Timing.OpeningDelay; // Get container element. - var container = UI.Dialog.modalHostView().element; + var container = UI.GlassPane.container(/** @type {!Document} */ (anchorElement.ownerDocument)); // Position tooltip based on the anchor element. var containerBox = container.boxInWindow(this.element.window()); var anchorBox = this._anchorElement.boxInWindow(this.element.window());
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js index 1e79d22..f999a81 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js +++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -94,8 +94,11 @@ _createGlassPane() { this._glassPaneInUse = true; - if (!UI.DragHandler._glassPaneUsageCount++) - UI.DragHandler._glassPane = new UI.GlassPane(UI.DragHandler._documentForMouseOut); + if (!UI.DragHandler._glassPaneUsageCount++) { + UI.DragHandler._glassPane = new UI.GlassPane( + UI.DragHandler._documentForMouseOut, false /* dimmed */, true /* blockPointerEvents */, event => {}); + UI.DragHandler._glassPane.show(); + } } _disposeGlassPane() { @@ -104,7 +107,7 @@ this._glassPaneInUse = false; if (--UI.DragHandler._glassPaneUsageCount) return; - UI.DragHandler._glassPane.dispose(); + UI.DragHandler._glassPane.hide(); delete UI.DragHandler._glassPane; delete UI.DragHandler._documentForMouseOut; } @@ -299,35 +302,6 @@ }; /** - * @unrestricted - */ -UI.GlassPane = class { - /** - * @param {!Document} document - * @param {boolean=} dimmed - */ - constructor(document, dimmed) { - this.element = createElement('div'); - var background = dimmed ? 'rgba(255, 255, 255, 0.5)' : 'transparent'; - this._zIndex = UI._glassPane ? UI._glassPane._zIndex + 1000 : - 3000; // Deliberately starts with 3000 to hide other z-indexed elements below. - this.element.style.cssText = 'position:absolute;top:0;bottom:0;left:0;right:0;background-color:' + background + - ';z-index:' + this._zIndex + ';overflow:hidden;'; - document.body.appendChild(this.element); - UI._glassPane = this; - // TODO(dgozman): disallow focus outside of glass pane? - } - - dispose() { - delete UI._glassPane; - this.element.remove(); - } -}; - -/** @type {!UI.GlassPane|undefined} */ -UI._glassPane; - -/** * @param {?Node=} node * @return {boolean} */ @@ -1217,6 +1191,7 @@ var body = /** @type {!Element} */ (document.body); UI.appendStyle(body, 'ui/inspectorStyle.css'); UI.appendStyle(body, 'ui/popover.css'); + UI.GlassPane.setContainer(/** @type {!Element} */ (document.body)); }; /** @@ -1531,6 +1506,12 @@ createdCallback: function() { var root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css'); this._buttonElement = root.createChild('div', 'close-button'); + var regularIcon = UI.Icon.create('smallicon-cross', 'default-icon'); + this._hoverIcon = UI.Icon.create('smallicon-red-cross-hover', 'hover-icon'); + this._activeIcon = UI.Icon.create('smallicon-red-cross-active', 'active-icon'); + this._buttonElement.appendChild(regularIcon); + this._buttonElement.appendChild(this._hoverIcon); + this._buttonElement.appendChild(this._activeIcon); }, /** @@ -1538,7 +1519,13 @@ * @this {Element} */ set gray(gray) { - this._buttonElement.className = gray ? 'close-button-gray' : 'close-button'; + if (gray) { + this._hoverIcon.setIconType('smallicon-gray-cross-hover'); + this._activeIcon.setIconType('smallicon-gray-cross-active'); + } else { + this._hoverIcon.setIconType('smallicon-red-cross-hover'); + this._activeIcon.setIconType('smallicon-red-cross-active'); + } }, __proto__: HTMLDivElement.prototype
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/checkboxTextLabel.css b/third_party/WebKit/Source/devtools/front_end/ui/checkboxTextLabel.css index 47e91dd..fe58a0a 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/checkboxTextLabel.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/checkboxTextLabel.css
@@ -47,14 +47,14 @@ } input.dt-checkbox-themed:after { - -webkit-mask-image: url(Images/toolbarButtonGlyphs.png); - -webkit-mask-size: 352px 168px; - -webkit-mask-position: -128px -110px; + -webkit-mask-image: url(Images/checkboxCheckmark.png); + -webkit-mask-size: 11px 11px; + -webkit-mask-position: 0 0; } @media (-webkit-min-device-pixel-ratio: 1.1) { input.dt-checkbox-themed:after { - -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png); + -webkit-mask-image: url(Images/checkboxCheckmark_2x.png); } } /* media */
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/closeButton.css b/third_party/WebKit/Source/devtools/front_end/ui/closeButton.css index 01e83e35..2d6d991 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/closeButton.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/closeButton.css
@@ -4,42 +4,31 @@ * found in the LICENSE file. */ -div { - background-image: url(Images/toolbarButtonGlyphs.png); - background-size: 352px 168px; -} - -@media (-webkit-min-device-pixel-ratio: 1.1) { -div { - background-image: url(Images/toolbarButtonGlyphs_2x.png); -} -} /* media */ - .close-button { width: 14px; height: 14px; - background-position: -128px -96px; cursor: default; + display: flex; + align-items: center; + justify-content: center; } -.close-button:hover { - background-position: -96px -96px; +.hover-icon, .active-icon { + display: none; } -.close-button:active { - background-position: -111px -96px; +.close-button:hover .default-icon, .close-button:active .default-icon { + display: none; } -.close-button-gray { - width: 13px; - height: 13px; - background-position: -175px -96px; +.close-button:hover .hover-icon { + display: block; } -.close-button-gray:hover { - background-position: -143px -96px; +.close-button:active .hover-icon { + display: none !important; } -.close-button-gray:active { - background-position: -160px -96px; +.close-button:active .active-icon { + display: block; }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/dialog.css b/third_party/WebKit/Source/devtools/front_end/ui/dialog.css index 7a3df44..730596e 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/dialog.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/dialog.css
@@ -5,10 +5,7 @@ */ :host { - position: absolute; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), - 0 2px 4px rgba(0, 0, 0, 0.2), - 0 2px 6px rgba(0, 0, 0, 0.1); + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1); background: white; justify-content: flex-start; align-items: stretch; @@ -22,14 +19,12 @@ } :host-context(.wraps-content) { - justify-content: center; align-items: flex-start; overflow: hidden; } :host-context(.wraps-content) .widget { flex: none !important; - justify-content: center; align-items: center; }
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css b/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css index d475f15c..e233db7 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/inspectorCommon.css
@@ -386,4 +386,17 @@ background-size: unset; background: unset; background-color: white; -} \ No newline at end of file +} + +.glass-pane { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + overflow: hidden; +} + +.glass-pane-content { + display: flex; +}
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/module.json b/third_party/WebKit/Source/devtools/front_end/ui/module.json index e94ac589..8539bb1 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/module.json +++ b/third_party/WebKit/Source/devtools/front_end/ui/module.json
@@ -29,6 +29,7 @@ "KeyboardShortcut.js", "ListControl.js", "ListWidget.js", + "GlassPane.js", "Panel.js", "Popover.js", "ProgressIndicator.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css b/third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css index c88cecfb..816bc72 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/suggestBox.css
@@ -29,41 +29,12 @@ */ :host { - position: absolute; - background-color: transparent; - z-index: 1000; - pointer-events: none; - overflow: hidden; display: flex; - flex-direction: row; -} - -.suggest-box-left-spacer { - flex: 0 1 auto; -} - -.suggest-box-horizontal { - display: flex; - flex-direction: column; - flex: 0 0 auto; - max-width: 300px; -} - -.suggest-box-top-spacer { flex: auto; } -:host(.under-anchor) .suggest-box-top-spacer, -:host(:not(.under-anchor)) .suggest-box-bottom-spacer { - flex: 0 0 auto; -} - -.suggest-box-container { - display: flex; - flex-direction: row; -} - .suggest-box { + flex: auto; background-color: #FFFFFF; pointer-events: auto; margin-left: -3px; @@ -73,16 +44,15 @@ overflow-x: hidden; } -.suggest-box .suggest-box-content-item { - padding: 1px; +.suggest-box-content-item { + padding: 1px 0 1px 1px; margin: 0; border: 1px solid transparent; - padding-right: 0; white-space: nowrap; display: flex; } -.suggest-box .suggest-box-content-item.secondary { +.suggest-box-content-item.secondary { background-color: #f9f9f9; } @@ -106,23 +76,23 @@ flex-shrink: 0; } -.suggest-box .suggest-box-content-item .query { +.suggest-box-content-item .query { font-weight: bold; } -.suggest-box .suggest-box-content-item .spacer { +.suggest-box-content-item .spacer { display: inline-block; width: 20px; } -.suggest-box .suggest-box-content-item.selected { +.suggest-box-content-item.selected { background-color: rgb(56, 121, 217); } -.suggest-box .suggest-box-content-item.selected > span { +.suggest-box-content-item.selected > span { color: #FFF; } -.suggest-box .suggest-box-content-item:hover:not(.selected) { +.suggest-box-content-item:hover:not(.selected) { background-color: rgba(56, 121, 217, 0.1); }
diff --git a/third_party/WebKit/Source/devtools/tests/TestExpectations b/third_party/WebKit/Source/devtools/tests/TestExpectations index e6b564ab..15e9798 100644 --- a/third_party/WebKit/Source/devtools/tests/TestExpectations +++ b/third_party/WebKit/Source/devtools/tests/TestExpectations
@@ -43,6 +43,9 @@ inspector/sources/debugger-async/async-await/async-pause-on-exception.html [ Skip ] inspector/sources/debugger-ui/async-call-stack-async-function.html [ Skip ] +# Skipping b/c 1.2 content shell (DevTools runtime) does not support async await +inspector/console/console-functions.html [ Skip ] + # 1.2 content shell does not support inspector-unit http/tests/inspector-unit/filtered-item-selection-dialog-filtering.js [ Skip ] http/tests/inspector-unit/list-control-equal-height.js [ Skip ]
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/command-line-api-getEventListeners-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/command-line-api-getEventListeners-expected.txt new file mode 100644 index 0000000..3498742 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/command-line-api-getEventListeners-expected.txt
@@ -0,0 +1,124 @@ +CONSOLE ERROR: line 26: Uncaught SyntaxError: Unexpected identifier +Tests getEventListeners() method of console command line API. + + +[page] - inner - +[page] keydown: { +[page] 0: { +[page] listener: function listener1() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "keydown" +[page] useCapture: false +[page] } +[page] 1: { +[page] listener: function listener2() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "keydown" +[page] useCapture: true +[page] } +[page] } +[page] wheel: { +[page] 0: { +[page] listener: function listener2() { } +[page] passive: true +[page] remove: function remove() { [Command Line API] } +[page] type: "wheel" +[page] useCapture: false +[page] } +[page] } +[page] - inner after a removal - +[page] keydown: { +[page] 0: { +[page] listener: function listener2() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "keydown" +[page] useCapture: true +[page] } +[page] } +[page] - outer - +[page] keydown: { +[page] 0: { +[page] listener: function listener2() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "keydown" +[page] useCapture: true +[page] } +[page] } +[page] keyup: { +[page] 0: { +[page] listener: function listener2() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "keyup" +[page] useCapture: false +[page] } +[page] } +[page] mousedown: { +[page] 0: { +[page] listener: function listener2() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "mousedown" +[page] useCapture: true +[page] } +[page] } +[page] mousemove: { +[page] 0: { +[page] listener: function listener1() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "mousemove" +[page] useCapture: false +[page] } +[page] } +[page] - attribute event listeners - +[page] click: { +[page] 0: { +[page] listener: function onclick(event) { alert(1) } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "click" +[page] useCapture: false +[page] } +[page] } +[page] mouseover: { +[page] 0: { +[page] listener: function onmouseover(event) { listener2() } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "mouseover" +[page] useCapture: false +[page] } +[page] } +[page] - window - +[page] load: { +[page] 0: { +[page] listener: function onload(event) { runTest() } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "load" +[page] useCapture: false +[page] } +[page] } +[page] popstate: { +[page] 0: { +[page] listener: function listener1() { } +[page] passive: false +[page] remove: function remove() { [Command Line API] } +[page] type: "popstate" +[page] useCapture: false +[page] } +[page] } +[page] - empty - +[page] - invalid - +[page] - object - +[page] object +[page] - null - +[page] object +[page] - undefined - +[page] object +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-big-array-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-big-array-expected.txt new file mode 100644 index 0000000..f5ce3e2 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-big-array-expected.txt
@@ -0,0 +1,220 @@ +CONSOLE MESSAGE: line 13: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100 +CONSOLE MESSAGE: line 18: ,,,,,,,,, +CONSOLE MESSAGE: line 24: 0,1,2,3,4,5,6,7,8,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100 +CONSOLE MESSAGE: line 29: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404 +CONSOLE MESSAGE: line 42: %O +CONSOLE MESSAGE: line 52: %O +CONSOLE MESSAGE: line 55: [object Uint8Array] +Tests that console logging dumps large arrays properly. + +console-big-array.html:13 Array[101] + [0 … 19] + 0: 0 + 1: 1 + 2: 2 + 3: 3 + 4: 4 + 5: 5 + 6: 6 + 7: 7 + 8: 8 + 9: 9 + 10: 10 + 11: 11 + 12: 12 + 13: 13 + 14: 14 + 15: 15 + 16: 16 + 17: 17 + 18: 18 + 19: 19 + [20 … 39] + 20: 20 + 21: 21 + 22: 22 + 23: 23 + 24: 24 + 25: 25 + 26: 26 + 27: 27 + 28: 28 + 29: 29 + 30: 30 + 31: 31 + 32: 32 + 33: 33 + 34: 34 + 35: 35 + 36: 36 + 37: 37 + 38: 38 + 39: 39 + [40 … 100] + 40: 40 + 41: 41 + 100: 100 + length: 101 + __proto__: Array[0] +console-big-array.html:18 Array[10] + 0: undefined + 1: undefined + 2: undefined + 3: undefined + 4: undefined + 5: undefined + 6: undefined + 7: undefined + 8: undefined + 9: undefined + length: 10 + __proto__: Array[0] +console-big-array.html:24 Array[101] + 0: 0 + 1: 1 + 2: 2 + 3: 3 + 4: 4 + 5: 5 + 6: 6 + 7: 7 + 8: 8 + 9: 9 + 100: 100 + length: 101 + __proto__: Array[0] +console-big-array.html:29 Array[405] + [0 … 399] + [0 … 19] + [20 … 39] + [40 … 59] + [60 … 79] + [80 … 99] + [100 … 119] + [120 … 139] + [140 … 159] + [160 … 179] + [180 … 199] + [200 … 219] + [220 … 239] + [240 … 259] + [260 … 279] + [280 … 299] + [300 … 319] + [320 … 339] + [340 … 359] + [360 … 379] + [380 … 399] + [400 … 404] + 400: 400 + 401: 401 + 402: 402 + 403: 403 + 404: 404 + length: 405 + __proto__: Array[0] +console-big-array.html:42 Array[124] + 0: 0 + 1: 1 + 2: 2 + 3: 3 + 4: 4 + 5: 5 + 6: 6 + 7: 7 + 8: 8 + 9: 9 + 123: 123 + -Infinity: -Infinity + 3.14: 3.14 + 4294967295: 4294967295 + 4294967296: 4294967296 + Infinity: Infinity + -123: -123 + NaN: NaN + length: 124 + __proto__: Array[0] +console-big-array.html:52 Array[4294967295] + [0 … 19] + 0: 0 + 1: 1 + 2: 2 + 3: 3 + 4: 4 + 5: 5 + 6: 6 + 7: 7 + 8: 8 + 9: 9 + 10: 10 + 11: 11 + 12: 12 + 13: 13 + 14: 14 + 15: 15 + 16: 16 + 17: 17 + 18: 18 + 19: 19 + [20 … 8388608] + 20: 20 + 32: 32 + 64: 64 + 128: 128 + 256: 256 + 512: 512 + 1024: 1024 + 2048: 2048 + 4096: 4096 + 8192: 8192 + 16384: 16384 + 32768: 32768 + 65536: 65536 + 131072: 131072 + 262144: 262144 + 524288: 524288 + 1048576: 1048576 + 2097152: 2097152 + 4194304: 4194304 + 8388608: 8388608 + [16777216 … 4294967294] + 16777216: 16777216 + 33554432: 33554432 + 67108864: 67108864 + 134217728: 134217728 + 268435456: 268435456 + 536870912: 536870912 + 1073741824: 1073741824 + 2147483648: 2147483648 + 4294967294: 4294967294 + 4294967296: 4294967296 + 8589934592: 8589934592 + length: 4294967295 + __proto__: Array[0] +console-big-array.html:55 Uint8Array[64160003] + [0 … 63999999] + [0 … 3199999] + [3200000 … 6399999] + [6400000 … 9599999] + [9600000 … 12799999] + [12800000 … 15999999] + [16000000 … 19199999] + [19200000 … 22399999] + [22400000 … 25599999] + [25600000 … 28799999] + [28800000 … 31999999] + [32000000 … 35199999] + [35200000 … 38399999] + [38400000 … 41599999] + [41600000 … 44799999] + [44800000 … 47999999] + [48000000 … 51199999] + [51200000 … 54399999] + [54400000 … 57599999] + [57600000 … 60799999] + [60800000 … 63999999] + [64000000 … 64160002] + [64000000 … 64159999] + [64160000 … 64160002] + __proto__: TypedArray +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-clear-function-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-clear-function-expected.txt new file mode 100644 index 0000000..d2bbb2c --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-clear-function-expected.txt
@@ -0,0 +1,14 @@ +CONSOLE MESSAGE: line 10: one +CONSOLE MESSAGE: line 11: two +CONSOLE MESSAGE: line 12: three +CONSOLE MESSAGE: line 19: console.clear +Tests that console is cleared via console.clear() method + +Bug 101021 +=== Before clear === +console-clear-function.html:10 one +console-clear-function.html:11 two +console-clear-function.html:12 three +=== After clear === +console-clear-function.html:19 Console was cleared +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-command-clear-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-command-clear-expected.txt new file mode 100644 index 0000000..75760b6 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-command-clear-expected.txt
@@ -0,0 +1,13 @@ +CONSOLE MESSAGE: line 9: one +CONSOLE MESSAGE: line 10: two +CONSOLE MESSAGE: line 11: three +CONSOLE MESSAGE: line 1: console.clear +Tests that console is cleared upon clear() eval in console. + +=== Before clear === +console-command-clear.html:9 one +console-command-clear.html:10 two +console-command-clear.html:11 three +=== After clear === +VM:1 Console was cleared +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-dir-es6-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-dir-es6-expected.txt new file mode 100644 index 0000000..91045d5 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-dir-es6-expected.txt
@@ -0,0 +1,147 @@ +CONSOLE MESSAGE: line 15: [object Object] +CONSOLE MESSAGE: line 18: Symbol() +CONSOLE MESSAGE: line 22: [object Map] +CONSOLE MESSAGE: line 22: [object WeakMap] +CONSOLE MESSAGE: line 26: [object Set] +CONSOLE MESSAGE: line 26: [object WeakSet] +CONSOLE MESSAGE: line 34: [object Set] +CONSOLE MESSAGE: line 37: [object WeakMap] +CONSOLE MESSAGE: line 45: [object Map Iterator] +CONSOLE MESSAGE: line 46: [object Map Iterator] +CONSOLE MESSAGE: line 47: [object Map Iterator] +CONSOLE MESSAGE: line 45: [object Set Iterator] +CONSOLE MESSAGE: line 46: [object Set Iterator] +CONSOLE MESSAGE: line 47: [object Set Iterator] +CONSOLE MESSAGE: line 85: class{method(){ return 1 }},class classWithWhitespace { method(){ return 1 } },class FooClass { + jump(x) { return 1 } + badArrow(x = a => 2) { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" } + },jump(x) { return 1 },class BarClass extends FooClass{},class BarClass2 extends class base{} {},class BarClass3 extends function base2(a, b) {} {},_ => { return 1 },(x) => { return 1 },(x, y, z) => { return 1 },({}) => { return 1 },([]) => { return 1 },() => { return "short" },() => { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" },(...x) => { return 1 },(x, y, ...z) => { return 1 },function (...x) { return 1 },function (x, y, ...z) { return 1 },function ({a}){ return 1 },function ([a]){ return 1 },function ({a, b}){ return 1 },function (...{a}){ return 1 },function (a = (1), b){ return 1 },function (a = {x: (1)}, b){ return 1 },function (a = (x) => { return 1 }, b){ return 2 },function ({a: b}){ return 1 },function (c = ")", {a: b}){ return 1 } +CONSOLE MESSAGE: line 93: badArrow(x = a => 2) { return "looooooooooooooooooooooooooooooooooooooooooooooooooooong" },function (a = ") {", b){ return 1 },function (a = function(){ return 1 }, b){ return 2 },function (a = class{ constructor(){} }){ return 2 } +Tests that console logging dumps proper messages. + +console-dir-es6.html:15 Object + a: 1 + Symbol(): 2 + Symbol(Symbol.iterator): Symbol(foo) + Symbol(a): 3 + Symbol(a): Symbol(Symbol.iterator) + __proto__: Object +console-dir-es6.html:18 Symbol() +console-dir-es6.html:22 Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-dir-es6.html:22 WeakMap + __proto__: WeakMap + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-dir-es6.html:26 Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:26 WeakSet + __proto__: WeakSet + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:34 Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: Set + length: 1 +console-dir-es6.html:37 WeakMap + __proto__: WeakMap + [[Entries]]: Array[0] + length: 0 +console-dir-es6.html:45 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "keys" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:46 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:47 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[1] + 0: Array[2] + length: 1 +console-dir-es6.html:45 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:46 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-dir-es6.html:47 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[1] + 0: Array[2] + length: 1 +console-dir-es6.html:85 Array[27] + 0: class + 1: class classWithWhitespace + 2: class FooClass + 3: function jump(x) + 4: class BarClass + 5: class BarClass2 + 6: class BarClass3 + 7: _ => { return 1 } + 8: (x) => { return 1 } + 9: (x, y, z) => { return 1 } + 10: ({}) => { return 1 } + 11: ([]) => { return 1 } + 12: () => { return "short" } + 13: () => {…} + 14: (...x) => { return 1 } + 15: (x, y, ...z) => { return 1 } + 16: function (...x) + 17: function (x, y, ...z) + 18: function ({a}) + 19: function ([a]) + 20: function ({a, b}) + 21: function (...{a}) + 22: function (a = (1), b) + 23: function (a = {x: (1)}, b) + 24: function (a = (x) => { return 1 }, b) + 25: function ({a: b}) + 26: function (c = ")", {a: b}) + length: 27 + __proto__: Array[0] +console-dir-es6.html:93 Array[4] + 0: badArrow(x = a => {…} + 1: function (a = ") + 2: function (a = function() + 3: function (a = class{ constructor() + length: 4 + __proto__: Array[0] +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-edit-property-value-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-edit-property-value-expected.txt new file mode 100644 index 0000000..73e66a1 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-edit-property-value-expected.txt
@@ -0,0 +1,14 @@ +CONSOLE MESSAGE: line 10: [object Object] +Tests that property values can be edited inline in the console via double click. + +Node was hidden after dblclick: true +Node was hidden after dblclick: true +Node was hidden after dblclick: true +logToConsole() +console-edit-property-value.html:10 Object + a: 3 + b: "foo" + c: Array[3] + __proto__: Object +undefined +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-error-on-call-frame-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-error-on-call-frame-expected.txt new file mode 100644 index 0000000..e8ba2b5 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-error-on-call-frame-expected.txt
@@ -0,0 +1,13 @@ +CONSOLE ERROR: line 1: 42 +Tests that console.error does not throw exception when executed in console on call frame. + +Set timer for test function. +Script execution paused. +Script execution resumed. +console.error(42) +VM:1 42 +(anonymous) @ VM:1 +evaluate +testFunction @ console-error-on-call-frame.html:10 +undefined +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-external-array-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-external-array-expected.txt new file mode 100644 index 0000000..aa98b649 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-external-array-expected.txt
@@ -0,0 +1,35 @@ +CONSOLE MESSAGE: line 9: [object Int8Array] +CONSOLE MESSAGE: line 10: [object Int16Array] +CONSOLE MESSAGE: line 11: [object Int32Array] +CONSOLE MESSAGE: line 12: [object Uint8Array] +CONSOLE MESSAGE: line 13: [object Uint16Array] +CONSOLE MESSAGE: line 14: [object Uint32Array] +CONSOLE MESSAGE: line 15: [object Float32Array] +CONSOLE MESSAGE: line 16: [object Float64Array] +CONSOLE MESSAGE: line 18: [object Int8Array] +CONSOLE MESSAGE: line 19: [object Int16Array] +CONSOLE MESSAGE: line 20: [object Int32Array] +CONSOLE MESSAGE: line 21: [object Uint8Array] +CONSOLE MESSAGE: line 22: [object Uint16Array] +CONSOLE MESSAGE: line 23: [object Uint32Array] +CONSOLE MESSAGE: line 24: [object Float32Array] +CONSOLE MESSAGE: line 25: [object Float64Array] +Tests that console logging detects external arrays as arrays. + +console-external-array.html:9 Int8Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:10 Int16Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:11 Int32Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:12 Uint8Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:13 Uint16Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:14 Uint32Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:15 Float32Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:16 Float64Array[10] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +console-external-array.html:18 Int8Array[10] +console-external-array.html:19 Int16Array[10] +console-external-array.html:20 Int32Array[10] +console-external-array.html:21 Uint8Array[10] +console-external-array.html:22 Uint16Array[10] +console-external-array.html:23 Uint32Array[10] +console-external-array.html:24 Float32Array[10] +console-external-array.html:25 Float64Array[10] +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-filter-level-test-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-filter-level-test-expected.txt new file mode 100644 index 0000000..6c9f40c --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-filter-level-test-expected.txt
@@ -0,0 +1,100 @@ +CONSOLE INFO: line 10: sample info +CONSOLE MESSAGE: line 11: sample log +CONSOLE WARNING: line 12: sample warning +CONSOLE DEBUG: line 13: sample debug +CONSOLE ERROR: line 14: sample error +CONSOLE INFO: line 16: abc info +CONSOLE INFO: line 17: def info +CONSOLE WARNING: line 19: abc warn +CONSOLE WARNING: line 20: def warn +Tests that console can filter messages by source. + + +Running: beforeFilter +beforeFilter +>console-filter-level-test.html:5 sample info +>console-filter-level-test.html:6 sample log +>console-filter-level-test.html:7 sample warning +onload @ console-filter-level-test.html:7 +>console-filter-level-test.html:9 sample error +onload @ console-filter-level-test.html:9 +>console-filter-level-test.html:11 abc info +>console-filter-level-test.html:12 def info +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>console-filter-level-test.html:15 def warn +onload @ console-filter-level-test.html:15 +>'Should be always visible' +>"Should be always visible" + +Running: verbose +>console-filter-level-test.html:5 sample info +>console-filter-level-test.html:6 sample log +>console-filter-level-test.html:7 sample warning +onload @ console-filter-level-test.html:7 +>console-filter-level-test.html:8 sample debug +>console-filter-level-test.html:9 sample error +onload @ console-filter-level-test.html:9 +>console-filter-level-test.html:11 abc info +>console-filter-level-test.html:12 def info +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>console-filter-level-test.html:15 def warn +onload @ console-filter-level-test.html:15 +>'Should be always visible' +>"Should be always visible" + +Running: info +>console-filter-level-test.html:5 sample info +>console-filter-level-test.html:6 sample log +>console-filter-level-test.html:7 sample warning +onload @ console-filter-level-test.html:7 +>console-filter-level-test.html:9 sample error +onload @ console-filter-level-test.html:9 +>console-filter-level-test.html:11 abc info +>console-filter-level-test.html:12 def info +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>console-filter-level-test.html:15 def warn +onload @ console-filter-level-test.html:15 +>'Should be always visible' +>"Should be always visible" + +Running: warning +>console-filter-level-test.html:7 sample warning +onload @ console-filter-level-test.html:7 +>console-filter-level-test.html:9 sample error +onload @ console-filter-level-test.html:9 +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>console-filter-level-test.html:15 def warn +onload @ console-filter-level-test.html:15 +>'Should be always visible' +>"Should be always visible" + +Running: error +>console-filter-level-test.html:9 sample error +onload @ console-filter-level-test.html:9 +>'Should be always visible' +>"Should be always visible" + +Running: abcMessagePlain +>console-filter-level-test.html:11 abc info +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>'Should be always visible' +>"Should be always visible" + +Running: abcMessageRegex +>console-filter-level-test.html:11 abc info +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>'Should be always visible' +>"Should be always visible" + +Running: abcMessageRegexWarning +>console-filter-level-test.html:14 abc warn +onload @ console-filter-level-test.html:14 +>'Should be always visible' +>"Should be always visible" +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-collections-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-collections-expected.txt new file mode 100644 index 0000000..49e7b737 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-collections-expected.txt
@@ -0,0 +1,75 @@ +CONSOLE MESSAGE: line 15: [object HTMLCollection] +CONSOLE MESSAGE: line 19: [object HTMLCollection] +CONSOLE MESSAGE: line 23: [object HTMLOptionsCollection] +CONSOLE MESSAGE: line 27: [object HTMLAllCollection] +CONSOLE MESSAGE: line 31: [object HTMLFormControlsCollection] +CONSOLE MESSAGE: line 35: [object RadioNodeList] +CONSOLE MESSAGE: line 41: 1,2, +CONSOLE MESSAGE: line 44: [object Object] +CONSOLE MESSAGE: line 51: [object Arguments] +CONSOLE MESSAGE: line 55: [object DOMTokenList] +CONSOLE MESSAGE: line 58: [object Object] +CONSOLE MESSAGE: line 59: [object Object] +CONSOLE MESSAGE: line 61: [object Object] +CONSOLE MESSAGE: line 62: [object Object] +CONSOLE MESSAGE: line 63: [object Object] +CONSOLE MESSAGE: line 64: [object Object] +CONSOLE MESSAGE: line 65: [object Object] +CONSOLE MESSAGE: line 66: [object Object] +CONSOLE MESSAGE: line 15: [object HTMLCollection] +CONSOLE MESSAGE: line 19: [object HTMLCollection] +CONSOLE MESSAGE: line 23: [object HTMLOptionsCollection] +CONSOLE MESSAGE: line 27: [object HTMLAllCollection] +CONSOLE MESSAGE: line 31: [object HTMLFormControlsCollection] +CONSOLE MESSAGE: line 35: [object RadioNodeList] +CONSOLE MESSAGE: line 41: 1,2, +CONSOLE MESSAGE: line 44: [object Object] +CONSOLE MESSAGE: line 51: [object Arguments] +CONSOLE MESSAGE: line 55: [object DOMTokenList] +CONSOLE MESSAGE: line 58: [object Object] +CONSOLE MESSAGE: line 59: [object Object] +CONSOLE MESSAGE: line 61: [object Object] +CONSOLE MESSAGE: line 62: [object Object] +CONSOLE MESSAGE: line 63: [object Object] +CONSOLE MESSAGE: line 64: [object Object] +CONSOLE MESSAGE: line 65: [object Object] +CONSOLE MESSAGE: line 66: [object Object] +Tests that console nicely formats HTML Collections, NodeLists and DOMTokenLists. + +console-format-collections.html:15 HTMLCollection[1] +console-format-collections.html:19 HTMLCollection[3] +console-format-collections.html:23 HTMLOptionsCollection[2] +console-format-collections.html:27 HTMLAllCollection[14] +console-format-collections.html:31 HTMLFormControlsCollection[3] +console-format-collections.html:35 RadioNodeList[2] +console-format-collections.html:41 Array[2] +console-format-collections.html:44 NonArrayWithLength +console-format-collections.html:51 Arguments[2] +console-format-collections.html:55 DOMTokenList[3] +console-format-collections.html:58 ArrayLike[5] +console-format-collections.html:59 ArrayLike[4294967295] +console-format-collections.html:61 ArrayLike +console-format-collections.html:62 ArrayLike +console-format-collections.html:63 ArrayLike +console-format-collections.html:64 ArrayLike +console-format-collections.html:65 ArrayLike +console-format-collections.html:66 ArrayLike +console-format-collections.html:15 [select#sel, sel: select#sel] +console-format-collections.html:19 [script, script, script] +console-format-collections.html:23 [option, option, selectedIndex: 0] +console-format-collections.html:27 [html, head, script, script, script, body, p, div.c1.c2.c3, form#f, select#sel, option, option, input, input, f: form#f, sel: select#sel, x: NodeList[2]] +console-format-collections.html:31 [select#sel, input, input, sel: select#sel, x: RadioNodeList[2]] +console-format-collections.html:35 [input, input, value: ""] +console-format-collections.html:41 [1, Array[2]] +console-format-collections.html:44 NonArrayWithLength {keys: Array[0]} +console-format-collections.html:51 [1, "2"] +console-format-collections.html:55 ["c1", "c2", "c3", value: "c1 c2 c3"] +console-format-collections.html:58 [undefined × 5] +console-format-collections.html:59 [undefined × 4294967295] +console-format-collections.html:61 ArrayLike {length: -5} +console-format-collections.html:62 ArrayLike {length: 5.6} +console-format-collections.html:63 ArrayLike {length: NaN} +console-format-collections.html:64 ArrayLike {length: Infinity} +console-format-collections.html:65 ArrayLike {length: -0} +console-format-collections.html:66 ArrayLike {length: 4294967296} +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-2-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-2-expected.txt new file mode 100644 index 0000000..50e2f18 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-2-expected.txt
@@ -0,0 +1,232 @@ +CONSOLE MESSAGE: line 11: [object Map Iterator] +CONSOLE MESSAGE: line 12: [object Map Iterator] +CONSOLE MESSAGE: line 11: [object Map Iterator] +CONSOLE MESSAGE: line 12: [object Map Iterator] +CONSOLE MESSAGE: line 11: [object Map Iterator] +CONSOLE MESSAGE: line 12: [object Map Iterator] +CONSOLE MESSAGE: line 11: [object Set Iterator] +CONSOLE MESSAGE: line 12: [object Set Iterator] +CONSOLE MESSAGE: line 11: [object Set Iterator] +CONSOLE MESSAGE: line 12: [object Set Iterator] +CONSOLE MESSAGE: line 11: [object Set Iterator] +CONSOLE MESSAGE: line 12: [object Set Iterator] +CONSOLE MESSAGE: line 11: [object Map Iterator] +CONSOLE MESSAGE: line 12: [object Map Iterator] +CONSOLE MESSAGE: line 11: [object Set Iterator] +CONSOLE MESSAGE: line 12: [object Set Iterator] +Tests that console properly displays information about ES6 features. + +console-format-es6-2.html:11 MapIterator {41, Object {foo: 1}} +console-format-es6-2.html:12 [MapIterator] +globals[0] +MapIterator {41, Object {foo: 1}} +console-format-es6-2.html:11 MapIterator {42, Object {foo: 2}} +console-format-es6-2.html:12 [MapIterator] +globals[1] +MapIterator {42, Object {foo: 2}} +console-format-es6-2.html:11 MapIterator {[41, 42], [Object, Object]} +console-format-es6-2.html:12 [MapIterator] +globals[2] +MapIterator {[41, 42], [Object, Object]} +console-format-es6-2.html:11 SetIterator {41, Object {foo: 1}} +console-format-es6-2.html:12 [SetIterator] +globals[3] +SetIterator {41, Object {foo: 1}} +console-format-es6-2.html:11 SetIterator {41, Object {foo: 1}} +console-format-es6-2.html:12 [SetIterator] +globals[4] +SetIterator {41, Object {foo: 1}} +console-format-es6-2.html:11 SetIterator {[41, 41], [Object, Object]} +console-format-es6-2.html:12 [SetIterator] +globals[5] +SetIterator {[41, 41], [Object, Object]} +console-format-es6-2.html:11 MapIterator {Object {foo: 2}} +console-format-es6-2.html:12 [MapIterator] +globals[6] +MapIterator {Object {foo: 2}} +console-format-es6-2.html:11 SetIterator {Object {foo: 1}} +console-format-es6-2.html:12 [SetIterator] +globals[7] +SetIterator {Object {foo: 1}} +Expanded all messages +console-format-es6-2.html:11 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "keys" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:12 Array[1] + 0: MapIterator + length: 1 + __proto__: Array[0] +globals[0] +MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "keys" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:11 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 42 + 1: Object + length: 2 +console-format-es6-2.html:12 Array[1] + 0: MapIterator + length: 1 + __proto__: Array[0] +globals[1] +MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 42 + 1: Object + length: 2 +console-format-es6-2.html:11 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[2] + 0: Array[2] + 1: Array[2] + length: 2 +console-format-es6-2.html:12 Array[1] + 0: MapIterator + length: 1 + __proto__: Array[0] +globals[2] +MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[2] + 0: Array[2] + 1: Array[2] + length: 2 +console-format-es6-2.html:11 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:12 Array[1] + 0: SetIterator + length: 1 + __proto__: Array[0] +globals[3] +SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:11 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:12 Array[1] + 0: SetIterator + length: 1 + __proto__: Array[0] +globals[4] +SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" + [[Entries]]: Array[2] + 0: 41 + 1: Object + length: 2 +console-format-es6-2.html:11 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[2] + 0: Array[2] + 1: Array[2] + length: 2 +console-format-es6-2.html:12 Array[1] + 0: SetIterator + length: 1 + __proto__: Array[0] +globals[5] +SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "entries" + [[Entries]]: Array[2] + 0: Array[2] + 1: Array[2] + length: 2 +console-format-es6-2.html:11 MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 1 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6-2.html:12 Array[1] + 0: MapIterator + length: 1 + __proto__: Array[0] +globals[6] +MapIterator + __proto__: Map Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 1 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6-2.html:11 SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 1 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6-2.html:12 Array[1] + 0: SetIterator + length: 1 + __proto__: Array[0] +globals[7] +SetIterator + __proto__: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 1 + [[IteratorKind]]: "values" + [[Entries]]: Array[1] + 0: Object + length: 1 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-expected.txt new file mode 100644 index 0000000..dbbb33e --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-es6-expected.txt
@@ -0,0 +1,285 @@ +CONSOLE MESSAGE: line 11: [object Promise] +CONSOLE MESSAGE: line 12: [object Promise] +CONSOLE MESSAGE: line 11: Symbol() +CONSOLE MESSAGE: line 12: Symbol() +CONSOLE MESSAGE: line 11: Symbol(a) +CONSOLE MESSAGE: line 12: Symbol(a) +CONSOLE MESSAGE: line 11: [object Object] +CONSOLE MESSAGE: line 12: [object Object] +CONSOLE MESSAGE: line 11: [object Map] +CONSOLE MESSAGE: line 12: [object Map] +CONSOLE MESSAGE: line 11: [object WeakMap] +CONSOLE MESSAGE: line 12: [object WeakMap] +CONSOLE MESSAGE: line 11: [object Set] +CONSOLE MESSAGE: line 12: [object Set] +CONSOLE MESSAGE: line 11: [object WeakSet] +CONSOLE MESSAGE: line 12: [object WeakSet] +CONSOLE MESSAGE: line 11: [object Map] +CONSOLE MESSAGE: line 12: [object Map] +CONSOLE MESSAGE: line 11: [object Map] +CONSOLE MESSAGE: line 12: [object Map] +CONSOLE MESSAGE: line 11: [object Set] +CONSOLE MESSAGE: line 12: [object Set] +CONSOLE MESSAGE: line 11: [object Set] +CONSOLE MESSAGE: line 12: [object Set] +CONSOLE MESSAGE: line 11: [object Map] +CONSOLE MESSAGE: line 12: [object Map] +Tests that console properly displays information about ES6 features. + +console-format-es6.html:11 Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0} +console-format-es6.html:12 [Promise] +globals[0] +Promise {[[PromiseStatus]]: "rejected", [[PromiseValue]]: -0} +console-format-es6.html:11 Symbol() +console-format-es6.html:12 [Symbol()] +globals[1] +Symbol() +console-format-es6.html:11 Symbol(a) +console-format-es6.html:12 [Symbol(a)] +globals[2] +Symbol(a) +console-format-es6.html:11 Object {a: Symbol(), Symbol(a): 2} +console-format-es6.html:12 [Object] +globals[3] +Object {a: Symbol(), Symbol(a): 2} +console-format-es6.html:11 Map {Object {a: Symbol(), Symbol(a): 2} => Object {foo: 1}} +console-format-es6.html:12 [Map] +globals[4] +Map {Object {a: Symbol(), Symbol(a): 2} => Object {foo: 1}} +console-format-es6.html:11 WeakMap {Object {a: Symbol(), Symbol(a): 2} => Object {foo: 1}} +console-format-es6.html:12 [WeakMap] +globals[5] +WeakMap {Object {a: Symbol(), Symbol(a): 2} => Object {foo: 1}} +console-format-es6.html:11 Set {Object {a: Symbol(), Symbol(a): 2}} +console-format-es6.html:12 [Set] +globals[6] +Set {Object {a: Symbol(), Symbol(a): 2}} +console-format-es6.html:11 WeakSet {Object {a: Symbol(), Symbol(a): 2}} +console-format-es6.html:12 [WeakSet] +globals[7] +WeakSet {Object {a: Symbol(), Symbol(a): 2}} +console-format-es6.html:11 Map {Map {} => WeakMap {}} +console-format-es6.html:12 [Map] +globals[8] +Map {Map {} => WeakMap {}} +console-format-es6.html:11 Map {Map {…} => WeakMap {…}} +console-format-es6.html:12 [Map] +globals[9] +Map {Map {…} => WeakMap {…}} +console-format-es6.html:11 Set {WeakSet {}} +console-format-es6.html:12 [Set] +globals[10] +Set {WeakSet {}} +console-format-es6.html:11 Set {WeakSet {…}} +console-format-es6.html:12 [Set] +globals[11] +Set {WeakSet {…}} +console-format-es6.html:11 Map {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}…} +console-format-es6.html:12 [Map] +globals[12] +Map {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}…} +Expanded all messages +console-format-es6.html:11 Promise + __proto__: Promise + [[PromiseStatus]]: "rejected" + [[PromiseValue]]: -0 +console-format-es6.html:12 Array[1] + 0: Promise + length: 1 + __proto__: Array[0] +globals[0] +Promise + __proto__: Promise + [[PromiseStatus]]: "rejected" + [[PromiseValue]]: -0 +console-format-es6.html:11 Symbol() +console-format-es6.html:12 Array[1] + 0: Symbol() + length: 1 + __proto__: Array[0] +globals[1] +Symbol() +console-format-es6.html:11 Symbol(a) +console-format-es6.html:12 Array[1] + 0: Symbol(a) + length: 1 + __proto__: Array[0] +globals[2] +Symbol(a) +console-format-es6.html:11 Object + a: Symbol() + getter: (...) + Symbol(a): 2 + get getter: function getter() + __proto__: Object +console-format-es6.html:12 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[3] +Object + a: Symbol() + getter: (...) + Symbol(a): 2 + get getter: function getter() + __proto__: Object +console-format-es6.html:11 Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-format-es6.html:12 Array[1] + 0: Map + length: 1 + __proto__: Array[0] +globals[4] +Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-format-es6.html:11 WeakMap + __proto__: WeakMap + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-format-es6.html:12 Array[1] + 0: WeakMap + length: 1 + __proto__: Array[0] +globals[5] +WeakMap + __proto__: WeakMap + [[Entries]]: Array[1] + 0: {Object => Object} + length: 1 +console-format-es6.html:11 Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6.html:12 Array[1] + 0: Set + length: 1 + __proto__: Array[0] +globals[6] +Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6.html:11 WeakSet + __proto__: WeakSet + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6.html:12 Array[1] + 0: WeakSet + length: 1 + __proto__: Array[0] +globals[7] +WeakSet + __proto__: WeakSet + [[Entries]]: Array[1] + 0: Object + length: 1 +console-format-es6.html:11 Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Map => WeakMap} + length: 1 +console-format-es6.html:12 Array[1] + 0: Map + length: 1 + __proto__: Array[0] +globals[8] +Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Map => WeakMap} + length: 1 +console-format-es6.html:11 Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Map => WeakMap} + length: 1 +console-format-es6.html:12 Array[1] + 0: Map + length: 1 + __proto__: Array[0] +globals[9] +Map + size: (...) + __proto__: Map + [[Entries]]: Array[1] + 0: {Map => WeakMap} + length: 1 +console-format-es6.html:11 Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: WeakSet + length: 1 +console-format-es6.html:12 Array[1] + 0: Set + length: 1 + __proto__: Array[0] +globals[10] +Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: WeakSet + length: 1 +console-format-es6.html:11 Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: WeakSet + length: 1 +console-format-es6.html:12 Array[1] + 0: Set + length: 1 + __proto__: Array[0] +globals[11] +Set + size: (...) + __proto__: Set + [[Entries]]: Array[1] + 0: WeakSet + length: 1 +console-format-es6.html:11 Map + size: (...) + __proto__: Map + [[Entries]]: Array[6] + 0: {" from str " => " to str "} + 1: {undefined => undefined} + 2: {null => null} + 3: {42 => 42} + 4: {Object => Object} + 5: {Array[1] => Array[1]} + length: 6 +console-format-es6.html:12 Array[1] + 0: Map + length: 1 + __proto__: Array[0] +globals[12] +Map + size: (...) + __proto__: Map + [[Entries]]: Array[6] + 0: {" from str " => " to str "} + 1: {undefined => undefined} + 2: {null => null} + 3: {42 => 42} + 4: {Object => Object} + 5: {Array[1] => Array[1]} + length: 6 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-expected.txt new file mode 100644 index 0000000..efbc763 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-expected.txt
@@ -0,0 +1,812 @@ +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 +CONSOLE MESSAGE: line 13: 42 +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 function () { return 1; } +console-format.html:8 [function] +globals[8] +function () { return 1; } +console-format.html:7 function () { + return 2; + } +console-format.html:8 [function] +globals[9] +function () { + 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 Object {} +console-format.html:8 [Object] +globals[17] +Object {} +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 ["test", "test2", undefined × 2, "test4", undefined × 5, foo: Object] +console-format.html:8 [Array[10]] +globals[21] +["test", "test2", undefined × 2, "test4", undefined × 5, foo: Object] +console-format.html:7 Object {} +console-format.html:8 [Object] +globals[22] +Object {} +console-format.html:7 [function] +console-format.html:8 [Array[1]] +globals[23] +[function] +console-format.html:7 Object {bar: "bar"} +console-format.html:8 [Object] +globals[24] +Object {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 Object {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3} +console-format.html:8 [Object] +globals[26] +Object {enumerableProp: 4, __underscoreEnumerableProp__: 5, __underscoreNonEnumerableProp: 2, abc: 3} +console-format.html:7 -0 +console-format.html:8 [-0] +globals[27] +-0 +console-format.html:7 Object {} +console-format.html:8 [Object] +globals[28] +Object {} +console-format.html:7 function Object() { [native code] } +console-format.html:8 [function] +globals[29] +function Object() { [native code] } +console-format.html:7 Object {} +console-format.html:8 [Object] +globals[30] +Object {} +console-format.html:7 function ( /**/ foo/**/, /*/**/bar, + /**/baz) {} +console-format.html:8 [function] +globals[31] +function ( /**/ 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 {0: "a", 1: "b", 2: "c", length: 3, [[PrimitiveValue]]: "abc"} +console-format.html:8 [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]] +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[1] [3] +console-format.html:8 [Uint8Array[1]] +globals[37] +Uint8Array[1] [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 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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] +[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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: Object + length: 10 + __proto__: Array[0] +console-format.html:23 Array[10] + 0: "test" + 1: "test2" + 4: "test4" + foo: Object + length: 10 + __proto__: Array[0] +console-format.html:24 Array[10] + 0: "test" + 1: "test2" + 4: "test4" + foo: Object + 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 Array[1] + 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 Array[1] + 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 Array[1] + 0: "test" + length: 1 + __proto__: Array[0] +globals[2] +"test" +console-format.html:7 test named "test" +console-format.html:8 Array[1] + 0: "test named "test"" + length: 1 + __proto__: Array[0] +globals[3] +"test named "test"" +console-format.html:7 Error +console-format.html:8 Array[1] + 0: Error + length: 1 + __proto__: Array[0] +globals[4] +Error +console-format.html:7 Error: my error message +console-format.html:8 Array[1] + 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 Array[1] + 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 Array[1] + 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 function () { return 1; } +console-format.html:8 Array[1] + 0: function () + length: 1 + __proto__: Array[0] +globals[8] +function () { return 1; } +console-format.html:7 function () { + return 2; + } +console-format.html:8 Array[1] + 0: function () + length: 1 + __proto__: Array[0] +globals[9] +function () { + return 2; + } +console-format.html:7 0.12 +console-format.html:8 Array[1] + 0: 0.12 + length: 1 + __proto__: Array[0] +globals[10] +0.12 +console-format.html:7 http://webkit.org/ +console-format.html:8 Array[1] + 0: "http://webkit.org/" + length: 1 + __proto__: Array[0] +globals[11] +"http://webkit.org/" +console-format.html:7 null +console-format.html:8 Array[1] + 0: null + length: 1 + __proto__: Array[0] +globals[12] +null +console-format.html:7 undefined +console-format.html:8 Array[1] + 0: undefined + length: 1 + __proto__: Array[0] +globals[13] +undefined +console-format.html:7 + attr="" +console-format.html:8 Array[1] + 0: attr + length: 1 + __proto__: Array[0] +globals[14] + attr="" +console-format.html:7 + attr="value" +console-format.html:8 Array[1] + 0: attr + length: 1 + __proto__: Array[0] +globals[15] + attr="value" +console-format.html:7 + id="x" +console-format.html:8 Array[1] + 0: id + length: 1 + __proto__: Array[0] +globals[16] + id="x" +console-format.html:7 Object + length: (...) + get length: function length() + __proto__: Object +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[17] +Object + length: (...) + get length: function length() + __proto__: Object +console-format.html:7 NaN +console-format.html:8 Array[1] + 0: NaN + length: 1 + __proto__: Array[0] +globals[18] +NaN +console-format.html:7 Infinity +console-format.html:8 Array[1] + 0: Infinity + length: 1 + __proto__: Array[0] +globals[19] +Infinity +console-format.html:7 -Infinity +console-format.html:8 Array[1] + 0: -Infinity + length: 1 + __proto__: Array[0] +globals[20] +-Infinity +console-format.html:7 Array[10] + 0: "test" + 1: "test2" + 4: "test4" + foo: Object + length: 10 + __proto__: Array[0] +console-format.html:8 Array[1] + 0: Array[10] + length: 1 + __proto__: Array[0] +globals[21] +Array[10] + 0: "test" + 1: "test2" + 4: "test4" + foo: Object + length: 10 + __proto__: Array[0] +console-format.html:7 Object + __proto__: Object +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[22] +Object + __proto__: Object +console-format.html:7 Array[1] + 0: function () + length: 1 + __proto__: Array[0] +console-format.html:8 Array[1] + 0: Array[1] + length: 1 + __proto__: Array[0] +globals[23] +Array[1] + 0: function () + length: 1 + __proto__: Array[0] +console-format.html:7 Object + bar: "bar" + __proto__: Object +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[24] +Object + bar: "bar" + __proto__: Object +console-format.html:7 + <svg id="svg-node"></svg> +console-format.html:8 Array[1] + 0: svg#svg-node + length: 1 + __proto__: Array[0] +globals[25] + <svg id="svg-node"></svg> +console-format.html:7 Object + enumerableProp: 4 + __underscoreEnumerableProp__: 5 + abc: 3 + bar: (...) + getFoo: function () + __underscoreNonEnumerableProp: 2 + get bar: function () + set bar: function (x) + __proto__: Object +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[26] +Object + enumerableProp: 4 + __underscoreEnumerableProp__: 5 + abc: 3 + bar: (...) + getFoo: function () + __underscoreNonEnumerableProp: 2 + get bar: function () + set bar: function (x) + __proto__: Object +console-format.html:7 -0 +console-format.html:8 Array[1] + 0: -0 + length: 1 + __proto__: Array[0] +globals[27] +-0 +console-format.html:7 Object + No Properties +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[28] +Object + No Properties +console-format.html:7 function Object() { [native code] } +console-format.html:8 Array[1] + 0: function Object() + length: 1 + __proto__: Array[0] +globals[29] +function Object() { [native code] } +console-format.html:7 Object + constructor: function Object() + hasOwnProperty: function hasOwnProperty() + isPrototypeOf: function isPrototypeOf() + propertyIsEnumerable: function propertyIsEnumerable() + toLocaleString: function toLocaleString() + toString: function toString() + valueOf: function valueOf() + __defineGetter__: function __defineGetter__() + __defineSetter__: function __defineSetter__() + __lookupGetter__: function __lookupGetter__() + __lookupSetter__: function __lookupSetter__() + get __proto__: function __proto__() + set __proto__: function __proto__() +console-format.html:8 Array[1] + 0: Object + length: 1 + __proto__: Array[0] +globals[30] +Object + constructor: function Object() + hasOwnProperty: function hasOwnProperty() + isPrototypeOf: function isPrototypeOf() + propertyIsEnumerable: function propertyIsEnumerable() + toLocaleString: function toLocaleString() + toString: function toString() + valueOf: function valueOf() + __defineGetter__: function __defineGetter__() + __defineSetter__: function __defineSetter__() + __lookupGetter__: function __lookupGetter__() + __lookupSetter__: function __lookupSetter__() + get __proto__: function __proto__() + set __proto__: function __proto__() +console-format.html:7 function ( /**/ foo/**/, /*/**/bar, + /**/baz) {} +console-format.html:8 Array[1] + 0: function ( /**/ foo/**/, /*/**/bar, /**/baz) + length: 1 + __proto__: Array[0] +globals[31] +function ( /**/ foo/**/, /*/**/bar, + /**/baz) {} +console-format.html:7 Number + __proto__: Number + [[PrimitiveValue]]: 42 +console-format.html:8 Array[1] + 0: Number + length: 1 + __proto__: Array[0] +globals[32] +Number + __proto__: Number + [[PrimitiveValue]]: 42 +console-format.html:7 String + 0: "a" + 1: "b" + 2: "c" + length: 3 + __proto__: String + [[PrimitiveValue]]: "abc" +console-format.html:8 Array[1] + 0: String + length: 1 + __proto__: Array[0] +globals[33] +String + 0: "a" + 1: "b" + 2: "c" + length: 3 + __proto__: String + [[PrimitiveValue]]: "abc" +console-format.html:7 Uint16Array[3] + 0: 1 + 1: 2 + 2: 3 + buffer: (...) + byteLength: (...) + byteOffset: (...) + length: (...) + Symbol(Symbol.toStringTag): (...) + __proto__: TypedArray +console-format.html:8 Array[1] + 0: Uint16Array[3] + length: 1 + __proto__: Array[0] +globals[34] +Uint16Array[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 Array[1] + 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 Array[1] + 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[1] + 0: 3 + buffer: (...) + byteLength: (...) + byteOffset: (...) + length: (...) + Symbol(Symbol.toStringTag): (...) + __proto__: TypedArray +console-format.html:8 Array[1] + 0: Uint8Array[1] + length: 1 + __proto__: Array[0] +globals[37] +Uint8Array[1] + 0: 3 + buffer: (...) + byteLength: (...) + byteOffset: (...) + length: (...) + Symbol(Symbol.toStringTag): (...) + __proto__: TypedArray +console-format.html:7 Uint8Array[400] + [0 … 99] + [100 … 199] + [200 … 299] + [300 … 399] + foo: "bar" + __proto__: TypedArray +console-format.html:8 Array[1] + 0: Uint8Array[400] + length: 1 + __proto__: Array[0] +globals[38] +Uint8Array[400] + [0 … 99] + [100 … 199] + [200 … 299] + [300 … 399] + foo: "bar" + __proto__: TypedArray +console-format.html:7 Uint8Array[400000000] + [0 … 99999999] + [100000000 … 199999999] + [200000000 … 299999999] + [300000000 … 399999999] + __proto__: TypedArray +console-format.html:8 Array[1] + 0: Uint8Array[400000000] + length: 1 + __proto__: Array[0] +globals[39] +Uint8Array[400000000] + [0 … 99999999] + [100000000 … 199999999] + [200000000 … 299999999] + [300000000 … 399999999] + __proto__: TypedArray +console-format.html:7 namespace.longSubNamespace.x.className + __proto__: Object +console-format.html:8 Array[1] + 0: namespace.longSubNamespace.x.className + length: 1 + __proto__: Array[0] +globals[40] +namespace.longSubNamespace.x.className + __proto__: Object +console-format.html:7 Array[200] + [0 … 99] + [100 … 199] + length: 200 + __proto__: Array[0] +console-format.html:8 Array[1] + 0: Array[200] + length: 1 + __proto__: Array[0] +globals[41] +Array[200] + [0 … 99] + [100 … 199] + length: 200 + __proto__: Array[0] +console-format.html:7 Array[1] + 0: "test" + length: 1 + __proto__: Array[0] +console-format.html:8 Array[1] + 0: Array[1] + length: 1 + __proto__: Array[0] +globals[42] +Array[1] + 0: "test" + length: 1 + __proto__: Array[0] +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-style-whitelist-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-style-whitelist-expected.txt new file mode 100644 index 0000000..399d737d --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-format-style-whitelist-expected.txt
@@ -0,0 +1,21 @@ +CONSOLE MESSAGE: line 8: %cColors are awesome. +CONSOLE MESSAGE: line 9: %cSo are fonts! +CONSOLE MESSAGE: line 10: %cAnd borders and margins and paddings! +CONSOLE MESSAGE: line 11: %ctext-* is fine by us! +CONSOLE MESSAGE: line 13: %cDisplay, on the other hand, is bad news. +CONSOLE MESSAGE: line 14: %cAnd position too. +Tests that console logging dumps properly styled messages, and that the whole message gets the same style, regardless of multiple %c settings. + +console-format-style-whitelist.html:4 Colors are awesome. +Styled text #0: color: blue; +console-format-style-whitelist.html:5 So are fonts! +Styled text #0: font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: 1em; line-height: normal; font-family: Helvetica; +console-format-style-whitelist.html:6 And borders and margins and paddings! +Styled text #0: border: 1px solid red; margin: 20px; padding: 10px; +console-format-style-whitelist.html:7 text-* is fine by us! +Styled text #0: text-decoration-line: none; text-decoration-style: initial; text-decoration-color: initial; +console-format-style-whitelist.html:9 Display, on the other hand, is bad news. +Styled text #0: NO STYLES DEFINED +console-format-style-whitelist.html:10 And position too. +Styled text #0: NO STYLES DEFINED +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-before-inspector-open-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-before-inspector-open-expected.txt new file mode 100644 index 0000000..49435e07 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-before-inspector-open-expected.txt
@@ -0,0 +1,13 @@ +CONSOLE MESSAGE: line 7: log +CONSOLE INFO: line 8: info +CONSOLE WARNING: line 9: warn +CONSOLE ERROR: line 10: error +Tests that Web Inspector won't crash if some console have been logged by the time it's opening. + +console-log-before-inspector-open.html:7 log +console-log-before-inspector-open.html:8 info +console-log-before-inspector-open.html:9 warn +(anonymous) @ console-log-before-inspector-open.html:9 +console-log-before-inspector-open.html:10 error +(anonymous) @ console-log-before-inspector-open.html:10 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-object-with-getter-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-object-with-getter-expected.txt new file mode 100644 index 0000000..e5bc3b6 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-object-with-getter-expected.txt
@@ -0,0 +1,12 @@ +CONSOLE MESSAGE: line 25: [object Object] +CONSOLE MESSAGE: line 26: 1, +CONSOLE MESSAGE: line 27: [object Object] +Tests that console logging dumps object values defined by getters and allows to expand it. + +console-log-object-with-getter.html:25 Object {} +console-log-object-with-getter.html:26 [undefined × 2] +console-log-object-with-getter.html:27 Object {} +console-log-object-with-getter.html:25 Objectfoo: Objecta: 1b: 2__proto__: Objectget foo: function ()set bar: function (x)__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > parent expanded > name > object-properties-section-separator > object-value-object value > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-log-object-with-getter.html:26 Array[2]0: 1length: 2get 0: function ()set 1: function (x)__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-log-object-with-getter.html:27 Objecterror: [Exception: Error: myError]function: [Exception: function ()]number: [Exception: 123]string: [Exception: "myString"]get error: function error()get function: function function()get number: function number()get string: function string()__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > name > object-properties-section-separator > error value > object-value-error > children > name > object-properties-section-separator > error value > object-value-function > object-value-function-prefix > children > name > object-properties-section-separator > error value > object-value-number > children > name > object-properties-section-separator > error value > object-value-string > object-value-string-quote > object-value-string-quote > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-function value > object-value-function-prefix > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-side-effects-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-side-effects-expected.txt new file mode 100644 index 0000000..2590455 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-side-effects-expected.txt
@@ -0,0 +1,33 @@ +CONSOLE MESSAGE: line 17: string +CONSOLE MESSAGE: line 18: 42 +CONSOLE MESSAGE: line 19: false +CONSOLE MESSAGE: line 20: undefined +CONSOLE MESSAGE: line 21: null +CONSOLE MESSAGE: line 22: NaN +CONSOLE MESSAGE: line 23: -Infinity +CONSOLE MESSAGE: line 24: 0 +CONSOLE MESSAGE: line 25: 42 +CONSOLE MESSAGE: line 26: -4.242e-11 +CONSOLE MESSAGE: line 27: true +CONSOLE MESSAGE: line 28: foo +CONSOLE MESSAGE: line 29: [object Object] +CONSOLE MESSAGE: line 30: [object Window] +CONSOLE MESSAGE: line 36: [object HTMLParagraphElement] +CONSOLE MESSAGE: line 40: [object Object] +CONSOLE MESSAGE: line 41: 1,2,3 +CONSOLE MESSAGE: line 43: [object Uint32Array] +CONSOLE MESSAGE: line 46: 1,2,3,[object Object] +CONSOLE MESSAGE: line 49: [object Object] +CONSOLE MESSAGE: line 52: 1,2,3,[object Object],[object Object] +CONSOLE MESSAGE: line 61: 1,2,3,4,5,,,,,,NaN,,,,,,,NaN,1,2,3,4,5,, +CONSOLE MESSAGE: line 65: [object Object] +CONSOLE MESSAGE: line 68: 1,2,3,[object Object],[object Object],[object Object] +CONSOLE MESSAGE: line 74: +CONSOLE MESSAGE: line 74: +CONSOLE MESSAGE: line 74: +CONSOLE MESSAGE: line 74: +CONSOLE MESSAGE: line 74: +CONSOLE MESSAGE: line 77: +CONSOLE MESSAGE: line 84: +CONSOLE MESSAGE: line 90: +Tests various extreme usages of console.log()
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-without-console-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-without-console-expected.txt new file mode 100644 index 0000000..55d62dc --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-log-without-console-expected.txt
@@ -0,0 +1,13 @@ +CONSOLE MESSAGE: line 7: 1 +CONSOLE INFO: line 9: 2 +CONSOLE ERROR: line 11: 3 +CONSOLE WARNING: line 13: 4 +Test that console.log can be called without console receiver. + +console-log-without-console.html:7 1 +console-log-without-console.html:9 2 +console-log-without-console.html:11 3 +(anonymous) @ console-log-without-console.html:11 +console-log-without-console.html:13 4 +(anonymous) @ console-log-without-console.html:13 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-object-preview-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-object-preview-expected.txt new file mode 100644 index 0000000..9e284be --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-object-preview-expected.txt
@@ -0,0 +1,97 @@ +CONSOLE MESSAGE: line 9: Mutating object in a loop +CONSOLE MESSAGE: line 13: [object Object] +CONSOLE MESSAGE: line 13: [object Object] +CONSOLE MESSAGE: line 13: [object Object] +CONSOLE MESSAGE: line 16: Mutating array in a loop +CONSOLE MESSAGE: line 20: 0,0,0 +CONSOLE MESSAGE: line 20: 0,0,1 +CONSOLE MESSAGE: line 20: 0,0,2 +CONSOLE MESSAGE: line 23: Object with many properties +CONSOLE MESSAGE: line 28: [object Object] +CONSOLE MESSAGE: line 30: Array with many properties +CONSOLE MESSAGE: line 35: 0,1 +CONSOLE MESSAGE: line 37: Array with gaps and overflow +CONSOLE MESSAGE: line 42: ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,11,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,14,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,19,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,20,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,21,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,22,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,28,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,30,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,31,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,32,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,33,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,34,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,36,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,38,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,39,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,40,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,41,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,43,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,44,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,45,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,46,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,47,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,48,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,52,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,53,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,54,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,55,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,56,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,57,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,58,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,59,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,60,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,61,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,62,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,63,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,64,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,65,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,66,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,67,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,68,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,69,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,70,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,71,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,72,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,73,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,74,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,76,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,77,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,78,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,79,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,80,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,81,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,82,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,83,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,84,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,85,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,86,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,87,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,88,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,89,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,90,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,91,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,92,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,93,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,94,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,95,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,96,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,97,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,98,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,99,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100 +CONSOLE MESSAGE: line 44: Array with gaps without overflow +CONSOLE MESSAGE: line 49: ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,11,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,14,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,16,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,19,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,20,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,21,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,22,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,23,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,24,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,27,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,28,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,30,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,31,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,32,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,33,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,34,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,36,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,37,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,38,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,39,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,40,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,41,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,43,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,44,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,45,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,46,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,47,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,48,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,49,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,52,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,53,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,54,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,55,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,56,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,57,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,58,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,59,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,60,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,61,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,62,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,63,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,64,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,65,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,66,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,67,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,68,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,69,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,70,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,71,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,72,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,73,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,74,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,75,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,76,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,77,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,78,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,79,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,80,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,81,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,82,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,83,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,84,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,85,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,86,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,87,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,88,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,89,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,90,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,91,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,92,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,93,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,94,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,95,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,96,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,97,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,98 +CONSOLE MESSAGE: line 51: Object with proto +CONSOLE MESSAGE: line 54: [object Object] +CONSOLE MESSAGE: line 56: Sparse array +CONSOLE MESSAGE: line 59: ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +CONSOLE MESSAGE: line 61: Dense array with indexes and propeties +CONSOLE MESSAGE: line 67: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149 +CONSOLE MESSAGE: line 69: Object with properties containing whitespaces +CONSOLE MESSAGE: line 76: [object Object] +CONSOLE MESSAGE: line 78: Object with a document.all property +CONSOLE MESSAGE: line 79: [object Object] +CONSOLE MESSAGE: line 81: Object with special numbers +CONSOLE MESSAGE: line 83: [object Object] +CONSOLE MESSAGE: line 85: Object with exactly 5 properties: expected to be lossless +CONSOLE MESSAGE: line 86: [object Object] +CONSOLE MESSAGE: line 88: [object Object] +Tests that console produces instant previews for arrays and objects. + +console-object-preview.html:9 Mutating object in a loop console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:13 Object {a: 0, b: 0, c: 0} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:13 Object {a: 0, b: 0, c: 1} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:13 Object {a: 0, b: 0, c: 2} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:16 Mutating array in a loop console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:20 [0, 0, 0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-number > object-value-number > object-value-number > children +console-object-preview.html:20 [0, 0, 1] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-number > object-value-number > object-value-number > children +console-object-preview.html:20 [0, 0, 2] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-number > object-value-number > object-value-number > children +console-object-preview.html:23 Object with many properties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:28 Object {property_0: 0, property_1: 1, property_2: 2, property_3: 3, property_4: 4…} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:30 Array with many properties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:35 [0, 1, property_0: 0, property_1: 1, property_2: 2, property_3: 3, property_4: 4…] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-number > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:37 Array with gaps and overflow console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:42 [32: 0, 89: 1, 146: 2, 203: 3, 260: 4, 317: 5, 374: 6, 431: 7, 488: 8, 545: 9, 602: 10, 659: 11, 716: 12, 773: 13, 830: 14, 887: 15, 944: 16, 1001: 17, 1058: 18, 1115: 19, 1172: 20, 1229: 21, 1286: 22, 1343: 23, 1400: 24, 1457: 25, 1514: 26, 1571: 27, 1628: 28, 1685: 29, 1742: 30, 1799: 31, 1856: 32, 1913: 33, 1970: 34, 2027: 35, 2084: 36, 2141: 37, 2198: 38, 2255: 39, 2312: 40, 2369: 41, 2426: 42, 2483: 43, 2540: 44, 2597: 45, 2654: 46, 2711: 47, 2768: 48, 2825: 49, 2882: 50, 2939: 51, 2996: 52, 3053: 53, 3110: 54, 3167: 55, 3224: 56, 3281: 57, 3338: 58, 3395: 59, 3452: 60, 3509: 61, 3566: 62, 3623: 63, 3680: 64, 3737: 65, 3794: 66, 3851: 67, 3908: 68, 3965: 69, 4022: 70, 4079: 71, 4136: 72, 4193: 73, 4250: 74, 4307: 75, 4364: 76, 4421: 77, 4478: 78, 4535: 79, 4592: 80, 4649: 81, 4706: 82, 4763: 83, 4820: 84, 4877: 85, 4934: 86, 4991: 87, 5048: 88, 5105: 89, 5162: 90, 5219: 91, 5276: 92, 5333: 93, 5390: 94, 5447: 95, 5504: 96, 5561: 97, 5618: 98, 5675: 99…] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:44 Array with gaps without overflow console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:49 [undefined × 32, 0, undefined × 56, 1, undefined × 56, 2, undefined × 56, 3, undefined × 56, 4, undefined × 56, 5, undefined × 56, 6, undefined × 56, 7, undefined × 56, 8, undefined × 56, 9, undefined × 56, 10, undefined × 56, 11, undefined × 56, 12, undefined × 56, 13, undefined × 56, 14, undefined × 56, 15, undefined × 56, 16, undefined × 56, 17, undefined × 56, 18, undefined × 56, 19, undefined × 56, 20, undefined × 56, 21, undefined × 56, 22, undefined × 56, 23, undefined × 56, 24, undefined × 56, 25, undefined × 56, 26, undefined × 56, 27, undefined × 56, 28, undefined × 56, 29, undefined × 56, 30, undefined × 56, 31, undefined × 56, 32, undefined × 56, 33, undefined × 56, 34, undefined × 56, 35, undefined × 56, 36, undefined × 56, 37, undefined × 56, 38, undefined × 56, 39, undefined × 56, 40, undefined × 56, 41, undefined × 56, 42, undefined × 56, 43, undefined × 56, 44, undefined × 56, 45, undefined × 56, 46, undefined × 56, 47, undefined × 56, 48, undefined × 56, 49, un console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > object-value-undefined > object-value-number > children +console-object-preview.html:51 Object with proto console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:54 Object {d: 1} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > children +console-object-preview.html:56 Sparse array console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:59 [undefined × 50, 50, undefined × 99] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-undefined > object-value-number > object-value-undefined > children +console-object-preview.html:61 Dense array with indexes and propeties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:67 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99…] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > object-value-number > children +console-object-preview.html:69 Object with properties containing whitespaces console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:76 Object {" a b ": " a b ", c d: "c d", "": "", " ": " ", "a↵↵b↵c": "a↵↵b↵c"} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-string > name > object-value-string > name > object-value-string > name > object-value-string > name > object-value-string > children +console-object-preview.html:78 Object with a document.all property console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:79 Object {all: HTMLAllCollection[7]} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-array > children +console-object-preview.html:81 Object with special numbers console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:83 Object {nan: NaN, posInf: Infinity, negInf: -Infinity, negZero: -0} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:85 Object with exactly 5 properties: expected to be lossless console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:86 Object {a: 1, b: 2, c: 3, d: 4, e: 5} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > name > object-value-number > children +console-object-preview.html:88 Object {null: null, undef: undefined, regexp: /^[regexp]$/g, bool: false} console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element > selection fill > console-object-preview > name > object-value-null > name > object-value-undefined > name > object-value-regexp > name > object-value-boolean > children +Expanded all messages +console-object-preview.html:9 Mutating object in a loop console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:13 Objecta: 0b: 0c: 2__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:13 Objecta: 0b: 0c: 2__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:13 Objecta: 0b: 0c: 2__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:16 Mutating array in a loop console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:20 Array[3]0: 01: 02: 2length: 3__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:20 Array[3]0: 01: 02: 2length: 3__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:20 Array[3]0: 01: 02: 2length: 3__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:23 Object with many properties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:28 Objectproperty_0: 0property_1: 1property_2: 2property_3: 3property_4: 4property_5: 5property_6: 6property_7: 7property_8: 8property_9: 9__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:30 Array with many properties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:35 Array[2]0: 01: 1property_0: 0property_1: 1property_2: 2property_3: 3property_4: 4property_5: 5property_6: 6property_7: 7property_8: 8property_9: 9length: 2__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:37 Array with gaps and overflow console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:42 Array[5733][32 … 5675]5732: 100length: 5733__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > parent object-properties-section-name > selection fill > tree-element-title > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:44 Array with gaps without overflow console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:49 Array[5619]32: 089: 1146: 2203: 3260: 4317: 5374: 6431: 7488: 8545: 9602: 10659: 11716: 12773: 13830: 14887: 15944: 161001: 171058: 181115: 191172: 201229: 211286: 221343: 231400: 241457: 251514: 261571: 271628: 281685: 291742: 301799: 311856: 321913: 331970: 342027: 352084: 362141: 372198: 382255: 392312: 402369: 412426: 422483: 432540: 442597: 452654: 462711: 472768: 482825: 492882: 502939: 512996: 523053: 533110: 543167: 553224: 563281: 573338: 583395: 593452: 603509: 613566: 623623: 633680: 643737: 653794: 663851: 673908: 683965: 694022: 704079: 714136: 724193: 734250: 744307: 754364: 764421: 774478: 784535: 794592: 804649: 814706: 824763: 834820: 844877: 854934: 864991: 875048: 885105: 895162: 905219: 915276: 925333: 935390: 945447: 955504: 965561: 975618: 98length: 5619__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:51 Object with proto console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:54 Objectd: 1__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:56 Sparse array console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:59 Array[150]50: 50length: 150__proto__: Array[0] console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:61 Dense array with indexes and propeties console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:67 Array[150][0 … 99][100 … 149]property_0: 0property_1: 1property_2: 2property_3: 3property_4: 4property_5: 5property_6: 6property_7: 7property_8: 8property_9: 9property_10: 10property_11: 11property_12: 12property_13: 13property_14: 14property_15: 15property_16: 16property_17: 17property_18: 18property_19: 19property_20: 20property_21: 21property_22: 22property_23: 23property_24: 24property_25: 25property_26: 26property_27: 27property_28: 28property_29: 29property_30: 30property_31: 31property_32: 32property_33: 33property_34: 34property_35: 35property_36: 36property_37: 37property_38: 38property_39: 39property_40: 40property_41: 41property_42: 42property_43: 43property_44: 44property_45: 45property_46: 46property_47: 47property_48: 48property_49: 49property_50: 50property_51: 51property_52: 52property_53: 53property_54: 54property_55: 55property_56: 56property_57: 57property_58: 58property_59: 59property_60: 60property_61: 61property_62: 62property_63: 63property_64: 64property_ console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-array source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > parent object-properties-section-name > selection fill > tree-element-title > children > parent object-properties-section-name > selection fill > tree-element-title > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-array value > children +console-object-preview.html:69 Object with properties containing whitespaces console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:76 Object"": """ ": " "" a b ": " a b ""a↵↵b↵c": "a↵↵b↵c"c d: "c d"__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-string value > object-value-string-quote > object-value-string-quote > children > selection fill > name > object-properties-section-separator > object-value-string value > object-value-string-quote > object-value-string-quote > children > selection fill > name > object-properties-section-separator > object-value-string value > object-value-string-quote > object-value-string-quote > children > selection fill > name > object-properties-section-separator > object-value-string value > object-value-string-quote > object-value-string-quote > children > selection fill > name > object-properties-section-separator > object-value-string value > object-value-string-quote > object-value-string-quote > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:78 Object with a document.all property console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:79 Objectall: HTMLAllCollection[7]__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > parent > selection fill > name > object-properties-section-separator > object-value-array value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:81 Object with special numbers console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:83 Objectnan: NaNnegInf: -InfinitynegZero: -0posInf: Infinity__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:85 Object with exactly 5 properties: expected to be lossless console-message > source-code > console-message-anchor > devtools-link > console-message-text +console-object-preview.html:86 Objecta: 1b: 2c: 3d: 4e: 5__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > selection fill > name > object-properties-section-separator > object-value-number value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +console-object-preview.html:88 Objectbool: falsenull: nullregexp: /^[regexp]$/gundef: undefined__proto__: Object console-message > source-code > console-message-anchor > devtools-link > console-message-text > console-view-object-properties-section object-value-object source-code expanded > tree-outline-disclosure tree-outline-disclosure-hide-overflow > tree-outline source-code object-properties-section > parent object-properties-section-root-element expanded > selection fill > object-state-note info-note > children expanded > selection fill > name > object-properties-section-separator > object-value-boolean value > children > selection fill > name > object-properties-section-separator > object-value-null value > children > parent > selection fill > name > object-properties-section-separator > object-value-regexp value > children > selection fill > name > object-properties-section-separator > object-value-undefined value > children > parent > selection fill > name object-properties-section-dimmed > object-properties-section-separator > object-value-object value > children +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-on-paint-worklet-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-on-paint-worklet-expected.txt new file mode 100644 index 0000000..803d117 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-on-paint-worklet-expected.txt
@@ -0,0 +1,11 @@ +CONSOLE INFO: line 1: Information +CONSOLE MESSAGE: line 2: Log +CONSOLE WARNING: line 3: Warning +Tests console output from PaintWorklet. + +Message count: 3 +console-worklet-script.js:1 Information +console-worklet-script.js:2 Log +console-worklet-script.js:3 Warning +(anonymous) @ console-worklet-script.js:3 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-save-to-temp-var-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-save-to-temp-var-expected.txt new file mode 100644 index 0000000..db6a0d2e --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-save-to-temp-var-expected.txt
@@ -0,0 +1,28 @@ +Tests saving objects to temporary variables. + +Number of expressions: 11 +Names [temp3..temp7] are reserved + +temp1 +42 +temp2 +"foo string" +temp8 +NaN +temp9 +Infinity +temp10 +-Infinity +temp11 +-0 +temp12 +[1, 2, NaN, -0, null, undefined] +temp13 +Object {foo: "bar"} +temp14 +[1, 2, 3, 4] +temp15 +function func() {} +temp16 +Error: errr +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tainted-globals-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tainted-globals-expected.txt new file mode 100644 index 0000000..d7429ca --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tainted-globals-expected.txt
@@ -0,0 +1,45 @@ +Tests that overriding global methods (like Array.prototype.push, Math.max) will not break the inspector. + + +Running: evaluateInConsole + +Running: testRuntimeAgentCallFunctionOn + +Running: dumpConsoleMessages +testOverriddenArrayPushAndMathMax() +[1, 2, 3] +testOverriddenConstructorName() +Object {constructor: Object} +testThrowConstructorName() +Object {} +testOverriddenIsFinite() +["arg1", "arg2"] +testOverriddenError() +Object {result: "PASS"} +restoreError() +Object {result: "PASS"} +testOverriddenToString(function func() {}, true) +function #<Function> +testOverriddenToString(function func() {}, false) +function #<Function> +testOverriddenToString(new Function, true) +function #<Function> +testOverriddenToString(new Function, false) +function #<Function> +testOverriddenToString(/^regex$/, true) +#<RegExp> +testOverriddenToString(/^regex$/, false) +#<RegExp> +testOverriddenToString(new Date, true) +#<Date> +testOverriddenToString(new Date, false) +#<Date> +testOverriddenToString({}, true) +Object {} +testOverriddenToString({}, false) +Object {} +testOverriddenToString(new Number(1), true) +Number {[[PrimitiveValue]]: 1} +testOverriddenToString(new Number(1), false) +Number {[[PrimitiveValue]]: 1} +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tests-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tests-expected.txt new file mode 100644 index 0000000..259399c --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-tests-expected.txt
@@ -0,0 +1,55 @@ +CONSOLE MESSAGE: line 9: log +CONSOLE DEBUG: line 10: debug +CONSOLE INFO: line 11: info +CONSOLE WARNING: line 12: warn +CONSOLE ERROR: line 13: error +CONSOLE MESSAGE: line 15: repeated +CONSOLE MESSAGE: line 15: repeated +CONSOLE MESSAGE: line 15: repeated +CONSOLE MESSAGE: line 15: repeated +CONSOLE MESSAGE: line 15: repeated +CONSOLE DEBUG: line 17: count: 1 +CONSOLE DEBUG: line 17: count: 2 +CONSOLE MESSAGE: line 18: group +CONSOLE MESSAGE: line 19: console.groupEnd +CONSOLE MESSAGE: line 20: 1 +CONSOLE MESSAGE: line 21: groupCollapsed +CONSOLE MESSAGE: line 22: [object Object] +CONSOLE MESSAGE: line 23: 42 +CONSOLE MESSAGE: line 24: true +CONSOLE MESSAGE: line 25: null +CONSOLE MESSAGE: line 26: undefined +CONSOLE MESSAGE: line 27: [object HTMLDocument] +CONSOLE MESSAGE: line 28: function () { } +CONSOLE MESSAGE: line 29: function f() { } +CONSOLE MESSAGE: line 30: 1,2,3 +CONSOLE MESSAGE: line 31: /regexp.*/ +CONSOLE MESSAGE: line 32: console.groupEnd +CONSOLE DEBUG: line 33: : 1 +CONSOLE DEBUG: line 34: : 1 +CONSOLE DEBUG: line 35: : 1 +CONSOLE DEBUG: line 36: title: 1 +CONSOLE DEBUG: line 37: title: 2 +CONSOLE DEBUG: line 38: title: 3 +Tests that console logging dumps proper messages. + +console-tests.html:9 log console-message-wrapper console-info-level > console-message +console-tests.html:10 debug console-message-wrapper console-verbose-level > console-message +console-tests.html:11 info console-message-wrapper console-info-level > console-message +console-tests.html:12 warn +onload @ console-tests.html:12 console-message-wrapper console-warning-level > console-message +console-tests.html:13 error +onload @ console-tests.html:13 console-message-wrapper console-error-level > console-message +5console-tests.html:15 repeated console-message-wrapper console-info-level > console-message repeated-message +console-tests.html:17 count: 1 console-message-wrapper console-verbose-level > console-message +console-tests.html:17 count: 2 console-message-wrapper console-verbose-level > console-message +console-tests.html:18 group console-message-wrapper console-info-level > console-message console-group-title +console-tests.html:20 1 2 3 console-message-wrapper console-info-level > console-message +console-tests.html:21 groupCollapsed console-message-wrapper console-info-level > console-message console-group-title +console-tests.html:33 : 1 console-message-wrapper console-verbose-level > console-message +console-tests.html:34 : 1 console-message-wrapper console-verbose-level > console-message +console-tests.html:35 : 1 console-message-wrapper console-verbose-level > console-message +console-tests.html:36 title: 1 console-message-wrapper console-verbose-level > console-message +console-tests.html:37 title: 2 console-message-wrapper console-verbose-level > console-message +console-tests.html:38 title: 3 console-message-wrapper console-verbose-level > console-message +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-uncaught-promise-in-worker-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-uncaught-promise-in-worker-expected.txt new file mode 100644 index 0000000..443716b4 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-uncaught-promise-in-worker-expected.txt
@@ -0,0 +1,7 @@ +CONSOLE ERROR: line 3: Uncaught (in promise) Error: err1 +CONSOLE ERROR: line 21: Uncaught (in promise) Error: err2 +Tests that uncaught promise rejections happenned in workers are logged into console. + +worker-with-unhandled-promises.js:3 Uncaught (in promise) Error: err1 +worker-with-unhandled-promises.js:21 Uncaught (in promise) Error: err2 +
diff --git a/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-worker-nested-imports-syntax-error-expected.txt b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-worker-nested-imports-syntax-error-expected.txt new file mode 100644 index 0000000..a25b8a2 --- /dev/null +++ b/third_party/WebKit/Source/devtools/tests/baseline/protocol-1.2/inspector/console/console-worker-nested-imports-syntax-error-expected.txt
@@ -0,0 +1,6 @@ +CONSOLE ERROR: line 1: Uncaught SyntaxError: Unexpected identifier +Tests that nested import scripts in worker show correct stack on syntax error. + +Message count: 1 +invalidScript.js:1 Uncaught SyntaxError: Unexpected identifier +
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp index eb78cb1..0aef977 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -1152,6 +1152,24 @@ return ExpandedUndefined; } +bool AXNodeObject::isModal() const { + if (roleValue() != DialogRole && roleValue() != AlertDialogRole) + return false; + + if (hasAttribute(aria_modalAttr)) { + const AtomicString& modal = getAttribute(aria_modalAttr); + if (equalIgnoringCase(modal, "true")) + return true; + if (equalIgnoringCase(modal, "false")) + return false; + } + + if (getNode() && isHTMLDialogElement(*getNode())) + return toElement(getNode())->isInTopLayer(); + + return false; +} + bool AXNodeObject::isPressed() const { if (!isButton()) return false;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h index 177568d9..2a08628 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
@@ -129,6 +129,7 @@ bool isClickable() const final; bool isEnabled() const override; AccessibilityExpanded isExpanded() const override; + bool isModal() const final; bool isPressed() const final; bool isReadOnly() const override; bool isRequired() const final;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h index 911958b..090f8f1 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h
@@ -682,6 +682,7 @@ virtual bool isHovered() const { return false; } virtual bool isLinked() const { return false; } virtual bool isLoaded() const { return false; } + virtual bool isModal() const { return false; } virtual bool isMultiSelectable() const { return false; } virtual bool isOffScreen() const { return false; } virtual bool isPressed() const { return false; }
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp index 1952d30..5f14c39 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
@@ -164,11 +164,11 @@ if (!firstBody) return false; - int numCols = firstBody->numEffectiveColumns(); + int numColsInFirstBody = firstBody->numEffectiveColumns(); int numRows = firstBody->numRows(); // If there's only one cell, it's not a good AXTable candidate. - if (numRows == 1 && numCols == 1) + if (numRows == 1 && numColsInFirstBody == 1) return false; // If there are at least 20 rows, we'll call it a data table. @@ -203,7 +203,8 @@ int headersInFirstColumnCount = 0; for (int row = 0; row < numRows; ++row) { int headersInFirstRowCount = 0; - for (int col = 0; col < numCols; ++col) { + int nCols = firstBody->numCols(row); + for (int col = 0; col < nCols; ++col) { LayoutTableCell* cell = firstBody->primaryCellAt(row, col); if (!cell) continue; @@ -291,7 +292,8 @@ } } - if (!row && headersInFirstRowCount == numCols && numCols > 1) + if (!row && headersInFirstRowCount == numColsInFirstBody && + numColsInFirstBody > 1) return true; }
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp index 8df3281..4ef4a5f 100644 --- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp +++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -115,6 +115,10 @@ } } +bool roleAllowsModal(AccessibilityRole role) { + return role == DialogRole || role == AlertDialogRole; +} + bool roleAllowsMultiselectable(AccessibilityRole role) { return role == GridRole || role == ListBoxRole || role == TabListRole || role == TreeGridRole || role == TreeRole; @@ -306,6 +310,11 @@ createProperty(AXWidgetStatesEnum::Selected, createBooleanValue(axObject.isSelected()))); } + + if (roleAllowsModal(role)) { + properties.addItem(createProperty(AXWidgetStatesEnum::Modal, + createBooleanValue(axObject.isModal()))); + } } std::unique_ptr<AXProperty> createRelatedNodeListProperty(
diff --git a/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp b/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp index e0d81d28..cf09d69 100644 --- a/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp +++ b/third_party/WebKit/Source/modules/app_banner/AppBannerController.cpp
@@ -54,7 +54,7 @@ m_frame->document()->outgoingReferrer()) .referrer; - callback.Run(reply, referrer.isNull() ? emptyString() : referrer); + callback.Run(reply, referrer.isNull() ? emptyString : referrer); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.h b/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.h index af868e4..e675240 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.h +++ b/third_party/WebKit/Source/modules/credentialmanager/FederatedCredential.h
@@ -30,7 +30,7 @@ // TODO(mkwst): This is a stub, as we don't yet have any support on the // Chromium-side. - const String& protocol() const { return emptyString(); } + const String& protocol() const { return emptyString; } private: FederatedCredential(WebFederatedCredential*);
diff --git a/third_party/WebKit/Source/modules/fetch/Response.cpp b/third_party/WebKit/Source/modules/fetch/Response.cpp index 12e7678..21c44bf 100644 --- a/third_party/WebKit/Source/modules/fetch/Response.cpp +++ b/third_party/WebKit/Source/modules/fetch/Response.cpp
@@ -338,7 +338,7 @@ // flag set, otherwise." const KURL* responseURL = m_response->url(); if (!responseURL) - return emptyString(); + return emptyString; if (!responseURL->hasFragmentIdentifier()) return *responseURL; KURL url(*responseURL);
diff --git a/third_party/WebKit/Source/modules/filesystem/EntryBase.cpp b/third_party/WebKit/Source/modules/filesystem/EntryBase.cpp index 8380e7ff..6d5a7a7e 100644 --- a/third_party/WebKit/Source/modules/filesystem/EntryBase.cpp +++ b/third_party/WebKit/Source/modules/filesystem/EntryBase.cpp
@@ -49,7 +49,7 @@ // Some filesystem type may not support toURL. if (!m_fileSystem->supportsToURL()) - m_cachedURL = emptyString(); + m_cachedURL = emptyString; else m_cachedURL = m_fileSystem->createFileSystemURL(this).getString(); return m_cachedURL;
diff --git a/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.cpp b/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.cpp index e198870e..4cecc72 100644 --- a/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.cpp +++ b/third_party/WebKit/Source/modules/imagecapture/PhotoCapabilities.cpp
@@ -21,7 +21,7 @@ default: NOTREACHED(); } - return emptyString(); + return emptyString; } } // anonymous namespace @@ -58,7 +58,7 @@ default: NOTREACHED(); } - return emptyString(); + return emptyString; } DEFINE_TRACE(PhotoCapabilities) {
diff --git a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.idl b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.idl index 6480ca0..2777375 100644 --- a/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.idl +++ b/third_party/WebKit/Source/modules/installedapp/NavigatorInstalledApp.idl
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(dhnishi): Link to full spec, rather than explainer, upon completion. -// https://github.com/DHNishi/IsNativeAppInstalled/blob/master/explainer.md +// TODO(mgiuca): Link to full spec, rather than explainer, upon completion. +// https://github.com/WICG/get-installed-related-apps/blob/master/EXPLAINER.md [ RuntimeEnabled=InstalledApp,
diff --git a/third_party/WebKit/Source/modules/installedapp/RelatedApplication.idl b/third_party/WebKit/Source/modules/installedapp/RelatedApplication.idl index 66e2f889..c55b7f6f 100644 --- a/third_party/WebKit/Source/modules/installedapp/RelatedApplication.idl +++ b/third_party/WebKit/Source/modules/installedapp/RelatedApplication.idl
@@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// TODO(dhnishi): Link to full spec upon completion. -// RelatedApplication defined in example. -// https://github.com/DHNishi/IsNativeAppInstalled/blob/master/explainer.md +// TODO(mgiuca): Link to full spec, rather than explainer, upon completion. +// https://github.com/WICG/get-installed-related-apps/blob/master/EXPLAINER.md +// TODO(mgiuca): This should be a dictionary, not an interface. +// (NoInterfaceObject is basically a makeshift dictionary.) +// https://crbug.com/687444. [ + NoInterfaceObject, RuntimeEnabled=InstalledApp ] interface RelatedApplication { readonly attribute DOMString platform;
diff --git a/third_party/WebKit/Source/modules/modules_idl_files.gni b/third_party/WebKit/Source/modules/modules_idl_files.gni index 05fb6ad..76b65b8 100644 --- a/third_party/WebKit/Source/modules/modules_idl_files.gni +++ b/third_party/WebKit/Source/modules/modules_idl_files.gni
@@ -220,16 +220,11 @@ "remoteplayback/RemotePlayback.idl", "screen_orientation/ScreenOrientation.idl", "sensor/Accelerometer.idl", - "sensor/AccelerometerReading.idl", "sensor/Gyroscope.idl", - "sensor/GyroscopeReading.idl", "sensor/AmbientLightSensor.idl", - "sensor/AmbientLightSensorReading.idl", "sensor/Magnetometer.idl", - "sensor/MagnetometerReading.idl", "sensor/Sensor.idl", "sensor/SensorErrorEvent.idl", - "sensor/SensorReading.idl", "serviceworkers/Client.idl", "serviceworkers/Clients.idl", "serviceworkers/ExtendableEvent.idl", @@ -485,10 +480,6 @@ "quota/StorageEstimate.idl", "quota/StorageInfo.idl", "sensor/AccelerometerOptions.idl", - "sensor/AccelerometerReadingInit.idl", - "sensor/GyroscopeReadingInit.idl", - "sensor/AmbientLightSensorReadingInit.idl", - "sensor/MagnetometerReadingInit.idl", "sensor/SensorErrorEventInit.idl", "sensor/SensorOptions.idl", "serviceworkers/ClientQueryOptions.idl", @@ -863,14 +854,6 @@ "$blink_modules_output_dir/quota/StorageInfo.h", "$blink_modules_output_dir/sensor/AccelerometerOptions.cpp", "$blink_modules_output_dir/sensor/AccelerometerOptions.h", - "$blink_modules_output_dir/sensor/AccelerometerReadingInit.cpp", - "$blink_modules_output_dir/sensor/AccelerometerReadingInit.h", - "$blink_modules_output_dir/sensor/GyroscopeReadingInit.cpp", - "$blink_modules_output_dir/sensor/GyroscopeReadingInit.h", - "$blink_modules_output_dir/sensor/AmbientLightSensorReadingInit.cpp", - "$blink_modules_output_dir/sensor/AmbientLightSensorReadingInit.h", - "$blink_modules_output_dir/sensor/MagnetometerReadingInit.cpp", - "$blink_modules_output_dir/sensor/MagnetometerReadingInit.h", "$blink_modules_output_dir/sensor/SensorErrorEventInit.cpp", "$blink_modules_output_dir/sensor/SensorErrorEventInit.h", "$blink_modules_output_dir/sensor/SensorOptions.cpp",
diff --git a/third_party/WebKit/Source/modules/nfc/NFC.cpp b/third_party/WebKit/Source/modules/nfc/NFC.cpp index 6c3f758..c8e487f 100644 --- a/third_party/WebKit/Source/modules/nfc/NFC.cpp +++ b/third_party/WebKit/Source/modules/nfc/NFC.cpp
@@ -775,11 +775,22 @@ ScriptPromise NFC::rejectIfNotSupported(ScriptState* scriptState) { String errorMessage; - if (!scriptState->getExecutionContext()->isSecureContext(errorMessage)) { + ExecutionContext* context = scriptState->getExecutionContext(); + if (!context->isSecureContext(errorMessage)) { return ScriptPromise::rejectWithDOMException( scriptState, DOMException::create(SecurityError, errorMessage)); } + // https://w3c.github.io/web-nfc/#security-policies + // WebNFC API must be only accessible from top level browsing context. + if (!toDocument(context)->domWindow()->frame() || + !toDocument(context)->frame()->isMainFrame()) { + return ScriptPromise::rejectWithDOMException( + scriptState, + DOMException::create(SecurityError, + "Must be in a top-level browsing context.")); + } + if (!m_nfc) { return ScriptPromise::rejectWithDOMException( scriptState, DOMException::create(NotSupportedError));
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp b/third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp index fd96130..3b06ab4 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp +++ b/third_party/WebKit/Source/modules/payments/PaymentAppManager.cpp
@@ -25,9 +25,9 @@ struct TypeConverter<PaymentAppOptionPtr, blink::PaymentAppOption> { static PaymentAppOptionPtr Convert(const blink::PaymentAppOption& input) { PaymentAppOptionPtr output = PaymentAppOption::New(); - output->name = input.hasName() ? input.name() : WTF::emptyString(); + output->name = input.hasName() ? input.name() : WTF::emptyString; output->icon = input.hasIcon() ? input.icon() : WTF::String(); - output->id = input.hasId() ? input.id() : WTF::emptyString(); + output->id = input.hasId() ? input.id() : WTF::emptyString; if (input.hasEnabledMethods()) { output->enabled_methods = WTF::Vector<WTF::String>(input.enabledMethods()); @@ -40,7 +40,7 @@ struct TypeConverter<PaymentAppManifestPtr, blink::PaymentAppManifest> { static PaymentAppManifestPtr Convert(const blink::PaymentAppManifest& input) { PaymentAppManifestPtr output = PaymentAppManifest::New(); - output->name = input.hasName() ? input.name() : WTF::emptyString(); + output->name = input.hasName() ? input.name() : WTF::emptyString; output->icon = input.hasIcon() ? input.icon() : WTF::String(); if (input.hasOptions()) { for (size_t i = 0; i < input.options().size(); ++i) {
diff --git a/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp b/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp index 20b9ae3..2af1644f 100644 --- a/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp +++ b/third_party/WebKit/Source/modules/sensor/Accelerometer.cpp
@@ -6,7 +6,6 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" -#include "modules/sensor/AccelerometerReading.h" using device::mojom::blink::SensorType; @@ -34,20 +33,22 @@ : SensorType::LINEAR_ACCELERATION), m_accelerometerOptions(options) {} -AccelerometerReading* Accelerometer::reading() const { - return static_cast<AccelerometerReading*>(Sensor::reading()); +double Accelerometer::x(bool& isNull) const { + return readingValue(0, isNull); +} + +double Accelerometer::y(bool& isNull) const { + return readingValue(1, isNull); +} + +double Accelerometer::z(bool& isNull) const { + return readingValue(2, isNull); } bool Accelerometer::includesGravity() const { return m_accelerometerOptions.includeGravity(); } -std::unique_ptr<SensorReadingFactory> -Accelerometer::createSensorReadingFactory() { - return std::unique_ptr<SensorReadingFactory>( - new SensorReadingFactoryImpl<AccelerometerReading>()); -} - DEFINE_TRACE(Accelerometer) { Sensor::trace(visitor); }
diff --git a/third_party/WebKit/Source/modules/sensor/Accelerometer.h b/third_party/WebKit/Source/modules/sensor/Accelerometer.h index a7cc237..5c82bc6 100644 --- a/third_party/WebKit/Source/modules/sensor/Accelerometer.h +++ b/third_party/WebKit/Source/modules/sensor/Accelerometer.h
@@ -10,8 +10,6 @@ namespace blink { -class AccelerometerReading; - class Accelerometer final : public Sensor { DEFINE_WRAPPERTYPEINFO(); @@ -21,7 +19,9 @@ ExceptionState&); static Accelerometer* create(ExecutionContext*, ExceptionState&); - AccelerometerReading* reading() const; + double x(bool& isNull) const; + double y(bool& isNull) const; + double z(bool& isNull) const; bool includesGravity() const; DECLARE_VIRTUAL_TRACE(); @@ -31,7 +31,6 @@ const AccelerometerOptions&, ExceptionState&); // Sensor overrides. - std::unique_ptr<SensorReadingFactory> createSensorReadingFactory() override; AccelerometerOptions m_accelerometerOptions; };
diff --git a/third_party/WebKit/Source/modules/sensor/Accelerometer.idl b/third_party/WebKit/Source/modules/sensor/Accelerometer.idl index 5c984f8..d5665b0 100644 --- a/third_party/WebKit/Source/modules/sensor/Accelerometer.idl +++ b/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
@@ -11,6 +11,8 @@ ConstructorCallWith=ExecutionContext, RaisesException=Constructor, ] interface Accelerometer : Sensor { - readonly attribute AccelerometerReading? reading; + readonly attribute unrestricted double? x; + readonly attribute unrestricted double? y; + readonly attribute unrestricted double? z; readonly attribute boolean includesGravity; };
diff --git a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.cpp b/third_party/WebKit/Source/modules/sensor/AccelerometerReading.cpp deleted file mode 100644 index 0a9d977..0000000 --- a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.cpp +++ /dev/null
@@ -1,56 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/sensor/AccelerometerReading.h" - -#include "modules/sensor/SensorProxy.h" -#include "wtf/CurrentTime.h" - -namespace blink { - -namespace { -device::SensorReading ToReadingData(const AccelerometerReadingInit& init) { - device::SensorReading result; - result.timestamp = WTF::monotonicallyIncreasingTime(); - if (init.hasX()) - result.values[0] = init.x(); - if (init.hasY()) - result.values[1] = init.y(); - if (init.hasZ()) - result.values[2] = init.z(); - return result; -} -} // namespace - -AccelerometerReading::AccelerometerReading(const AccelerometerReadingInit& init) - : SensorReading(ToReadingData(init)) {} - -AccelerometerReading::AccelerometerReading(const device::SensorReading& data) - : SensorReading(data) {} - -AccelerometerReading::~AccelerometerReading() = default; - -double AccelerometerReading::x() const { - return data().values[0]; -} - -double AccelerometerReading::y() const { - return data().values[1]; -} - -double AccelerometerReading::z() const { - return data().values[2]; -} - -bool AccelerometerReading::isReadingUpdated( - const device::SensorReading& previous) const { - return (previous.values[0] != x() || previous.values[1] != y() || - previous.values[2] != z()); -} - -DEFINE_TRACE(AccelerometerReading) { - SensorReading::trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h b/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h deleted file mode 100644 index 260a7ccb..0000000 --- a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.h +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef AccelerometerReading_h -#define AccelerometerReading_h - -#include "modules/sensor/AccelerometerReadingInit.h" -#include "modules/sensor/SensorReading.h" - -namespace blink { - -class AccelerometerReading final : public SensorReading { - DEFINE_WRAPPERTYPEINFO(); - - public: - static AccelerometerReading* create(const AccelerometerReadingInit& init) { - return new AccelerometerReading(init); - } - - static AccelerometerReading* create(const device::SensorReading& data) { - return new AccelerometerReading(data); - } - - ~AccelerometerReading() override; - - double x() const; - double y() const; - double z() const; - - bool isReadingUpdated(const device::SensorReading&) const override; - - DECLARE_VIRTUAL_TRACE(); - - private: - explicit AccelerometerReading(const AccelerometerReadingInit&); - explicit AccelerometerReading(const device::SensorReading&); -}; - -} // namepsace blink - -#endif // AccelerometerReading_h
diff --git a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.idl b/third_party/WebKit/Source/modules/sensor/AccelerometerReading.idl deleted file mode 100644 index 74bc693..0000000 --- a/third_party/WebKit/Source/modules/sensor/AccelerometerReading.idl +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/accelerometer/#accelerometer-reading-interface - -[ - RuntimeEnabled=Sensor, - Constructor(AccelerometerReadingInit accelerometerReadingInit) -] interface AccelerometerReading : SensorReading { - readonly attribute unrestricted double x; - readonly attribute unrestricted double y; - readonly attribute unrestricted double z; -};
diff --git a/third_party/WebKit/Source/modules/sensor/AccelerometerReadingInit.idl b/third_party/WebKit/Source/modules/sensor/AccelerometerReadingInit.idl deleted file mode 100644 index 4e06012..0000000 --- a/third_party/WebKit/Source/modules/sensor/AccelerometerReadingInit.idl +++ /dev/null
@@ -1,12 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/accelerometer/#dictdef-accelerometerreadinginit - -dictionary AccelerometerReadingInit { - unrestricted double x; - unrestricted double y; - unrestricted double z; -};
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp index d7129f5..4d4518b 100644 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.cpp
@@ -6,7 +6,6 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" -#include "modules/sensor/AmbientLightSensorReading.h" using device::mojom::blink::SensorType; @@ -35,14 +34,8 @@ exceptionState, SensorType::AMBIENT_LIGHT) {} -AmbientLightSensorReading* AmbientLightSensor::reading() const { - return static_cast<AmbientLightSensorReading*>(Sensor::reading()); -} - -std::unique_ptr<SensorReadingFactory> -AmbientLightSensor::createSensorReadingFactory() { - return std::unique_ptr<SensorReadingFactory>( - new SensorReadingFactoryImpl<AmbientLightSensorReading>()); +double AmbientLightSensor::illuminance(bool& isNull) const { + return readingValue(0, isNull); } DEFINE_TRACE(AmbientLightSensor) {
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h index 345117c1..c5346e7 100644 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h +++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.h
@@ -9,8 +9,6 @@ namespace blink { -class AmbientLightSensorReading; - class AmbientLightSensor final : public Sensor { DEFINE_WRAPPERTYPEINFO(); @@ -20,14 +18,12 @@ ExceptionState&); static AmbientLightSensor* create(ExecutionContext*, ExceptionState&); - AmbientLightSensorReading* reading() const; + double illuminance(bool& isNull) const; DECLARE_VIRTUAL_TRACE(); private: AmbientLightSensor(ExecutionContext*, const SensorOptions&, ExceptionState&); - // Sensor overrides. - std::unique_ptr<SensorReadingFactory> createSensorReadingFactory() override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl index 1e350079..c9b69cd 100644 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
@@ -11,5 +11,5 @@ ConstructorCallWith=ExecutionContext, RaisesException=Constructor, ] interface AmbientLightSensor : Sensor { - readonly attribute AmbientLightSensorReading? reading; + readonly attribute unrestricted double? illuminance; };
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp deleted file mode 100644 index c2034e3d..0000000 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.cpp +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/sensor/AmbientLightSensorReading.h" - -#include "modules/sensor/SensorProxy.h" -#include "wtf/CurrentTime.h" - -namespace blink { - -namespace { - -device::SensorReading ToReadingData(const AmbientLightSensorReadingInit& init) { - device::SensorReading result; - result.timestamp = WTF::monotonicallyIncreasingTime(); - if (init.hasIlluminance()) - result.values[0] = init.illuminance(); - - return result; -} - -} // namespace - -AmbientLightSensorReading::AmbientLightSensorReading( - const AmbientLightSensorReadingInit& init) - : SensorReading(ToReadingData(init)) {} - -AmbientLightSensorReading::AmbientLightSensorReading( - const device::SensorReading& data) - : SensorReading(data) {} - -AmbientLightSensorReading::~AmbientLightSensorReading() = default; - -double AmbientLightSensorReading::illuminance() const { - return data().values[0]; -} - -bool AmbientLightSensorReading::isReadingUpdated( - const device::SensorReading& previous) const { - return previous.values[0] != illuminance(); -} - -DEFINE_TRACE(AmbientLightSensorReading) { - SensorReading::trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h deleted file mode 100644 index 8d1081fe..0000000 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.h +++ /dev/null
@@ -1,41 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef AmbientLightSensorReading_h -#define AmbientLightSensorReading_h - -#include "modules/sensor/AmbientLightSensorReadingInit.h" -#include "modules/sensor/SensorReading.h" - -namespace blink { - -class AmbientLightSensorReading final : public SensorReading { - DEFINE_WRAPPERTYPEINFO(); - - public: - static AmbientLightSensorReading* create( - const AmbientLightSensorReadingInit& init) { - return new AmbientLightSensorReading(init); - } - - static AmbientLightSensorReading* create(const device::SensorReading& data) { - return new AmbientLightSensorReading(data); - } - - ~AmbientLightSensorReading() override; - - double illuminance() const; - - bool isReadingUpdated(const device::SensorReading&) const override; - - DECLARE_VIRTUAL_TRACE(); - - private: - explicit AmbientLightSensorReading(const AmbientLightSensorReadingInit&); - explicit AmbientLightSensorReading(const device::SensorReading&); -}; - -} // namepsace blink - -#endif // AmbientLightSensorReading_h
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl deleted file mode 100644 index 041e5cb..0000000 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReading.idl +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/ambient-light/#ambient-light-sensor-reading-interface - -[ - RuntimeEnabled=Sensor, - Constructor(AmbientLightSensorReadingInit ambientLightSensorReadingInit) -] interface AmbientLightSensorReading : SensorReading { - readonly attribute unrestricted double illuminance; -};
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl b/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl deleted file mode 100644 index 30dc03e..0000000 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensorReadingInit.idl +++ /dev/null
@@ -1,10 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/ambient-light/#dictdef-ambientlightsensorreadinginit - -dictionary AmbientLightSensorReadingInit { - unrestricted double illuminance; -};
diff --git a/third_party/WebKit/Source/modules/sensor/BUILD.gn b/third_party/WebKit/Source/modules/sensor/BUILD.gn index 6f59d028..e7eac6e 100644 --- a/third_party/WebKit/Source/modules/sensor/BUILD.gn +++ b/third_party/WebKit/Source/modules/sensor/BUILD.gn
@@ -8,20 +8,12 @@ sources = [ "Accelerometer.cpp", "Accelerometer.h", - "AccelerometerReading.cpp", - "AccelerometerReading.h", "AmbientLightSensor.cpp", "AmbientLightSensor.h", - "AmbientLightSensorReading.cpp", - "AmbientLightSensorReading.h", "Gyroscope.cpp", "Gyroscope.h", - "GyroscopeReading.cpp", - "GyroscopeReading.h", "Magnetometer.cpp", "Magnetometer.h", - "MagnetometerReading.cpp", - "MagnetometerReading.h", "Sensor.cpp", "Sensor.h", "SensorErrorEvent.cpp", @@ -30,8 +22,6 @@ "SensorProviderProxy.h", "SensorProxy.cpp", "SensorProxy.h", - "SensorReading.cpp", - "SensorReading.h", "SensorReadingUpdater.cpp", "SensorReadingUpdater.h", ]
diff --git a/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp b/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp index 8f80539..3f18c60 100644 --- a/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp +++ b/third_party/WebKit/Source/modules/sensor/Gyroscope.cpp
@@ -4,7 +4,6 @@ #include "modules/sensor/Gyroscope.h" -#include "modules/sensor/GyroscopeReading.h" using device::mojom::blink::SensorType; @@ -28,12 +27,16 @@ : Sensor(executionContext, options, exceptionState, SensorType::GYROSCOPE) { } -GyroscopeReading* Gyroscope::reading() const { - return static_cast<GyroscopeReading*>(Sensor::reading()); +double Gyroscope::x(bool& isNull) const { + return readingValue(0, isNull); } -std::unique_ptr<SensorReadingFactory> Gyroscope::createSensorReadingFactory() { - return WTF::makeUnique<SensorReadingFactoryImpl<GyroscopeReading>>(); +double Gyroscope::y(bool& isNull) const { + return readingValue(1, isNull); +} + +double Gyroscope::z(bool& isNull) const { + return readingValue(2, isNull); } DEFINE_TRACE(Gyroscope) {
diff --git a/third_party/WebKit/Source/modules/sensor/Gyroscope.h b/third_party/WebKit/Source/modules/sensor/Gyroscope.h index 0585029..4b97c2d 100644 --- a/third_party/WebKit/Source/modules/sensor/Gyroscope.h +++ b/third_party/WebKit/Source/modules/sensor/Gyroscope.h
@@ -9,8 +9,6 @@ namespace blink { -class GyroscopeReading; - class Gyroscope final : public Sensor { DEFINE_WRAPPERTYPEINFO(); @@ -20,14 +18,14 @@ ExceptionState&); static Gyroscope* create(ExecutionContext*, ExceptionState&); - GyroscopeReading* reading() const; + double x(bool& isNull) const; + double y(bool& isNull) const; + double z(bool& isNull) const; DECLARE_VIRTUAL_TRACE(); private: Gyroscope(ExecutionContext*, const SensorOptions&, ExceptionState&); - // Sensor overrides. - std::unique_ptr<SensorReadingFactory> createSensorReadingFactory() override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/Gyroscope.idl b/third_party/WebKit/Source/modules/sensor/Gyroscope.idl index 49557a3..67a67d59 100644 --- a/third_party/WebKit/Source/modules/sensor/Gyroscope.idl +++ b/third_party/WebKit/Source/modules/sensor/Gyroscope.idl
@@ -11,5 +11,7 @@ ConstructorCallWith=ExecutionContext, RaisesException=Constructor, ] interface Gyroscope : Sensor { - readonly attribute GyroscopeReading? reading; + readonly attribute unrestricted double? x; + readonly attribute unrestricted double? y; + readonly attribute unrestricted double? z; };
diff --git a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.cpp b/third_party/WebKit/Source/modules/sensor/GyroscopeReading.cpp deleted file mode 100644 index c06a298..0000000 --- a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.cpp +++ /dev/null
@@ -1,56 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/sensor/GyroscopeReading.h" - -#include "modules/sensor/GyroscopeReadingInit.h" -#include "wtf/CurrentTime.h" - -namespace blink { - -namespace { -device::SensorReading ToReadingData(const GyroscopeReadingInit& init) { - device::SensorReading result; - result.timestamp = WTF::monotonicallyIncreasingTime(); - if (init.hasX()) - result.values[0] = init.x(); - if (init.hasY()) - result.values[1] = init.y(); - if (init.hasZ()) - result.values[2] = init.z(); - return result; -} -} // namespace - -GyroscopeReading::GyroscopeReading(const GyroscopeReadingInit& init) - : SensorReading(ToReadingData(init)) {} - -GyroscopeReading::GyroscopeReading(const device::SensorReading& data) - : SensorReading(data) {} - -GyroscopeReading::~GyroscopeReading() = default; - -double GyroscopeReading::x() const { - return data().values[0]; -} - -double GyroscopeReading::y() const { - return data().values[1]; -} - -double GyroscopeReading::z() const { - return data().values[2]; -} - -bool GyroscopeReading::isReadingUpdated( - const device::SensorReading& previous) const { - return previous.values[0] != x() || previous.values[1] != y() || - previous.values[2] != z(); -} - -DEFINE_TRACE(GyroscopeReading) { - SensorReading::trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.h b/third_party/WebKit/Source/modules/sensor/GyroscopeReading.h deleted file mode 100644 index 4157635..0000000 --- a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef GyroscopeReading_h -#define GyroscopeReading_h - -#include "modules/sensor/SensorReading.h" - -namespace blink { - -class GyroscopeReadingInit; - -class GyroscopeReading final : public SensorReading { - DEFINE_WRAPPERTYPEINFO(); - - public: - static GyroscopeReading* create(const GyroscopeReadingInit& init) { - return new GyroscopeReading(init); - } - - static GyroscopeReading* create(const device::SensorReading& data) { - return new GyroscopeReading(data); - } - - ~GyroscopeReading() override; - - double x() const; - double y() const; - double z() const; - - bool isReadingUpdated(const device::SensorReading&) const override; - - DECLARE_VIRTUAL_TRACE(); - - private: - explicit GyroscopeReading(const GyroscopeReadingInit&); - explicit GyroscopeReading(const device::SensorReading&); -}; - -} // namepsace blink - -#endif // GyroscopeReading_h
diff --git a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.idl b/third_party/WebKit/Source/modules/sensor/GyroscopeReading.idl deleted file mode 100644 index f74eae6..0000000 --- a/third_party/WebKit/Source/modules/sensor/GyroscopeReading.idl +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/gyroscope/#gyroscope-reading-interface - -[ - RuntimeEnabled=Sensor, - Constructor(GyroscopeReadingInit gyroscopeReadingInit) -] interface GyroscopeReading : SensorReading { - readonly attribute unrestricted double x; - readonly attribute unrestricted double y; - readonly attribute unrestricted double z; -};
diff --git a/third_party/WebKit/Source/modules/sensor/GyroscopeReadingInit.idl b/third_party/WebKit/Source/modules/sensor/GyroscopeReadingInit.idl deleted file mode 100644 index 1b9fc11f..0000000 --- a/third_party/WebKit/Source/modules/sensor/GyroscopeReadingInit.idl +++ /dev/null
@@ -1,12 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/gyroscope/#dictdef-gyroscopereadinginit - -dictionary GyroscopeReadingInit { - unrestricted double x; - unrestricted double y; - unrestricted double z; -};
diff --git a/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp b/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp index 10b228c7..78a64c0 100644 --- a/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp +++ b/third_party/WebKit/Source/modules/sensor/Magnetometer.cpp
@@ -4,8 +4,6 @@ #include "modules/sensor/Magnetometer.h" -#include "modules/sensor/MagnetometerReading.h" - using device::mojom::blink::SensorType; namespace blink { @@ -31,13 +29,16 @@ exceptionState, SensorType::MAGNETOMETER) {} -MagnetometerReading* Magnetometer::reading() const { - return static_cast<MagnetometerReading*>(Sensor::reading()); +double Magnetometer::x(bool& isNull) const { + return readingValue(0, isNull); } -std::unique_ptr<SensorReadingFactory> -Magnetometer::createSensorReadingFactory() { - return WTF::makeUnique<SensorReadingFactoryImpl<MagnetometerReading>>(); +double Magnetometer::y(bool& isNull) const { + return readingValue(1, isNull); +} + +double Magnetometer::z(bool& isNull) const { + return readingValue(2, isNull); } DEFINE_TRACE(Magnetometer) {
diff --git a/third_party/WebKit/Source/modules/sensor/Magnetometer.h b/third_party/WebKit/Source/modules/sensor/Magnetometer.h index 6d926ac..f1d5b9a3 100644 --- a/third_party/WebKit/Source/modules/sensor/Magnetometer.h +++ b/third_party/WebKit/Source/modules/sensor/Magnetometer.h
@@ -9,8 +9,6 @@ namespace blink { -class MagnetometerReading; - class Magnetometer final : public Sensor { DEFINE_WRAPPERTYPEINFO(); @@ -20,14 +18,14 @@ ExceptionState&); static Magnetometer* create(ExecutionContext*, ExceptionState&); - MagnetometerReading* reading() const; + double x(bool& isNull) const; + double y(bool& isNull) const; + double z(bool& isNull) const; DECLARE_VIRTUAL_TRACE(); private: Magnetometer(ExecutionContext*, const SensorOptions&, ExceptionState&); - // Sensor overrides. - std::unique_ptr<SensorReadingFactory> createSensorReadingFactory() override; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/Magnetometer.idl b/third_party/WebKit/Source/modules/sensor/Magnetometer.idl index 2d0f8a5..cc29a23 100644 --- a/third_party/WebKit/Source/modules/sensor/Magnetometer.idl +++ b/third_party/WebKit/Source/modules/sensor/Magnetometer.idl
@@ -11,5 +11,7 @@ ConstructorCallWith=ExecutionContext, RaisesException=Constructor, ] interface Magnetometer : Sensor { - readonly attribute MagnetometerReading? reading; + readonly attribute unrestricted double? x; + readonly attribute unrestricted double? y; + readonly attribute unrestricted double? z; };
diff --git a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp b/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp deleted file mode 100644 index 5270eca..0000000 --- a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.cpp +++ /dev/null
@@ -1,59 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/sensor/MagnetometerReading.h" - -#include "modules/sensor/MagnetometerReadingInit.h" -#include "wtf/CurrentTime.h" - -namespace blink { - -namespace { - -device::SensorReading ToReadingData(const MagnetometerReadingInit& init) { - device::SensorReading result; - result.timestamp = WTF::monotonicallyIncreasingTime(); - if (init.hasX()) - result.values[0] = init.x(); - if (init.hasY()) - result.values[1] = init.y(); - if (init.hasZ()) - result.values[2] = init.z(); - - return result; -} - -} // namespace - -MagnetometerReading::MagnetometerReading(const MagnetometerReadingInit& init) - : SensorReading(ToReadingData(init)) {} - -MagnetometerReading::MagnetometerReading(const device::SensorReading& data) - : SensorReading(data) {} - -MagnetometerReading::~MagnetometerReading() = default; - -double MagnetometerReading::x() const { - return data().values[0]; -} - -double MagnetometerReading::y() const { - return data().values[1]; -} - -double MagnetometerReading::z() const { - return data().values[2]; -} - -bool MagnetometerReading::isReadingUpdated( - const device::SensorReading& previous) const { - return previous.values[0] != x() || previous.values[1] != y() || - previous.values[2] != z(); -} - -DEFINE_TRACE(MagnetometerReading) { - SensorReading::trace(visitor); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.h b/third_party/WebKit/Source/modules/sensor/MagnetometerReading.h deleted file mode 100644 index 26023b0..0000000 --- a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef MagnetometerReading_h -#define MagnetometerReading_h - -#include "modules/sensor/SensorReading.h" - -namespace blink { - -class MagnetometerReadingInit; - -class MagnetometerReading final : public SensorReading { - DEFINE_WRAPPERTYPEINFO(); - - public: - static MagnetometerReading* create(const MagnetometerReadingInit& init) { - return new MagnetometerReading(init); - } - - static MagnetometerReading* create(const device::SensorReading& data) { - return new MagnetometerReading(data); - } - - ~MagnetometerReading() override; - - double x() const; - double y() const; - double z() const; - - bool isReadingUpdated(const device::SensorReading&) const override; - - DECLARE_VIRTUAL_TRACE(); - - private: - explicit MagnetometerReading(const MagnetometerReadingInit&); - explicit MagnetometerReading(const device::SensorReading&); -}; - -} // namepsace blink - -#endif // MagnetometerReading_h
diff --git a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.idl b/third_party/WebKit/Source/modules/sensor/MagnetometerReading.idl deleted file mode 100644 index c750fc793..0000000 --- a/third_party/WebKit/Source/modules/sensor/MagnetometerReading.idl +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/magnetometer/#magnetometer-reading-interface - -[ - RuntimeEnabled=Sensor, - Constructor(MagnetometerReadingInit magnetometerReadingInit) -] interface MagnetometerReading : SensorReading { - readonly attribute unrestricted double x; - readonly attribute unrestricted double y; - readonly attribute unrestricted double z; -};
diff --git a/third_party/WebKit/Source/modules/sensor/MagnetometerReadingInit.idl b/third_party/WebKit/Source/modules/sensor/MagnetometerReadingInit.idl deleted file mode 100644 index 35a262d8..0000000 --- a/third_party/WebKit/Source/modules/sensor/MagnetometerReadingInit.idl +++ /dev/null
@@ -1,12 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/magnetometer/#dictdef-magnetometerreadinginit - -dictionary MagnetometerReadingInit { - unrestricted double x = 0; - unrestricted double y = 0; - unrestricted double z = 0; -}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp index ac012048b..6dbe824 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -9,10 +9,11 @@ #include "core/dom/ExecutionContextTask.h" #include "core/dom/TaskRunnerHelper.h" #include "core/inspector/ConsoleMessage.h" +#include "core/timing/DOMWindowPerformance.h" +#include "core/timing/Performance.h" #include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" #include "modules/sensor/SensorErrorEvent.h" #include "modules/sensor/SensorProviderProxy.h" -#include "modules/sensor/SensorReading.h" using namespace device::mojom::blink; @@ -63,12 +64,8 @@ void Sensor::start(ScriptState* scriptState, ExceptionState& exceptionState) { if (m_state != Sensor::SensorState::Idle && - m_state != Sensor::SensorState::Errored) { - exceptionState.throwDOMException( - InvalidStateError, - "Cannot start because SensorState is not Idle or errored"); + m_state != Sensor::SensorState::Errored) return; - } initSensorProxyIfNeeded(); @@ -83,12 +80,8 @@ void Sensor::stop(ScriptState*, ExceptionState& exceptionState) { if (m_state == Sensor::SensorState::Idle || - m_state == Sensor::SensorState::Errored) { - exceptionState.throwDOMException( - InvalidStateError, - "Cannot stop because SensorState is either Idle or errored"); + m_state == Sensor::SensorState::Errored) return; - } stopListening(); } @@ -114,11 +107,26 @@ return ToString(m_state); } -SensorReading* Sensor::reading() const { - if (m_state != Sensor::SensorState::Activated) - return nullptr; +DOMHighResTimeStamp Sensor::timestamp(ScriptState* scriptState, + bool& isNull) const { + if (!canReturnReadings()) { + isNull = true; + return 0.0; + } + + LocalDOMWindow* window = scriptState->domWindow(); + if (!window) { + isNull = true; + return 0.0; + } + + Performance* performance = DOMWindowPerformance::performance(*window); + DCHECK(performance); DCHECK(m_sensorProxy); - return m_sensorProxy->sensorReading(); + isNull = false; + + return performance->monotonicTimeToDOMHighResTimeStamp( + m_sensorProxy->reading().timestamp); } DEFINE_TRACE(Sensor) { @@ -152,6 +160,16 @@ return result; } +double Sensor::readingValue(int index, bool& isNull) const { + if (!canReturnReadings()) { + isNull = true; + return 0.0; + } + DCHECK(m_sensorProxy); + DCHECK(index >= 0 && index < device::SensorReading::kValuesCount); + return m_sensorProxy->reading().values[index]; +} + void Sensor::initSensorProxyIfNeeded() { if (m_sensorProxy) return; @@ -163,10 +181,8 @@ auto provider = SensorProviderProxy::from(document->frame()); m_sensorProxy = provider->getSensorProxy(m_type); - if (!m_sensorProxy) { - m_sensorProxy = provider->createSensorProxy(m_type, document->page(), - createSensorReadingFactory()); - } + if (!m_sensorProxy) + m_sensorProxy = provider->createSensorProxy(m_type, document->page()); } void Sensor::contextDestroyed(ExecutionContext*) { @@ -283,10 +299,9 @@ void Sensor::notifySensorReadingChanged() { DCHECK(m_sensorProxy); - DCHECK(m_sensorProxy->sensorReading()); - if (m_sensorProxy->sensorReading()->isReadingUpdated(m_storedData)) { - m_storedData = m_sensorProxy->sensorReading()->data(); + if (m_sensorProxy->reading().timestamp != m_storedData.timestamp) { + m_storedData = m_sensorProxy->reading(); dispatchEvent(Event::create(EventTypeNames::change)); } } @@ -300,4 +315,11 @@ SensorErrorEvent::create(EventTypeNames::error, std::move(error))); } +bool Sensor::canReturnReadings() const { + if (m_state != Sensor::SensorState::Activated) + return false; + DCHECK(m_sensorProxy); + return m_sensorProxy->reading().timestamp != 0.0; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h index 1f1e25d..7654017 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.h +++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -8,6 +8,8 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h" #include "core/dom/ContextLifecycleObserver.h" +#include "core/dom/DOMHighResTimeStamp.h" +#include "core/dom/DOMTimeStamp.h" #include "core/dom/SuspendableObject.h" #include "core/frame/PlatformEventController.h" #include "modules/EventTargetModules.h" @@ -46,8 +48,7 @@ // Getters String state() const; - // TODO(riju): crbug.com/614797 . - SensorReading* reading() const; + DOMHighResTimeStamp timestamp(ScriptState*, bool& isNull) const; DEFINE_ATTRIBUTE_EVENT_LISTENER(error); DEFINE_ATTRIBUTE_EVENT_LISTENER(change); @@ -63,8 +64,6 @@ const SensorOptions&, ExceptionState&, device::mojom::blink::SensorType); - virtual std::unique_ptr<SensorReadingFactory> - createSensorReadingFactory() = 0; using SensorConfigurationPtr = device::mojom::blink::SensorConfigurationPtr; using SensorConfiguration = device::mojom::blink::SensorConfiguration; @@ -73,6 +72,7 @@ // concrete sensor implementations can override this method to handle other // parameters if needed. virtual SensorConfigurationPtr createSensorConfig(); + double readingValue(int index, bool& isNull) const; private: void initSensorProxyIfNeeded(); @@ -102,6 +102,8 @@ void notifyOnActivate(); void notifyError(DOMException* error); + bool canReturnReadings() const; + private: SensorOptions m_sensorOptions; device::mojom::blink::SensorType m_type;
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.idl b/third_party/WebKit/Source/modules/sensor/Sensor.idl index 8370677..e709671 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.idl +++ b/third_party/WebKit/Source/modules/sensor/Sensor.idl
@@ -18,7 +18,7 @@ RuntimeEnabled=Sensor, ] interface Sensor : EventTarget { readonly attribute SensorState state; - readonly attribute SensorReading? reading; + [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp? timestamp; [CallWith=ScriptState, RaisesException, MeasureAs=GenericSensorStart] void start(); [CallWith=ScriptState, RaisesException, MeasureAs=GenericSensorStop] void stop();
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp index 24cab8b..45e61e7 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp +++ b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
@@ -5,7 +5,6 @@ #include "modules/sensor/SensorProviderProxy.h" #include "modules/sensor/SensorProxy.h" -#include "modules/sensor/SensorReading.h" #include "platform/mojo/MojoHelper.h" #include "public/platform/InterfaceProvider.h" #include "public/platform/Platform.h" @@ -53,12 +52,10 @@ SensorProxy* SensorProviderProxy::createSensorProxy( device::mojom::blink::SensorType type, - Page* page, - std::unique_ptr<SensorReadingFactory> readingFactory) { + Page* page) { DCHECK(!getSensorProxy(type)); - SensorProxy* sensor = - new SensorProxy(type, this, page, std::move(readingFactory)); + SensorProxy* sensor = new SensorProxy(type, this, page); m_sensorProxies.insert(sensor); return sensor;
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h index 91c324e..227e1cbe 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h +++ b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
@@ -14,7 +14,6 @@ namespace blink { class SensorProxy; -class SensorReadingFactory; // This class wraps 'SensorProvider' mojo interface and it manages // 'SensorProxy' instances. @@ -29,9 +28,7 @@ ~SensorProviderProxy(); - SensorProxy* createSensorProxy(device::mojom::blink::SensorType, - Page*, - std::unique_ptr<SensorReadingFactory>); + SensorProxy* createSensorProxy(device::mojom::blink::SensorType, Page*); SensorProxy* getSensorProxy(device::mojom::blink::SensorType);
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp index 6ba4e6ec..226d9f7 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp +++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
@@ -7,7 +7,6 @@ #include "core/dom/Document.h" #include "core/frame/LocalFrame.h" #include "modules/sensor/SensorProviderProxy.h" -#include "modules/sensor/SensorReading.h" #include "modules/sensor/SensorReadingUpdater.h" #include "platform/mojo/MojoHelper.h" #include "public/platform/Platform.h" @@ -18,8 +17,7 @@ SensorProxy::SensorProxy(SensorType sensorType, SensorProviderProxy* provider, - Page* page, - std::unique_ptr<SensorReadingFactory> readingFactory) + Page* page) : PageVisibilityObserver(page), m_type(sensorType), m_mode(ReportingMode::CONTINUOUS), @@ -27,7 +25,6 @@ m_clientBinding(this), m_state(SensorProxy::Uninitialized), m_suspended(false), - m_readingFactory(std::move(readingFactory)), m_maximumFrequency(0.0) {} SensorProxy::~SensorProxy() {} @@ -38,7 +35,6 @@ DEFINE_TRACE(SensorProxy) { visitor->trace(m_readingUpdater); - visitor->trace(m_reading); visitor->trace(m_observers); visitor->trace(m_provider); PageVisibilityObserver::trace(visitor); @@ -124,7 +120,6 @@ void SensorProxy::updateSensorReading() { DCHECK(isInitialized()); - DCHECK(m_readingFactory); int readAttempts = 0; const int kMaxReadAttemptsCount = 10; device::SensorReading readingData; @@ -135,7 +130,7 @@ } } - m_reading = m_readingFactory->createSensorReading(readingData); + m_reading = readingData; } void SensorProxy::notifySensorChanged(double timestamp) { @@ -177,6 +172,7 @@ m_state = Uninitialized; m_frequenciesUsed.clear(); + m_reading = device::SensorReading(); // The m_sensor.reset() will release all callbacks and its bound parameters, // therefore, handleSensorError accepts messages by value. @@ -185,7 +181,6 @@ m_sharedBufferHandle.reset(); m_defaultConfig.reset(); m_clientBinding.Close(); - m_reading = nullptr; for (Observer* observer : m_observers) observer->onSensorError(code, sanitizedMessage, unsanitizedMessage);
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProxy.h index db9977d..b9264fec 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProxy.h +++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
@@ -19,7 +19,6 @@ class SensorProviderProxy; class SensorReading; -class SensorReadingFactory; class SensorReadingUpdater; // This class wraps 'Sensor' mojo interface and used by multiple @@ -77,10 +76,8 @@ device::mojom::blink::SensorType type() const { return m_type; } device::mojom::blink::ReportingMode reportingMode() const { return m_mode; } - // The |SensorReading| instance which is shared between sensor instances - // of the same type. // Note: the returned value is reset after updateSensorReading() call. - SensorReading* sensorReading() const { return m_reading; } + const device::SensorReading& reading() const { return m_reading; } const device::mojom::blink::SensorConfiguration* defaultConfig() const; @@ -97,10 +94,7 @@ friend class SensorProviderProxy; friend class SensorReadingUpdaterContinuous; friend class SensorReadingUpdaterOnChange; - SensorProxy(device::mojom::blink::SensorType, - SensorProviderProxy*, - Page*, - std::unique_ptr<SensorReadingFactory>); + SensorProxy(device::mojom::blink::SensorType, SensorProviderProxy*, Page*); // Updates sensor reading from shared buffer. void updateSensorReading(); @@ -145,8 +139,7 @@ mojo::ScopedSharedBufferHandle m_sharedBufferHandle; mojo::ScopedSharedBufferMapping m_sharedBuffer; bool m_suspended; - Member<SensorReading> m_reading; - std::unique_ptr<SensorReadingFactory> m_readingFactory; + device::SensorReading m_reading; double m_maximumFrequency; Member<SensorReadingUpdater> m_readingUpdater;
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReading.cpp b/third_party/WebKit/Source/modules/sensor/SensorReading.cpp deleted file mode 100644 index 7717e58..0000000 --- a/third_party/WebKit/Source/modules/sensor/SensorReading.cpp +++ /dev/null
@@ -1,30 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "modules/sensor/SensorReading.h" - -#include "core/dom/ExecutionContext.h" -#include "core/frame/LocalDOMWindow.h" -#include "core/timing/DOMWindowPerformance.h" -#include "core/timing/Performance.h" - -namespace blink { - -SensorReading::SensorReading(const device::SensorReading& data) - : m_data(data) {} - -SensorReading::~SensorReading() = default; - -DOMHighResTimeStamp SensorReading::timeStamp(ScriptState* scriptState) const { - LocalDOMWindow* window = scriptState->domWindow(); - if (!window) - return 0.0; - - Performance* performance = DOMWindowPerformance::performance(*window); - DCHECK(performance); - - return performance->monotonicTimeToDOMHighResTimeStamp(data().timestamp); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReading.h b/third_party/WebKit/Source/modules/sensor/SensorReading.h deleted file mode 100644 index 4942812..0000000 --- a/third_party/WebKit/Source/modules/sensor/SensorReading.h +++ /dev/null
@@ -1,61 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef SensorReading_h -#define SensorReading_h - -#include "bindings/core/v8/ScriptWrappable.h" -#include "core/dom/DOMHighResTimeStamp.h" -#include "core/dom/DOMTimeStamp.h" -#include "modules/sensor/SensorProxy.h" - -namespace blink { - -class ScriptState; - -class SensorReading : public GarbageCollectedFinalized<SensorReading>, - public ScriptWrappable { - DEFINE_WRAPPERTYPEINFO(); - - public: - DEFINE_INLINE_VIRTUAL_TRACE() {} - - DOMHighResTimeStamp timeStamp(ScriptState*) const; - - // Returns 'true' if the current reading value is different than the given - // previous one; otherwise returns 'false'. - virtual bool isReadingUpdated( - const device::SensorReading& previous) const = 0; - - const device::SensorReading& data() const { return m_data; } - - virtual ~SensorReading(); - - protected: - explicit SensorReading(const device::SensorReading&); - - private: - device::SensorReading m_data; -}; - -class SensorReadingFactory { - public: - virtual SensorReading* createSensorReading(const device::SensorReading&) = 0; - - protected: - SensorReadingFactory() = default; -}; - -template <typename SensorReadingType> -class SensorReadingFactoryImpl : public SensorReadingFactory { - public: - SensorReading* createSensorReading( - const device::SensorReading& reading) override { - return SensorReadingType::create(reading); - } -}; - -} // namepsace blink - -#endif // SensorReading_h
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReading.idl b/third_party/WebKit/Source/modules/sensor/SensorReading.idl deleted file mode 100644 index 787d7ce..0000000 --- a/third_party/WebKit/Source/modules/sensor/SensorReading.idl +++ /dev/null
@@ -1,12 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Specification at: -// https://w3c.github.io/sensors/#sensorreading - -[ - RuntimeEnabled=Sensor, -] interface SensorReading { - [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp timeStamp; -};
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp index 21a337c..005bfbb 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp
@@ -61,7 +61,7 @@ } String ServiceWorkerScriptCachedMetadataHandler::encoding() const { - return emptyString(); + return emptyString; } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.cpp b/third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.cpp index 622dcce..c5aeab8 100644 --- a/third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.cpp +++ b/third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.cpp
@@ -10,7 +10,7 @@ DetectedBarcode* DetectedBarcode::create() { HeapVector<Point2D> emptyList; - return new DetectedBarcode(emptyString(), DOMRect::create(0, 0, 0, 0), + return new DetectedBarcode(emptyString, DOMRect::create(0, 0, 0, 0), emptyList); }
diff --git a/third_party/WebKit/Source/modules/shapedetection/DetectedText.cpp b/third_party/WebKit/Source/modules/shapedetection/DetectedText.cpp index 9551b62..4650ef9e3 100644 --- a/third_party/WebKit/Source/modules/shapedetection/DetectedText.cpp +++ b/third_party/WebKit/Source/modules/shapedetection/DetectedText.cpp
@@ -9,7 +9,7 @@ namespace blink { DetectedText* DetectedText::create() { - return new DetectedText(emptyString(), DOMRect::create()); + return new DetectedText(emptyString, DOMRect::create()); } DetectedText* DetectedText::create(String rawValue, DOMRect* boundingBox) {
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.idl b/third_party/WebKit/Source/modules/webaudio/AudioParam.idl index f604805..d95a028c3 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.idl +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.idl
@@ -51,6 +51,6 @@ [RaisesException, MeasureAs=AudioParamCancelScheduledValues] AudioParam cancelScheduledValues(double startTime); // Cancel scheduled parameter changes and hold the last value - [RaisesException] AudioParam cancelAndHoldAtTime(double startTime); + [RaisesException, MeasureAs=AudioParamCancelAndHoldAtTime] AudioParam cancelAndHoldAtTime(double startTime); };
diff --git a/third_party/WebKit/Source/modules/webdatabase/Database.cpp b/third_party/WebKit/Source/modules/webdatabase/Database.cpp index afe9e49f..f6a1b6cd 100644 --- a/third_party/WebKit/Source/modules/webdatabase/Database.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/Database.cpp
@@ -460,7 +460,7 @@ if (entry != guidToVersionMap().end()) { // Map null string to empty string (see updateGuidVersionMap()). currentVersion = - entry->value.isNull() ? emptyString() : entry->value.isolatedCopy(); + entry->value.isNull() ? emptyString : entry->value.isolatedCopy(); STORAGE_DVLOG(1) << "Current cached version for guid " << m_guid << " is " << currentVersion;
diff --git a/third_party/WebKit/Source/modules/webgl/GLStringQuery.h b/third_party/WebKit/Source/modules/webgl/GLStringQuery.h index ebca932..9b89bb81 100644 --- a/third_party/WebKit/Source/modules/webgl/GLStringQuery.h +++ b/third_party/WebKit/Source/modules/webgl/GLStringQuery.h
@@ -69,7 +69,7 @@ GLint length = 0; Traits::LengthFunction(m_gl, id, &length); if (!length) - return WTF::emptyString(); + return WTF::emptyString; LChar* logPtr; RefPtr<WTF::StringImpl> nameImpl = WTF::StringImpl::createUninitialized(length, logPtr);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index 24795897..1d0669eb 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -7557,7 +7557,7 @@ String WebGLRenderingContextBase::ensureNotNull(const String& text) const { if (text.isNull()) - return WTF::emptyString(); + return WTF::emptyString; return text; }
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp index cab6504..4a1ca73 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp +++ b/third_party/WebKit/Source/modules/webmidi/MIDIPort.cpp
@@ -69,7 +69,7 @@ case ConnectionStatePending: return "pending"; } - return emptyString(); + return emptyString; } String MIDIPort::state() const { @@ -82,7 +82,7 @@ NOTREACHED(); return "connected"; } - return emptyString(); + return emptyString; } String MIDIPort::type() const { @@ -92,7 +92,7 @@ case TypeOutput: return "output"; } - return emptyString(); + return emptyString; } ScriptPromise MIDIPort::open(ScriptState* scriptState) {
diff --git a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp index 84b82c2..5d3182257 100644 --- a/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp +++ b/third_party/WebKit/Source/modules/webshare/NavigatorShare.cpp
@@ -111,8 +111,8 @@ m_clients.insert(client); ScriptPromise promise = resolver->promise(); - m_service->Share(shareData.hasTitle() ? shareData.title() : emptyString(), - shareData.hasText() ? shareData.text() : emptyString(), + m_service->Share(shareData.hasTitle() ? shareData.title() : emptyString, + shareData.hasText() ? shareData.text() : emptyString, doc->completeURL(shareData.url()), convertToBaseCallback(WTF::bind(&ShareClientImpl::callback, wrapPersistent(client))));
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp index a06f140..2e9effb 100644 --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.cpp
@@ -560,7 +560,7 @@ frame.payloadLength); if (m_receivingMessageTypeIsText) { String message = m_receivingMessageData.isEmpty() - ? emptyString() + ? emptyString : String::fromUTF8(m_receivingMessageData.data(), m_receivingMessageData.size()); m_receivingMessageData.clear();
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp index efc1aa3..9c863dd4 100644 --- a/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp +++ b/third_party/WebKit/Source/modules/websockets/WebSocketHandleImpl.cpp
@@ -33,7 +33,7 @@ NETWORK_DVLOG(1) << this << " deleted"; if (m_websocket) - m_websocket->StartClosingHandshake(kAbnormalShutdownOpCode, emptyString()); + m_websocket->StartClosingHandshake(kAbnormalShutdownOpCode, emptyString); } void WebSocketHandleImpl::initialize(InterfaceProvider* interfaceProvider) { @@ -64,7 +64,7 @@ m_websocket->AddChannelRequest( url, protocols, origin, firstPartyForCookies, - userAgentOverride.isNull() ? emptyString() : userAgentOverride, + userAgentOverride.isNull() ? emptyString : userAgentOverride, m_clientBinding.CreateInterfacePtrAndBind( Platform::current() ->currentThread() @@ -119,7 +119,7 @@ NETWORK_DVLOG(1) << this << " close(" << code << ", " << reason << ")"; m_websocket->StartClosingHandshake(code, - reason.isNull() ? emptyString() : reason); + reason.isNull() ? emptyString : reason); } void WebSocketHandleImpl::disconnect() {
diff --git a/third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp b/third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp index 05d8ed7..6e24570 100644 --- a/third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp +++ b/third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp
@@ -118,7 +118,7 @@ return data.size() ? String::fromUTF8WithLatin1Fallback(data.data(), data.size()) - : emptyString(); + : emptyString; } size_t SharedBufferChunkReader::peek(Vector<char>& data, size_t requestedSize) {
diff --git a/third_party/WebKit/Source/platform/fonts/OrientationIteratorTest.cpp b/third_party/WebKit/Source/platform/fonts/OrientationIteratorTest.cpp index 1eaa8f28..126093f0 100644 --- a/third_party/WebKit/Source/platform/fonts/OrientationIteratorTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/OrientationIteratorTest.cpp
@@ -26,7 +26,7 @@ class OrientationIteratorTest : public testing::Test { protected: void CheckRuns(const Vector<TestRun>& runs) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<ExpectedRun> expect; for (auto& run : runs) { text.append(String::fromUTF8(run.text.c_str())); @@ -60,7 +60,7 @@ CheckRuns(runs); TEST_F(OrientationIteratorTest, Empty) { - String empty(emptyString16Bit()); + String empty(emptyString16Bit); OrientationIterator orientationIterator(empty.characters16(), empty.length(), FontOrientation::VerticalMixed); unsigned limit = 0;
diff --git a/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp b/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp index d7e6d17..dacb039 100644 --- a/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp
@@ -109,7 +109,7 @@ } static String ToTestString(const std::string& input) { - String result(emptyString16Bit()); + String result(emptyString16Bit); bool inSet = false; int seen = 0; int code = 0; @@ -288,7 +288,7 @@ class ScriptRunIteratorTest : public testing::Test { protected: void CheckRuns(const Vector<TestRun>& runs) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<ExpectedRun> expect; for (auto& run : runs) { text.append(String::fromUTF8(run.text.c_str())); @@ -301,7 +301,7 @@ // FIXME crbug.com/527329 - CheckMockRuns should be replaced by finding // suitable equivalent real codepoint sequences instead. void CheckMockRuns(const Vector<TestRun>& runs) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<ExpectedRun> expect; for (const TestRun& run : runs) { text.append(MockScriptData::ToTestString(run.text)); @@ -329,7 +329,7 @@ }; TEST_F(ScriptRunIteratorTest, Empty) { - String empty(emptyString16Bit()); + String empty(emptyString16Bit); ScriptRunIterator scriptRunIterator(empty.characters16(), empty.length()); unsigned limit = 0; UScriptCode code = USCRIPT_INVALID_CODE;
diff --git a/third_party/WebKit/Source/platform/fonts/SmallCapsIteratorTest.cpp b/third_party/WebKit/Source/platform/fonts/SmallCapsIteratorTest.cpp index 9245ba6..4e18bec 100644 --- a/third_party/WebKit/Source/platform/fonts/SmallCapsIteratorTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/SmallCapsIteratorTest.cpp
@@ -26,7 +26,7 @@ class SmallCapsIteratorTest : public testing::Test { protected: void CheckRuns(const Vector<TestRun>& runs) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<ExpectedRun> expect; for (auto& run : runs) { text.append(String::fromUTF8(run.text.c_str())); @@ -62,7 +62,7 @@ CheckRuns(runs); TEST_F(SmallCapsIteratorTest, Empty) { - String empty(emptyString16Bit()); + String empty(emptyString16Bit); SmallCapsIterator smallCapsIterator(empty.characters16(), empty.length()); unsigned limit = 0; SmallCapsIterator::SmallCapsBehavior smallCapsBehavior =
diff --git a/third_party/WebKit/Source/platform/fonts/SymbolsIteratorTest.cpp b/third_party/WebKit/Source/platform/fonts/SymbolsIteratorTest.cpp index 7b977e9..c733ec9 100644 --- a/third_party/WebKit/Source/platform/fonts/SymbolsIteratorTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/SymbolsIteratorTest.cpp
@@ -25,7 +25,7 @@ class SymbolsIteratorTest : public testing::Test { protected: void CheckRuns(const Vector<TestRun>& runs) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<ExpectedRun> expect; for (auto& run : runs) { text.append(String::fromUTF8(run.text.c_str())); @@ -61,7 +61,7 @@ CheckRuns(runs); TEST_F(SymbolsIteratorTest, Empty) { - String empty(emptyString16Bit()); + String empty(emptyString16Bit); SymbolsIterator symbolsIterator(empty.characters16(), empty.length()); unsigned limit = 0; FontFallbackPriority symbolsFont = FontFallbackPriority::Invalid;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/RunSegmenterTest.cpp b/third_party/WebKit/Source/platform/fonts/shaping/RunSegmenterTest.cpp index 833057db..080bdeb 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/RunSegmenterTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/RunSegmenterTest.cpp
@@ -44,7 +44,7 @@ protected: void CheckRuns(const Vector<SegmenterTestRun>& runs, FontOrientation orientation) { - String text(emptyString16Bit()); + String text(emptyString16Bit); Vector<SegmenterExpectedRun> expect; for (auto& run : runs) { unsigned lengthBefore = text.length(); @@ -91,7 +91,7 @@ CheckRuns(runs, FontOrientation::Horizontal); TEST_F(RunSegmenterTest, Empty) { - String empty(emptyString16Bit()); + String empty(emptyString16Bit); RunSegmenter::RunSegmenterRange segmenterRange = { 0, 0, USCRIPT_INVALID_CODE, OrientationIterator::OrientationKeep}; RunSegmenter runSegmenter(empty.characters16(), empty.length(),
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp index 94eba0a..4498febd 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCache.cpp
@@ -117,7 +117,7 @@ } String MemoryCache::defaultCacheIdentifier() { - return emptyString(); + return emptyString; } MemoryCache::ResourceMap* MemoryCache::ensureResourceMap(
diff --git a/third_party/WebKit/Source/platform/mojo/KURLStructTraits.h b/third_party/WebKit/Source/platform/mojo/KURLStructTraits.h index ebea8a7..80a7fb7 100644 --- a/third_party/WebKit/Source/platform/mojo/KURLStructTraits.h +++ b/third_party/WebKit/Source/platform/mojo/KURLStructTraits.h
@@ -17,7 +17,7 @@ static WTF::String url(const ::blink::KURL& blinkUrl) { if (!blinkUrl.isValid() || blinkUrl.getString().length() > url::kMaxURLChars) { - return emptyString(); + return emptyString; } return blinkUrl.getString();
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp index 27a4ea7..1e5fe828 100644 --- a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp +++ b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
@@ -194,9 +194,9 @@ EXPECT_EQ("tExt/hTMl", extractMIMETypeFromMediaType(AtomicString("tExt/hTMl"))); - EXPECT_EQ(emptyString(), + EXPECT_EQ(emptyString, extractMIMETypeFromMediaType(AtomicString(", text/html"))); - EXPECT_EQ(emptyString(), + EXPECT_EQ(emptyString, extractMIMETypeFromMediaType(AtomicString("; text/html"))); // If no normalization is required, the same AtomicString should be returned.
diff --git a/third_party/WebKit/Source/platform/text/LocaleICU.cpp b/third_party/WebKit/Source/platform/text/LocaleICU.cpp index 641e5527..5a471cf4 100644 --- a/third_party/WebKit/Source/platform/text/LocaleICU.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleICU.cpp
@@ -166,17 +166,17 @@ static String getDateFormatPattern(const UDateFormat* dateFormat) { if (!dateFormat) - return emptyString(); + return emptyString; UErrorCode status = U_ZERO_ERROR; int32_t length = udat_toPattern(dateFormat, TRUE, 0, 0, &status); if (status != U_BUFFER_OVERFLOW_ERROR || !length) - return emptyString(); + return emptyString; StringBuffer<UChar> buffer(length); status = U_ZERO_ERROR; udat_toPattern(dateFormat, TRUE, buffer.characters(), length, &status); if (U_FAILURE(status)) - return emptyString(); + return emptyString; return String::adopt(buffer); }
diff --git a/third_party/WebKit/Source/platform/text/LocaleWin.cpp b/third_party/WebKit/Source/platform/text/LocaleWin.cpp index 071fdc2..d2fe3d6 100644 --- a/third_party/WebKit/Source/platform/text/LocaleWin.cpp +++ b/third_party/WebKit/Source/platform/text/LocaleWin.cpp
@@ -470,8 +470,8 @@ }; DWORD negativeFormat = NegativeFormatSignPrefix; getLocaleInfo(LOCALE_INEGNUMBER, negativeFormat); - String negativePrefix = emptyString(); - String negativeSuffix = emptyString(); + String negativePrefix = emptyString; + String negativeSuffix = emptyString; switch (negativeFormat) { case NegativeFormatParenthesis: negativePrefix = "("; @@ -492,7 +492,7 @@ break; } m_didInitializeNumberData = true; - setLocaleData(symbols, emptyString(), emptyString(), negativePrefix, + setLocaleData(symbols, emptyString, emptyString, negativePrefix, negativeSuffix); } }
diff --git a/third_party/WebKit/Source/platform/weborigin/KURL.cpp b/third_party/WebKit/Source/platform/weborigin/KURL.cpp index 6df46cf..3b0af2cc 100644 --- a/third_party/WebKit/Source/platform/weborigin/KURL.cpp +++ b/third_party/WebKit/Source/platform/weborigin/KURL.cpp
@@ -416,7 +416,7 @@ // which is right). // Returns a null if the query is not specified, instead of empty. if (m_parsed.query.is_valid()) - return emptyString(); + return emptyString; return String(); }
diff --git a/third_party/WebKit/Source/platform/weborigin/KnownPorts.cpp b/third_party/WebKit/Source/platform/weborigin/KnownPorts.cpp index 2fdb2f4..e4dbb29 100644 --- a/third_party/WebKit/Source/platform/weborigin/KnownPorts.cpp +++ b/third_party/WebKit/Source/platform/weborigin/KnownPorts.cpp
@@ -71,7 +71,7 @@ return true; String protocol = url.protocol(); if (protocol.isNull()) - protocol = emptyString(); + protocol = emptyString; unsigned short effectivePort = url.port(); if (!effectivePort) effectivePort = defaultPortForProtocol(protocol);
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp index f3a8f83..d7c0ccb 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -123,9 +123,9 @@ m_blockLocalAccessFromLocalOrigin(false), m_isUniqueOriginPotentiallyTrustworthy(false) { if (m_protocol.isNull()) - m_protocol = emptyString(); + m_protocol = emptyString; if (m_host.isNull()) - m_host = emptyString(); + m_host = emptyString; // Suborigins are serialized into the host, so extract it if necessary. String suboriginName; @@ -148,9 +148,9 @@ } SecurityOrigin::SecurityOrigin() - : m_protocol(emptyString()), - m_host(emptyString()), - m_domain(emptyString()), + : m_protocol(emptyString), + m_host(emptyString), + m_domain(emptyString), m_port(InvalidPort), m_effectivePort(InvalidPort), m_isUnique(true),
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp index ae78fdf..8d0abcc 100644 --- a/third_party/WebKit/Source/web/WebAXObject.cpp +++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -358,6 +358,13 @@ return m_private->isLoaded(); } +bool WebAXObject::isModal() const { + if (isDetached()) + return false; + + return m_private->isModal(); +} + bool WebAXObject::isMultiSelectable() const { if (isDetached()) return false;
diff --git a/third_party/WebKit/Source/web/tests/KeyboardTest.cpp b/third_party/WebKit/Source/web/tests/KeyboardTest.cpp index a94195e3..8c14efb 100644 --- a/third_party/WebKit/Source/web/tests/KeyboardTest.cpp +++ b/third_party/WebKit/Source/web/tests/KeyboardTest.cpp
@@ -56,7 +56,7 @@ WebKeyboardEvent createFakeKeyboardEvent(char keyCode, int modifiers, WebInputEvent::Type type, - const String& key = emptyString()) { + const String& key = emptyString) { WebKeyboardEvent event(type, modifiers, WebInputEvent::TimeStampForTesting); event.text[0] = keyCode; event.windowsKeyCode = keyCode;
diff --git a/third_party/WebKit/Source/wtf/text/StringBuilder.cpp b/third_party/WebKit/Source/wtf/text/StringBuilder.cpp index edf7c6a6..3086eb9 100644 --- a/third_party/WebKit/Source/wtf/text/StringBuilder.cpp +++ b/third_party/WebKit/Source/wtf/text/StringBuilder.cpp
@@ -35,7 +35,7 @@ String StringBuilder::toString() { if (!m_length) - return emptyString(); + return emptyString; if (m_string.isNull()) { if (m_is8Bit) m_string = String(characters8(), m_length); @@ -61,7 +61,7 @@ String StringBuilder::substring(unsigned start, unsigned length) const { if (start >= m_length) - return emptyString(); + return emptyString; if (!m_string.isNull()) return m_string.substring(start, length); length = std::min(length, m_length - start);
diff --git a/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp b/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp index 07eb73c..acaee22 100644 --- a/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp +++ b/third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp
@@ -286,7 +286,7 @@ } { // AtomicString constructed from an empty string. StringBuilder builder; - builder.append(emptyString()); + builder.append(emptyString); AtomicString atomicString = builder.toAtomicString(); EXPECT_EQ(emptyAtom, atomicString); } @@ -316,7 +316,7 @@ { // Default constructed. StringBuilder builder; String substring = builder.substring(0, 10); - EXPECT_EQ(emptyString(), substring); + EXPECT_EQ(emptyString, substring); } { // With capacity. StringBuilder builder;
diff --git a/third_party/WebKit/Source/wtf/text/StringStatics.cpp b/third_party/WebKit/Source/wtf/text/StringStatics.cpp index ff7910a..d89ef98a 100644 --- a/third_party/WebKit/Source/wtf/text/StringStatics.cpp +++ b/third_party/WebKit/Source/wtf/text/StringStatics.cpp
@@ -46,6 +46,9 @@ // table. WTF_EXPORT DEFINE_GLOBAL(String, xmlnsWithColon); +WTF_EXPORT DEFINE_GLOBAL(String, emptyString); +WTF_EXPORT DEFINE_GLOBAL(String, emptyString16Bit); + NEVER_INLINE unsigned StringImpl::hashSlowCase() const { if (is8Bit()) setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length)); @@ -74,6 +77,8 @@ DCHECK(isMainThread()); StringImpl::initStatics(); + new (NotNull, (void*)&emptyString) String(StringImpl::empty); + new (NotNull, (void*)&emptyString16Bit) String(StringImpl::empty16Bit); // FIXME: These should be allocated at compile time. new (NotNull, (void*)&starAtom) AtomicString("*");
diff --git a/third_party/WebKit/Source/wtf/text/StringView.cpp b/third_party/WebKit/Source/wtf/text/StringView.cpp index 6774c5f..b74b75cc 100644 --- a/third_party/WebKit/Source/wtf/text/StringView.cpp +++ b/third_party/WebKit/Source/wtf/text/StringView.cpp
@@ -26,7 +26,7 @@ if (isNull()) return String(); if (isEmpty()) - return emptyString(); + return emptyString; if (StringImpl* impl = sharedImpl()) return impl; if (is8Bit())
diff --git a/third_party/WebKit/Source/wtf/text/StringViewTest.cpp b/third_party/WebKit/Source/wtf/text/StringViewTest.cpp index 71c3252..7c41186 100644 --- a/third_party/WebKit/Source/wtf/text/StringViewTest.cpp +++ b/third_party/WebKit/Source/wtf/text/StringViewTest.cpp
@@ -366,7 +366,7 @@ } TEST(StringViewTest, ToString) { - EXPECT_EQ(emptyString().impl(), StringView("").toString().impl()); + EXPECT_EQ(emptyString.impl(), StringView("").toString().impl()); EXPECT_EQ(nullAtom.impl(), StringView().toString().impl()); // NOTE: All the construction tests also check toString(). }
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp b/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp index ca473ce..589c853e 100644 --- a/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp +++ b/third_party/WebKit/Source/wtf/text/TextCodecLatin1.cpp
@@ -112,7 +112,7 @@ bool&) { LChar* characters; if (!length) - return emptyString(); + return emptyString; String result = String::createUninitialized(length, characters); const uint8_t* source = reinterpret_cast<const uint8_t*>(bytes);
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp index 95c4159..b547cbd 100644 --- a/third_party/WebKit/Source/wtf/text/WTFString.cpp +++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
@@ -709,7 +709,7 @@ String String::make8BitFrom16BitSource(const UChar* source, size_t length) { if (!length) - return emptyString(); + return emptyString; LChar* destination; String result = String::createUninitialized(length, destination); @@ -721,7 +721,7 @@ String String::make16BitFrom8BitSource(const LChar* source, size_t length) { if (!length) - return emptyString16Bit(); + return emptyString16Bit; UChar* destination; String result = String::createUninitialized(length, destination); @@ -738,7 +738,7 @@ return String(); if (!length) - return emptyString(); + return emptyString; if (charactersAreAllASCII(stringStart, length)) return StringImpl::create(stringStart, length); @@ -775,16 +775,6 @@ return utf8; } -const String& emptyString() { - DEFINE_STATIC_LOCAL(String, emptyString, (StringImpl::empty)); - return emptyString; -} - -const String& emptyString16Bit() { - DEFINE_STATIC_LOCAL(String, emptyString, (StringImpl::empty16Bit)); - return emptyString; -} - std::ostream& operator<<(std::ostream& out, const String& string) { if (string.isNull()) return out << "<null>";
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h index 80508ad1..9ba534a6 100644 --- a/third_party/WebKit/Source/wtf/text/WTFString.h +++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -566,8 +566,8 @@ }; // Shared global empty string. -WTF_EXPORT const String& emptyString(); -WTF_EXPORT const String& emptyString16Bit(); +WTF_EXPORT extern const String& emptyString; +WTF_EXPORT extern const String& emptyString16Bit; WTF_EXPORT extern const String& xmlnsWithColon; // Pretty printer for gtest and base/logging.*. It prepends and appends
diff --git a/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp b/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp index b8adf49..081384c1 100644 --- a/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp +++ b/third_party/WebKit/Source/wtf/text/WTFStringTest.cpp
@@ -48,7 +48,7 @@ EXPECT_STREQ("", output.data()); // Empty String. - output = emptyString().ascii(); + output = emptyString.ascii(); EXPECT_STREQ("", output.data()); // Regular String. @@ -489,7 +489,7 @@ toCStringThroughPrinter(String("\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", 8))); EXPECT_EQ(CString("\"\\u007F\\u0080\\u0081\""), toCStringThroughPrinter("\x7F\x80\x81")); - EXPECT_EQ(CString("\"\""), toCStringThroughPrinter(emptyString())); + EXPECT_EQ(CString("\"\""), toCStringThroughPrinter(emptyString)); EXPECT_EQ(CString("<null>"), toCStringThroughPrinter(String())); static const UChar unicodeSample[] = {0x30C6, 0x30B9,
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py index 6933ca4..442173fb 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
@@ -48,40 +48,12 @@ executable_name = 'git' - def __init__(self, cwd=None, executive=None, filesystem=None): + def __init__(self, cwd, executive=None, filesystem=None): + self.cwd = cwd self._executive = executive or Executive() self._filesystem = filesystem or FileSystem() - - self.cwd = cwd or self._filesystem.abspath(self._filesystem.getcwd()) - if not Git.in_working_directory(self.cwd, executive=self._executive): - module_directory = self._filesystem.abspath( - self._filesystem.dirname(self._filesystem.path_to_module(self.__module__))) - _log.info('The current directory (%s) is not in a git repo, trying directory %s.', - cwd, module_directory) - if Git.in_working_directory(module_directory, executive=self._executive): - self.cwd = module_directory - _log.error('Failed to find Git repo for %s or %s', cwd, module_directory) - - self._init_executable_name() self.checkout_root = self.find_checkout_root(self.cwd) - def _init_executable_name(self): - # FIXME: This is a hack and should be removed. - try: - self._executive.run_command(['git', 'help']) - except OSError: - try: - self._executive.run_command(['git.bat', 'help']) - # The Win port uses the depot_tools package, which contains a number - # of development tools, including Python and git. Instead of using a - # real git executable, depot_tools indirects via a batch file, called - # "git.bat". This batch file allows depot_tools to auto-update the real - # git executable, which is contained in a subdirectory. - _log.debug('Engaging git.bat Windows hack.') - self.executable_name = 'git.bat' - except OSError: - _log.debug('Failed to engage git.bat Windows hack.') - def _run_git(self, command_args, cwd=None,
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git_mock.py index 2f887ce..707f3de 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git_mock.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git_mock.py
@@ -13,9 +13,8 @@ executable_name = 'mock-git' - def __init__(self, cwd=None, filesystem=None, executive=None): + def __init__(self, filesystem=None, executive=None): self.checkout_root = '/mock-checkout' - self.cwd = cwd or self.checkout_root self.added_paths = set() self._filesystem = filesystem or MockFileSystem() self._executive = executive or MockExecutive()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py index 8fbb787..9f31e25 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/host.py
@@ -28,11 +28,12 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import logging +import sys from webkitpy.common.checkout.scm.git import Git from webkitpy.common.config.builders import BUILDERS -from webkitpy.common.net import web from webkitpy.common.net.buildbot import BuildBot +from webkitpy.common.net import web from webkitpy.common.system.system_host import SystemHost from webkitpy.layout_tests.builder_list import BuilderList from webkitpy.layout_tests.port.factory import PortFactory @@ -76,9 +77,58 @@ self.environ['LC_MESSAGES'] = 'en_US.UTF-8' self.environ['LC_ALL'] = '' - def scm(self, path=None): - if path: - return Git(cwd=path, executive=self.executive, filesystem=self.filesystem) - if not self._scm: - self._scm = Git(filesystem=self.filesystem, executive=self.executive) + # FIXME: This is a horrible, horrible hack for WinPort and should be removed. + # Maybe this belongs in Git in some more generic "find the git binary" codepath? + # Or possibly Executive should have a way to emulate shell path-lookups? + # FIXME: Unclear how to test this, since it currently mutates global state on Git. + def _engage_awesome_windows_hacks(self): + try: + self.executive.run_command(['git', 'help']) + except OSError: + try: + self.executive.run_command(['git.bat', 'help']) + # The Win port uses the depot_tools package, which contains a number + # of development tools, including Python and git. Instead of using a + # real git executable, depot_tools indirects via a batch file, called + # git.bat. This batch file allows depot_tools to auto-update the real + # git executable, which is contained in a subdirectory. + # + # That's all fine and good, except that subprocess.popen can detect + # the difference between a real git executable and batch file when we + # don't provide use shell=True. Rather than use shell=True on Windows, + # We hack the git.bat name into the SVN class. + _log.debug('Engaging git.bat Windows hack.') + Git.executable_name = 'git.bat' + except OSError: + _log.debug('Failed to engage git.bat Windows hack.') + + def initialize_scm(self): + # TODO(qyearsley): Refactor this so that scm is initialized + # when self.scm() is called the first time; put any initialization + # code in the git module. + if sys.platform == 'win32': + self._engage_awesome_windows_hacks() + + cwd = self.filesystem.abspath(self.filesystem.getcwd()) + if Git.in_working_directory(cwd, executive=self.executive): + self._scm = Git(cwd=cwd, filesystem=self.filesystem, executive=self.executive) + return + + script_directory = self.filesystem.abspath( + self.filesystem.dirname(self.filesystem.path_to_module(self.__module__))) + _log.info('The current directory (%s) is not in a git repo, trying script directory %s.', cwd, script_directory) + if Git.in_working_directory(script_directory, executive=self.executive): + self._scm = Git(cwd=script_directory, filesystem=self.filesystem, executive=self.executive) + return + + raise Exception('FATAL: Failed to find Git repo for %s or %s' % (cwd, script_directory)) + + def scm(self,): return self._scm + + def scm_for_path(self, path): + # FIXME: make scm() be a wrapper around this, and clean up the way + # callers call initialize_scm() (to remove patch_directories) and scm(). + if sys.platform == "win32": + self._engage_awesome_windows_hacks() + return Git(cwd=path, executive=self.executive, filesystem=self.filesystem)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py index b204e2d2..7bfd8901 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py
@@ -42,6 +42,7 @@ def __init__(self, log_executive=False, + initialize_scm_by_default=True, web=None, scm=None, os_name=None, @@ -55,8 +56,13 @@ add_unit_tests_to_mock_filesystem(self.filesystem) self.web = web or MockWeb() - self._scm = scm + self._scm = scm + # TODO(qyearsley): we should never initialize the SCM by default, since + # the real object doesn't either. This has caused at least one bug + # (see bug 89498). + if initialize_scm_by_default: + self.initialize_scm() self.buildbot = MockBuildBot() # Note: We're using a real PortFactory here. Tests which don't wish to depend @@ -65,12 +71,17 @@ self.builders = BuilderList(BUILDERS) - def scm(self, path=None): - if path: - return MockGit(cwd=path, filesystem=self.filesystem, executive=self.executive) + def initialize_scm(self, patch_directories=None): if not self._scm: self._scm = MockGit(filesystem=self.filesystem, executive=self.executive) # Various pieces of code (wrongly) call filesystem.chdir(checkout_root). # Making the checkout_root exist in the mock filesystem makes that chdir not raise. self.filesystem.maybe_make_directory(self._scm.checkout_root) + + def scm(self): + return self._scm + + def scm_for_path(self, path): + # FIXME: consider supporting more than one SCM so that we can do more comprehensive testing. + self.initialize_scm() return self._scm
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py index d44c592..7c3a438 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py
@@ -341,7 +341,7 @@ results['chromium_revision'] = '' if port_obj.get_option('builder_name'): path = port_obj.repository_path() - scm = port_obj.host.scm(path=path) + scm = port_obj.host.scm_for_path(path) if scm: results['chromium_revision'] = str(scm.commit_position(path)) else:
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py index 5cf8ca4b..432e43d1 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py
@@ -188,7 +188,7 @@ class SummarizedResultsTest(unittest.TestCase): def setUp(self): - host = MockHost() + host = MockHost(initialize_scm_by_default=False) self.port = host.port_factory.get(port_name='test') def test_no_chromium_revision(self):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py b/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py index 6c6ffd2..4d2ae5b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
@@ -63,6 +63,7 @@ else: self._host = Host() self._port = self._host.port_factory.get(self._options.platform, self._options) + self._host.initialize_scm() self._webkit_base_dir_len = len(self._port.webkit_base()) self._base_path = self._port.perf_tests_dir() self._timestamp = time.time() @@ -261,7 +262,7 @@ def _generate_results_dict(self, timestamp, description, platform, builder_name, build_number): revisions = {} path = self._port.repository_path() - git = self._host.scm(path=path) + git = self._host.scm_for_path(path) revision = str(git.commit_position(path)) revisions['chromium'] = {'revision': revision, 'timestamp': git.timestamp_of_revision(path, revision)}
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py index c8b8051..2d08062 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -47,6 +47,7 @@ # FIXME: host should be a required parameter, not an optional one. host = host or Host() + host.initialize_scm() self._port_obj = host.port_factory.get()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py index 65efd03..2eed34c 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/main.py
@@ -125,6 +125,7 @@ args = sys.argv[1:] host = Host() + host.initialize_scm() stderr = self._engage_awesome_stderr_hacks()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/bot/commit_announcer.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/bot/commit_announcer.py index c1015eb1..11d3982c 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/bot/commit_announcer.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/bot/commit_announcer.py
@@ -50,7 +50,7 @@ def __init__(self, tool, announce_path, irc_password): SingleServerIRCBot.__init__(self, [(SERVER, PORT, irc_password)], NICKNAME, NICKNAME) self.announce_path = announce_path - self.git = tool.scm(path=tool.scm().checkout_root) + self.git = Git(cwd=tool.scm().checkout_root, filesystem=tool.filesystem, executive=tool.executive) self.commands = { 'help': self.help, 'ping': self.ping,
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py index e154f19e..dd29430c 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py
@@ -82,6 +82,7 @@ def _prepare_config(self, options, args, tool): results_directory = args[0] host = Host() + host.initialize_scm() print 'Parsing full_results.json...' results_json_path = host.filesystem.join(results_directory, 'full_results.json')
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py index 4c5ebcc..b300451 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py
@@ -65,9 +65,6 @@ class WebKitPatch(Host): - # FIXME: It might make more sense if this class had a Host attribute - # instead of being a Host subclass. - global_options = [ optparse.make_option( "-v", "--verbose", action="store_true", dest="verbose", default=False, @@ -115,6 +112,7 @@ command.set_option_parser(option_parser) (options, args) = command.parse_args(args) + self.initialize_scm() (should_execute, failure_reason) = self._should_execute_command(command) if not should_execute:
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py index 2a875e9a..cd5c166 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -39,6 +39,7 @@ def __init__(self, host): self.host = host + self.host.initialize_scm() self.executive = host.executive self.fs = host.filesystem self.finder = WebKitFinder(self.fs)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py index 2d581fc..3444b17 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
@@ -28,6 +28,7 @@ def __init__(self, host): self.host = host + self.host.initialize_scm() self.finder = WebKitFinder(self.host.filesystem) def run(self, args=None):
diff --git a/third_party/WebKit/public/web/WebAXObject.h b/third_party/WebKit/public/web/WebAXObject.h index b7712b23..d8bb7a3 100644 --- a/third_party/WebKit/public/web/WebAXObject.h +++ b/third_party/WebKit/public/web/WebAXObject.h
@@ -138,6 +138,7 @@ BLINK_EXPORT bool isHovered() const; BLINK_EXPORT bool isLinked() const; BLINK_EXPORT bool isLoaded() const; + BLINK_EXPORT bool isModal() const; BLINK_EXPORT bool isMultiSelectable() const; BLINK_EXPORT bool isOffScreen() const; BLINK_EXPORT bool isPasswordField() const;
diff --git a/third_party/boringssl/BUILD.generated.gni b/third_party/boringssl/BUILD.generated.gni index 79d3e94f..f35e1d50 100644 --- a/third_party/boringssl/BUILD.generated.gni +++ b/third_party/boringssl/BUILD.generated.gni
@@ -46,7 +46,6 @@ "src/crypto/base64/base64.c", "src/crypto/bio/bio.c", "src/crypto/bio/bio_mem.c", - "src/crypto/bio/buffer.c", "src/crypto/bio/connect.c", "src/crypto/bio/fd.c", "src/crypto/bio/file.c", @@ -407,6 +406,7 @@ "src/ssl/ssl_rsa_cc.cc", "src/ssl/ssl_session.c", "src/ssl/ssl_stat.c", + "src/ssl/ssl_x509.c", "src/ssl/t1_enc.c", "src/ssl/t1_lib.c", "src/ssl/tls13_both.c", @@ -471,6 +471,7 @@ "linux-x86_64/crypto/bn/x86_64-mont.S", "linux-x86_64/crypto/bn/x86_64-mont5.S", "linux-x86_64/crypto/chacha/chacha-x86_64.S", + "linux-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S", "linux-x86_64/crypto/ec/p256-x86_64-asm.S", "linux-x86_64/crypto/md5/md5-x86_64.S", "linux-x86_64/crypto/modes/aesni-gcm-x86_64.S", @@ -506,6 +507,7 @@ "mac-x86_64/crypto/bn/x86_64-mont.S", "mac-x86_64/crypto/bn/x86_64-mont5.S", "mac-x86_64/crypto/chacha/chacha-x86_64.S", + "mac-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S", "mac-x86_64/crypto/ec/p256-x86_64-asm.S", "mac-x86_64/crypto/md5/md5-x86_64.S", "mac-x86_64/crypto/modes/aesni-gcm-x86_64.S", @@ -541,6 +543,7 @@ "win-x86_64/crypto/bn/x86_64-mont.asm", "win-x86_64/crypto/bn/x86_64-mont5.asm", "win-x86_64/crypto/chacha/chacha-x86_64.asm", + "win-x86_64/crypto/cipher/chacha20_poly1305_x86_64.asm", "win-x86_64/crypto/ec/p256-x86_64-asm.asm", "win-x86_64/crypto/md5/md5-x86_64.asm", "win-x86_64/crypto/modes/aesni-gcm-x86_64.asm",
diff --git a/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S index 554df1f..5d7502c 100644 --- a/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S +++ b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S
@@ -1826,6 +1826,7 @@ .align 32 .L8x_tail_done: + xorq %rax,%rax addq (%rdx),%r8 adcq $0,%r9 adcq $0,%r10 @@ -1834,9 +1835,7 @@ adcq $0,%r13 adcq $0,%r14 adcq $0,%r15 - - - xorq %rax,%rax + adcq $0,%rax negq %rsi .L8x_no_tail:
diff --git a/third_party/boringssl/linux-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S b/third_party/boringssl/linux-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S new file mode 100644 index 0000000..ca825dc9 --- /dev/null +++ b/third_party/boringssl/linux-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S
@@ -0,0 +1,8787 @@ +#if defined(__x86_64__) +.text +.extern OPENSSL_ia32cap_P +.hidden OPENSSL_ia32cap_P +.align 64 +.chacha20_consts: +.byte 'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k' +.byte 'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k' +.rol8: +.byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 +.byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 +.rol16: +.byte 2,3,0,1, 6,7,4,5, 10,11,8,9, 14,15,12,13 +.byte 2,3,0,1, 6,7,4,5, 10,11,8,9, 14,15,12,13 +.avx2_init: +.long 0,0,0,0 +.sse_inc: +.long 1,0,0,0 +.avx2_inc: +.long 2,0,0,0,2,0,0,0 +.clamp: +.quad 0x0FFFFFFC0FFFFFFF, 0x0FFFFFFC0FFFFFFC +.quad 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF +.align 16 +.and_masks: +.byte 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00 + +.type poly_hash_ad_internal,@function +.align 64 +poly_hash_ad_internal: +.cfi_startproc + xorq %r10,%r10 + xorq %r11,%r11 + xorq %r12,%r12 + cmpq $13,%r8 + jne hash_ad_loop +poly_fast_tls_ad: + + movq (%rcx),%r10 + movq 5(%rcx),%r11 + shrq $24,%r11 + movq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + .byte 0xf3,0xc3 +hash_ad_loop: + + cmpq $16,%r8 + jb hash_ad_tail + addq 0(%rcx),%r10 + adcq 8+0(%rcx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rcx),%rcx + subq $16,%r8 + jmp hash_ad_loop +hash_ad_tail: + cmpq $0,%r8 + je 1f + + xorq %r13,%r13 + xorq %r14,%r14 + xorq %r15,%r15 + addq %r8,%rcx +hash_ad_tail_loop: + shldq $8,%r13,%r14 + shlq $8,%r13 + movzbq -1(%rcx),%r15 + xorq %r15,%r13 + decq %rcx + decq %r8 + jne hash_ad_tail_loop + + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + +1: + .byte 0xf3,0xc3 +.cfi_endproc +.size poly_hash_ad_internal, .-poly_hash_ad_internal + +.globl chacha20_poly1305_open +.hidden chacha20_poly1305_open +.type chacha20_poly1305_open,@function +.align 64 +chacha20_poly1305_open: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 + pushq %rbx +.cfi_adjust_cfa_offset 8 + pushq %r12 +.cfi_adjust_cfa_offset 8 + pushq %r13 +.cfi_adjust_cfa_offset 8 + pushq %r14 +.cfi_adjust_cfa_offset 8 + pushq %r15 +.cfi_adjust_cfa_offset 8 + + + pushq %r9 +.cfi_adjust_cfa_offset 8 + subq $288 + 32,%rsp +.cfi_adjust_cfa_offset 288 + 32 +.cfi_offset rbp, -16 +.cfi_offset rbx, -24 +.cfi_offset r12, -32 +.cfi_offset r13, -40 +.cfi_offset r14, -48 +.cfi_offset r15, -56 +.cfi_offset %r9, -64 + leaq 32(%rsp),%rbp + andq $-32,%rbp + movq %rdx,8+32(%rbp) + movq %r8,0+32(%rbp) + movq %rdx,%rbx + + movl OPENSSL_ia32cap_P+8(%rip),%eax + andl $288,%eax + xorl $288,%eax + jz chacha20_poly1305_open_avx2 + +1: + cmpq $128,%rbx + jbe open_sse_128 + + movdqa .chacha20_consts(%rip),%xmm0 + movdqu 0(%r9),%xmm4 + movdqu 16(%r9),%xmm8 + movdqu 32(%r9),%xmm12 + movdqa %xmm12,%xmm7 + + movdqa %xmm4,48(%rbp) + movdqa %xmm8,64(%rbp) + movdqa %xmm12,96(%rbp) + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %r10 + jne 1b + + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + + pand .clamp(%rip),%xmm0 + movdqa %xmm0,0(%rbp) + movdqa %xmm4,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal +open_sse_main_loop: + cmpq $256,%rbx + jb 2f + + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + + + + movq $4,%rcx + movq %rsi,%r8 +1: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + + leaq 16(%r8),%r8 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %rcx + jge 1b + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + cmpq $-6,%rcx + jg 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqa %xmm12,80(%rbp) + movdqu 0 + 0(%rsi),%xmm12 + pxor %xmm3,%xmm12 + movdqu %xmm12,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm12 + pxor %xmm7,%xmm12 + movdqu %xmm12,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm12 + pxor %xmm11,%xmm12 + movdqu %xmm12,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm12 + pxor %xmm15,%xmm12 + movdqu %xmm12,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + movdqu 0 + 192(%rsi),%xmm3 + movdqu 16 + 192(%rsi),%xmm7 + movdqu 32 + 192(%rsi),%xmm11 + movdqu 48 + 192(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor 80(%rbp),%xmm15 + movdqu %xmm0,0 + 192(%rdi) + movdqu %xmm4,16 + 192(%rdi) + movdqu %xmm8,32 + 192(%rdi) + movdqu %xmm15,48 + 192(%rdi) + + leaq 256(%rsi),%rsi + leaq 256(%rdi),%rdi + subq $256,%rbx + jmp open_sse_main_loop +2: + + testq %rbx,%rbx + jz open_sse_finalize + cmpq $64,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa 96(%rbp),%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + + xorq %r8,%r8 + movq %rbx,%rcx + cmpq $16,%rcx + jb 2f +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + cmpq $16,%rcx + jae 1b + cmpq $160,%r8 + jne 2b + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + jmp open_sse_tail_64_dec_loop +3: + cmpq $128,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa 96(%rbp),%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + + movq %rbx,%rcx + andq $-16,%rcx + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 0(%rdi) + movdqu %xmm5,16 + 0(%rdi) + movdqu %xmm9,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + + subq $64,%rbx + leaq 64(%rsi),%rsi + leaq 64(%rdi),%rdi + jmp open_sse_tail_64_dec_loop +3: + cmpq $192,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa 96(%rbp),%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + + movq %rbx,%rcx + movq $160,%r8 + cmpq $160,%rcx + cmovgq %r8,%rcx + andq $-16,%rcx + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + cmpq $176,%rbx + jb 1f + addq 160(%rsi),%r10 + adcq 8+160(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + cmpq $192,%rbx + jb 1f + addq 176(%rsi),%r10 + adcq 8+176(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +1: + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + subq $128,%rbx + leaq 128(%rsi),%rsi + leaq 128(%rdi),%rdi + jmp open_sse_tail_64_dec_loop +3: + + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movdqa %xmm11,80(%rbp) + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm4 + pxor %xmm11,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm4 + pxor %xmm11,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm5 + pxor %xmm11,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm5 + pxor %xmm11,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm6 + pxor %xmm11,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm6 + pxor %xmm11,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + movdqa 80(%rbp),%xmm11 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa %xmm9,80(%rbp) + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol16(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $12,%xmm9 + psrld $20,%xmm7 + pxor %xmm9,%xmm7 + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol8(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $7,%xmm9 + psrld $25,%xmm7 + pxor %xmm9,%xmm7 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 + movdqa 80(%rbp),%xmm9 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + movdqa %xmm11,80(%rbp) + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm4 + pxor %xmm11,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm4 + pxor %xmm11,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm5 + pxor %xmm11,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm5 + pxor %xmm11,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm6 + pxor %xmm11,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm6 + pxor %xmm11,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + movdqa 80(%rbp),%xmm11 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + movdqa %xmm9,80(%rbp) + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol16(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $12,%xmm9 + psrld $20,%xmm7 + pxor %xmm9,%xmm7 + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol8(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $7,%xmm9 + psrld $25,%xmm7 + pxor %xmm9,%xmm7 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 + movdqa 80(%rbp),%xmm9 + + addq $16,%r8 + cmpq $160,%r8 + jb 1b + movq %rbx,%rcx + andq $-16,%rcx +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + addq $16,%r8 + cmpq %rcx,%r8 + jb 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqa %xmm12,80(%rbp) + movdqu 0 + 0(%rsi),%xmm12 + pxor %xmm3,%xmm12 + movdqu %xmm12,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm12 + pxor %xmm7,%xmm12 + movdqu %xmm12,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm12 + pxor %xmm11,%xmm12 + movdqu %xmm12,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm12 + pxor %xmm15,%xmm12 + movdqu %xmm12,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + movdqa 80(%rbp),%xmm12 + subq $192,%rbx + leaq 192(%rsi),%rsi + leaq 192(%rdi),%rdi + + +open_sse_tail_64_dec_loop: + cmpq $16,%rbx + jb 1f + subq $16,%rbx + movdqu (%rsi),%xmm3 + pxor %xmm3,%xmm0 + movdqu %xmm0,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movdqa %xmm4,%xmm0 + movdqa %xmm8,%xmm4 + movdqa %xmm12,%xmm8 + jmp open_sse_tail_64_dec_loop +1: + movdqa %xmm0,%xmm1 + + +open_sse_tail_16: + testq %rbx,%rbx + jz open_sse_finalize + + + + pxor %xmm3,%xmm3 + leaq -1(%rsi,%rbx), %rsi + movq %rbx,%r8 +2: + pslldq $1,%xmm3 + pinsrb $0,(%rsi),%xmm3 + subq $1,%rsi + subq $1,%r8 + jnz 2b + +3: +.byte 102,73,15,126,221 + pextrq $1,%xmm3,%r14 + + pxor %xmm1,%xmm3 + + +2: + pextrb $0,%xmm3,(%rdi) + psrldq $1,%xmm3 + addq $1,%rdi + subq $1,%rbx + jne 2b + + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + +open_sse_finalize: + addq 32(%rbp),%r10 + adcq 8+32(%rbp),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movq %r10,%r13 + movq %r11,%r14 + movq %r12,%r15 + subq $-5,%r10 + sbbq $-1,%r11 + sbbq $3,%r12 + cmovcq %r13,%r10 + cmovcq %r14,%r11 + cmovcq %r15,%r12 + + addq 0+16(%rbp),%r10 + adcq 8+16(%rbp),%r11 + + addq $288 + 32,%rsp +.cfi_adjust_cfa_offset -(288 + 32) + popq %r9 +.cfi_adjust_cfa_offset -8 + movq %r10,(%r9) + movq %r11,8(%r9) + + popq %r15 +.cfi_adjust_cfa_offset -8 + popq %r14 +.cfi_adjust_cfa_offset -8 + popq %r13 +.cfi_adjust_cfa_offset -8 + popq %r12 +.cfi_adjust_cfa_offset -8 + popq %rbx +.cfi_adjust_cfa_offset -8 + popq %rbp +.cfi_adjust_cfa_offset -8 + .byte 0xf3,0xc3 +.cfi_adjust_cfa_offset (8 * 6) + 288 + 32 + +open_sse_128: + movdqu .chacha20_consts(%rip),%xmm0 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqu 0(%r9),%xmm4 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqu 16(%r9),%xmm8 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqu 32(%r9),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa %xmm13,%xmm15 + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm0 + paddd .chacha20_consts(%rip),%xmm1 + paddd .chacha20_consts(%rip),%xmm2 + paddd %xmm7,%xmm4 + paddd %xmm7,%xmm5 + paddd %xmm7,%xmm6 + paddd %xmm11,%xmm9 + paddd %xmm11,%xmm10 + paddd %xmm15,%xmm13 + paddd .sse_inc(%rip),%xmm15 + paddd %xmm15,%xmm14 + + pand .clamp(%rip),%xmm0 + movdqa %xmm0,0(%rbp) + movdqa %xmm4,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal +1: + cmpq $16,%rbx + jb open_sse_tail_16 + subq $16,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + + + movdqu 0(%rsi),%xmm3 + pxor %xmm3,%xmm1 + movdqu %xmm1,0(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movdqa %xmm5,%xmm1 + movdqa %xmm9,%xmm5 + movdqa %xmm13,%xmm9 + movdqa %xmm2,%xmm13 + movdqa %xmm6,%xmm2 + movdqa %xmm10,%xmm6 + movdqa %xmm14,%xmm10 + jmp 1b + jmp open_sse_tail_16 +.size chacha20_poly1305_open, .-chacha20_poly1305_open +.cfi_endproc + + + + +.globl chacha20_poly1305_seal +.hidden chacha20_poly1305_seal +.type chacha20_poly1305_seal,@function +.align 64 +chacha20_poly1305_seal: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 + pushq %rbx +.cfi_adjust_cfa_offset 8 + pushq %r12 +.cfi_adjust_cfa_offset 8 + pushq %r13 +.cfi_adjust_cfa_offset 8 + pushq %r14 +.cfi_adjust_cfa_offset 8 + pushq %r15 +.cfi_adjust_cfa_offset 8 + + + pushq %r9 +.cfi_adjust_cfa_offset 8 + subq $288 + 32,%rsp +.cfi_adjust_cfa_offset 288 + 32 +.cfi_offset rbp, -16 +.cfi_offset rbx, -24 +.cfi_offset r12, -32 +.cfi_offset r13, -40 +.cfi_offset r14, -48 +.cfi_offset r15, -56 +.cfi_offset %r9, -64 + leaq 32(%rsp),%rbp + andq $-32,%rbp + movq %rdx,8+32(%rbp) + movq %r8,0+32(%rbp) + movq %rdx,%rbx + + movl OPENSSL_ia32cap_P+8(%rip),%eax + andl $288,%eax + xorl $288,%eax + jz chacha20_poly1305_seal_avx2 + + cmpq $128,%rbx + jbe seal_sse_128 + + movdqa .chacha20_consts(%rip),%xmm0 + movdqu 0(%r9),%xmm4 + movdqu 16(%r9),%xmm8 + movdqu 32(%r9),%xmm12 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqa %xmm8,%xmm11 + movdqa %xmm12,%xmm15 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm14 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm12 + + movdqa %xmm4,48(%rbp) + movdqa %xmm8,64(%rbp) + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + movq $10,%r10 +1: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + + pand .clamp(%rip),%xmm3 + movdqa %xmm3,0(%rbp) + movdqa %xmm7,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + cmpq $192,%rbx + ja 1f + movq $128,%rcx + subq $128,%rbx + leaq 128(%rsi),%rsi + jmp seal_sse_128_seal_hash +1: + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor %xmm12,%xmm15 + movdqu %xmm0,0 + 128(%rdi) + movdqu %xmm4,16 + 128(%rdi) + movdqu %xmm8,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + movq $192,%rcx + subq $192,%rbx + leaq 192(%rsi),%rsi + movq $2,%rcx + movq $8,%r8 + cmpq $64,%rbx + jbe seal_sse_tail_64 + cmpq $128,%rbx + jbe seal_sse_tail_128 + cmpq $192,%rbx + jbe seal_sse_tail_192 + +1: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + +2: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + leaq 16(%rdi),%rdi + decq %r8 + jge 2b + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + decq %rcx + jg 2b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + movdqa %xmm14,80(%rbp) + movdqa %xmm14,80(%rbp) + movdqu 0 + 0(%rsi),%xmm14 + pxor %xmm3,%xmm14 + movdqu %xmm14,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm14 + pxor %xmm7,%xmm14 + movdqu %xmm14,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm14 + pxor %xmm11,%xmm14 + movdqu %xmm14,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm14 + pxor %xmm15,%xmm14 + movdqu %xmm14,48 + 0(%rdi) + + movdqa 80(%rbp),%xmm14 + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + cmpq $256,%rbx + ja 3f + + movq $192,%rcx + subq $192,%rbx + leaq 192(%rsi),%rsi + jmp seal_sse_128_seal_hash +3: + movdqu 0 + 192(%rsi),%xmm3 + movdqu 16 + 192(%rsi),%xmm7 + movdqu 32 + 192(%rsi),%xmm11 + movdqu 48 + 192(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor %xmm12,%xmm15 + movdqu %xmm0,0 + 192(%rdi) + movdqu %xmm4,16 + 192(%rdi) + movdqu %xmm8,32 + 192(%rdi) + movdqu %xmm15,48 + 192(%rdi) + + leaq 256(%rsi),%rsi + subq $256,%rbx + movq $6,%rcx + movq $4,%r8 + cmpq $192,%rbx + jg 1b + movq %rbx,%rcx + testq %rbx,%rbx + je seal_sse_128_seal_hash + movq $6,%rcx + cmpq $64,%rbx + jg 3f + +seal_sse_tail_64: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa 96(%rbp),%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + jmp seal_sse_128_seal +3: + cmpq $128,%rbx + jg 3f + +seal_sse_tail_128: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa 96(%rbp),%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 0(%rdi) + movdqu %xmm5,16 + 0(%rdi) + movdqu %xmm9,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + + movq $64,%rcx + subq $64,%rbx + leaq 64(%rsi),%rsi + jmp seal_sse_128_seal_hash +3: + +seal_sse_tail_192: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa 96(%rbp),%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + movq $128,%rcx + subq $128,%rbx + leaq 128(%rsi),%rsi + +seal_sse_128_seal_hash: + cmpq $16,%rcx + jb seal_sse_128_seal + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx + leaq 16(%rdi),%rdi + jmp seal_sse_128_seal_hash + +seal_sse_128_seal: + cmpq $16,%rbx + jb seal_sse_tail_16 + subq $16,%rbx + + movdqu 0(%rsi),%xmm3 + pxor %xmm3,%xmm0 + movdqu %xmm0,0(%rdi) + + addq 0(%rdi),%r10 + adcq 8(%rdi),%r11 + adcq $1,%r12 + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movdqa %xmm4,%xmm0 + movdqa %xmm8,%xmm4 + movdqa %xmm12,%xmm8 + movdqa %xmm1,%xmm12 + movdqa %xmm5,%xmm1 + movdqa %xmm9,%xmm5 + movdqa %xmm13,%xmm9 + jmp seal_sse_128_seal + +seal_sse_tail_16: + testq %rbx,%rbx + jz seal_sse_finalize + + movq %rbx,%r8 + shlq $4,%r8 + leaq .and_masks(%rip),%r13 + movq %rbx,%rcx + leaq -1(%rsi,%rbx), %rsi + pxor %xmm15,%xmm15 +1: + pslldq $1,%xmm15 + pinsrb $0,(%rsi),%xmm15 + leaq -1(%rsi),%rsi + decq %rcx + jne 1b + + + pxor %xmm0,%xmm15 + + + movq %rbx,%rcx + movdqu %xmm15,%xmm0 +2: + pextrb $0,%xmm0,(%rdi) + psrldq $1,%xmm0 + addq $1,%rdi + subq $1,%rcx + jnz 2b + + pand -16(%r13,%r8), %xmm15 +.byte 102,77,15,126,253 + pextrq $1,%xmm15,%r14 + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +seal_sse_finalize: + addq 32(%rbp),%r10 + adcq 8+32(%rbp),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movq %r10,%r13 + movq %r11,%r14 + movq %r12,%r15 + subq $-5,%r10 + sbbq $-1,%r11 + sbbq $3,%r12 + cmovcq %r13,%r10 + cmovcq %r14,%r11 + cmovcq %r15,%r12 + + addq 0+16(%rbp),%r10 + adcq 8+16(%rbp),%r11 + + addq $288 + 32,%rsp +.cfi_adjust_cfa_offset -(288 + 32) + popq %r9 +.cfi_adjust_cfa_offset -8 + movq %r10,0(%r9) + movq %r11,8(%r9) + + popq %r15 +.cfi_adjust_cfa_offset -8 + popq %r14 +.cfi_adjust_cfa_offset -8 + popq %r13 +.cfi_adjust_cfa_offset -8 + popq %r12 +.cfi_adjust_cfa_offset -8 + popq %rbx +.cfi_adjust_cfa_offset -8 + popq %rbp +.cfi_adjust_cfa_offset -8 + .byte 0xf3,0xc3 +.cfi_adjust_cfa_offset (8 * 6) + 288 + 32 + +seal_sse_128: + movdqu .chacha20_consts(%rip),%xmm0 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqu 0(%r9),%xmm4 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqu 16(%r9),%xmm8 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqu 32(%r9),%xmm14 + movdqa %xmm14,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa %xmm12,%xmm15 + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm0 + paddd .chacha20_consts(%rip),%xmm1 + paddd .chacha20_consts(%rip),%xmm2 + paddd %xmm7,%xmm4 + paddd %xmm7,%xmm5 + paddd %xmm7,%xmm6 + paddd %xmm11,%xmm8 + paddd %xmm11,%xmm9 + paddd %xmm15,%xmm12 + paddd .sse_inc(%rip),%xmm15 + paddd %xmm15,%xmm13 + + pand .clamp(%rip),%xmm2 + movdqa %xmm2,0(%rbp) + movdqa %xmm6,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal + jmp seal_sse_128_seal +.size chacha20_poly1305_seal, .-chacha20_poly1305_seal + + +.type chacha20_poly1305_open_avx2,@function +.align 64 +chacha20_poly1305_open_avx2: + vzeroupper + vmovdqa .chacha20_consts(%rip),%ymm0 + vbroadcasti128 0(%r9),%ymm4 + vbroadcasti128 16(%r9),%ymm8 + vbroadcasti128 32(%r9),%ymm12 + vpaddd .avx2_init(%rip),%ymm12,%ymm12 + cmpq $192,%rbx + jbe open_avx2_192 + cmpq $320,%rbx + jbe open_avx2_320 + + vmovdqa %ymm4,64(%rbp) + vmovdqa %ymm8,96(%rbp) + vmovdqa %ymm12,160(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + + movq %r8,%r8 + call poly_hash_ad_internal + xorq %rcx,%rcx + +1: + addq 0(%rsi,%rcx), %r10 + adcq 8+0(%rsi,%rcx), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + addq $16,%rcx + cmpq $64,%rcx + jne 1b + + vpxor 0(%rsi),%ymm0,%ymm0 + vpxor 32(%rsi),%ymm4,%ymm4 + vmovdqu %ymm0,0(%rdi) + vmovdqu %ymm4,32(%rdi) + leaq 64(%rsi),%rsi + leaq 64(%rdi),%rdi + subq $64,%rbx +1: + + cmpq $512,%rbx + jb 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + xorq %rcx,%rcx +2: + addq 0*8(%rsi,%rcx), %r10 + adcq 8+0*8(%rsi,%rcx), %r11 + adcq $1,%r12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + addq %rax,%r15 + adcq %rdx,%r9 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + addq 2*8(%rsi,%rcx), %r10 + adcq 8+2*8(%rsi,%rcx), %r11 + adcq $1,%r12 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + addq %rax,%r15 + adcq %rdx,%r9 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + addq 4*8(%rsi,%rcx), %r10 + adcq 8+4*8(%rsi,%rcx), %r11 + adcq $1,%r12 + + leaq 48(%rcx),%rcx + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + addq %rax,%r15 + adcq %rdx,%r9 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + cmpq $60*8,%rcx + jne 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + addq 60*8(%rsi),%r10 + adcq 8+60*8(%rsi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + addq 60*8+16(%rsi),%r10 + adcq 8+60*8+16(%rsi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm4 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm8 + vpxor 0+384(%rsi),%ymm3,%ymm3 + vpxor 32+384(%rsi),%ymm0,%ymm0 + vpxor 64+384(%rsi),%ymm4,%ymm4 + vpxor 96+384(%rsi),%ymm8,%ymm8 + vmovdqu %ymm3,0+384(%rdi) + vmovdqu %ymm0,32+384(%rdi) + vmovdqu %ymm4,64+384(%rdi) + vmovdqu %ymm8,96+384(%rdi) + + leaq 512(%rsi),%rsi + leaq 512(%rdi),%rdi + subq $512,%rbx + jmp 1b +3: + testq %rbx,%rbx + vzeroupper + je open_sse_finalize +3: + cmpq $128,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + + xorq %r8,%r8 + movq %rbx,%rcx + andq $-16,%rcx + testq %rcx,%rcx + je 2f +1: + addq 0*8(%rsi,%r8), %r10 + adcq 8+0*8(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + jmp open_avx2_tail_loop +3: + cmpq $256,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + + movq %rbx,128(%rbp) + movq %rbx,%rcx + subq $128,%rcx + shrq $4,%rcx + movq $10,%r8 + cmpq $10,%rcx + cmovgq %r8,%rcx + movq %rsi,%rbx + xorq %r8,%r8 +1: + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + + incq %r8 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + cmpq %rcx,%r8 + jb 1b + cmpq $10,%r8 + jne 2b + movq %rbx,%r8 + subq %rsi,%rbx + movq %rbx,%rcx + movq 128(%rbp),%rbx +1: + addq $16,%rcx + cmpq %rbx,%rcx + jg 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm1,%ymm1 + vpxor 64+0(%rsi),%ymm5,%ymm5 + vpxor 96+0(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm1,32+0(%rdi) + vmovdqu %ymm5,64+0(%rdi) + vmovdqu %ymm9,96+0(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 128(%rsi),%rsi + leaq 128(%rdi),%rdi + subq $128,%rbx + jmp open_avx2_tail_loop +3: + cmpq $384,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + + movq %rbx,128(%rbp) + movq %rbx,%rcx + subq $256,%rcx + shrq $4,%rcx + addq $6,%rcx + movq $10,%r8 + cmpq $10,%rcx + cmovgq %r8,%rcx + movq %rsi,%rbx + xorq %r8,%r8 +1: + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx +2: + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx + incq %r8 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + cmpq %rcx,%r8 + jb 1b + cmpq $10,%r8 + jne 2b + movq %rbx,%r8 + subq %rsi,%rbx + movq %rbx,%rcx + movq 128(%rbp),%rbx +1: + addq $16,%rcx + cmpq %rbx,%rcx + jg 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm2,%ymm2 + vpxor 64+0(%rsi),%ymm6,%ymm6 + vpxor 96+0(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm2,32+0(%rdi) + vmovdqu %ymm6,64+0(%rdi) + vmovdqu %ymm10,96+0(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm1,%ymm1 + vpxor 64+128(%rsi),%ymm5,%ymm5 + vpxor 96+128(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm1,32+128(%rdi) + vmovdqu %ymm5,64+128(%rdi) + vmovdqu %ymm9,96+128(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 256(%rsi),%rsi + leaq 256(%rdi),%rdi + subq $256,%rbx + jmp open_avx2_tail_loop +3: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + xorq %rcx,%rcx + movq %rsi,%r8 +1: + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 +2: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + addq 16(%r8),%r10 + adcq 8+16(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%r8),%r8 + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + incq %rcx + cmpq $4,%rcx + jl 1b + cmpq $10,%rcx + jne 2b + movq %rbx,%rcx + subq $384,%rcx + andq $-16,%rcx +1: + testq %rcx,%rcx + je 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + subq $16,%rcx + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 384(%rsi),%rsi + leaq 384(%rdi),%rdi + subq $384,%rbx +open_avx2_tail_loop: + cmpq $32,%rbx + jb open_avx2_tail + subq $32,%rbx + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + leaq 32(%rdi),%rdi + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + jmp open_avx2_tail_loop +open_avx2_tail: + cmpq $16,%rbx + vmovdqa %xmm0,%xmm1 + jb 1f + subq $16,%rbx + + vpxor (%rsi),%xmm0,%xmm1 + vmovdqu %xmm1,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + vperm2i128 $0x11,%ymm0,%ymm0,%ymm0 + vmovdqa %xmm0,%xmm1 +1: + vzeroupper + jmp open_sse_tail_16 + +open_avx2_192: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vmovdqa %ymm12,%ymm11 + vmovdqa %ymm13,%ymm15 + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + + decq %r10 + jne 1b + vpaddd %ymm2,%ymm0,%ymm0 + vpaddd %ymm2,%ymm1,%ymm1 + vpaddd %ymm6,%ymm4,%ymm4 + vpaddd %ymm6,%ymm5,%ymm5 + vpaddd %ymm10,%ymm8,%ymm8 + vpaddd %ymm10,%ymm9,%ymm9 + vpaddd %ymm11,%ymm12,%ymm12 + vpaddd %ymm15,%ymm13,%ymm13 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 +open_avx2_short: + movq %r8,%r8 + call poly_hash_ad_internal +open_avx2_hash_and_xor_loop: + cmpq $32,%rbx + jb open_avx2_short_tail_32 + subq $32,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rsi),%r10 + adcq 8+16(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + leaq 32(%rdi),%rdi + + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + vmovdqa %ymm1,%ymm12 + vmovdqa %ymm5,%ymm1 + vmovdqa %ymm9,%ymm5 + vmovdqa %ymm13,%ymm9 + vmovdqa %ymm2,%ymm13 + vmovdqa %ymm6,%ymm2 + jmp open_avx2_hash_and_xor_loop +open_avx2_short_tail_32: + cmpq $16,%rbx + vmovdqa %xmm0,%xmm1 + jb 1f + subq $16,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + vpxor (%rsi),%xmm0,%xmm3 + vmovdqu %xmm3,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + vextracti128 $1,%ymm0,%xmm1 +1: + vzeroupper + jmp open_sse_tail_16 + +open_avx2_320: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm14 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd %ymm7,%ymm4,%ymm4 + vpaddd %ymm7,%ymm5,%ymm5 + vpaddd %ymm7,%ymm6,%ymm6 + vpaddd %ymm11,%ymm8,%ymm8 + vpaddd %ymm11,%ymm9,%ymm9 + vpaddd %ymm11,%ymm10,%ymm10 + vpaddd 160(%rbp),%ymm12,%ymm12 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd 224(%rbp),%ymm14,%ymm14 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm9 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm13 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm6 + jmp open_avx2_short +.size chacha20_poly1305_open_avx2, .-chacha20_poly1305_open_avx2 + + +.type chacha20_poly1305_seal_avx2,@function +.align 64 +chacha20_poly1305_seal_avx2: + vzeroupper + vmovdqa .chacha20_consts(%rip),%ymm0 + vbroadcasti128 0(%r9),%ymm4 + vbroadcasti128 16(%r9),%ymm8 + vbroadcasti128 32(%r9),%ymm12 + vpaddd .avx2_init(%rip),%ymm12,%ymm12 + cmpq $192,%rbx + jbe seal_avx2_192 + cmpq $320,%rbx + jbe seal_avx2_320 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm4,64(%rbp) + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm8,96(%rbp) + vmovdqa %ymm12,%ymm15 + vpaddd .avx2_inc(%rip),%ymm15,%ymm14 + vpaddd .avx2_inc(%rip),%ymm14,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm15,256(%rbp) + movq $10,%r10 +1: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + decq %r10 + jnz 1b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm15 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm3 + vpand .clamp(%rip),%ymm15,%ymm15 + vmovdqa %ymm15,0(%rbp) + movq %r8,%r8 + call poly_hash_ad_internal + + vpxor 0(%rsi),%ymm3,%ymm3 + vpxor 32(%rsi),%ymm11,%ymm11 + vmovdqu %ymm3,0(%rdi) + vmovdqu %ymm11,32(%rdi) + vperm2i128 $0x02,%ymm2,%ymm6,%ymm15 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+64(%rsi),%ymm15,%ymm15 + vpxor 32+64(%rsi),%ymm2,%ymm2 + vpxor 64+64(%rsi),%ymm6,%ymm6 + vpxor 96+64(%rsi),%ymm10,%ymm10 + vmovdqu %ymm15,0+64(%rdi) + vmovdqu %ymm2,32+64(%rdi) + vmovdqu %ymm6,64+64(%rdi) + vmovdqu %ymm10,96+64(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm15 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+192(%rsi),%ymm15,%ymm15 + vpxor 32+192(%rsi),%ymm1,%ymm1 + vpxor 64+192(%rsi),%ymm5,%ymm5 + vpxor 96+192(%rsi),%ymm9,%ymm9 + vmovdqu %ymm15,0+192(%rdi) + vmovdqu %ymm1,32+192(%rdi) + vmovdqu %ymm5,64+192(%rdi) + vmovdqu %ymm9,96+192(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm15 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm15,%ymm8 + + leaq 320(%rsi),%rsi + subq $320,%rbx + movq $320,%rcx + cmpq $128,%rbx + jbe seal_avx2_hash + vpxor 0(%rsi),%ymm0,%ymm0 + vpxor 32(%rsi),%ymm4,%ymm4 + vpxor 64(%rsi),%ymm8,%ymm8 + vpxor 96(%rsi),%ymm12,%ymm12 + vmovdqu %ymm0,320(%rdi) + vmovdqu %ymm4,352(%rdi) + vmovdqu %ymm8,384(%rdi) + vmovdqu %ymm12,416(%rdi) + leaq 128(%rsi),%rsi + subq $128,%rbx + movq $8,%rcx + movq $2,%r8 + cmpq $128,%rbx + jbe seal_avx2_tail_128 + cmpq $256,%rbx + jbe seal_avx2_tail_256 + cmpq $384,%rbx + jbe seal_avx2_tail_384 + cmpq $512,%rbx + jbe seal_avx2_tail_512 + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + + subq $16,%rdi + movq $9,%rcx + jmp 4f +1: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + movq $10,%rcx +2: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + addq %rax,%r15 + adcq %rdx,%r9 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +4: + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + addq %rax,%r15 + adcq %rdx,%r9 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + addq 32(%rdi),%r10 + adcq 8+32(%rdi),%r11 + adcq $1,%r12 + + leaq 48(%rdi),%rdi + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + addq %rax,%r15 + adcq %rdx,%r9 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + decq %rcx + jne 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + leaq 32(%rdi),%rdi + vmovdqa %ymm0,128(%rbp) + addq -32(%rdi),%r10 + adcq 8+-32(%rdi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + addq -16(%rdi),%r10 + adcq 8+-16(%rdi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm4 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm8 + vpxor 0+384(%rsi),%ymm3,%ymm3 + vpxor 32+384(%rsi),%ymm0,%ymm0 + vpxor 64+384(%rsi),%ymm4,%ymm4 + vpxor 96+384(%rsi),%ymm8,%ymm8 + vmovdqu %ymm3,0+384(%rdi) + vmovdqu %ymm0,32+384(%rdi) + vmovdqu %ymm4,64+384(%rdi) + vmovdqu %ymm8,96+384(%rdi) + + leaq 512(%rsi),%rsi + subq $512,%rbx + cmpq $512,%rbx + jg 1b + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + movq $10,%rcx + xorq %r8,%r8 + cmpq $128,%rbx + ja 3f + +seal_avx2_tail_128: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + jmp seal_avx2_short_loop +3: + cmpq $256,%rbx + ja 3f + +seal_avx2_tail_256: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm1,%ymm1 + vpxor 64+0(%rsi),%ymm5,%ymm5 + vpxor 96+0(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm1,32+0(%rdi) + vmovdqu %ymm5,64+0(%rdi) + vmovdqu %ymm9,96+0(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $128,%rcx + leaq 128(%rsi),%rsi + subq $128,%rbx + jmp seal_avx2_hash +3: + cmpq $384,%rbx + ja seal_avx2_tail_512 + +seal_avx2_tail_384: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm2,%ymm2 + vpxor 64+0(%rsi),%ymm6,%ymm6 + vpxor 96+0(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm2,32+0(%rdi) + vmovdqu %ymm6,64+0(%rdi) + vmovdqu %ymm10,96+0(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm1,%ymm1 + vpxor 64+128(%rsi),%ymm5,%ymm5 + vpxor 96+128(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm1,32+128(%rdi) + vmovdqu %ymm5,64+128(%rdi) + vmovdqu %ymm9,96+128(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $256,%rcx + leaq 256(%rsi),%rsi + subq $256,%rbx + jmp seal_avx2_hash + +seal_avx2_tail_512: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + addq %rax,%r15 + adcq %rdx,%r9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + + + + + + + + + + + + addq %rax,%r15 + adcq %rdx,%r9 + + + + + + + + + + + + + + + + + + + + + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $384,%rcx + leaq 384(%rsi),%rsi + subq $384,%rbx + jmp seal_avx2_hash + +seal_avx2_320: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm14 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd %ymm7,%ymm4,%ymm4 + vpaddd %ymm7,%ymm5,%ymm5 + vpaddd %ymm7,%ymm6,%ymm6 + vpaddd %ymm11,%ymm8,%ymm8 + vpaddd %ymm11,%ymm9,%ymm9 + vpaddd %ymm11,%ymm10,%ymm10 + vpaddd 160(%rbp),%ymm12,%ymm12 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd 224(%rbp),%ymm14,%ymm14 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm9 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm13 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm6 + jmp seal_avx2_short + +seal_avx2_192: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vmovdqa %ymm12,%ymm11 + vmovdqa %ymm13,%ymm15 + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + + decq %r10 + jne 1b + vpaddd %ymm2,%ymm0,%ymm0 + vpaddd %ymm2,%ymm1,%ymm1 + vpaddd %ymm6,%ymm4,%ymm4 + vpaddd %ymm6,%ymm5,%ymm5 + vpaddd %ymm10,%ymm8,%ymm8 + vpaddd %ymm10,%ymm9,%ymm9 + vpaddd %ymm11,%ymm12,%ymm12 + vpaddd %ymm15,%ymm13,%ymm13 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 +seal_avx2_short: + movq %r8,%r8 + call poly_hash_ad_internal + xorq %rcx,%rcx +seal_avx2_hash: + cmpq $16,%rcx + jb seal_avx2_short_loop + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx + addq $16,%rdi + jmp seal_avx2_hash +seal_avx2_short_loop: + cmpq $32,%rbx + jb seal_avx2_short_tail + subq $32,%rbx + + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + vmovdqa %ymm1,%ymm12 + vmovdqa %ymm5,%ymm1 + vmovdqa %ymm9,%ymm5 + vmovdqa %ymm13,%ymm9 + vmovdqa %ymm2,%ymm13 + vmovdqa %ymm6,%ymm2 + jmp seal_avx2_short_loop +seal_avx2_short_tail: + cmpq $16,%rbx + jb 1f + subq $16,%rbx + vpxor (%rsi),%xmm0,%xmm3 + vmovdqu %xmm3,(%rdi) + leaq 16(%rsi),%rsi + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + vextracti128 $1,%ymm0,%xmm0 +1: + vzeroupper + jmp seal_sse_tail_16 +.cfi_endproc +#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S index f3ad8d7..a154cc8 100644 --- a/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S +++ b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S
@@ -1825,6 +1825,7 @@ .p2align 5 L$8x_tail_done: + xorq %rax,%rax addq (%rdx),%r8 adcq $0,%r9 adcq $0,%r10 @@ -1833,9 +1834,7 @@ adcq $0,%r13 adcq $0,%r14 adcq $0,%r15 - - - xorq %rax,%rax + adcq $0,%rax negq %rsi L$8x_no_tail:
diff --git a/third_party/boringssl/mac-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S b/third_party/boringssl/mac-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S new file mode 100644 index 0000000..646ee6b0 --- /dev/null +++ b/third_party/boringssl/mac-x86_64/crypto/cipher/chacha20_poly1305_x86_64.S
@@ -0,0 +1,8786 @@ +#if defined(__x86_64__) +.text + +.p2align 6 +.chacha20_consts: +.byte 'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k' +.byte 'e','x','p','a','n','d',' ','3','2','-','b','y','t','e',' ','k' +.rol8: +.byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 +.byte 3,0,1,2, 7,4,5,6, 11,8,9,10, 15,12,13,14 +.rol16: +.byte 2,3,0,1, 6,7,4,5, 10,11,8,9, 14,15,12,13 +.byte 2,3,0,1, 6,7,4,5, 10,11,8,9, 14,15,12,13 +.avx2_init: +.long 0,0,0,0 +.sse_inc: +.long 1,0,0,0 +.avx2_inc: +.long 2,0,0,0,2,0,0,0 +.clamp: +.quad 0x0FFFFFFC0FFFFFFF, 0x0FFFFFFC0FFFFFFC +.quad 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF +.p2align 4 +.and_masks: +.byte 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00 +.byte 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00 + + +.p2align 6 +poly_hash_ad_internal: +.cfi_startproc + xorq %r10,%r10 + xorq %r11,%r11 + xorq %r12,%r12 + cmpq $13,%r8 + jne hash_ad_loop +poly_fast_tls_ad: + + movq (%rcx),%r10 + movq 5(%rcx),%r11 + shrq $24,%r11 + movq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + .byte 0xf3,0xc3 +hash_ad_loop: + + cmpq $16,%r8 + jb hash_ad_tail + addq 0(%rcx),%r10 + adcq 8+0(%rcx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rcx),%rcx + subq $16,%r8 + jmp hash_ad_loop +hash_ad_tail: + cmpq $0,%r8 + je 1f + + xorq %r13,%r13 + xorq %r14,%r14 + xorq %r15,%r15 + addq %r8,%rcx +hash_ad_tail_loop: + shldq $8,%r13,%r14 + shlq $8,%r13 + movzbq -1(%rcx),%r15 + xorq %r15,%r13 + decq %rcx + decq %r8 + jne hash_ad_tail_loop + + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + +1: + .byte 0xf3,0xc3 +.cfi_endproc + + +.globl _chacha20_poly1305_open +.private_extern _chacha20_poly1305_open + +.p2align 6 +_chacha20_poly1305_open: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 + pushq %rbx +.cfi_adjust_cfa_offset 8 + pushq %r12 +.cfi_adjust_cfa_offset 8 + pushq %r13 +.cfi_adjust_cfa_offset 8 + pushq %r14 +.cfi_adjust_cfa_offset 8 + pushq %r15 +.cfi_adjust_cfa_offset 8 + + + pushq %r9 +.cfi_adjust_cfa_offset 8 + subq $288 + 32,%rsp +.cfi_adjust_cfa_offset 288 + 32 +.cfi_offset rbp, -16 +.cfi_offset rbx, -24 +.cfi_offset r12, -32 +.cfi_offset r13, -40 +.cfi_offset r14, -48 +.cfi_offset r15, -56 +.cfi_offset %r9, -64 + leaq 32(%rsp),%rbp + andq $-32,%rbp + movq %rdx,8+32(%rbp) + movq %r8,0+32(%rbp) + movq %rdx,%rbx + + movl _OPENSSL_ia32cap_P+8(%rip),%eax + andl $288,%eax + xorl $288,%eax + jz chacha20_poly1305_open_avx2 + +1: + cmpq $128,%rbx + jbe open_sse_128 + + movdqa .chacha20_consts(%rip),%xmm0 + movdqu 0(%r9),%xmm4 + movdqu 16(%r9),%xmm8 + movdqu 32(%r9),%xmm12 + movdqa %xmm12,%xmm7 + + movdqa %xmm4,48(%rbp) + movdqa %xmm8,64(%rbp) + movdqa %xmm12,96(%rbp) + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %r10 + jne 1b + + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + + pand .clamp(%rip),%xmm0 + movdqa %xmm0,0(%rbp) + movdqa %xmm4,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal +open_sse_main_loop: + cmpq $256,%rbx + jb 2f + + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + + + + movq $4,%rcx + movq %rsi,%r8 +1: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + + leaq 16(%r8),%r8 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %rcx + jge 1b + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + cmpq $-6,%rcx + jg 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqa %xmm12,80(%rbp) + movdqu 0 + 0(%rsi),%xmm12 + pxor %xmm3,%xmm12 + movdqu %xmm12,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm12 + pxor %xmm7,%xmm12 + movdqu %xmm12,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm12 + pxor %xmm11,%xmm12 + movdqu %xmm12,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm12 + pxor %xmm15,%xmm12 + movdqu %xmm12,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + movdqu 0 + 192(%rsi),%xmm3 + movdqu 16 + 192(%rsi),%xmm7 + movdqu 32 + 192(%rsi),%xmm11 + movdqu 48 + 192(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor 80(%rbp),%xmm15 + movdqu %xmm0,0 + 192(%rdi) + movdqu %xmm4,16 + 192(%rdi) + movdqu %xmm8,32 + 192(%rdi) + movdqu %xmm15,48 + 192(%rdi) + + leaq 256(%rsi),%rsi + leaq 256(%rdi),%rdi + subq $256,%rbx + jmp open_sse_main_loop +2: + + testq %rbx,%rbx + jz open_sse_finalize + cmpq $64,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa 96(%rbp),%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + + xorq %r8,%r8 + movq %rbx,%rcx + cmpq $16,%rcx + jb 2f +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + cmpq $16,%rcx + jae 1b + cmpq $160,%r8 + jne 2b + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + jmp open_sse_tail_64_dec_loop +3: + cmpq $128,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa 96(%rbp),%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + + movq %rbx,%rcx + andq $-16,%rcx + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 0(%rdi) + movdqu %xmm5,16 + 0(%rdi) + movdqu %xmm9,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + + subq $64,%rbx + leaq 64(%rsi),%rsi + leaq 64(%rdi),%rdi + jmp open_sse_tail_64_dec_loop +3: + cmpq $192,%rbx + ja 3f + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa 96(%rbp),%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + + movq %rbx,%rcx + movq $160,%r8 + cmpq $160,%rcx + cmovgq %r8,%rcx + andq $-16,%rcx + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + cmpq $176,%rbx + jb 1f + addq 160(%rsi),%r10 + adcq 8+160(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + cmpq $192,%rbx + jb 1f + addq 176(%rsi),%r10 + adcq 8+176(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +1: + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + subq $128,%rbx + leaq 128(%rsi),%rsi + leaq 128(%rdi),%rdi + jmp open_sse_tail_64_dec_loop +3: + + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + + xorq %r8,%r8 +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movdqa %xmm11,80(%rbp) + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm4 + pxor %xmm11,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm4 + pxor %xmm11,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm5 + pxor %xmm11,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm5 + pxor %xmm11,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm6 + pxor %xmm11,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm6 + pxor %xmm11,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + movdqa 80(%rbp),%xmm11 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa %xmm9,80(%rbp) + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol16(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $12,%xmm9 + psrld $20,%xmm7 + pxor %xmm9,%xmm7 + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol8(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $7,%xmm9 + psrld $25,%xmm7 + pxor %xmm9,%xmm7 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 + movdqa 80(%rbp),%xmm9 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + movdqa %xmm11,80(%rbp) + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm4 + pxor %xmm11,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm4 + pxor %xmm11,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm5 + pxor %xmm11,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm5 + pxor %xmm11,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $12,%xmm11 + psrld $20,%xmm6 + pxor %xmm11,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm11 + pslld $7,%xmm11 + psrld $25,%xmm6 + pxor %xmm11,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + movdqa 80(%rbp),%xmm11 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + movdqa %xmm9,80(%rbp) + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol16(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $12,%xmm9 + psrld $20,%xmm7 + pxor %xmm9,%xmm7 + paddd %xmm7,%xmm3 + pxor %xmm3,%xmm15 + pshufb .rol8(%rip),%xmm15 + paddd %xmm15,%xmm11 + pxor %xmm11,%xmm7 + movdqa %xmm7,%xmm9 + pslld $7,%xmm9 + psrld $25,%xmm7 + pxor %xmm9,%xmm7 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 + movdqa 80(%rbp),%xmm9 + + addq $16,%r8 + cmpq $160,%r8 + jb 1b + movq %rbx,%rcx + andq $-16,%rcx +1: + addq 0(%rsi,%r8), %r10 + adcq 8+0(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + addq $16,%r8 + cmpq %rcx,%r8 + jb 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqa %xmm12,80(%rbp) + movdqu 0 + 0(%rsi),%xmm12 + pxor %xmm3,%xmm12 + movdqu %xmm12,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm12 + pxor %xmm7,%xmm12 + movdqu %xmm12,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm12 + pxor %xmm11,%xmm12 + movdqu %xmm12,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm12 + pxor %xmm15,%xmm12 + movdqu %xmm12,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + movdqa 80(%rbp),%xmm12 + subq $192,%rbx + leaq 192(%rsi),%rsi + leaq 192(%rdi),%rdi + + +open_sse_tail_64_dec_loop: + cmpq $16,%rbx + jb 1f + subq $16,%rbx + movdqu (%rsi),%xmm3 + pxor %xmm3,%xmm0 + movdqu %xmm0,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movdqa %xmm4,%xmm0 + movdqa %xmm8,%xmm4 + movdqa %xmm12,%xmm8 + jmp open_sse_tail_64_dec_loop +1: + movdqa %xmm0,%xmm1 + + +open_sse_tail_16: + testq %rbx,%rbx + jz open_sse_finalize + + + + pxor %xmm3,%xmm3 + leaq -1(%rsi,%rbx), %rsi + movq %rbx,%r8 +2: + pslldq $1,%xmm3 + pinsrb $0,(%rsi),%xmm3 + subq $1,%rsi + subq $1,%r8 + jnz 2b + +3: +.byte 102,73,15,126,221 + pextrq $1,%xmm3,%r14 + + pxor %xmm1,%xmm3 + + +2: + pextrb $0,%xmm3,(%rdi) + psrldq $1,%xmm3 + addq $1,%rdi + subq $1,%rbx + jne 2b + + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + +open_sse_finalize: + addq 32(%rbp),%r10 + adcq 8+32(%rbp),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movq %r10,%r13 + movq %r11,%r14 + movq %r12,%r15 + subq $-5,%r10 + sbbq $-1,%r11 + sbbq $3,%r12 + cmovcq %r13,%r10 + cmovcq %r14,%r11 + cmovcq %r15,%r12 + + addq 0+16(%rbp),%r10 + adcq 8+16(%rbp),%r11 + + addq $288 + 32,%rsp +.cfi_adjust_cfa_offset -(288 + 32) + popq %r9 +.cfi_adjust_cfa_offset -8 + movq %r10,(%r9) + movq %r11,8(%r9) + + popq %r15 +.cfi_adjust_cfa_offset -8 + popq %r14 +.cfi_adjust_cfa_offset -8 + popq %r13 +.cfi_adjust_cfa_offset -8 + popq %r12 +.cfi_adjust_cfa_offset -8 + popq %rbx +.cfi_adjust_cfa_offset -8 + popq %rbp +.cfi_adjust_cfa_offset -8 + .byte 0xf3,0xc3 +.cfi_adjust_cfa_offset (8 * 6) + 288 + 32 + +open_sse_128: + movdqu .chacha20_consts(%rip),%xmm0 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqu 0(%r9),%xmm4 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqu 16(%r9),%xmm8 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqu 32(%r9),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa %xmm13,%xmm15 + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm0 + paddd .chacha20_consts(%rip),%xmm1 + paddd .chacha20_consts(%rip),%xmm2 + paddd %xmm7,%xmm4 + paddd %xmm7,%xmm5 + paddd %xmm7,%xmm6 + paddd %xmm11,%xmm9 + paddd %xmm11,%xmm10 + paddd %xmm15,%xmm13 + paddd .sse_inc(%rip),%xmm15 + paddd %xmm15,%xmm14 + + pand .clamp(%rip),%xmm0 + movdqa %xmm0,0(%rbp) + movdqa %xmm4,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal +1: + cmpq $16,%rbx + jb open_sse_tail_16 + subq $16,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + + + movdqu 0(%rsi),%xmm3 + pxor %xmm3,%xmm1 + movdqu %xmm1,0(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movdqa %xmm5,%xmm1 + movdqa %xmm9,%xmm5 + movdqa %xmm13,%xmm9 + movdqa %xmm2,%xmm13 + movdqa %xmm6,%xmm2 + movdqa %xmm10,%xmm6 + movdqa %xmm14,%xmm10 + jmp 1b + jmp open_sse_tail_16 + +.cfi_endproc + + + + +.globl _chacha20_poly1305_seal +.private_extern _chacha20_poly1305_seal + +.p2align 6 +_chacha20_poly1305_seal: +.cfi_startproc + pushq %rbp +.cfi_adjust_cfa_offset 8 + pushq %rbx +.cfi_adjust_cfa_offset 8 + pushq %r12 +.cfi_adjust_cfa_offset 8 + pushq %r13 +.cfi_adjust_cfa_offset 8 + pushq %r14 +.cfi_adjust_cfa_offset 8 + pushq %r15 +.cfi_adjust_cfa_offset 8 + + + pushq %r9 +.cfi_adjust_cfa_offset 8 + subq $288 + 32,%rsp +.cfi_adjust_cfa_offset 288 + 32 +.cfi_offset rbp, -16 +.cfi_offset rbx, -24 +.cfi_offset r12, -32 +.cfi_offset r13, -40 +.cfi_offset r14, -48 +.cfi_offset r15, -56 +.cfi_offset %r9, -64 + leaq 32(%rsp),%rbp + andq $-32,%rbp + movq %rdx,8+32(%rbp) + movq %r8,0+32(%rbp) + movq %rdx,%rbx + + movl _OPENSSL_ia32cap_P+8(%rip),%eax + andl $288,%eax + xorl $288,%eax + jz chacha20_poly1305_seal_avx2 + + cmpq $128,%rbx + jbe seal_sse_128 + + movdqa .chacha20_consts(%rip),%xmm0 + movdqu 0(%r9),%xmm4 + movdqu 16(%r9),%xmm8 + movdqu 32(%r9),%xmm12 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqa %xmm8,%xmm11 + movdqa %xmm12,%xmm15 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm14 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm12 + + movdqa %xmm4,48(%rbp) + movdqa %xmm8,64(%rbp) + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + movq $10,%r10 +1: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + + pand .clamp(%rip),%xmm3 + movdqa %xmm3,0(%rbp) + movdqa %xmm7,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + cmpq $192,%rbx + ja 1f + movq $128,%rcx + subq $128,%rbx + leaq 128(%rsi),%rsi + jmp seal_sse_128_seal_hash +1: + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor %xmm12,%xmm15 + movdqu %xmm0,0 + 128(%rdi) + movdqu %xmm4,16 + 128(%rdi) + movdqu %xmm8,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + movq $192,%rcx + subq $192,%rbx + leaq 192(%rsi),%rsi + movq $2,%rcx + movq $8,%r8 + cmpq $64,%rbx + jbe seal_sse_tail_64 + cmpq $128,%rbx + jbe seal_sse_tail_128 + cmpq $192,%rbx + jbe seal_sse_tail_192 + +1: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa %xmm0,%xmm3 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa 96(%rbp),%xmm15 + paddd .sse_inc(%rip),%xmm15 + movdqa %xmm15,%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + movdqa %xmm15,144(%rbp) + +2: + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 +.byte 102,15,58,15,255,4 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,12 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + movdqa %xmm8,80(%rbp) + movdqa .rol16(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $20,%xmm8 + pslld $32-20,%xmm4 + pxor %xmm8,%xmm4 + movdqa .rol8(%rip),%xmm8 + paddd %xmm7,%xmm3 + paddd %xmm6,%xmm2 + paddd %xmm5,%xmm1 + paddd %xmm4,%xmm0 + pxor %xmm3,%xmm15 + pxor %xmm2,%xmm14 + pxor %xmm1,%xmm13 + pxor %xmm0,%xmm12 +.byte 102,69,15,56,0,248 +.byte 102,69,15,56,0,240 +.byte 102,69,15,56,0,232 +.byte 102,69,15,56,0,224 + movdqa 80(%rbp),%xmm8 + paddd %xmm15,%xmm11 + paddd %xmm14,%xmm10 + paddd %xmm13,%xmm9 + paddd %xmm12,%xmm8 + pxor %xmm11,%xmm7 + pxor %xmm10,%xmm6 + pxor %xmm9,%xmm5 + pxor %xmm8,%xmm4 + movdqa %xmm8,80(%rbp) + movdqa %xmm7,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm7 + pxor %xmm8,%xmm7 + movdqa %xmm6,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm6 + pxor %xmm8,%xmm6 + movdqa %xmm5,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm5 + pxor %xmm8,%xmm5 + movdqa %xmm4,%xmm8 + psrld $25,%xmm8 + pslld $32-25,%xmm4 + pxor %xmm8,%xmm4 + movdqa 80(%rbp),%xmm8 +.byte 102,15,58,15,255,12 +.byte 102,69,15,58,15,219,8 +.byte 102,69,15,58,15,255,4 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + + leaq 16(%rdi),%rdi + decq %r8 + jge 2b + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + decq %rcx + jg 2b + paddd .chacha20_consts(%rip),%xmm3 + paddd 48(%rbp),%xmm7 + paddd 64(%rbp),%xmm11 + paddd 144(%rbp),%xmm15 + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + movdqa %xmm14,80(%rbp) + movdqa %xmm14,80(%rbp) + movdqu 0 + 0(%rsi),%xmm14 + pxor %xmm3,%xmm14 + movdqu %xmm14,0 + 0(%rdi) + movdqu 16 + 0(%rsi),%xmm14 + pxor %xmm7,%xmm14 + movdqu %xmm14,16 + 0(%rdi) + movdqu 32 + 0(%rsi),%xmm14 + pxor %xmm11,%xmm14 + movdqu %xmm14,32 + 0(%rdi) + movdqu 48 + 0(%rsi),%xmm14 + pxor %xmm15,%xmm14 + movdqu %xmm14,48 + 0(%rdi) + + movdqa 80(%rbp),%xmm14 + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 64(%rdi) + movdqu %xmm6,16 + 64(%rdi) + movdqu %xmm10,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + movdqu 0 + 128(%rsi),%xmm3 + movdqu 16 + 128(%rsi),%xmm7 + movdqu 32 + 128(%rsi),%xmm11 + movdqu 48 + 128(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 128(%rdi) + movdqu %xmm5,16 + 128(%rdi) + movdqu %xmm9,32 + 128(%rdi) + movdqu %xmm15,48 + 128(%rdi) + + cmpq $256,%rbx + ja 3f + + movq $192,%rcx + subq $192,%rbx + leaq 192(%rsi),%rsi + jmp seal_sse_128_seal_hash +3: + movdqu 0 + 192(%rsi),%xmm3 + movdqu 16 + 192(%rsi),%xmm7 + movdqu 32 + 192(%rsi),%xmm11 + movdqu 48 + 192(%rsi),%xmm15 + pxor %xmm3,%xmm0 + pxor %xmm7,%xmm4 + pxor %xmm11,%xmm8 + pxor %xmm12,%xmm15 + movdqu %xmm0,0 + 192(%rdi) + movdqu %xmm4,16 + 192(%rdi) + movdqu %xmm8,32 + 192(%rdi) + movdqu %xmm15,48 + 192(%rdi) + + leaq 256(%rsi),%rsi + subq $256,%rbx + movq $6,%rcx + movq $4,%r8 + cmpq $192,%rbx + jg 1b + movq %rbx,%rcx + testq %rbx,%rbx + je seal_sse_128_seal_hash + movq $6,%rcx + cmpq $64,%rbx + jg 3f + +seal_sse_tail_64: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa 96(%rbp),%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + + jmp seal_sse_128_seal +3: + cmpq $128,%rbx + jg 3f + +seal_sse_tail_128: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa 96(%rbp),%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 0(%rdi) + movdqu %xmm5,16 + 0(%rdi) + movdqu %xmm9,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + + movq $64,%rcx + subq $64,%rbx + leaq 64(%rsi),%rsi + jmp seal_sse_128_seal_hash +3: + +seal_sse_tail_192: + movdqa .chacha20_consts(%rip),%xmm0 + movdqa 48(%rbp),%xmm4 + movdqa 64(%rbp),%xmm8 + movdqa %xmm0,%xmm1 + movdqa %xmm4,%xmm5 + movdqa %xmm8,%xmm9 + movdqa %xmm0,%xmm2 + movdqa %xmm4,%xmm6 + movdqa %xmm8,%xmm10 + movdqa 96(%rbp),%xmm14 + paddd .sse_inc(%rip),%xmm14 + movdqa %xmm14,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm13,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,96(%rbp) + movdqa %xmm13,112(%rbp) + movdqa %xmm14,128(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + leaq 16(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + paddd .chacha20_consts(%rip),%xmm2 + paddd 48(%rbp),%xmm6 + paddd 64(%rbp),%xmm10 + paddd 128(%rbp),%xmm14 + paddd .chacha20_consts(%rip),%xmm1 + paddd 48(%rbp),%xmm5 + paddd 64(%rbp),%xmm9 + paddd 112(%rbp),%xmm13 + paddd .chacha20_consts(%rip),%xmm0 + paddd 48(%rbp),%xmm4 + paddd 64(%rbp),%xmm8 + paddd 96(%rbp),%xmm12 + movdqu 0 + 0(%rsi),%xmm3 + movdqu 16 + 0(%rsi),%xmm7 + movdqu 32 + 0(%rsi),%xmm11 + movdqu 48 + 0(%rsi),%xmm15 + pxor %xmm3,%xmm2 + pxor %xmm7,%xmm6 + pxor %xmm11,%xmm10 + pxor %xmm14,%xmm15 + movdqu %xmm2,0 + 0(%rdi) + movdqu %xmm6,16 + 0(%rdi) + movdqu %xmm10,32 + 0(%rdi) + movdqu %xmm15,48 + 0(%rdi) + movdqu 0 + 64(%rsi),%xmm3 + movdqu 16 + 64(%rsi),%xmm7 + movdqu 32 + 64(%rsi),%xmm11 + movdqu 48 + 64(%rsi),%xmm15 + pxor %xmm3,%xmm1 + pxor %xmm7,%xmm5 + pxor %xmm11,%xmm9 + pxor %xmm13,%xmm15 + movdqu %xmm1,0 + 64(%rdi) + movdqu %xmm5,16 + 64(%rdi) + movdqu %xmm9,32 + 64(%rdi) + movdqu %xmm15,48 + 64(%rdi) + + movq $128,%rcx + subq $128,%rbx + leaq 128(%rsi),%rsi + +seal_sse_128_seal_hash: + cmpq $16,%rcx + jb seal_sse_128_seal + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx + leaq 16(%rdi),%rdi + jmp seal_sse_128_seal_hash + +seal_sse_128_seal: + cmpq $16,%rbx + jb seal_sse_tail_16 + subq $16,%rbx + + movdqu 0(%rsi),%xmm3 + pxor %xmm3,%xmm0 + movdqu %xmm0,0(%rdi) + + addq 0(%rdi),%r10 + adcq 8(%rdi),%r11 + adcq $1,%r12 + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movdqa %xmm4,%xmm0 + movdqa %xmm8,%xmm4 + movdqa %xmm12,%xmm8 + movdqa %xmm1,%xmm12 + movdqa %xmm5,%xmm1 + movdqa %xmm9,%xmm5 + movdqa %xmm13,%xmm9 + jmp seal_sse_128_seal + +seal_sse_tail_16: + testq %rbx,%rbx + jz seal_sse_finalize + + movq %rbx,%r8 + shlq $4,%r8 + leaq .and_masks(%rip),%r13 + movq %rbx,%rcx + leaq -1(%rsi,%rbx), %rsi + pxor %xmm15,%xmm15 +1: + pslldq $1,%xmm15 + pinsrb $0,(%rsi),%xmm15 + leaq -1(%rsi),%rsi + decq %rcx + jne 1b + + + pxor %xmm0,%xmm15 + + + movq %rbx,%rcx + movdqu %xmm15,%xmm0 +2: + pextrb $0,%xmm0,(%rdi) + psrldq $1,%xmm0 + addq $1,%rdi + subq $1,%rcx + jnz 2b + + pand -16(%r13,%r8), %xmm15 +.byte 102,77,15,126,253 + pextrq $1,%xmm15,%r14 + addq %r13,%r10 + adcq %r14,%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +seal_sse_finalize: + addq 32(%rbp),%r10 + adcq 8+32(%rbp),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + movq %r10,%r13 + movq %r11,%r14 + movq %r12,%r15 + subq $-5,%r10 + sbbq $-1,%r11 + sbbq $3,%r12 + cmovcq %r13,%r10 + cmovcq %r14,%r11 + cmovcq %r15,%r12 + + addq 0+16(%rbp),%r10 + adcq 8+16(%rbp),%r11 + + addq $288 + 32,%rsp +.cfi_adjust_cfa_offset -(288 + 32) + popq %r9 +.cfi_adjust_cfa_offset -8 + movq %r10,0(%r9) + movq %r11,8(%r9) + + popq %r15 +.cfi_adjust_cfa_offset -8 + popq %r14 +.cfi_adjust_cfa_offset -8 + popq %r13 +.cfi_adjust_cfa_offset -8 + popq %r12 +.cfi_adjust_cfa_offset -8 + popq %rbx +.cfi_adjust_cfa_offset -8 + popq %rbp +.cfi_adjust_cfa_offset -8 + .byte 0xf3,0xc3 +.cfi_adjust_cfa_offset (8 * 6) + 288 + 32 + +seal_sse_128: + movdqu .chacha20_consts(%rip),%xmm0 + movdqa %xmm0,%xmm1 + movdqa %xmm0,%xmm2 + movdqu 0(%r9),%xmm4 + movdqa %xmm4,%xmm5 + movdqa %xmm4,%xmm6 + movdqu 16(%r9),%xmm8 + movdqa %xmm8,%xmm9 + movdqa %xmm8,%xmm10 + movdqu 32(%r9),%xmm14 + movdqa %xmm14,%xmm12 + paddd .sse_inc(%rip),%xmm12 + movdqa %xmm12,%xmm13 + paddd .sse_inc(%rip),%xmm13 + movdqa %xmm4,%xmm7 + movdqa %xmm8,%xmm11 + movdqa %xmm12,%xmm15 + movq $10,%r10 +1: + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,4 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,12 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,4 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,12 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,4 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,12 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol16(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm4 + pxor %xmm3,%xmm4 + paddd %xmm4,%xmm0 + pxor %xmm0,%xmm12 + pshufb .rol8(%rip),%xmm12 + paddd %xmm12,%xmm8 + pxor %xmm8,%xmm4 + movdqa %xmm4,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm4 + pxor %xmm3,%xmm4 +.byte 102,15,58,15,228,12 +.byte 102,69,15,58,15,192,8 +.byte 102,69,15,58,15,228,4 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol16(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm5 + pxor %xmm3,%xmm5 + paddd %xmm5,%xmm1 + pxor %xmm1,%xmm13 + pshufb .rol8(%rip),%xmm13 + paddd %xmm13,%xmm9 + pxor %xmm9,%xmm5 + movdqa %xmm5,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm5 + pxor %xmm3,%xmm5 +.byte 102,15,58,15,237,12 +.byte 102,69,15,58,15,201,8 +.byte 102,69,15,58,15,237,4 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol16(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $12,%xmm3 + psrld $20,%xmm6 + pxor %xmm3,%xmm6 + paddd %xmm6,%xmm2 + pxor %xmm2,%xmm14 + pshufb .rol8(%rip),%xmm14 + paddd %xmm14,%xmm10 + pxor %xmm10,%xmm6 + movdqa %xmm6,%xmm3 + pslld $7,%xmm3 + psrld $25,%xmm6 + pxor %xmm3,%xmm6 +.byte 102,15,58,15,246,12 +.byte 102,69,15,58,15,210,8 +.byte 102,69,15,58,15,246,4 + + decq %r10 + jnz 1b + paddd .chacha20_consts(%rip),%xmm0 + paddd .chacha20_consts(%rip),%xmm1 + paddd .chacha20_consts(%rip),%xmm2 + paddd %xmm7,%xmm4 + paddd %xmm7,%xmm5 + paddd %xmm7,%xmm6 + paddd %xmm11,%xmm8 + paddd %xmm11,%xmm9 + paddd %xmm15,%xmm12 + paddd .sse_inc(%rip),%xmm15 + paddd %xmm15,%xmm13 + + pand .clamp(%rip),%xmm2 + movdqa %xmm2,0(%rbp) + movdqa %xmm6,16(%rbp) + + movq %r8,%r8 + call poly_hash_ad_internal + jmp seal_sse_128_seal + + + + +.p2align 6 +chacha20_poly1305_open_avx2: + vzeroupper + vmovdqa .chacha20_consts(%rip),%ymm0 + vbroadcasti128 0(%r9),%ymm4 + vbroadcasti128 16(%r9),%ymm8 + vbroadcasti128 32(%r9),%ymm12 + vpaddd .avx2_init(%rip),%ymm12,%ymm12 + cmpq $192,%rbx + jbe open_avx2_192 + cmpq $320,%rbx + jbe open_avx2_320 + + vmovdqa %ymm4,64(%rbp) + vmovdqa %ymm8,96(%rbp) + vmovdqa %ymm12,160(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + + movq %r8,%r8 + call poly_hash_ad_internal + xorq %rcx,%rcx + +1: + addq 0(%rsi,%rcx), %r10 + adcq 8+0(%rsi,%rcx), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + addq $16,%rcx + cmpq $64,%rcx + jne 1b + + vpxor 0(%rsi),%ymm0,%ymm0 + vpxor 32(%rsi),%ymm4,%ymm4 + vmovdqu %ymm0,0(%rdi) + vmovdqu %ymm4,32(%rdi) + leaq 64(%rsi),%rsi + leaq 64(%rdi),%rdi + subq $64,%rbx +1: + + cmpq $512,%rbx + jb 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + xorq %rcx,%rcx +2: + addq 0*8(%rsi,%rcx), %r10 + adcq 8+0*8(%rsi,%rcx), %r11 + adcq $1,%r12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + addq %rax,%r15 + adcq %rdx,%r9 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + addq 2*8(%rsi,%rcx), %r10 + adcq 8+2*8(%rsi,%rcx), %r11 + adcq $1,%r12 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + addq %rax,%r15 + adcq %rdx,%r9 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + addq 4*8(%rsi,%rcx), %r10 + adcq 8+4*8(%rsi,%rcx), %r11 + adcq $1,%r12 + + leaq 48(%rcx),%rcx + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + addq %rax,%r15 + adcq %rdx,%r9 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + cmpq $60*8,%rcx + jne 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + addq 60*8(%rsi),%r10 + adcq 8+60*8(%rsi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + addq 60*8+16(%rsi),%r10 + adcq 8+60*8+16(%rsi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm4 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm8 + vpxor 0+384(%rsi),%ymm3,%ymm3 + vpxor 32+384(%rsi),%ymm0,%ymm0 + vpxor 64+384(%rsi),%ymm4,%ymm4 + vpxor 96+384(%rsi),%ymm8,%ymm8 + vmovdqu %ymm3,0+384(%rdi) + vmovdqu %ymm0,32+384(%rdi) + vmovdqu %ymm4,64+384(%rdi) + vmovdqu %ymm8,96+384(%rdi) + + leaq 512(%rsi),%rsi + leaq 512(%rdi),%rdi + subq $512,%rbx + jmp 1b +3: + testq %rbx,%rbx + vzeroupper + je open_sse_finalize +3: + cmpq $128,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + + xorq %r8,%r8 + movq %rbx,%rcx + andq $-16,%rcx + testq %rcx,%rcx + je 2f +1: + addq 0*8(%rsi,%r8), %r10 + adcq 8+0*8(%rsi,%r8), %r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +2: + addq $16,%r8 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + cmpq %rcx,%r8 + jb 1b + cmpq $160,%r8 + jne 2b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + jmp open_avx2_tail_loop +3: + cmpq $256,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + + movq %rbx,128(%rbp) + movq %rbx,%rcx + subq $128,%rcx + shrq $4,%rcx + movq $10,%r8 + cmpq $10,%rcx + cmovgq %r8,%rcx + movq %rsi,%rbx + xorq %r8,%r8 +1: + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + + incq %r8 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + cmpq %rcx,%r8 + jb 1b + cmpq $10,%r8 + jne 2b + movq %rbx,%r8 + subq %rsi,%rbx + movq %rbx,%rcx + movq 128(%rbp),%rbx +1: + addq $16,%rcx + cmpq %rbx,%rcx + jg 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm1,%ymm1 + vpxor 64+0(%rsi),%ymm5,%ymm5 + vpxor 96+0(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm1,32+0(%rdi) + vmovdqu %ymm5,64+0(%rdi) + vmovdqu %ymm9,96+0(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 128(%rsi),%rsi + leaq 128(%rdi),%rdi + subq $128,%rbx + jmp open_avx2_tail_loop +3: + cmpq $384,%rbx + ja 3f + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + + movq %rbx,128(%rbp) + movq %rbx,%rcx + subq $256,%rcx + shrq $4,%rcx + addq $6,%rcx + movq $10,%r8 + cmpq $10,%rcx + cmovgq %r8,%rcx + movq %rsi,%rbx + xorq %r8,%r8 +1: + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx +2: + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + addq 0(%rbx),%r10 + adcq 8+0(%rbx),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rbx),%rbx + incq %r8 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + + cmpq %rcx,%r8 + jb 1b + cmpq $10,%r8 + jne 2b + movq %rbx,%r8 + subq %rsi,%rbx + movq %rbx,%rcx + movq 128(%rbp),%rbx +1: + addq $16,%rcx + cmpq %rbx,%rcx + jg 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm2,%ymm2 + vpxor 64+0(%rsi),%ymm6,%ymm6 + vpxor 96+0(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm2,32+0(%rdi) + vmovdqu %ymm6,64+0(%rdi) + vmovdqu %ymm10,96+0(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm1,%ymm1 + vpxor 64+128(%rsi),%ymm5,%ymm5 + vpxor 96+128(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm1,32+128(%rdi) + vmovdqu %ymm5,64+128(%rdi) + vmovdqu %ymm9,96+128(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 256(%rsi),%rsi + leaq 256(%rdi),%rdi + subq $256,%rbx + jmp open_avx2_tail_loop +3: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + xorq %rcx,%rcx + movq %rsi,%r8 +1: + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 +2: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + addq 16(%r8),%r10 + adcq 8+16(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%r8),%r8 + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + incq %rcx + cmpq $4,%rcx + jl 1b + cmpq $10,%rcx + jne 2b + movq %rbx,%rcx + subq $384,%rcx + andq $-16,%rcx +1: + testq %rcx,%rcx + je 1f + addq 0(%r8),%r10 + adcq 8+0(%r8),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%r8),%r8 + subq $16,%rcx + jmp 1b +1: + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + leaq 384(%rsi),%rsi + leaq 384(%rdi),%rdi + subq $384,%rbx +open_avx2_tail_loop: + cmpq $32,%rbx + jb open_avx2_tail + subq $32,%rbx + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + leaq 32(%rdi),%rdi + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + jmp open_avx2_tail_loop +open_avx2_tail: + cmpq $16,%rbx + vmovdqa %xmm0,%xmm1 + jb 1f + subq $16,%rbx + + vpxor (%rsi),%xmm0,%xmm1 + vmovdqu %xmm1,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + vperm2i128 $0x11,%ymm0,%ymm0,%ymm0 + vmovdqa %xmm0,%xmm1 +1: + vzeroupper + jmp open_sse_tail_16 + +open_avx2_192: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vmovdqa %ymm12,%ymm11 + vmovdqa %ymm13,%ymm15 + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + + decq %r10 + jne 1b + vpaddd %ymm2,%ymm0,%ymm0 + vpaddd %ymm2,%ymm1,%ymm1 + vpaddd %ymm6,%ymm4,%ymm4 + vpaddd %ymm6,%ymm5,%ymm5 + vpaddd %ymm10,%ymm8,%ymm8 + vpaddd %ymm10,%ymm9,%ymm9 + vpaddd %ymm11,%ymm12,%ymm12 + vpaddd %ymm15,%ymm13,%ymm13 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 +open_avx2_short: + movq %r8,%r8 + call poly_hash_ad_internal +open_avx2_hash_and_xor_loop: + cmpq $32,%rbx + jb open_avx2_short_tail_32 + subq $32,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rsi),%r10 + adcq 8+16(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + leaq 32(%rdi),%rdi + + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + vmovdqa %ymm1,%ymm12 + vmovdqa %ymm5,%ymm1 + vmovdqa %ymm9,%ymm5 + vmovdqa %ymm13,%ymm9 + vmovdqa %ymm2,%ymm13 + vmovdqa %ymm6,%ymm2 + jmp open_avx2_hash_and_xor_loop +open_avx2_short_tail_32: + cmpq $16,%rbx + vmovdqa %xmm0,%xmm1 + jb 1f + subq $16,%rbx + addq 0(%rsi),%r10 + adcq 8+0(%rsi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + vpxor (%rsi),%xmm0,%xmm3 + vmovdqu %xmm3,(%rdi) + leaq 16(%rsi),%rsi + leaq 16(%rdi),%rdi + vextracti128 $1,%ymm0,%xmm1 +1: + vzeroupper + jmp open_sse_tail_16 + +open_avx2_320: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm14 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd %ymm7,%ymm4,%ymm4 + vpaddd %ymm7,%ymm5,%ymm5 + vpaddd %ymm7,%ymm6,%ymm6 + vpaddd %ymm11,%ymm8,%ymm8 + vpaddd %ymm11,%ymm9,%ymm9 + vpaddd %ymm11,%ymm10,%ymm10 + vpaddd 160(%rbp),%ymm12,%ymm12 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd 224(%rbp),%ymm14,%ymm14 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm9 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm13 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm6 + jmp open_avx2_short + + + + +.p2align 6 +chacha20_poly1305_seal_avx2: + vzeroupper + vmovdqa .chacha20_consts(%rip),%ymm0 + vbroadcasti128 0(%r9),%ymm4 + vbroadcasti128 16(%r9),%ymm8 + vbroadcasti128 32(%r9),%ymm12 + vpaddd .avx2_init(%rip),%ymm12,%ymm12 + cmpq $192,%rbx + jbe seal_avx2_192 + cmpq $320,%rbx + jbe seal_avx2_320 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm4,64(%rbp) + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm8,96(%rbp) + vmovdqa %ymm12,%ymm15 + vpaddd .avx2_inc(%rip),%ymm15,%ymm14 + vpaddd .avx2_inc(%rip),%ymm14,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm15,256(%rbp) + movq $10,%r10 +1: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + decq %r10 + jnz 1b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm15 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm3 + vpand .clamp(%rip),%ymm15,%ymm15 + vmovdqa %ymm15,0(%rbp) + movq %r8,%r8 + call poly_hash_ad_internal + + vpxor 0(%rsi),%ymm3,%ymm3 + vpxor 32(%rsi),%ymm11,%ymm11 + vmovdqu %ymm3,0(%rdi) + vmovdqu %ymm11,32(%rdi) + vperm2i128 $0x02,%ymm2,%ymm6,%ymm15 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+64(%rsi),%ymm15,%ymm15 + vpxor 32+64(%rsi),%ymm2,%ymm2 + vpxor 64+64(%rsi),%ymm6,%ymm6 + vpxor 96+64(%rsi),%ymm10,%ymm10 + vmovdqu %ymm15,0+64(%rdi) + vmovdqu %ymm2,32+64(%rdi) + vmovdqu %ymm6,64+64(%rdi) + vmovdqu %ymm10,96+64(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm15 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+192(%rsi),%ymm15,%ymm15 + vpxor 32+192(%rsi),%ymm1,%ymm1 + vpxor 64+192(%rsi),%ymm5,%ymm5 + vpxor 96+192(%rsi),%ymm9,%ymm9 + vmovdqu %ymm15,0+192(%rdi) + vmovdqu %ymm1,32+192(%rdi) + vmovdqu %ymm5,64+192(%rdi) + vmovdqu %ymm9,96+192(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm15 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm15,%ymm8 + + leaq 320(%rsi),%rsi + subq $320,%rbx + movq $320,%rcx + cmpq $128,%rbx + jbe seal_avx2_hash + vpxor 0(%rsi),%ymm0,%ymm0 + vpxor 32(%rsi),%ymm4,%ymm4 + vpxor 64(%rsi),%ymm8,%ymm8 + vpxor 96(%rsi),%ymm12,%ymm12 + vmovdqu %ymm0,320(%rdi) + vmovdqu %ymm4,352(%rdi) + vmovdqu %ymm8,384(%rdi) + vmovdqu %ymm12,416(%rdi) + leaq 128(%rsi),%rsi + subq $128,%rbx + movq $8,%rcx + movq $2,%r8 + cmpq $128,%rbx + jbe seal_avx2_tail_128 + cmpq $256,%rbx + jbe seal_avx2_tail_256 + cmpq $384,%rbx + jbe seal_avx2_tail_384 + cmpq $512,%rbx + jbe seal_avx2_tail_512 + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + + subq $16,%rdi + movq $9,%rcx + jmp 4f +1: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + + movq $10,%rcx +2: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + addq %rax,%r15 + adcq %rdx,%r9 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + +4: + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + addq %rax,%r15 + adcq %rdx,%r9 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + addq 32(%rdi),%r10 + adcq 8+32(%rdi),%r11 + adcq $1,%r12 + + leaq 48(%rdi),%rdi + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + addq %rax,%r15 + adcq %rdx,%r9 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + decq %rcx + jne 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + leaq 32(%rdi),%rdi + vmovdqa %ymm0,128(%rbp) + addq -32(%rdi),%r10 + adcq 8+-32(%rdi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + addq -16(%rdi),%r10 + adcq 8+-16(%rdi),%r11 + adcq $1,%r12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm4 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm8 + vpxor 0+384(%rsi),%ymm3,%ymm3 + vpxor 32+384(%rsi),%ymm0,%ymm0 + vpxor 64+384(%rsi),%ymm4,%ymm4 + vpxor 96+384(%rsi),%ymm8,%ymm8 + vmovdqu %ymm3,0+384(%rdi) + vmovdqu %ymm0,32+384(%rdi) + vmovdqu %ymm4,64+384(%rdi) + vmovdqu %ymm8,96+384(%rdi) + + leaq 512(%rsi),%rsi + subq $512,%rbx + cmpq $512,%rbx + jg 1b + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + movq $10,%rcx + xorq %r8,%r8 + cmpq $128,%rbx + ja 3f + +seal_avx2_tail_128: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + jmp seal_avx2_short_loop +3: + cmpq $256,%rbx + ja 3f + +seal_avx2_tail_256: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm1,%ymm1 + vpxor 64+0(%rsi),%ymm5,%ymm5 + vpxor 96+0(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm1,32+0(%rdi) + vmovdqu %ymm5,64+0(%rdi) + vmovdqu %ymm9,96+0(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $128,%rcx + leaq 128(%rsi),%rsi + subq $128,%rbx + jmp seal_avx2_hash +3: + cmpq $384,%rbx + ja seal_avx2_tail_512 + +seal_avx2_tail_384: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+0(%rsi),%ymm3,%ymm3 + vpxor 32+0(%rsi),%ymm2,%ymm2 + vpxor 64+0(%rsi),%ymm6,%ymm6 + vpxor 96+0(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+0(%rdi) + vmovdqu %ymm2,32+0(%rdi) + vmovdqu %ymm6,64+0(%rdi) + vmovdqu %ymm10,96+0(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm1,%ymm1 + vpxor 64+128(%rsi),%ymm5,%ymm5 + vpxor 96+128(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm1,32+128(%rdi) + vmovdqu %ymm5,64+128(%rdi) + vmovdqu %ymm9,96+128(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $256,%rcx + leaq 256(%rsi),%rsi + subq $256,%rbx + jmp seal_avx2_hash + +seal_avx2_tail_512: + vmovdqa .chacha20_consts(%rip),%ymm0 + vmovdqa 64(%rbp),%ymm4 + vmovdqa 96(%rbp),%ymm8 + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm10 + vmovdqa %ymm0,%ymm3 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa .avx2_inc(%rip),%ymm12 + vpaddd 160(%rbp),%ymm12,%ymm15 + vpaddd %ymm15,%ymm12,%ymm14 + vpaddd %ymm14,%ymm12,%ymm13 + vpaddd %ymm13,%ymm12,%ymm12 + vmovdqa %ymm15,256(%rbp) + vmovdqa %ymm14,224(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm12,160(%rbp) + +1: + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + addq %rax,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi +2: + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $4,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $12,%ymm15,%ymm15,%ymm15 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + addq %rax,%r15 + adcq %rdx,%r9 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vmovdqa %ymm8,128(%rbp) + vmovdqa .rol16(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $20,%ymm7,%ymm8 + vpslld $32-20,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $20,%ymm6,%ymm8 + vpslld $32-20,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $20,%ymm5,%ymm8 + vpslld $32-20,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $20,%ymm4,%ymm8 + vpslld $32-20,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + vmovdqa .rol8(%rip),%ymm8 + vpaddd %ymm7,%ymm3,%ymm3 + vpaddd %ymm6,%ymm2,%ymm2 + vpaddd %ymm5,%ymm1,%ymm1 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm3,%ymm15,%ymm15 + vpxor %ymm2,%ymm14,%ymm14 + vpxor %ymm1,%ymm13,%ymm13 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb %ymm8,%ymm15,%ymm15 + vpshufb %ymm8,%ymm14,%ymm14 + vpshufb %ymm8,%ymm13,%ymm13 + vpshufb %ymm8,%ymm12,%ymm12 + vmovdqa 128(%rbp),%ymm8 + vpaddd %ymm15,%ymm11,%ymm11 + vpaddd %ymm14,%ymm10,%ymm10 + vpaddd %ymm13,%ymm9,%ymm9 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm11,%ymm7,%ymm7 + vpxor %ymm10,%ymm6,%ymm6 + movq 0+0(%rbp),%rdx + movq %rdx,%r15 + mulxq %r10,%r13,%r14 + mulxq %r11,%rax,%rdx + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + vpxor %ymm9,%ymm5,%ymm5 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa %ymm8,128(%rbp) + vpsrld $25,%ymm7,%ymm8 + vpslld $32-25,%ymm7,%ymm7 + vpxor %ymm8,%ymm7,%ymm7 + vpsrld $25,%ymm6,%ymm8 + vpslld $32-25,%ymm6,%ymm6 + vpxor %ymm8,%ymm6,%ymm6 + vpsrld $25,%ymm5,%ymm8 + vpslld $32-25,%ymm5,%ymm5 + vpxor %ymm8,%ymm5,%ymm5 + vpsrld $25,%ymm4,%ymm8 + vpslld $32-25,%ymm4,%ymm4 + vpxor %ymm8,%ymm4,%ymm4 + vmovdqa 128(%rbp),%ymm8 + vpalignr $12,%ymm7,%ymm7,%ymm7 + vpalignr $8,%ymm11,%ymm11,%ymm11 + vpalignr $4,%ymm15,%ymm15,%ymm15 + vpalignr $12,%ymm6,%ymm6,%ymm6 + movq 8+0(%rbp),%rdx + mulxq %r10,%r10,%rax + addq %r10,%r14 + mulxq %r11,%r11,%r9 + adcq %r11,%r15 + adcq $0,%r9 + imulq %r12,%rdx + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm12,%ymm12,%ymm12 + + + + + + + + + + + + + addq %rax,%r15 + adcq %rdx,%r9 + + + + + + + + + + + + + + + + + + + + + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + decq %rcx + jg 1b + decq %r8 + jge 2b + vpaddd .chacha20_consts(%rip),%ymm3,%ymm3 + vpaddd 64(%rbp),%ymm7,%ymm7 + vpaddd 96(%rbp),%ymm11,%ymm11 + vpaddd 256(%rbp),%ymm15,%ymm15 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd 64(%rbp),%ymm6,%ymm6 + vpaddd 96(%rbp),%ymm10,%ymm10 + vpaddd 224(%rbp),%ymm14,%ymm14 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd 64(%rbp),%ymm5,%ymm5 + vpaddd 96(%rbp),%ymm9,%ymm9 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd 64(%rbp),%ymm4,%ymm4 + vpaddd 96(%rbp),%ymm8,%ymm8 + vpaddd 160(%rbp),%ymm12,%ymm12 + + vmovdqa %ymm0,128(%rbp) + vperm2i128 $0x02,%ymm3,%ymm7,%ymm0 + vperm2i128 $0x13,%ymm3,%ymm7,%ymm7 + vperm2i128 $0x02,%ymm11,%ymm15,%ymm3 + vperm2i128 $0x13,%ymm11,%ymm15,%ymm11 + vpxor 0+0(%rsi),%ymm0,%ymm0 + vpxor 32+0(%rsi),%ymm3,%ymm3 + vpxor 64+0(%rsi),%ymm7,%ymm7 + vpxor 96+0(%rsi),%ymm11,%ymm11 + vmovdqu %ymm0,0+0(%rdi) + vmovdqu %ymm3,32+0(%rdi) + vmovdqu %ymm7,64+0(%rdi) + vmovdqu %ymm11,96+0(%rdi) + + vmovdqa 128(%rbp),%ymm0 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm3 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm6 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm10 + vpxor 0+128(%rsi),%ymm3,%ymm3 + vpxor 32+128(%rsi),%ymm2,%ymm2 + vpxor 64+128(%rsi),%ymm6,%ymm6 + vpxor 96+128(%rsi),%ymm10,%ymm10 + vmovdqu %ymm3,0+128(%rdi) + vmovdqu %ymm2,32+128(%rdi) + vmovdqu %ymm6,64+128(%rdi) + vmovdqu %ymm10,96+128(%rdi) + vperm2i128 $0x02,%ymm1,%ymm5,%ymm3 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm5 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm9 + vpxor 0+256(%rsi),%ymm3,%ymm3 + vpxor 32+256(%rsi),%ymm1,%ymm1 + vpxor 64+256(%rsi),%ymm5,%ymm5 + vpxor 96+256(%rsi),%ymm9,%ymm9 + vmovdqu %ymm3,0+256(%rdi) + vmovdqu %ymm1,32+256(%rdi) + vmovdqu %ymm5,64+256(%rdi) + vmovdqu %ymm9,96+256(%rdi) + vperm2i128 $0x13,%ymm0,%ymm4,%ymm3 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x02,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm12 + vmovdqa %ymm3,%ymm8 + + movq $384,%rcx + leaq 384(%rsi),%rsi + subq $384,%rbx + jmp seal_avx2_hash + +seal_avx2_320: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vpaddd .avx2_inc(%rip),%ymm13,%ymm14 + vmovdqa %ymm4,%ymm7 + vmovdqa %ymm8,%ymm11 + vmovdqa %ymm12,160(%rbp) + vmovdqa %ymm13,192(%rbp) + vmovdqa %ymm14,224(%rbp) + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $12,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $4,%ymm6,%ymm6,%ymm6 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol16(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpsrld $20,%ymm6,%ymm3 + vpslld $12,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpaddd %ymm6,%ymm2,%ymm2 + vpxor %ymm2,%ymm14,%ymm14 + vpshufb .rol8(%rip),%ymm14,%ymm14 + vpaddd %ymm14,%ymm10,%ymm10 + vpxor %ymm10,%ymm6,%ymm6 + vpslld $7,%ymm6,%ymm3 + vpsrld $25,%ymm6,%ymm6 + vpxor %ymm3,%ymm6,%ymm6 + vpalignr $4,%ymm14,%ymm14,%ymm14 + vpalignr $8,%ymm10,%ymm10,%ymm10 + vpalignr $12,%ymm6,%ymm6,%ymm6 + + decq %r10 + jne 1b + vpaddd .chacha20_consts(%rip),%ymm0,%ymm0 + vpaddd .chacha20_consts(%rip),%ymm1,%ymm1 + vpaddd .chacha20_consts(%rip),%ymm2,%ymm2 + vpaddd %ymm7,%ymm4,%ymm4 + vpaddd %ymm7,%ymm5,%ymm5 + vpaddd %ymm7,%ymm6,%ymm6 + vpaddd %ymm11,%ymm8,%ymm8 + vpaddd %ymm11,%ymm9,%ymm9 + vpaddd %ymm11,%ymm10,%ymm10 + vpaddd 160(%rbp),%ymm12,%ymm12 + vpaddd 192(%rbp),%ymm13,%ymm13 + vpaddd 224(%rbp),%ymm14,%ymm14 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 + vperm2i128 $0x02,%ymm2,%ymm6,%ymm9 + vperm2i128 $0x02,%ymm10,%ymm14,%ymm13 + vperm2i128 $0x13,%ymm2,%ymm6,%ymm2 + vperm2i128 $0x13,%ymm10,%ymm14,%ymm6 + jmp seal_avx2_short + +seal_avx2_192: + vmovdqa %ymm0,%ymm1 + vmovdqa %ymm0,%ymm2 + vmovdqa %ymm4,%ymm5 + vmovdqa %ymm4,%ymm6 + vmovdqa %ymm8,%ymm9 + vmovdqa %ymm8,%ymm10 + vpaddd .avx2_inc(%rip),%ymm12,%ymm13 + vmovdqa %ymm12,%ymm11 + vmovdqa %ymm13,%ymm15 + movq $10,%r10 +1: + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $12,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $4,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $12,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $4,%ymm5,%ymm5,%ymm5 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol16(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpsrld $20,%ymm4,%ymm3 + vpslld $12,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpaddd %ymm4,%ymm0,%ymm0 + vpxor %ymm0,%ymm12,%ymm12 + vpshufb .rol8(%rip),%ymm12,%ymm12 + vpaddd %ymm12,%ymm8,%ymm8 + vpxor %ymm8,%ymm4,%ymm4 + vpslld $7,%ymm4,%ymm3 + vpsrld $25,%ymm4,%ymm4 + vpxor %ymm3,%ymm4,%ymm4 + vpalignr $4,%ymm12,%ymm12,%ymm12 + vpalignr $8,%ymm8,%ymm8,%ymm8 + vpalignr $12,%ymm4,%ymm4,%ymm4 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol16(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpsrld $20,%ymm5,%ymm3 + vpslld $12,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpaddd %ymm5,%ymm1,%ymm1 + vpxor %ymm1,%ymm13,%ymm13 + vpshufb .rol8(%rip),%ymm13,%ymm13 + vpaddd %ymm13,%ymm9,%ymm9 + vpxor %ymm9,%ymm5,%ymm5 + vpslld $7,%ymm5,%ymm3 + vpsrld $25,%ymm5,%ymm5 + vpxor %ymm3,%ymm5,%ymm5 + vpalignr $4,%ymm13,%ymm13,%ymm13 + vpalignr $8,%ymm9,%ymm9,%ymm9 + vpalignr $12,%ymm5,%ymm5,%ymm5 + + decq %r10 + jne 1b + vpaddd %ymm2,%ymm0,%ymm0 + vpaddd %ymm2,%ymm1,%ymm1 + vpaddd %ymm6,%ymm4,%ymm4 + vpaddd %ymm6,%ymm5,%ymm5 + vpaddd %ymm10,%ymm8,%ymm8 + vpaddd %ymm10,%ymm9,%ymm9 + vpaddd %ymm11,%ymm12,%ymm12 + vpaddd %ymm15,%ymm13,%ymm13 + vperm2i128 $0x02,%ymm0,%ymm4,%ymm3 + + vpand .clamp(%rip),%ymm3,%ymm3 + vmovdqa %ymm3,0(%rbp) + + vperm2i128 $0x13,%ymm0,%ymm4,%ymm0 + vperm2i128 $0x13,%ymm8,%ymm12,%ymm4 + vperm2i128 $0x02,%ymm1,%ymm5,%ymm8 + vperm2i128 $0x02,%ymm9,%ymm13,%ymm12 + vperm2i128 $0x13,%ymm1,%ymm5,%ymm1 + vperm2i128 $0x13,%ymm9,%ymm13,%ymm5 +seal_avx2_short: + movq %r8,%r8 + call poly_hash_ad_internal + xorq %rcx,%rcx +seal_avx2_hash: + cmpq $16,%rcx + jb seal_avx2_short_loop + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + subq $16,%rcx + addq $16,%rdi + jmp seal_avx2_hash +seal_avx2_short_loop: + cmpq $32,%rbx + jb seal_avx2_short_tail + subq $32,%rbx + + vpxor (%rsi),%ymm0,%ymm0 + vmovdqu %ymm0,(%rdi) + leaq 32(%rsi),%rsi + + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + addq 16(%rdi),%r10 + adcq 8+16(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 32(%rdi),%rdi + + vmovdqa %ymm4,%ymm0 + vmovdqa %ymm8,%ymm4 + vmovdqa %ymm12,%ymm8 + vmovdqa %ymm1,%ymm12 + vmovdqa %ymm5,%ymm1 + vmovdqa %ymm9,%ymm5 + vmovdqa %ymm13,%ymm9 + vmovdqa %ymm2,%ymm13 + vmovdqa %ymm6,%ymm2 + jmp seal_avx2_short_loop +seal_avx2_short_tail: + cmpq $16,%rbx + jb 1f + subq $16,%rbx + vpxor (%rsi),%xmm0,%xmm3 + vmovdqu %xmm3,(%rdi) + leaq 16(%rsi),%rsi + addq 0(%rdi),%r10 + adcq 8+0(%rdi),%r11 + adcq $1,%r12 + movq 0+0(%rbp),%rax + movq %rax,%r15 + mulq %r10 + movq %rax,%r13 + movq %rdx,%r14 + movq 0+0(%rbp),%rax + mulq %r11 + imulq %r12,%r15 + addq %rax,%r14 + adcq %rdx,%r15 + movq 8+0(%rbp),%rax + movq %rax,%r9 + mulq %r10 + addq %rax,%r14 + adcq $0,%rdx + movq %rdx,%r10 + movq 8+0(%rbp),%rax + mulq %r11 + addq %rax,%r15 + adcq $0,%rdx + imulq %r12,%r9 + addq %r10,%r15 + adcq %rdx,%r9 + movq %r13,%r10 + movq %r14,%r11 + movq %r15,%r12 + andq $3,%r12 + movq %r15,%r13 + andq $-4,%r13 + movq %r9,%r14 + shrdq $2,%r9,%r15 + shrq $2,%r9 + addq %r13,%r10 + adcq %r14,%r11 + adcq $0,%r12 + addq %r15,%r10 + adcq %r9,%r11 + adcq $0,%r12 + + leaq 16(%rdi),%rdi + vextracti128 $1,%ymm0,%xmm0 +1: + vzeroupper + jmp seal_sse_tail_16 +.cfi_endproc +#endif
diff --git a/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm index cd9a6e5..58f19ac2 100644 --- a/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm +++ b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm
@@ -1868,6 +1868,7 @@ ALIGN 32 $L$8x_tail_done: + xor rax,rax add r8,QWORD[rdx] adc r9,0 adc r10,0 @@ -1876,9 +1877,7 @@ adc r13,0 adc r14,0 adc r15,0 - - - xor rax,rax + adc rax,0 neg rsi $L$8x_no_tail:
diff --git a/third_party/boringssl/win-x86_64/crypto/cipher/chacha20_poly1305_x86_64.asm b/third_party/boringssl/win-x86_64/crypto/cipher/chacha20_poly1305_x86_64.asm new file mode 100644 index 0000000..ab8cf92 --- /dev/null +++ b/third_party/boringssl/win-x86_64/crypto/cipher/chacha20_poly1305_x86_64.asm
@@ -0,0 +1,8 @@ +default rel +%define XMMWORD +%define YMMWORD +%define ZMMWORD +global dummy_chacha20_poly1305_asm + +dummy_chacha20_poly1305_asm: + DB 0F3h,0C3h ;repret
diff --git a/third_party/closure_compiler/compiled_resources.gyp b/third_party/closure_compiler/compiled_resources.gyp index ee61980..e58b09af 100644 --- a/third_party/closure_compiler/compiled_resources.gyp +++ b/third_party/closure_compiler/compiled_resources.gyp
@@ -29,7 +29,6 @@ # '../../remoting/remoting_webapp_compile.gypi:*', '../../ui/file_manager/file_manager/foreground/js/compiled_resources.gyp:*', '../../ui/file_manager/gallery/js/compiled_resources.gyp:*', - '../../ui/file_manager/video_player/js/compiled_resources.gyp:*', ], }, ]
diff --git a/third_party/kasko/BUILD.gn b/third_party/kasko/BUILD.gn deleted file mode 100644 index e32e7f7..0000000 --- a/third_party/kasko/BUILD.gn +++ /dev/null
@@ -1,54 +0,0 @@ -# Copyright 2015 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/buildflag_header.gni") -import("//build/config/chrome_build.gni") -import("//third_party/kasko/kasko.gni") - -buildflag_header("kasko_features") { - header = "kasko_features.h" - flags = [ "ENABLE_KASKO=$enable_kasko" ] -} - -if (enable_kasko) { - assert(is_win, "Kasko only support Windows.") - assert(target_cpu == "x86", "Kasko only support 32 bits.") - - # TODO(sebmarchand): Fix this once the Kasko dependency in SyzyAsan has been - # removed for the non-official builds. - #assert(is_chrome_branded, - # "The Kasko client is only initialized in Chrome-branded builds.") - - config("kasko_config") { - visibility = [ ":*" ] - include_dirs = [ "//third_party/kasko/binaries/include" ] - lib_dirs = [ "//third_party/kasko/binaries" ] - libs = [ "kasko.dll.lib" ] - } - - copy("copy_kasko_dll") { - visibility = [ ":*" ] - sources = [ - "//third_party/kasko/binaries/kasko.dll", - "//third_party/kasko/binaries/kasko.dll.pdb", - ] - outputs = [ - "$root_out_dir/{{source_file_part}}", - ] - } - - group("kasko") { - public_deps = [ - ":copy_kasko_dll", - ":kasko_features", - ] - public_configs = [ ":kasko_config" ] - } -} else { - group("kasko") { - public_deps = [ - ":kasko_features", - ] - } -}
diff --git a/third_party/kasko/OWNERS b/third_party/kasko/OWNERS deleted file mode 100644 index 71dc7187..0000000 --- a/third_party/kasko/OWNERS +++ /dev/null
@@ -1,3 +0,0 @@ -chrisha@chromium.org -pmonette@chromium.org -siggi@chromium.org
diff --git a/third_party/kasko/kasko.gni b/third_party/kasko/kasko.gni deleted file mode 100644 index 6e6c831d..0000000 --- a/third_party/kasko/kasko.gni +++ /dev/null
@@ -1,9 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/sanitizers/sanitizers.gni") - -# Enable the Kasko crash reporter. Enabled by default on Syzyasan official -# build. -enable_kasko = is_official_build && is_syzyasan
diff --git a/tools/gn/misc/vim/syntax/gn.vim b/tools/gn/misc/vim/syntax/gn.vim index 55f1852..0fbd6e0 100644 --- a/tools/gn/misc/vim/syntax/gn.vim +++ b/tools/gn/misc/vim/syntax/gn.vim
@@ -52,8 +52,10 @@ hi def link gnVariable Keyword " Strings -syn region gnString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell +syn region gnString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell,gnTargetName +syn match gnTargetName '\v:[^"]+' contained hi def link gnString String +hi def link gnTargetName Special " Comments syn keyword gnTodo contained TODO FIXME XXX BUG NOTE
diff --git a/tools/licenses.py b/tools/licenses.py index b7ea2334..5b68d5d 100755 --- a/tools/licenses.py +++ b/tools/licenses.py
@@ -47,7 +47,6 @@ os.path.join('third_party','gnu_binutils'), os.path.join('third_party','gold'), os.path.join('third_party','gperf'), - os.path.join('third_party','kasko'), os.path.join('third_party','lighttpd'), os.path.join('third_party','llvm'), os.path.join('third_party','llvm-build'),
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 9b24ca7..61b2b2f 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -1032,11 +1032,11 @@ ], 'chromeos_with_codecs_ozone_release_bot': [ - 'chromeos_with_codecs', 'ozone', 'release_bot', + 'chromeos_with_codecs', 'ozone', 'default_ozone_platform_x11', 'release_bot', ], 'chromeos_with_codecs_ozone_release_trybot': [ - 'chromeos_with_codecs', 'ozone', 'release_trybot', + 'chromeos_with_codecs', 'ozone', 'default_ozone_platform_x11', 'release_trybot', ], 'chromeos_with_codecs_release_bot': [ @@ -1648,6 +1648,10 @@ 'mixins': ['debug_bot', 'minimal_symbols'], }, + 'default_ozone_platform_x11': { + 'gn_args': 'ozone_platform="x11"', + }, + 'disable_nacl': { 'gn_args': 'enable_nacl=false', },
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 0456101c..9dbc8c2 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -446,6 +446,24 @@ </summary> </histogram> +<histogram name="Android.CustomFeedback.Category" + enum="AndroidFeedbackCategory"> + <owner>jwanda@chromium.org</owner> + <summary> + Recorded when the user selects a category button when in the Custom Feedback + UI. + </summary> +</histogram> + +<histogram name="Android.CustomFeedback.CategoryDetails" + enum="AndroidFeedbackCategoryDetails"> + <owner>jwanda@chromium.org</owner> + <summary> + Recorded when a user selects an option related to their problem within the + Custom Feedback UI. + </summary> +</histogram> + <histogram name="Android.DownloadManager.Filter" enum="AndroidDownloadFilterType"> <owner>dfalcantara@chromium.org</owner> @@ -1366,6 +1384,15 @@ </summary> </histogram> +<histogram name="Arc.ComplianceReportSinceUpdateNotificationTime" units="ms"> + <owner>alexchau@google.com</owner> + <owner>emaxx@google.com</owner> + <summary> + Elapsed time from the policy update notification sent to ARC to the + corresponding successfully obtained compliance report from CloudDPS. + </summary> +</histogram> + <histogram name="Arc.CumulativeUseTime" units="seconds"> <owner>elijahtaylor@google.com</owner> <owner>mitsuji@google.com</owner> @@ -1377,6 +1404,25 @@ </summary> </histogram> +<histogram name="Arc.FirstComplianceReportTime.SinceSignIn" units="ms"> + <owner>alexchau@google.com</owner> + <owner>emaxx@google.com</owner> + <summary> + Elapsed time from the signing in process start to a successfully obtained + compliance report from CloudDPS. + </summary> +</histogram> + +<histogram name="Arc.FirstComplianceReportTime.SinceStartup" units="ms"> + <owner>alexchau@google.com</owner> + <owner>emaxx@google.com</owner> + <summary> + Elapsed time from ARC startup to a successfully obtained compliance report + from CloudDPS. This value is not reported during the first startup when + signing in happens. + </summary> +</histogram> + <histogram name="Arc.IntentHandlerAction" enum="ArcIntentHandlerAction"> <owner>elijahtaylor@google.com</owner> <owner>mitsuji@google.com</owner> @@ -8486,6 +8532,9 @@ </histogram> <histogram name="CrashReport.PermanentUploadFailure" enum="BooleanHit"> + <obsolete> + Deprecated 01/2017 in Issue 680162 with the removal of Kasko. + </obsolete> <owner>siggi@chromium.org</owner> <summary> Counts crash reports that the Kasko crash reporter fails to upload and hands @@ -44623,6 +44672,19 @@ <summary>The dismissal reason of the account chooser.</summary> </histogram> +<histogram name="PasswordManager.AccountChooserDialogAccounts" units="accounts"> + <owner>vasilii@chromium.org</owner> + <summary>The number of accounts displayed in the account chooser.</summary> +</histogram> + +<histogram name="PasswordManager.AccountChooserDialogEmptyAvatars" + units="avatars"> + <owner>vasilii@chromium.org</owner> + <summary> + The count of the placeholder avatars shown in the account chooser. + </summary> +</histogram> + <histogram name="PasswordManager.AccountChooserDialogMultipleAccounts" enum="AccountChooserDismissalReason"> <owner>vasilii@chromium.org</owner> @@ -71928,6 +71990,13 @@ </summary> </histogram> +<histogram name="V8.AsmWasmTranslationMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <owner>aseemgarg@chromium.org</owner> + <summary>Time to convert asm.js code to WebAssembly.</summary> +</histogram> + <histogram name="V8.ASTOptimization"> <obsolete> This histogram is no longer present in V8. @@ -72566,6 +72635,84 @@ <summary>TBD</summary> </histogram> +<histogram name="V8.WasmCompileFunctionMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Time to compile a WebAssembly function.</summary> +</histogram> + +<histogram name="V8.WasmCompileFunctionPeakMemoryBytes" units="bytes"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Peak memory used to compile a WebAssembly function.</summary> +</histogram> + +<histogram name="V8.WasmCompileModuleMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Time to compile a WebAssembly module.</summary> +</histogram> + +<histogram name="V8.WasmDecodeFunctionMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Time to decode a WebAssembly function.</summary> +</histogram> + +<histogram name="V8.WasmDecodeModuleMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Time to decode a WebAssembly module.</summary> +</histogram> + +<histogram name="V8.WasmDecodeModulePeakMemoryBytes" units="bytes"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Peak memory used to decode a WebAssembly module.</summary> +</histogram> + +<histogram name="V8.WasmFunctionSizeBytes" units="bytes"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Size of a WebAssembly function.</summary> +</histogram> + +<histogram name="V8.WasmFunctionsPerModule" units="functions"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Function count in each WebAssembly module.</summary> +</histogram> + +<histogram name="V8.WasmInstantiateModuleMicroSeconds" units="microseconds"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Time to instantiate a WebAssembly module.</summary> +</histogram> + +<histogram name="V8.WasmMaxMemPagesCount" units="pages"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary> + Number of 64KiB pages a WebAssembly module declares as its maximum + requirement. + </summary> +</histogram> + +<histogram name="V8.WasmMinMemPagesCount" units="pages"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary> + Number of 64KiB pages a WebAssembly module declares as its minimum + requirement. + </summary> +</histogram> + +<histogram name="V8.WasmModuleSizeBytes" units="bytes"> + <owner>bradnelson@chromium.org</owner> + <owner>titzer@chromium.org</owner> + <summary>Size of a WebAssembly module.</summary> +</histogram> + <histogram name="Variations.CreateTrials.SeedExpiry" enum="VariationsSeedExpiry"> <owner>asvitkine@chromium.org</owner> @@ -77703,6 +77850,45 @@ <int value="4" label="EvictAll"/> </enum> +<enum name="AndroidFeedbackCategory" type="int"> + <summary> + This list corresponds to the categories the user can press when selecting a + category their feedback falls under. + </summary> + <int value="0" label="Error or blank page"/> + <int value="1" label="Chrome crashes or freezes"/> + <int value="2" label="Issues with website"/> + <int value="3" label="Trouble with something else"/> +</enum> + +<enum name="AndroidFeedbackCategoryDetails" type="int"> + <summary> + This list corresponds to all the possible options a user can press when + selecting an option their feedback falls under. Each option is prefixed with + a shortened name of the category that the option belongs to. + </summary> + <int value="0" label="Error Network error"/> + <int value="1" label="Error Blank page"/> + <int value="2" label="Error Video won't play"/> + <int value="3" label="Error Page won't download"/> + <int value="4" label="Error Can't connect to Wi-Fi"/> + <int value="5" label="Error Other"/> + <int value="6" label="Crash Watching videos"/> + <int value="7" label="Crash Downloading files"/> + <int value="8" label="Crash Browsing websites"/> + <int value="9" label="Crash Other"/> + <int value="10" label="Website Account or sign-in problems"/> + <int value="11" label="Website Advertisements"/> + <int value="12" label="Website Video won't play"/> + <int value="13" label="Website Slow website"/> + <int value="14" label="Website Broken or unreadable website"/> + <int value="15" label="Website Other"/> + <int value="16" label="Something Website"/> + <int value="17" label="Something Tabs"/> + <int value="18" label="Something Settings"/> + <int value="19" label="Something Other"/> +</enum> + <enum name="AndroidGATTConnectionErrorCodes" type="int"> <summary> This list includes all errors from the Bluetooth Specification Version 4.2 @@ -83872,6 +84058,8 @@ <int value="16" label="DOM properties expanded"/> <int value="17" label="Resized view in responsive mode"/> <int value="18" label="Timeline started (page reload)"/> + <int value="19" label="Connect to node.js from frontend"/> + <int value="20" label="Connect to node.js directly (paste link from CLI)"/> </enum> <enum name="DevToolsPanel" type="int"> @@ -90330,6 +90518,10 @@ <int value="1794" label="WebNFCCancelPush"/> <int value="1795" label="WebNFCWatch"/> <int value="1796" label="WebNFCCancelWatch"/> + <int value="1797" label="AudioParamCancelAndHoldAtTime"/> + <int value="1798" label="CSSValueUserModifyReadOnly"/> + <int value="1799" label="CSSValueUserModifyReadWrite"/> + <int value="1800" label="CSSValueUserModifyReadWritePlaintextOnly"/> </enum> <enum name="FetchRequestMode" type="int">
diff --git a/tools/perf/benchmarks/battor.py b/tools/perf/benchmarks/battor.py index 39586d7..aa0a077 100644 --- a/tools/perf/benchmarks/battor.py +++ b/tools/perf/benchmarks/battor.py
@@ -87,7 +87,7 @@ def CreateStorySet(self, options): # We want it to wait for 30 seconds to be comparable to legacy power tests. - return page_sets.MacGpuTrivialPagesStorySet(wait_in_seconds=30) + return page_sets.TrivialSitesStorySet(wait_in_seconds=30) @classmethod def Name(cls):
diff --git a/tools/perf/benchmarks/power.py b/tools/perf/benchmarks/power.py index 8b90ed8..31507bd 100644 --- a/tools/perf/benchmarks/power.py +++ b/tools/perf/benchmarks/power.py
@@ -199,7 +199,7 @@ class PowerScrollingTrivialPage(perf_benchmark.PerfBenchmark): """Measure power consumption for some very simple pages.""" test = power.QuiescentPower - page_set = page_sets.MacGpuTrivialPagesStorySet + page_set = page_sets.TrivialSitesStorySet @classmethod def Name(cls):
diff --git a/tools/perf/benchmarks/speedometer.py b/tools/perf/benchmarks/speedometer.py index 243783fa..4c76788 100644 --- a/tools/perf/benchmarks/speedometer.py +++ b/tools/perf/benchmarks/speedometer.py
@@ -69,7 +69,7 @@ count=iterationCount) tab.WaitForJavaScriptCondition2( 'benchmarkClient._finishedTestCount == benchmarkClient.testsCount', - timemout=600) + timeout=600) results.AddValue(list_of_scalar_values.ListOfScalarValues( page, 'Total', 'ms', tab.EvaluateJavaScript2('benchmarkClient._timeValues'),
diff --git a/tools/perf/core/benchmark_finders.py b/tools/perf/core/benchmark_finders.py index 400b89f..6705b16 100644 --- a/tools/perf/core/benchmark_finders.py +++ b/tools/perf/core/benchmark_finders.py
@@ -6,8 +6,12 @@ import os import sys +from core import path_util from core import perf_benchmark +from telemetry.core import discover +from telemetry import benchmark as benchmark_module + def GetClassFilePath(clazz): """ Return the absolute file path to |clazz|. """ @@ -37,3 +41,11 @@ return sorted(benchmark_names) finally: sys.path = original_sys_path + + +def GetAllPerfBenchmarks(): + benchmarks_dir = path_util.GetPerfBenchmarksDir() + top_level_dir = os.path.join(benchmarks_dir, '..') + return discover.DiscoverClasses( + benchmarks_dir, top_level_dir, benchmark_module.Benchmark, + index_by_class_name=True).values()
diff --git a/tools/perf/docs/apk_size_regressions.md b/tools/perf/docs/apk_size_regressions.md index d7d258f..8c26cb7 100644 --- a/tools/perf/docs/apk_size_regressions.md +++ b/tools/perf/docs/apk_size_regressions.md
@@ -67,9 +67,8 @@ ``` ### Option 2: Download artifacts from perf jobs (Googlers only)** - 1. Replace the bolded part of the following URL with your build number: - [https://luci-milo.appspot.com/buildbot/chromium.perf/Android%20Builder/**131325**](https://luci-milo.appspot.com/buildbot/chromium.perf/Android%20Builder/131325) - 2. Click the **gsutil.upload** link in the **gsutil upload_build_product** step + 1. Replace the bolded part of the following URL with the git commit hash: + [https://storage.cloud.google.com/chrome-perf/Android%20Builder/full-build-linux_**HASH**.zip](https://storage.cloud.google.com/chrome-perf/Android%20Builder/full-build-linux_**HASH**.zip) ## Step 3: Analyze
diff --git a/tools/perf/list_benchmarks b/tools/perf/list_benchmarks new file mode 100755 index 0000000..e05f1345 --- /dev/null +++ b/tools/perf/list_benchmarks
@@ -0,0 +1,23 @@ +#!/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 sys + +from core import path_util +from core import benchmark_finders + +sys.path.insert(1, path_util.GetTelemetryDir()) + +from telemetry import decorators + + +def main(): + all_benchmarks = benchmark_finders.GetAllPerfBenchmarks() + for b in all_benchmarks: + disabled_platforms = ', '.join(decorators.GetDisabledAttributes(b)) + print '{:<60} {:<40}'.format(b.Name(), disabled_platforms) + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/tools/perf/page_sets/blank_page.py b/tools/perf/page_sets/blank_page.py index 1858cfa..6719096 100644 --- a/tools/perf/page_sets/blank_page.py +++ b/tools/perf/page_sets/blank_page.py
@@ -13,7 +13,7 @@ def RunPageInteractions(self, action_runner): # Request a RAF and wait for it to be processed to ensure that the metric # Startup.FirstWebContents.NonEmptyPaint2 is recorded. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( """ this.hasRunRAF = 0; requestAnimationFrame(function() { @@ -21,7 +21,7 @@ }); """ ) - action_runner.WaitForJavaScriptCondition("this.hasRunRAF == 1") + action_runner.WaitForJavaScriptCondition2("this.hasRunRAF == 1") class BlankPageSet(story.StorySet): """A single blank page.""" @@ -39,7 +39,7 @@ shared_page_state_class=BrowserStartupSharedState) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( """ this.hasRunRAF = 0; requestAnimationFrame(function() { @@ -47,7 +47,7 @@ }); """ ) - action_runner.WaitForJavaScriptCondition("this.hasRunRAF == 1") + action_runner.WaitForJavaScriptCondition2("this.hasRunRAF == 1") class BlankPageSetTBM(story.StorySet):
diff --git a/tools/perf/page_sets/blink_memory_mobile.py b/tools/perf/page_sets/blink_memory_mobile.py index e6c53c94..1e0ad6c 100644 --- a/tools/perf/page_sets/blink_memory_mobile.py +++ b/tools/perf/page_sets/blink_memory_mobile.py
@@ -47,11 +47,11 @@ def RunPageInteractions(self, action_runner): action_runner.WaitForElement(selector=TheVergePage.COMMENT_LINK_SELECTOR) - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'window.location.hash = "comments"') action_runner.TapElement( selector=TheVergePage.COMMENT_LINK_SELECTOR) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.Chorus.Comments.collection.length > 0') super(TheVergePage, self).RunPageInteractions(action_runner) @@ -65,7 +65,7 @@ def RunNavigateSteps(self, action_runner): super(FacebookPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("u_0_c") !== null &&' 'document.body.scrollHeight > window.innerHeight') @@ -82,7 +82,7 @@ self.credentials_path) super(GmailPage, self).RunNavigateSteps(action_runner) action_runner.WaitForElement(selector='#apploadingdiv') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.querySelector("#apploadingdiv").style.opacity == "0"')
diff --git a/tools/perf/page_sets/blob_workshop.py b/tools/perf/page_sets/blob_workshop.py index 8d873f9..a79dacd 100644 --- a/tools/perf/page_sets/blob_workshop.py +++ b/tools/perf/page_sets/blob_workshop.py
@@ -20,17 +20,17 @@ self._blob_sizes = blob_sizes def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('disableUI = true;') + action_runner.ExecuteJavaScript2('disableUI = true;') for size_bytes in self._blob_sizes: with action_runner.CreateInteraction('Action_CreateAndReadBlob', repeatable=True): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'createAndRead({{ size }});', size=size_bytes) - action_runner.WaitForJavaScriptCondition( - 'doneReading === true || errors', timeout_in_seconds=60) + action_runner.WaitForJavaScriptCondition2( + 'doneReading === true || errors', timeout=60) - errors = action_runner.EvaluateJavaScript('errors') + errors = action_runner.EvaluateJavaScript2('errors') if errors: raise legacy_page_test.Failure('Errors on page: ' + ', '.join(errors)) @@ -44,27 +44,27 @@ self._blob_sizes = blob_sizes def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('disableUI = true;') + action_runner.ExecuteJavaScript2('disableUI = true;') # Add blobs for size_bytes in self._blob_sizes: with action_runner.CreateInteraction('Action_CreateBlob', repeatable=True): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'createBlob({{ size }});', size=size_bytes) # Read blobs for _ in range(0, NUM_BLOB_MASS_CREATE_READS): with action_runner.CreateInteraction('Action_ReadBlobs', repeatable=True): - action_runner.ExecuteJavaScript('readBlobsSerially();') - action_runner.WaitForJavaScriptCondition( - 'doneReading === true || errors', timeout_in_seconds=60) + action_runner.ExecuteJavaScript2('readBlobsSerially();') + action_runner.WaitForJavaScriptCondition2( + 'doneReading === true || errors', timeout=60) # Clean up blobs. Make sure this flag is turned on: # --enable-experimental-web-platform-features - action_runner.ExecuteJavaScript('garbageCollect();') + action_runner.ExecuteJavaScript2('garbageCollect();') - errors = action_runner.EvaluateJavaScript('errors') + errors = action_runner.EvaluateJavaScript2('errors') if errors: raise legacy_page_test.Failure('Errors on page: ' + ', '.join(errors))
diff --git a/tools/perf/page_sets/dummy_story_set.py b/tools/perf/page_sets/dummy_story_set.py index c3fe05c..15ce788 100644 --- a/tools/perf/page_sets/dummy_story_set.py +++ b/tools/perf/page_sets/dummy_story_set.py
@@ -13,7 +13,7 @@ page_set=page_set) def RunPageInteractions(self, action_runner): - assert action_runner.EvaluateJavaScript('1 + window.__dummy_value') == 2 + assert action_runner.EvaluateJavaScript2('1 + window.__dummy_value') == 2 class BrokenDummyPage(page_module.Page): @@ -26,7 +26,7 @@ def RunPageInteractions(self, action_runner): # The call below should raise an AssertionError - assert action_runner.EvaluateJavaScript('1 + window.__dummy_value') == 3 + assert action_runner.EvaluateJavaScript2('1 + window.__dummy_value') == 3 class DummyStorySet(story.StorySet):
diff --git a/tools/perf/page_sets/google_pages.py b/tools/perf/page_sets/google_pages.py index abdb76a..21aaddca 100644 --- a/tools/perf/page_sets/google_pages.py +++ b/tools/perf/page_sets/google_pages.py
@@ -38,7 +38,7 @@ google_login.LoginGoogleAccount(action_runner, 'google', self.credentials_path) super(GmailPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null') @@ -56,7 +56,7 @@ self.credentials_path) super(GoogleDocPage, self).RunNavigateSteps(action_runner) action_runner.Wait(2) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("kix-appview-editor").length') @@ -78,5 +78,5 @@ def RunPageInteractions(self, action_runner): action_runner.WaitForElement(text='Welcome to AdWords!') - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'console.timeEnd({{ label }});', label=INTERACTION_NAME)
diff --git a/tools/perf/page_sets/image_decoding_measurement.py b/tools/perf/page_sets/image_decoding_measurement.py index e101fff9..fed80cc 100644 --- a/tools/perf/page_sets/image_decoding_measurement.py +++ b/tools/perf/page_sets/image_decoding_measurement.py
@@ -14,8 +14,8 @@ def RunNavigateSteps(self, action_runner): super(ImageDecodingMeasurementPage, self).RunNavigateSteps(action_runner) - action_runner.ExecuteJavaScript('runBenchmark();') - action_runner.WaitForJavaScriptCondition('isDone') + action_runner.ExecuteJavaScript2('runBenchmark();') + action_runner.WaitForJavaScriptCondition2('isDone') class ImageDecodingMeasurementPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/indexeddb_endure_page.py b/tools/perf/page_sets/indexeddb_endure_page.py index 176d726..fdee22c 100644 --- a/tools/perf/page_sets/indexeddb_endure_page.py +++ b/tools/perf/page_sets/indexeddb_endure_page.py
@@ -15,12 +15,12 @@ self._subtest = subtest def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'window.testFilter = {{ subtest }};', subtest=self._subtest) with action_runner.CreateInteraction('Action_Test'): - action_runner.ExecuteJavaScript('window.test();') - action_runner.WaitForJavaScriptCondition( - 'window.done', timeout_in_seconds=600) + action_runner.ExecuteJavaScript2('window.test();') + action_runner.WaitForJavaScriptCondition2( + 'window.done', timeout=600) class IndexedDBEndurePageSet(story.StorySet): """The IndexedDB Endurance page set.
diff --git a/tools/perf/page_sets/infinite_scroll_cases.py b/tools/perf/page_sets/infinite_scroll_cases.py index 7930a6e..6c3de0fc 100644 --- a/tools/perf/page_sets/infinite_scroll_cases.py +++ b/tools/perf/page_sets/infinite_scroll_cases.py
@@ -47,7 +47,7 @@ def _WaitAction(self, action_runner): with action_runner.CreateInteraction('Load'): - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.body != null && ' 'document.body.scrollHeight > window.innerHeight && ' '!document.body.addEventListener("touchstart", function() {})')
diff --git a/tools/perf/page_sets/key_desktop_move_cases.py b/tools/perf/page_sets/key_desktop_move_cases.py index a226a62..d2e1ad82 100644 --- a/tools/perf/page_sets/key_desktop_move_cases.py +++ b/tools/perf/page_sets/key_desktop_move_cases.py
@@ -36,19 +36,19 @@ def RunNavigateSteps(self, action_runner): super(GmailMouseScrollPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null') # This check is needed for gmonkey to load completely. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.readyState == "complete"') def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' gmonkey.load('2.0', function(api) { window.__scrollableElementForTelemetry = api.getScrollableElement(); });''') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__scrollableElementForTelemetry != null') scrollbar_x, start_y, end_y = self._CalculateScrollBarRatios(action_runner) @@ -59,13 +59,13 @@ element_function='window.__scrollableElementForTelemetry') def _CalculateScrollBarRatios(self, action_runner): - viewport_height = float(action_runner.EvaluateJavaScript( + viewport_height = float(action_runner.EvaluateJavaScript2( 'window.__scrollableElementForTelemetry.clientHeight')) - content_height = float(action_runner.EvaluateJavaScript( + content_height = float(action_runner.EvaluateJavaScript2( 'window.__scrollableElementForTelemetry.scrollHeight')) - viewport_width = float(action_runner.EvaluateJavaScript( + viewport_width = float(action_runner.EvaluateJavaScript2( 'window.__scrollableElementForTelemetry.offsetWidth')) - scrollbar_width = float(action_runner.EvaluateJavaScript(''' + scrollbar_width = float(action_runner.EvaluateJavaScript2(''' window.__scrollableElementForTelemetry.offsetWidth - window.__scrollableElementForTelemetry.scrollWidth'''))
diff --git a/tools/perf/page_sets/key_desktop_sites.py b/tools/perf/page_sets/key_desktop_sites.py index 8fca86e3..ff930d5d 100644 --- a/tools/perf/page_sets/key_desktop_sites.py +++ b/tools/perf/page_sets/key_desktop_sites.py
@@ -45,7 +45,7 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined && ' 'document.getElementById("gb") !== null') @@ -80,7 +80,7 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("doclistview-list").length') @@ -101,7 +101,7 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("kix-appview-editor").length')
diff --git a/tools/perf/page_sets/key_hit_test_cases.py b/tools/perf/page_sets/key_hit_test_cases.py index d9dd86c..955e219b9 100644 --- a/tools/perf/page_sets/key_hit_test_cases.py +++ b/tools/perf/page_sets/key_hit_test_cases.py
@@ -18,7 +18,7 @@ def PerformPageInteractions(self, action_runner): # pay cost of selecting tap target only once - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' window.__tapTarget = document.querySelector( 'body /deep/ #outerPanels' ).querySelector( @@ -26,7 +26,7 @@ ).shadowRoot.querySelector( 'paper-calculator-key[label="5"]' )''') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__tapTarget != null') for _ in xrange(100):
diff --git a/tools/perf/page_sets/key_mobile_sites_pages.py b/tools/perf/page_sets/key_mobile_sites_pages.py index cf79415..f8db9140 100644 --- a/tools/perf/page_sets/key_mobile_sites_pages.py +++ b/tools/perf/page_sets/key_mobile_sites_pages.py
@@ -28,7 +28,7 @@ def RunNavigateSteps(self, action_runner): super(CapitolVolkswagenPage, self).RunNavigateSteps(action_runner) action_runner.WaitForElement(text='Next 35') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.body.scrollHeight > 2560') @@ -45,7 +45,7 @@ def RunNavigateSteps(self, action_runner): super(TheVergeArticlePage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.Chorus !== undefined &&' 'window.Chorus.Comments !== undefined &&' 'window.Chorus.Comments.Json !== undefined &&' @@ -80,7 +80,7 @@ def RunNavigateSteps(self, action_runner): super(FacebookPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("u_0_c") !== null &&' 'document.body.scrollHeight > window.innerHeight') @@ -96,7 +96,7 @@ def RunNavigateSteps(self, action_runner): super(YoutubeMobilePage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("paginatortarget") !== null') @@ -112,7 +112,7 @@ def RunNavigateSteps(self, action_runner): super(LinkedInPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("profile-view-scroller") !== null') @@ -146,9 +146,9 @@ def RunNavigateSteps(self, action_runner): super(GmailPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("og_user_warning") !== null') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("og_user_warning") === null') @@ -165,7 +165,7 @@ def RunNavigateSteps(self, action_runner): super(GroupClonedPage, self).RunNavigateSteps(action_runner) action_runner.Wait(5) - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' document.getElementById("element-19") !== null && document.getElementById("element-19").contentDocument .getElementById("element-22") !== null && @@ -185,7 +185,7 @@ def RunNavigateSteps(self, action_runner): super(GroupClonedListImagesPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("element-5") !== null') @@ -200,7 +200,7 @@ def RunNavigateSteps(self, action_runner): super(GoogleNewsMobilePage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'typeof NEWS_telemetryReady !== "undefined" && ' 'NEWS_telemetryReady == true') @@ -218,7 +218,7 @@ def RunNavigateSteps(self, action_runner): super(GoogleNewsMobile2Page, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById(":h") != null') action_runner.Wait(1)
diff --git a/tools/perf/page_sets/key_mobile_sites_smooth.py b/tools/perf/page_sets/key_mobile_sites_smooth.py index 2a7536d..5600f86 100644 --- a/tools/perf/page_sets/key_mobile_sites_smooth.py +++ b/tools/perf/page_sets/key_mobile_sites_smooth.py
@@ -34,8 +34,8 @@ def RunPageInteractions(self, action_runner): if self.action_on_load_complete: - action_runner.WaitForJavaScriptCondition( - 'document.readyState == "complete"', timeout_in_seconds=30) + action_runner.WaitForJavaScriptCondition2( + 'document.readyState == "complete"', timeout=30) _IssueMarkerAndScroll(action_runner)
diff --git a/tools/perf/page_sets/key_silk_cases.py b/tools/perf/page_sets/key_silk_cases.py index ee9395f..9e7789f 100644 --- a/tools/perf/page_sets/key_silk_cases.py +++ b/tools/perf/page_sets/key_silk_cases.py
@@ -364,7 +364,7 @@ action_runner.TapElement('#menu-button') with action_runner.CreateInteraction('Wait'): - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' document.getElementById("nav-drawer").active && document.getElementById("nav-drawer").children[0] .getBoundingClientRect().left == 0''') @@ -383,7 +383,7 @@ left_start_ratio=0.8, top_start_ratio=0.2, direction='left', distance=200, element_function='document.getElementById("nav-drawer").children[0]') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( '!document.getElementById("nav-drawer").active') @@ -418,7 +418,7 @@ def ScrollKnowledgeCardToTop(self, action_runner, card_id): # scroll until the knowledge card is at the top - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( "document.getElementById({{ card_id }}).scrollIntoView()", card_id=card_id) @@ -465,7 +465,7 @@ def RunNavigateSteps(self, action_runner): super(Page22, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("fHa").length > 0') action_runner.Wait(2) @@ -511,7 +511,7 @@ def RunNavigateSteps(self, action_runner): super(Page24, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById(":h") != null') action_runner.Wait(1) @@ -532,7 +532,7 @@ def RunNavigateSteps(self, action_runner): super(Page25, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById(":h") != null') action_runner.Wait(1) @@ -556,14 +556,14 @@ def RunNavigateSteps(self, action_runner): super(Page26, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("tweet").length > 0') action_runner.Wait(1) def PerformPageInteractions(self, action_runner): # Add a touch-action: none because this page prevent defaults all # touch moves. - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' var style = document.createElement("style"); document.head.appendChild(style); style.sheet.insertRule("body { touch-action: none }", 0); @@ -583,7 +583,7 @@ def RunNavigateSteps(self, action_runner): super(SVGIconRaster, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'loaded = true') action_runner.Wait(1) @@ -607,12 +607,12 @@ def RunNavigateSteps(self, action_runner): super(UpdateHistoryState, self).RunNavigateSteps(action_runner) - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' window.requestAnimationFrame(function() { window.__history_state_loaded = true; }); ''') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__history_state_loaded == true;') def PerformPageInteractions(self, action_runner): @@ -648,20 +648,20 @@ first_name = profile + 'paper-input#first /deep/ input' action_runner.WaitForElement(selector=first_name) # Input First Name: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' var fn = document.querySelector({{ first_name }}); fn.value = 'Chrome'; fn.fire('input');''', first_name=first_name) # Input Last Initial: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' var li = document.querySelector({{ selector }}); li.value = 'E'; li.fire('input');''', selector='%s paper-input#last /deep/ input' % profile) with action_runner.CreateInteraction('animation_interaction'): # Click the check-mark to login: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' window.topeka_page_transitions = 0; [].forEach.call(document.querySelectorAll( 'html /deep/ core-animated-pages'), function(p){ @@ -673,32 +673,32 @@ document.querySelector({{ selector }}).fire('tap')''', selector='%s paper-fab' % profile) # Wait for category list to animate in: - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' window.topeka_page_transitions === 1''') # Click a category to start a quiz: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' document.querySelector('\ html /deep/ core-selector.category-list').fire( 'tap',1,document.querySelector('html /deep/ \ div.category-item.red-theme'));''') # Wait for the category splash to animate in: - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' window.topeka_page_transitions === 2''') # Click to start the quiz: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' document.querySelector('html /deep/ topeka-category-front-page /deep/\ paper-fab').fire('tap');''') - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' window.topeka_page_transitions === 4''') # Input a mostly correct answer: - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' document.querySelector('html /deep/ topeka-quiz-fill-blank /deep/\ input').value = 'arkinsaw'; document.querySelector('html /deep/ topeka-quiz-fill-blank /deep/\ input').fire('input'); document.querySelector('html /deep/ topeka-quizzes /deep/ \ paper-fab').fire('tap');''') - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' window.topeka_page_transitions === 6''') class Masonry(KeySilkCasesPage): @@ -712,8 +712,8 @@ def PerformPageInteractions(self, action_runner): with action_runner.CreateInteraction('animation_interaction'): - action_runner.ExecuteJavaScript('window.brick()') - action_runner.WaitForJavaScriptCondition('window.done') + action_runner.ExecuteJavaScript2('window.brick()') + action_runner.WaitForJavaScriptCondition2('window.done') class KeySilkCasesPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/login_helpers/chrome_login.py b/tools/perf/page_sets/login_helpers/chrome_login.py index 33dad0fc..1be4ee2 100644 --- a/tools/perf/page_sets/login_helpers/chrome_login.py +++ b/tools/perf/page_sets/login_helpers/chrome_login.py
@@ -44,7 +44,7 @@ raise RuntimeError('Can not find GAIA webview context for sign in.') gaia_action_runner = action_runner_module.ActionRunner(gaia_context) - new_flow = gaia_action_runner.EvaluateJavaScript( + new_flow = gaia_action_runner.EvaluateJavaScript2( 'document.querySelector("#gaia_firsform") != null') gaia_form_id = 'gaia_firstform' if new_flow else 'gaia_loginform' login_utils.InputForm(gaia_action_runner, account_name, input_id='Email',
diff --git a/tools/perf/page_sets/login_helpers/dropbox_login.py b/tools/perf/page_sets/login_helpers/dropbox_login.py index c4f81c4..a2aef275 100644 --- a/tools/perf/page_sets/login_helpers/dropbox_login.py +++ b/tools/perf/page_sets/login_helpers/dropbox_login.py
@@ -32,7 +32,7 @@ # Wait until the "Sign in" button is enabled and then click it. login_button_selector = '.login-form .login-button' - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' (function() { var loginButton = document.querySelector({{ selector }}); if (!loginButton)
diff --git a/tools/perf/page_sets/login_helpers/google_login.py b/tools/perf/page_sets/login_helpers/google_login.py index a1108e4..e41bb07a3 100644 --- a/tools/perf/page_sets/login_helpers/google_login.py +++ b/tools/perf/page_sets/login_helpers/google_login.py
@@ -43,13 +43,13 @@ 'https%3A%2F%2Faccounts.google.com%2FManageAccount') # Wait until either the email or password input is visible. - action_runner.WaitForJavaScriptCondition('{{ @a }} || {{ @b }}', + action_runner.WaitForJavaScriptCondition2('{{ @a }} || {{ @b }}', a=_EMAIL_INPUT_VISIBLE_CONDITION, b=_PASSWORD_INPUT_VISIBLE_CONDITION) # If the email input is visible, this is the first Google login within the # browser session, so we must enter both email and password. Otherwise, only # password is required. - if action_runner.EvaluateJavaScript(_EMAIL_INPUT_VISIBLE_CONDITION): + if action_runner.EvaluateJavaScript2(_EMAIL_INPUT_VISIBLE_CONDITION): login_utils.InputForm(action_runner, account_name, input_id='Email', form_id='gaia_firstform') action_runner.ClickElement(selector='#gaia_firstform #next')
diff --git a/tools/perf/page_sets/login_helpers/login_utils.py b/tools/perf/page_sets/login_helpers/login_utils.py index 710c415..6e313f7 100644 --- a/tools/perf/page_sets/login_helpers/login_utils.py +++ b/tools/perf/page_sets/login_helpers/login_utils.py
@@ -45,7 +45,7 @@ possible exceptions. """ action_runner.WaitForElement(selector=input_selector) - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.querySelector({{ selector }}).value = {{ value }};', selector=input_selector, value=input_text)
diff --git a/tools/perf/page_sets/mac_gpu_sites.py b/tools/perf/page_sets/mac_gpu_sites.py deleted file mode 100644 index fdd18d2..0000000 --- a/tools/perf/page_sets/mac_gpu_sites.py +++ /dev/null
@@ -1,70 +0,0 @@ -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -from page_sets import trivial_sites -from telemetry.page import shared_page_state -from telemetry import story - - -class _NoGpuSharedPageState(shared_page_state.SharedPageState): - def __init__(self, test, finder_options, story_set): - super(_NoGpuSharedPageState, self).__init__( - test, finder_options, story_set) - finder_options.browser_options.AppendExtraBrowserArgs( - ['--disable-gpu']) - - -class _NoOverlaysSharedPageState(shared_page_state.SharedPageState): - def __init__(self, test, finder_options, story_set): - super(_NoOverlaysSharedPageState, self).__init__( - test, finder_options, story_set) - finder_options.browser_options.AppendExtraBrowserArgs( - ['--disable-mac-overlays']) - - -class _NoWebGLImageChromiumSharedPageState(shared_page_state.SharedPageState): - def __init__(self, test, finder_options, story_set): - super(_NoWebGLImageChromiumSharedPageState, self).__init__( - test, finder_options, story_set) - finder_options.browser_options.AppendExtraBrowserArgs( - ['--disable-webgl-image-chromium']) - - -class MacGpuTrivialPagesStorySet(story.StorySet): - - def __init__(self, wait_in_seconds=0): - # Wait is time to wait_in_seconds on page in seconds. - super(MacGpuTrivialPagesStorySet, self).__init__( - cloud_storage_bucket=story.PUBLIC_BUCKET) - - default_trivial_sites = trivial_sites.TrivialSitesStorySet( - wait_in_seconds = wait_in_seconds) - for user_story in default_trivial_sites.stories: - self.AddStory(user_story) - - no_overlays_trivial_sites = trivial_sites.TrivialSitesStorySet( - _NoOverlaysSharedPageState, wait_in_seconds) - for user_story in no_overlays_trivial_sites.stories: - self.AddStory(user_story) - - self.AddStory(trivial_sites.TrivialScrollingPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialBlinkingCursorPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialCanvasPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialWebGLPage( - self, _NoWebGLImageChromiumSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialBlurAnimationPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialFullscreenVideoPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - self.AddStory(trivial_sites.TrivialGifPage( - self, _NoGpuSharedPageState, wait_in_seconds)) - - @property - def allow_mixed_story_states(self): - # Return True here in order to be able to add the same tests with - # a different SharedPageState. - return True
diff --git a/tools/perf/page_sets/maps.py b/tools/perf/page_sets/maps.py index 373bb7a..4d5ec2c 100644 --- a/tools/perf/page_sets/maps.py +++ b/tools/perf/page_sets/maps.py
@@ -29,8 +29,8 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('MapAnimation'): - action_runner.WaitForJavaScriptCondition( - 'window.testMetrics != undefined', timeout_in_seconds=120) + action_runner.WaitForJavaScriptCondition2( + 'window.testMetrics != undefined', timeout=120) class MapsPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/mobile_infinite_scroll_cases.py b/tools/perf/page_sets/mobile_infinite_scroll_cases.py index adf4271..5cf6d2ca 100644 --- a/tools/perf/page_sets/mobile_infinite_scroll_cases.py +++ b/tools/perf/page_sets/mobile_infinite_scroll_cases.py
@@ -29,7 +29,7 @@ def _WaitAction(action_runner): with action_runner.CreateInteraction('Load'): - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.body != null && ' 'document.body.scrollHeight > window.innerHeight && ' '!document.body.addEventListener("touchstart", function() {})')
diff --git a/tools/perf/page_sets/mobile_memory.py b/tools/perf/page_sets/mobile_memory.py index 4357d10f..268a848 100644 --- a/tools/perf/page_sets/mobile_memory.py +++ b/tools/perf/page_sets/mobile_memory.py
@@ -59,7 +59,7 @@ action_runner.Wait(3) with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("rg_s").childElementCount > 300')
diff --git a/tools/perf/page_sets/mse_cases.py b/tools/perf/page_sets/mse_cases.py index d87964a..3cd41b7 100644 --- a/tools/perf/page_sets/mse_cases.py +++ b/tools/perf/page_sets/mse_cases.py
@@ -12,7 +12,7 @@ def RunNavigateSteps(self, action_runner): super(MseCasesPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition('window.__testDone == true') + action_runner.WaitForJavaScriptCondition2('window.__testDone == true') class MseCasesPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/oortonline.py b/tools/perf/page_sets/oortonline.py index 6e1f6e8..55655d7 100644 --- a/tools/perf/page_sets/oortonline.py +++ b/tools/perf/page_sets/oortonline.py
@@ -52,7 +52,7 @@ def RunPageInteractions(self, action_runner): WAIT_TIME_IN_SECONDS = 2 RUN_TIME_IN_SECONDS = 20 - action_runner.WaitForJavaScriptCondition('window.benchmarkStarted') + action_runner.WaitForJavaScriptCondition2('window.benchmarkStarted') # Perform GC to get rid of start-up garbage. action_runner.ForceGarbageCollection() with action_runner.CreateInteraction('Begin'):
diff --git a/tools/perf/page_sets/polymer.py b/tools/perf/page_sets/polymer.py index 47665aa..7a9c26b 100644 --- a/tools/perf/page_sets/polymer.py +++ b/tools/perf/page_sets/polymer.py
@@ -40,7 +40,7 @@ def RunNavigateSteps(self, action_runner): super(PolymerPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__polymer_ready') @@ -70,7 +70,7 @@ def SlidePanel(self, action_runner): # only bother with this interaction if the drawer is hidden - opened = action_runner.EvaluateJavaScript(''' + opened = action_runner.EvaluateJavaScript2(''' (function() { var outer = document.querySelector("body /deep/ #outerPanels"); return outer.opened || outer.wideMode; @@ -88,7 +88,7 @@ ).shadowRoot.querySelector( '.handle-bar' )''') - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' var outer = document.querySelector("body /deep/ #outerPanels"); outer.opened || outer.wideMode;''') @@ -102,7 +102,7 @@ def PerformPageInteractions(self, action_runner): with action_runner.CreateInteraction('ScrollAndShadowAnimation'): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( "document.getElementById('fab').scrollIntoView()") action_runner.Wait(5) self.AnimateShadow(action_runner, 'card') @@ -112,7 +112,7 @@ def AnimateShadow(self, action_runner, eid): for i in range(1, 6): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.getElementById({{ eid }}).z = {{ i }}', eid=eid, i=i) action_runner.Wait(1) @@ -138,14 +138,14 @@ def RunNavigateSteps(self, action_runner): super(PolymerSampler, self).RunNavigateSteps(action_runner) - action_runner.ExecuteJavaScript(""" + action_runner.ExecuteJavaScript2(""" window.Polymer.whenPolymerReady(function() { {{ @iframe }}.contentWindow.Polymer.whenPolymerReady(function() { window.__polymer_ready = true; }) }); """, iframe=self.iframe_js) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__polymer_ready') def PerformPageInteractions(self, action_runner): @@ -196,13 +196,13 @@ selector='body %s:not([disabled]):not([active])' % widget_type) roles_count_query = element_list_query + '.length' - for i in range(action_runner.EvaluateJavaScript(roles_count_query)): + for i in range(action_runner.EvaluateJavaScript2(roles_count_query)): element_query = js_template.Render( '{{ @query }}[{{ i }}]', query=element_list_query, i=i) - if action_runner.EvaluateJavaScript( + if action_runner.EvaluateJavaScript2( element_query + '.offsetParent != null'): # Only try to tap on visible elements (offsetParent != null) - action_runner.ExecuteJavaScript(element_query + '.scrollIntoView()') + action_runner.ExecuteJavaScript2(element_query + '.scrollIntoView()') action_runner.Wait(1) # wait for page to settle after scrolling action_function(action_runner, element_query)
diff --git a/tools/perf/page_sets/repaint_helpers.py b/tools/perf/page_sets/repaint_helpers.py index a08025c..45486d2a 100644 --- a/tools/perf/page_sets/repaint_helpers.py +++ b/tools/perf/page_sets/repaint_helpers.py
@@ -6,10 +6,10 @@ def Repaint(action_runner, mode='viewport', width=None, height=None): - action_runner.WaitForJavaScriptCondition( - 'document.readyState == "complete"', timeout_in_seconds=90) + action_runner.WaitForJavaScriptCondition2( + 'document.readyState == "complete"', timeout=90) # Rasterize only what's visible. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') args = {} @@ -20,7 +20,7 @@ args['height'] = height # Enqueue benchmark - action_runner.ExecuteJavaScript(""" + action_runner.ExecuteJavaScript2(""" window.benchmark_results = {}; window.benchmark_results.id = chrome.gpuBenchmarking.runMicroBenchmark( @@ -31,7 +31,7 @@ """, args=args) - micro_benchmark_id = action_runner.EvaluateJavaScript( + micro_benchmark_id = action_runner.EvaluateJavaScript2( 'window.benchmark_results.id') if not micro_benchmark_id: raise legacy_page_test.MeasurementFailure( @@ -40,7 +40,7 @@ with action_runner.CreateInteraction('Repaint'): action_runner.RepaintContinuously(seconds=5) - action_runner.ExecuteJavaScript(""" + action_runner.ExecuteJavaScript2(""" window.benchmark_results.message_handled = chrome.gpuBenchmarking.sendMessageToMicroBenchmark( {{ micro_benchmark_id }}, {
diff --git a/tools/perf/page_sets/service_worker_micro_benchmark.py b/tools/perf/page_sets/service_worker_micro_benchmark.py index 21f1c8e..87fe435 100644 --- a/tools/perf/page_sets/service_worker_micro_benchmark.py +++ b/tools/perf/page_sets/service_worker_micro_benchmark.py
@@ -11,7 +11,7 @@ def RunNavigateSteps(self, action_runner): super(ServiceWorkerBenchmarkPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition('window.done') + action_runner.WaitForJavaScriptCondition2('window.done') class ServiceWorkerMicroBenchmarkPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/system_health/background_stories.py b/tools/perf/page_sets/system_health/background_stories.py index a0eb93f..5bdf261 100644 --- a/tools/perf/page_sets/system_health/background_stories.py +++ b/tools/perf/page_sets/system_health/background_stories.py
@@ -56,7 +56,7 @@ action_runner.WaitForElement(selector='#additional-content button') action_runner.ScrollPageToElement(selector='#additional-content button') # TapElement seems flaky here so use JavaScript instead. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.querySelector("#additional-content button").click()') # Scroll to video, start it and then wait for a few seconds.
diff --git a/tools/perf/page_sets/system_health/blank_stories.py b/tools/perf/page_sets/system_health/blank_stories.py index ffe0ecc..24866b0 100644 --- a/tools/perf/page_sets/system_health/blank_stories.py +++ b/tools/perf/page_sets/system_health/blank_stories.py
@@ -14,7 +14,7 @@ def _DidLoadDocument(self, action_runner): # Request a RAF and wait for it to be processed to ensure that the metric # Startup.FirstWebContents.NonEmptyPaint2 is recorded. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( """ window.__hasRunRAF = false; requestAnimationFrame(function() { @@ -22,4 +22,4 @@ }); """ ) - action_runner.WaitForJavaScriptCondition("window.__hasRunRAF") + action_runner.WaitForJavaScriptCondition2("window.__hasRunRAF")
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py index 231f9ad..5e194e5 100644 --- a/tools/perf/page_sets/system_health/browsing_stories.py +++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -225,7 +225,7 @@ # window does not have a "Close" button, instead it has only a "Send link # to phone" button. So on tablets we run with the popup window open. The # popup is transparent, so this is mostly an aesthetical issue. - has_button = action_runner.EvaluateJavaScript( + has_button = action_runner.EvaluateJavaScript2( '!!document.querySelector({{ selector }})', selector=self._CLOSE_BUTTON_SELECTOR) if has_button: @@ -319,7 +319,7 @@ # Refine search query in the search box. # TODO(nednguyen): replace this with input text gesture to make it more # realistic. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( js_template.Render( 'document.querySelector({{ selector }}).value += "वितरण";', selector=self._SEARCH_BOX_SELECTOR))
diff --git a/tools/perf/page_sets/system_health/loading_stories.py b/tools/perf/page_sets/system_health/loading_stories.py index 022d74f3..9d30253 100644 --- a/tools/perf/page_sets/system_health/loading_stories.py +++ b/tools/perf/page_sets/system_health/loading_stories.py
@@ -187,7 +187,7 @@ # window does not have a "Close" button, instead it has only a "Send link # to phone" button. So on tablets we run with the popup window open. The # popup is transparent, so this is mostly an aesthetical issue. - has_button = action_runner.EvaluateJavaScript( + has_button = action_runner.EvaluateJavaScript2( '!!document.querySelector({{ selector }})', selector=self._CLOSE_BUTTON_SELECTOR) if has_button: @@ -241,7 +241,7 @@ def _DidLoadDocument(self, action_runner): # Wait until the 'Recently tagged' view loads. - action_runner.WaitForJavaScriptCondition(''' + action_runner.WaitForJavaScriptCondition2(''' document.querySelector( '.search-photos-everyone-trending-view .photo-list-view') !== null''') @@ -305,7 +305,7 @@ def _DidLoadDocument(self, action_runner): # Wait until the UI loads. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("loading").style.display === "none"') @@ -316,7 +316,7 @@ def _DidLoadDocument(self, action_runner): # Wait until the UI loads. action_runner.WaitForElement('#apploadingdiv') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("apploadingdiv").style.height === "0px"') class LoadMapsStory(_LoadingStory): @@ -364,7 +364,7 @@ def _DidLoadDocument(self, action_runner): # The #logo element is removed right before the main menu is displayed. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("logo") === null') @@ -382,7 +382,7 @@ def _DidLoadDocument(self, action_runner): # The background of the game canvas is set when the "Tap screen to play" # caption is displayed. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.querySelector("#game canvas").style.background !== ""')
diff --git a/tools/perf/page_sets/system_health/long_running_stories.py b/tools/perf/page_sets/system_health/long_running_stories.py index a32ea45..809971d8 100644 --- a/tools/perf/page_sets/system_health/long_running_stories.py +++ b/tools/perf/page_sets/system_health/long_running_stories.py
@@ -65,12 +65,12 @@ def _DidLoadDocument(self, action_runner): # Close the "Get Inbox by Gmail" interstitial. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.querySelector("#isppromo a") !== null') - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.querySelector("#isppromo a").click()') # Wait until the UI loads. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("apploadingdiv").style.height === "0px"') @@ -79,7 +79,7 @@ def _DidLoadDocument(self, action_runner): # Wait until the UI loads. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("loading").style.display === "none"')
diff --git a/tools/perf/page_sets/system_health/media_stories.py b/tools/perf/page_sets/system_health/media_stories.py index ad079e8..c8a68ae 100644 --- a/tools/perf/page_sets/system_health/media_stories.py +++ b/tools/perf/page_sets/system_health/media_stories.py
@@ -45,7 +45,7 @@ self.PLAY_DURATION - self._GetTimeInSeconds(action_runner)) def _GetTimeInSeconds(self, action_runner): - minutes, seconds = action_runner.EvaluateJavaScript( + minutes, seconds = action_runner.EvaluateJavaScript2( 'document.querySelector({{ selector }}).textContent', selector=self.TIME_SELECTOR).split(':') return int(minutes * 60 + seconds)
diff --git a/tools/perf/page_sets/text_selection_sites.py b/tools/perf/page_sets/text_selection_sites.py index 435379c..0fa2aa63 100644 --- a/tools/perf/page_sets/text_selection_sites.py +++ b/tools/perf/page_sets/text_selection_sites.py
@@ -18,7 +18,7 @@ def RunNavigateSteps(self, action_runner): super(SimplePage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.readyState == "complete"') @@ -31,7 +31,7 @@ # Create a fixed position div in the top left corner of the page, and # another one in the bottom right corner of the page. # Select the text within the first div. - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' (function() { var text_div = document.createElement('div'); var text_div_2 = document.createElement('div'); @@ -65,32 +65,32 @@ # Wait two frames so that the selection information is sent to chromium # and it is able to process input events interacting with selection. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("text-for-perf-test").style.color == "green"') - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' window.requestAnimationFrame(function() { document.getElementById("text-for-perf-test").style.color="red"; }); ''') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementById("text-for-perf-test").style.color == "red"') # Confirm that the selection is set correctly. - text = action_runner.EvaluateJavaScript('window.getSelection().toString()') + text = action_runner.EvaluateJavaScript2('window.getSelection().toString()') assert text == "Hello" # Tap on the selected text to make the handles show up. with action_runner.CreateGestureInteraction('TapAction'): action_runner.TapElement('#text-for-perf-test') - text_div_bottom = float(action_runner.EvaluateJavaScript(''' + text_div_bottom = float(action_runner.EvaluateJavaScript2(''' document.getElementById("text-for-perf-test").getClientRects()[0].bottom ''')) - text_div_2_bottom = float(action_runner.EvaluateJavaScript(''' + text_div_2_bottom = float(action_runner.EvaluateJavaScript2(''' document.getElementById( "text-for-perf-test-2").getClientRects()[0].bottom ''')) - body_rect_str = action_runner.EvaluateJavaScript(''' + body_rect_str = action_runner.EvaluateJavaScript2(''' var r = window.__GestureCommon_GetBoundingVisibleRect(document.body); r.left + " " + r.top + " " + r.height + " " + r.width; ''') @@ -116,11 +116,11 @@ use_touch=1) # Confirm that the selection has changed. - text = action_runner.EvaluateJavaScript('window.getSelection().toString()') + text = action_runner.EvaluateJavaScript2('window.getSelection().toString()') assert text != "Hello" # Determine the coordinates of the end of the selection - sel_end_str = action_runner.EvaluateJavaScript(''' + sel_end_str = action_runner.EvaluateJavaScript2(''' var rects = window.getSelection().getRangeAt(0).getClientRects(); var last_rect = rects[rects.length - 1]; last_rect.right + " " + last_rect.bottom; @@ -139,7 +139,7 @@ use_touch=1) # Confirm that the selection is back to the text in the first div. - text = action_runner.EvaluateJavaScript('window.getSelection().toString()') + text = action_runner.EvaluateJavaScript2('window.getSelection().toString()') assert text == "Hello"
diff --git a/tools/perf/page_sets/todomvc.py b/tools/perf/page_sets/todomvc.py index 43ce61e..a03ebab1 100644 --- a/tools/perf/page_sets/todomvc.py +++ b/tools/perf/page_sets/todomvc.py
@@ -36,7 +36,7 @@ 'console.time({{ label }});', label=INTERACTION_NAME) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( """ this.becameIdle = false; this.idleCallback = function(deadline) { @@ -48,8 +48,8 @@ requestIdleCallback(this.idleCallback); """ ) - action_runner.WaitForJavaScriptCondition('this.becameIdle === true') - action_runner.ExecuteJavaScript( + action_runner.WaitForJavaScriptCondition2('this.becameIdle === true') + action_runner.ExecuteJavaScript2( 'console.timeEnd({{ label }});', label=INTERACTION_NAME)
diff --git a/tools/perf/page_sets/top_10.py b/tools/perf/page_sets/top_10.py index 7c9045f..4d9b5eb 100644 --- a/tools/perf/page_sets/top_10.py +++ b/tools/perf/page_sets/top_10.py
@@ -37,7 +37,7 @@ def RunNavigateSteps(self, action_runner): super(Gmail, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null') @@ -51,7 +51,7 @@ def RunNavigateSteps(self, action_runner): super(GoogleCalendar, self).RunNavigateSteps(action_runner) - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' (function() { var elem = document.createElement("meta"); elem.name="viewport"; elem.content="initial-scale=1";
diff --git a/tools/perf/page_sets/top_25_smooth.py b/tools/perf/page_sets/top_25_smooth.py index a021e3f..9267c522 100644 --- a/tools/perf/page_sets/top_25_smooth.py +++ b/tools/perf/page_sets/top_25_smooth.py
@@ -57,17 +57,17 @@ google_login.LoginGoogleAccount(action_runner, 'google3', self.credentials_path) super(GmailSmoothPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null', - timeout_in_seconds=120) + timeout=120) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' gmonkey.load('2.0', function(api) { window.__scrollableElementForTelemetry = api.getScrollableElement(); });''') - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.__scrollableElementForTelemetry != null') action_runner.Wait(1) with action_runner.CreateGestureInteraction('ScrollAction'):
diff --git a/tools/perf/page_sets/top_7_stress.py b/tools/perf/page_sets/top_7_stress.py index c46eb79..c3494a60 100644 --- a/tools/perf/page_sets/top_7_stress.py +++ b/tools/perf/page_sets/top_7_stress.py
@@ -7,11 +7,11 @@ def _GetCurrentLocation(action_runner): - return action_runner.EvaluateJavaScript('document.location.href') + return action_runner.EvaluateJavaScript2('document.location.href') def _WaitForLocationChange(action_runner, old_href): - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.location.href != {{ old_href }}', old_href=old_href) @@ -99,7 +99,7 @@ def RunNavigateSteps(self, action_runner): super(GmailPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null') @@ -129,7 +129,7 @@ super(GoogleCalendarPage, self).RunNavigateSteps(action_runner) action_runner.Wait(2) action_runner.WaitForElement('div[class~="navForward"]') - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' (function() { var elem = document.createElement('meta'); elem.name='viewport'; @@ -295,14 +295,14 @@ # Scroll and wait for the next page to be loaded. with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.documentElement.scrollHeight - window.innerHeight - ' 'window.pageYOffset > 0') # Scroll and wait again. with action_runner.CreateGestureInteraction('ScrollAction'): action_runner.ScrollPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.documentElement.scrollHeight - window.innerHeight - ' 'window.pageYOffset > 0')
diff --git a/tools/perf/page_sets/top_pages.py b/tools/perf/page_sets/top_pages.py index 7f0d187..bb758447 100644 --- a/tools/perf/page_sets/top_pages.py +++ b/tools/perf/page_sets/top_pages.py
@@ -59,7 +59,7 @@ def RunNavigateSteps(self, action_runner): super(GmailPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null') @@ -80,7 +80,7 @@ super(GoogleCalendarPage, self).RunNavigateSteps(action_runner) action_runner.Wait(2) action_runner.WaitForElement('div[class~="navForward"]') - action_runner.ExecuteJavaScript(''' + action_runner.ExecuteJavaScript2(''' (function() { var elem = document.createElement('meta'); elem.name='viewport'; @@ -107,7 +107,7 @@ def RunNavigateSteps(self, action_runner): super(GoogleDocPage, self).RunNavigateSteps(action_runner) action_runner.Wait(2) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.getElementsByClassName("kix-appview-editor").length')
diff --git a/tools/perf/page_sets/tough_ad_cases.py b/tools/perf/page_sets/tough_ad_cases.py index 68321d1..6ab88fc0 100644 --- a/tools/perf/page_sets/tough_ad_cases.py +++ b/tools/perf/page_sets/tough_ad_cases.py
@@ -21,15 +21,15 @@ util.WaitFor(action_runner.tab.HasReachedQuiescence, 60) # Swiffy overwrites toString() to return a constant string, so "undo" that # here so that we don't think it has stomped over console.time. - action_runner.EvaluateJavaScript( + action_runner.EvaluateJavaScript2( 'Function.prototype.toString = function() { return "[native code]"; }') # Make sure we have a reasonable viewport for mobile. - viewport_js = ( - 'var meta = document.createElement("meta");' - 'meta.name = "viewport";' - 'meta.content = "width=device-width";' - 'document.getElementsByTagName("head")[0].appendChild(meta);') - action_runner.EvaluateJavaScript(viewport_js) + action_runner.EvaluateJavaScript2(""" + var meta = document.createElement("meta"); + meta.name = "viewport"; + meta.content = "width=device-width"; + document.getElementsByTagName("head")[0].appendChild(meta); + """) def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('ToughAd'): @@ -68,14 +68,14 @@ # Most ads have touch handlers and we want to simulate the worst case of the # user trying to scroll the page by grabbing an ad. if self._wait_for_interactive_or_better: - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( '(document.readyState == "interactive" || ' 'document.readyState == "complete") &&' 'document.body != null && ' 'document.body.scrollHeight > window.innerHeight && ' '!document.body.addEventListener("touchstart", function() {})') else: - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.body != null && ' 'document.body.scrollHeight > window.innerHeight && ' '!document.body.addEventListener("touchstart", function() {})') @@ -104,7 +104,7 @@ def RunNavigateSteps(self, action_runner): super(ForbesAdPage, self).RunNavigateSteps(action_runner) # Wait until the interstitial banner goes away. - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.location.pathname.indexOf("welcome") == -1')
diff --git a/tools/perf/page_sets/tough_animation_cases.py b/tools/perf/page_sets/tough_animation_cases.py index 6e831b2..a817ad69 100644 --- a/tools/perf/page_sets/tough_animation_cases.py +++ b/tools/perf/page_sets/tough_animation_cases.py
@@ -15,7 +15,7 @@ def RunNavigateSteps(self, action_runner): super(ToughAnimationCasesPage, self).RunNavigateSteps(action_runner) if self._need_measurement_ready: - action_runner.WaitForJavaScriptCondition('window.measurementReady') + action_runner.WaitForJavaScriptCondition2('window.measurementReady') def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('ToughAnimation'):
diff --git a/tools/perf/page_sets/tough_canvas_cases.py b/tools/perf/page_sets/tough_canvas_cases.py index 28ce0bb..1a9d729 100644 --- a/tools/perf/page_sets/tough_canvas_cases.py +++ b/tools/perf/page_sets/tough_canvas_cases.py
@@ -13,7 +13,7 @@ def RunNavigateSteps(self, action_runner): super(ToughCanvasCasesPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( "document.readyState == 'complete'") def RunPageInteractions(self, action_runner):
diff --git a/tools/perf/page_sets/tough_energy_cases.py b/tools/perf/page_sets/tough_energy_cases.py index 215435c..94043fd5 100644 --- a/tools/perf/page_sets/tough_energy_cases.py +++ b/tools/perf/page_sets/tough_energy_cases.py
@@ -28,7 +28,7 @@ def RunNavigateSteps(self, action_runner): super(GooglePage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null')
diff --git a/tools/perf/page_sets/tough_filters_cases.py b/tools/perf/page_sets/tough_filters_cases.py index 36b41276..2c7bc8d5 100644 --- a/tools/perf/page_sets/tough_filters_cases.py +++ b/tools/perf/page_sets/tough_filters_cases.py
@@ -23,7 +23,7 @@ def RunPageInteractions(self, action_runner): action_runner.WaitForNetworkQuiescence() with action_runner.CreateInteraction('Filter'): - action_runner.EvaluateJavaScript( + action_runner.EvaluateJavaScript2( 'document.getElementById("benchmarkButtonText").click()') action_runner.Wait(10)
diff --git a/tools/perf/page_sets/tough_image_decode_cases.py b/tools/perf/page_sets/tough_image_decode_cases.py index fd20064..40b95b7 100644 --- a/tools/perf/page_sets/tough_image_decode_cases.py +++ b/tools/perf/page_sets/tough_image_decode_cases.py
@@ -16,7 +16,7 @@ self.archive_data_file = 'data/tough_image_decode_cases.json' def RunPageInteractions(self, action_runner): - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.readyState === "complete"') action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=5000) with action_runner.CreateGestureInteraction('ScrollAction'):
diff --git a/tools/perf/page_sets/tough_path_rendering_cases.py b/tools/perf/page_sets/tough_path_rendering_cases.py index 1748ddb..3b7ac0b1 100644 --- a/tools/perf/page_sets/tough_path_rendering_cases.py +++ b/tools/perf/page_sets/tough_path_rendering_cases.py
@@ -16,7 +16,7 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('ClickStart'): - action_runner.EvaluateJavaScript( + action_runner.EvaluateJavaScript2( 'document.getElementById("StartButton").click()') action_runner.Wait(20)
diff --git a/tools/perf/page_sets/tough_pinch_zoom_cases.py b/tools/perf/page_sets/tough_pinch_zoom_cases.py index 2aa0151..8b672e35 100644 --- a/tools/perf/page_sets/tough_pinch_zoom_cases.py +++ b/tools/perf/page_sets/tough_pinch_zoom_cases.py
@@ -62,7 +62,7 @@ def RunNavigateSteps(self, action_runner): super(GmailPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'window.gmonkey !== undefined &&' 'document.getElementById("gb") !== null')
diff --git a/tools/perf/page_sets/tough_scheduling_cases.py b/tools/perf/page_sets/tough_scheduling_cases.py index 1a817a1..ac0de95 100644 --- a/tools/perf/page_sets/tough_scheduling_cases.py +++ b/tools/perf/page_sets/tough_scheduling_cases.py
@@ -377,16 +377,16 @@ action_runner.TapElement(selector='div[id="spinner"]') # Begin the action immediately because we want the page to update smoothly # even while resources are being loaded. - action_runner.WaitForJavaScriptCondition('window.__ready !== undefined') + action_runner.WaitForJavaScriptCondition2('window.__ready !== undefined') with action_runner.CreateGestureInteraction('LoadAction'): - action_runner.ExecuteJavaScript('kickOffLoading()') - action_runner.WaitForJavaScriptCondition('window.__ready') + action_runner.ExecuteJavaScript2('kickOffLoading()') + action_runner.WaitForJavaScriptCondition2('window.__ready') # Click one second after the resources have finished loading. action_runner.Wait(1) action_runner.TapElement(selector='input[id="run"]') # Wait for the test to complete. - action_runner.WaitForJavaScriptCondition('window.__finished') + action_runner.WaitForJavaScriptCondition2('window.__finished') class ToughSchedulingCasesPageSet(story.StorySet):
diff --git a/tools/perf/page_sets/tough_webgl_cases.py b/tools/perf/page_sets/tough_webgl_cases.py index 49a0be2c..54677df 100644 --- a/tools/perf/page_sets/tough_webgl_cases.py +++ b/tools/perf/page_sets/tough_webgl_cases.py
@@ -27,7 +27,7 @@ def RunNavigateSteps(self, action_runner): super(ToughWebglCasesPage, self).RunNavigateSteps(action_runner) - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.readyState == "complete"') action_runner.Wait(2)
diff --git a/tools/perf/page_sets/typical_10_mobile.py b/tools/perf/page_sets/typical_10_mobile.py index 5b03a73..9c8951d 100644 --- a/tools/perf/page_sets/typical_10_mobile.py +++ b/tools/perf/page_sets/typical_10_mobile.py
@@ -29,7 +29,7 @@ def RunPageInteractions(self, action_runner): for _ in range(0, 5): action_runner.ReloadPage() - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'document.readyState === "complete"')
diff --git a/tools/perf/page_sets/typical_25.py b/tools/perf/page_sets/typical_25.py index a1700d1..085f356 100644 --- a/tools/perf/page_sets/typical_25.py +++ b/tools/perf/page_sets/typical_25.py
@@ -50,7 +50,7 @@ def RunPageInteractions(self, action_runner): if self._run_no_page_interactions: - action_runner.WaitForJavaScriptCondition( + action_runner.WaitForJavaScriptCondition2( 'performance.timing.loadEventStart > 0') return with action_runner.CreateGestureInteraction('ScrollAction'):
diff --git a/tools/perf/page_sets/webrtc_cases.py b/tools/perf/page_sets/webrtc_cases.py index 41427d81..af0c9ead 100644 --- a/tools/perf/page_sets/webrtc_cases.py +++ b/tools/perf/page_sets/webrtc_cases.py
@@ -49,10 +49,10 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('Action_Create_PeerConnection', repeatable=False): - action_runner.ExecuteJavaScript('minWidthInput.value = 1280') - action_runner.ExecuteJavaScript('maxWidthInput.value = 1280') - action_runner.ExecuteJavaScript('minHeightInput.value = 720') - action_runner.ExecuteJavaScript('maxHeightInput.value = 720') + action_runner.ExecuteJavaScript2('minWidthInput.value = 1280') + action_runner.ExecuteJavaScript2('maxWidthInput.value = 1280') + action_runner.ExecuteJavaScript2('minHeightInput.value = 720') + action_runner.ExecuteJavaScript2('maxHeightInput.value = 720') action_runner.ClickElement('button[id="getMedia"]') action_runner.Wait(2) action_runner.ClickElement('button[id="connect"]') @@ -71,7 +71,7 @@ def RunPageInteractions(self, action_runner): # It won't have time to finish the 512 MB, but we're only interested in # cpu + memory anyway rather than how much data we manage to transfer. - action_runner.ExecuteJavaScript('megsToSend.value = 512;') + action_runner.ExecuteJavaScript2('megsToSend.value = 512;') action_runner.ClickElement('button[id="sendTheData"]') action_runner.Wait(30) @@ -86,7 +86,7 @@ page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('codecSelector.value="OPUS";') + action_runner.ExecuteJavaScript2('codecSelector.value="OPUS";') action_runner.ClickElement('button[id="callButton"]') action_runner.Wait(10) @@ -101,7 +101,7 @@ page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('codecSelector.value="G722";') + action_runner.ExecuteJavaScript2('codecSelector.value="G722";') action_runner.ClickElement('button[id="callButton"]') action_runner.Wait(10) @@ -116,7 +116,7 @@ page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('codecSelector.value="PCMU";') + action_runner.ExecuteJavaScript2('codecSelector.value="PCMU";') action_runner.ClickElement('button[id="callButton"]') action_runner.Wait(10) @@ -131,7 +131,7 @@ page_set=page_set) def RunPageInteractions(self, action_runner): - action_runner.ExecuteJavaScript('codecSelector.value="ISAC/16000";') + action_runner.ExecuteJavaScript2('codecSelector.value="ISAC/16000";') action_runner.ClickElement('button[id="callButton"]') action_runner.Wait(10) @@ -149,8 +149,8 @@ def RunPageInteractions(self, action_runner): with action_runner.CreateInteraction('Action_Canvas_PeerConnection', repeatable=False): - action_runner.ExecuteJavaScript('draw();') - action_runner.ExecuteJavaScript('doCanvasCaptureAndPeerConnection();') + action_runner.ExecuteJavaScript2('draw();') + action_runner.ExecuteJavaScript2('doCanvasCaptureAndPeerConnection();') action_runner.Wait(10) @@ -167,9 +167,9 @@ with action_runner.CreateInteraction('Action_Create_PeerConnection', repeatable=False): # Set the number of peer connections to create to 15. - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.getElementById("num-peerconnections").value=15') - action_runner.ExecuteJavaScript( + action_runner.ExecuteJavaScript2( 'document.getElementById("cpuoveruse-detection").checked=false') action_runner.ClickElement('button[id="start-test"]') action_runner.Wait(45)
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_custom_notification_view.cc index cdb2c7d..71b8777 100644 --- a/ui/arc/notification/arc_custom_notification_view.cc +++ b/ui/arc/notification/arc_custom_notification_view.cc
@@ -169,7 +169,7 @@ } bool IsPinned() const override { - return owner_->floating_close_button_ == nullptr; + return owner_->item_->pinned(); } private:
diff --git a/ui/aura/mus/capture_synchronizer.cc b/ui/aura/mus/capture_synchronizer.cc index 67dacb4..48b74f96 100644 --- a/ui/aura/mus/capture_synchronizer.cc +++ b/ui/aura/mus/capture_synchronizer.cc
@@ -14,30 +14,38 @@ namespace aura { CaptureSynchronizer::CaptureSynchronizer(CaptureSynchronizerDelegate* delegate, - ui::mojom::WindowTree* window_tree, - client::CaptureClient* capture_client) - : delegate_(delegate), - window_tree_(window_tree), - capture_client_(capture_client) { - capture_client_->AddObserver(this); -} + ui::mojom::WindowTree* window_tree) + : delegate_(delegate), window_tree_(window_tree) {} -CaptureSynchronizer::~CaptureSynchronizer() { - SetCaptureWindow(nullptr); - capture_client_->RemoveObserver(this); -} +CaptureSynchronizer::~CaptureSynchronizer() {} void CaptureSynchronizer::SetCaptureFromServer(WindowMus* window) { if (window == capture_window_) return; DCHECK(!setting_capture_); - // Don't immediately set |capture_client_|. It's possible the change will be - // rejected. + // Don't immediately set |capture_window_|. It's possible the change + // will be rejected. |capture_window_| is set in OnCaptureChanged() if + // capture succeeds. base::AutoReset<bool> capture_reset(&setting_capture_, true); base::AutoReset<WindowMus*> window_setting_capture_to_reset( &window_setting_capture_to_, window); - capture_client_->SetCapture(window ? window->GetWindow() : nullptr); + client::CaptureClient* capture_client = + window ? client::GetCaptureClient(window->GetWindow()->GetRootWindow()) + : client::GetCaptureClient( + capture_window_->GetWindow()->GetRootWindow()); + capture_client->SetCapture(window ? window->GetWindow() : nullptr); +} + +void CaptureSynchronizer::AttachToCaptureClient( + client::CaptureClient* capture_client) { + capture_client->AddObserver(this); +} + +void CaptureSynchronizer::DetachFromCaptureClient( + client::CaptureClient* capture_client) { + SetCaptureWindow(nullptr); + capture_client->RemoveObserver(this); } void CaptureSynchronizer::SetCaptureWindow(WindowMus* window) { @@ -62,6 +70,17 @@ if (!gained_capture && !capture_window_) return; // Happens if the window is deleted during notification. + // Happens if the window that just lost capture is not the most updated window + // that has capture to avoid setting the current |capture_window_| to null by + // accident. This can occur because CaptureSynchronizer can be the observer + // for multiple capture clients; after we set capture for one capture client + // and then set capture for another capture client, releasing capture on the + // first capture client could potentially reset the |capture_window_| to null + // while the correct |capture_window_| should be the capture window for the + // second capture client at that time. + if (!gained_capture && lost_capture != capture_window_->GetWindow()) + return; + WindowMus* gained_capture_mus = WindowMus::Get(gained_capture); if (setting_capture_ && gained_capture_mus == window_setting_capture_to_) { SetCaptureWindow(gained_capture_mus);
diff --git a/ui/aura/mus/capture_synchronizer.h b/ui/aura/mus/capture_synchronizer.h index 87bce87..4b300160 100644 --- a/ui/aura/mus/capture_synchronizer.h +++ b/ui/aura/mus/capture_synchronizer.h
@@ -28,12 +28,11 @@ // CaptureSynchronizer is resonsible for keeping capture in sync between aura // and the mus server. -class CaptureSynchronizer : public WindowObserver, - public client::CaptureClientObserver { +class AURA_EXPORT CaptureSynchronizer : public WindowObserver, + public client::CaptureClientObserver { public: CaptureSynchronizer(CaptureSynchronizerDelegate* delegate, - ui::mojom::WindowTree* window_tree, - client::CaptureClient* capture_client); + ui::mojom::WindowTree* window_tree); ~CaptureSynchronizer() override; WindowMus* capture_window() { return capture_window_; } @@ -41,6 +40,10 @@ // Called when the server side wants to change capture to |window|. void SetCaptureFromServer(WindowMus* window); + // Called when the |capture_client| has been set or will be unset. + void AttachToCaptureClient(client::CaptureClient* capture_client); + void DetachFromCaptureClient(client::CaptureClient* capture_client); + private: // Internal implementation for capture changes. Adds/removes observer as // necessary and sets |capture_window_| to |window|. @@ -54,7 +57,6 @@ CaptureSynchronizerDelegate* delegate_; ui::mojom::WindowTree* window_tree_; - client::CaptureClient* capture_client_; // Window that currently has capture. WindowMus* capture_window_ = nullptr;
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc index 68a4cda3..ac8a12b 100644 --- a/ui/aura/mus/window_port_mus.cc +++ b/ui/aura/mus/window_port_mus.cc
@@ -66,8 +66,9 @@ predefined_cursor_ = cursor_id; } -void WindowPortMus::SetCanAcceptEvents(bool value) { - window_tree_client_->SetCanAcceptEvents(this, value); +void WindowPortMus::SetEventTargetingPolicy( + ui::mojom::EventTargetingPolicy policy) { + window_tree_client_->SetEventTargetingPolicy(this, policy); } void WindowPortMus::Embed(
diff --git a/ui/aura/mus/window_port_mus.h b/ui/aura/mus/window_port_mus.h index c3018a36..5e3921a 100644 --- a/ui/aura/mus/window_port_mus.h +++ b/ui/aura/mus/window_port_mus.h
@@ -56,8 +56,8 @@ ui::mojom::Cursor predefined_cursor() const { return predefined_cursor_; } void SetPredefinedCursor(ui::mojom::Cursor cursor_id); - // Sets whether the window can receive events. Default value is true. - void SetCanAcceptEvents(bool value); + // Sets the EventTargetingPolicy, default is TARGET_AND_DESCENDANTS. + void SetEventTargetingPolicy(ui::mojom::EventTargetingPolicy policy); // Embeds a new client in this Window. See WindowTreeClient::Embed() for // details on arguments.
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc index 5f73fbb..b71391b 100644 --- a/ui/aura/mus/window_tree_client.cc +++ b/ui/aura/mus/window_tree_client.cc
@@ -234,10 +234,6 @@ SetWindowTree(std::move(window_tree)); } -client::CaptureClient* WindowTreeClient::GetCaptureClient() { - return delegate_->GetCaptureClient(); -} - void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) { DCHECK(tree_); DCHECK(window); @@ -467,8 +463,7 @@ tree_ = window_tree; drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_); - capture_synchronizer_ = - base::MakeUnique<CaptureSynchronizer>(this, tree_, GetCaptureClient()); + capture_synchronizer_ = base::MakeUnique<CaptureSynchronizer>(this, tree_); focus_synchronizer_ = base::MakeUnique<FocusSynchronizer>(this, tree_); } @@ -828,10 +823,11 @@ tree_->SetCanAcceptDrops(window_id, can_accept_drops); } -void WindowTreeClient::SetCanAcceptEvents(WindowMus* window, - bool can_accept_events) { +void WindowTreeClient::SetEventTargetingPolicy( + WindowMus* window, + ui::mojom::EventTargetingPolicy policy) { DCHECK(tree_); - tree_->SetCanAcceptEvents(window->server_id(), can_accept_events); + tree_->SetEventTargetingPolicy(window->server_id(), policy); } void WindowTreeClient::OnEmbed(ClientSpecificId client_id,
diff --git a/ui/aura/mus/window_tree_client.h b/ui/aura/mus/window_tree_client.h index f218b5e..09dc89ba 100644 --- a/ui/aura/mus/window_tree_client.h +++ b/ui/aura/mus/window_tree_client.h
@@ -68,10 +68,6 @@ class WindowTreeClientTestObserver; class WindowTreeHostMus; -namespace client { -class CaptureClient; -} - using EventResultCallback = base::Callback<void(ui::mojom::EventResult)>; // Manages the connection with mus. @@ -108,15 +104,17 @@ service_manager::Connector* connector() { return connector_; } ui::Gpu* gpu() { return gpu_.get(); } + CaptureSynchronizer* capture_synchronizer() { + return capture_synchronizer_.get(); + } bool connected() const { return tree_ != nullptr; } ClientSpecificId client_id() const { return client_id_; } - client::CaptureClient* GetCaptureClient(); - void SetCanFocus(Window* window, bool can_focus); void SetCanAcceptDrops(Id window_id, bool can_accept_drops); - void SetCanAcceptEvents(WindowMus* window, bool can_accept_events); + void SetEventTargetingPolicy(WindowMus* window, + ui::mojom::EventTargetingPolicy policy); void SetPredefinedCursor(WindowMus* window, ui::mojom::Cursor old_cursor, ui::mojom::Cursor new_cursor);
diff --git a/ui/aura/mus/window_tree_client_delegate.h b/ui/aura/mus/window_tree_client_delegate.h index 609a057..e76d2efb 100644 --- a/ui/aura/mus/window_tree_client_delegate.h +++ b/ui/aura/mus/window_tree_client_delegate.h
@@ -19,10 +19,6 @@ class WindowTreeClient; class WindowTreeHostMus; -namespace client { -class CaptureClient; -} - // Interface implemented by an application using mus. class AURA_EXPORT WindowTreeClientDelegate { public: @@ -62,10 +58,6 @@ virtual void OnPointerEventObserved(const ui::PointerEvent& event, Window* target) = 0; - // Mus expects a single CaptureClient is used for all WindowTreeHosts. This - // returns it. GetCaptureClient() is called from the constructor. - virtual client::CaptureClient* GetCaptureClient() = 0; - virtual PropertyConverter* GetPropertyConverter() = 0; protected:
diff --git a/ui/aura/mus/window_tree_client_unittest.cc b/ui/aura/mus/window_tree_client_unittest.cc index f6f877f..a804d3b 100644 --- a/ui/aura/mus/window_tree_client_unittest.cc +++ b/ui/aura/mus/window_tree_client_unittest.cc
@@ -18,8 +18,10 @@ #include "ui/aura/client/aura_constants.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/capture_client_observer.h" +#include "ui/aura/client/default_capture_client.h" #include "ui/aura/client/focus_client.h" #include "ui/aura/client/transient_window_client.h" +#include "ui/aura/mus/capture_synchronizer.h" #include "ui/aura/mus/property_converter.h" #include "ui/aura/mus/window_mus.h" #include "ui/aura/mus/window_tree_client_delegate.h" @@ -1364,6 +1366,78 @@ capture_recorder.reset_capture_captured_count(); } +TEST_F(WindowTreeClientClientTest, TwoWindowTreesRequestCapture) { + // Creating a WindowTreeHost so we can have two root windows: top_level + // and root_window(). + std::unique_ptr<WindowTreeHostMus> window_tree_host = + base::MakeUnique<WindowTreeHostMus>(window_tree_client_impl()); + window_tree_host->InitHost(); + Window* top_level = window_tree_host->window(); + std::unique_ptr<client::DefaultCaptureClient> capture_client( + base::MakeUnique<client::DefaultCaptureClient>()); + client::SetCaptureClient(top_level, capture_client.get()); + window_tree_client_impl()->capture_synchronizer()->AttachToCaptureClient( + capture_client.get()); + EXPECT_NE(server_id(top_level), server_id(root_window())); + + // Ack the request to the windowtree to create the new window. + uint32_t change_id; + ASSERT_TRUE(window_tree()->GetAndRemoveFirstChangeOfType( + WindowTreeChangeType::NEW_TOP_LEVEL, &change_id)); + EXPECT_EQ(window_tree()->window_id(), server_id(top_level)); + + ui::mojom::WindowDataPtr data = ui::mojom::WindowData::New(); + data->window_id = server_id(top_level); + data->visible = true; + const int64_t display_id = 1; + window_tree_client()->OnTopLevelCreated(change_id, std::move(data), + display_id, true); + EXPECT_EQ( + 0u, window_tree()->GetChangeCountForType(WindowTreeChangeType::VISIBLE)); + EXPECT_TRUE(top_level->TargetVisibility()); + + std::unique_ptr<CaptureRecorder> capture_recorder1( + base::MakeUnique<CaptureRecorder>(root_window())); + std::unique_ptr<CaptureRecorder> capture_recorder2( + base::MakeUnique<CaptureRecorder>(top_level)); + EXPECT_NE(client::GetCaptureClient(root_window()), + client::GetCaptureClient(top_level)); + + EXPECT_EQ(0, capture_recorder1->capture_changed_count()); + EXPECT_EQ(0, capture_recorder2->capture_changed_count()); + // Give capture to top_level and ensure everyone is notified correctly. + top_level->SetCapture(); + ASSERT_TRUE(window_tree()->AckSingleChangeOfType( + WindowTreeChangeType::CAPTURE, true)); + EXPECT_EQ(0, capture_recorder1->capture_changed_count()); + EXPECT_EQ(1, capture_recorder2->capture_changed_count()); + EXPECT_EQ(top_level->id(), + capture_recorder2->last_gained_capture_window_id()); + EXPECT_EQ(0, capture_recorder2->last_lost_capture_window_id()); + top_level->ReleaseCapture(); + capture_recorder1->reset_capture_captured_count(); + capture_recorder2->reset_capture_captured_count(); + + // Release capture of top_level shouldn't affect the capture of root_window(). + top_level->SetCapture(); + root_window()->SetCapture(); + top_level->ReleaseCapture(); + EXPECT_EQ(1, capture_recorder1->capture_changed_count()); + EXPECT_EQ(2, capture_recorder2->capture_changed_count()); + EXPECT_EQ(root_window()->id(), + capture_recorder1->last_gained_capture_window_id()); + EXPECT_EQ(0, capture_recorder1->last_lost_capture_window_id()); + EXPECT_EQ(0, capture_recorder2->last_gained_capture_window_id()); + EXPECT_EQ(top_level->id(), capture_recorder2->last_lost_capture_window_id()); + + capture_recorder1->reset_capture_captured_count(); + capture_recorder2->reset_capture_captured_count(); + capture_recorder1.reset(); + capture_recorder2.reset(); + window_tree_host.reset(); + capture_client.reset(); +} + TEST_F(WindowTreeClientClientTest, ModalFail) { Window window(nullptr); window.Init(ui::LAYER_NOT_DRAWN);
diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc index 9732917..6d7c340b 100644 --- a/ui/aura/test/aura_test_base.cc +++ b/ui/aura/test/aura_test_base.cc
@@ -228,10 +228,6 @@ void AuraTestBase::OnWmDeactivateWindow(Window* window) {} -client::CaptureClient* AuraTestBase::GetCaptureClient() { - return helper_->capture_client(); -} - PropertyConverter* AuraTestBase::GetPropertyConverter() { return &property_converter_; }
diff --git a/ui/aura/test/aura_test_base.h b/ui/aura/test/aura_test_base.h index f79283d..b5a765b 100644 --- a/ui/aura/test/aura_test_base.h +++ b/ui/aura/test/aura_test_base.h
@@ -126,7 +126,6 @@ const std::vector<gfx::Rect>& additional_client_areas) override; bool IsWindowActive(aura::Window* window) override; void OnWmDeactivateWindow(Window* window) override; - client::CaptureClient* GetCaptureClient() override; PropertyConverter* GetPropertyConverter() override; private:
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc index b215374a..1d0dc9b 100644 --- a/ui/aura/test/aura_test_helper.cc +++ b/ui/aura/test/aura_test_helper.cc
@@ -11,6 +11,7 @@ #include "ui/aura/client/focus_client.h" #include "ui/aura/env.h" #include "ui/aura/input_state_lookup.h" +#include "ui/aura/mus/capture_synchronizer.h" #include "ui/aura/mus/window_port_mus.h" #include "ui/aura/mus/window_tree_client.h" #include "ui/aura/test/env_test_helper.h" @@ -195,6 +196,8 @@ window_tree_client_setup_->InitForWindowManager(window_tree_delegate_, window_manager_delegate_); window_tree_client_ = window_tree_client_setup_->window_tree_client(); + window_tree_client_->capture_synchronizer()->AttachToCaptureClient( + capture_client_.get()); } } // namespace test
diff --git a/ui/aura/test/mus/test_window_tree.cc b/ui/aura/test/mus/test_window_tree.cc index 6245a04..e9be6351 100644 --- a/ui/aura/test/mus/test_window_tree.cc +++ b/ui/aura/test/mus/test_window_tree.cc
@@ -244,8 +244,9 @@ void TestWindowTree::SetCanFocus(uint32_t window_id, bool can_focus) {} -void TestWindowTree::SetCanAcceptEvents(uint32_t window_id, - bool can_accept_events) {} +void TestWindowTree::SetEventTargetingPolicy( + uint32_t window_id, + ui::mojom::EventTargetingPolicy policy) {} void TestWindowTree::SetPredefinedCursor(uint32_t change_id, uint32_t window_id,
diff --git a/ui/aura/test/mus/test_window_tree.h b/ui/aura/test/mus/test_window_tree.h index aba306a..92d05bac 100644 --- a/ui/aura/test/mus/test_window_tree.h +++ b/ui/aura/test/mus/test_window_tree.h
@@ -165,7 +165,8 @@ const EmbedCallback& callback) override; void SetFocus(uint32_t change_id, uint32_t window_id) override; void SetCanFocus(uint32_t window_id, bool can_focus) override; - void SetCanAcceptEvents(uint32_t window_id, bool can_accept_events) override; + void SetEventTargetingPolicy(uint32_t window_id, + ui::mojom::EventTargetingPolicy policy) override; void SetPredefinedCursor(uint32_t change_id, uint32_t window_id, ui::mojom::Cursor cursor_id) override;
diff --git a/ui/display/display_layout.cc b/ui/display/display_layout.cc index 9b5ee17..443ac83 100644 --- a/ui/display/display_layout.cc +++ b/ui/display/display_layout.cc
@@ -65,7 +65,11 @@ const int kMaxDepth = 100; // Avoid layouts with cycles. while (current_id != primary_id && depth < kMaxDepth) { ++depth; - current_id = display_to_parent_ids_map.at(current_id); + auto iter = display_to_parent_ids_map.find(current_id); + if (iter == display_to_parent_ids_map.end()) + return kMaxDepth; // Let detached diplays go to the end. + + current_id = iter->second; } return depth; @@ -93,9 +97,15 @@ // After the layout has been applied to the |display_list| and any possible // overlaps have been fixed, this function is called to update the offsets in -// the |placement_list|. -void UpdateOffsets(Displays* display_list, - std::vector<DisplayPlacement>* placement_list) { +// the |placement_list|, and make sure the placement list is sorted by display +// IDs. +void UpdatePlacementList(Displays* display_list, + std::vector<DisplayPlacement>* placement_list) { + std::sort(placement_list->begin(), placement_list->end(), + [](const DisplayPlacement& p1, const DisplayPlacement& p2) { + return p1.display_id < p2.display_id; + }); + for (DisplayPlacement& placement : *placement_list) { const Display* child_display = FindDisplayById(display_list, placement.display_id); @@ -118,7 +128,9 @@ } // Reparents |target_display| to |last_intersecting_source_display| if it's not -// touching with its current parent. +// touching with its current parent. It also handles the case if +// |target_display| is detached, it then reparents it to the last intersecting +// display. void MaybeReparentTargetDisplay( int last_offset_x, int last_offset_y, @@ -130,44 +142,55 @@ // A de-intersection was performed. // The offset target display may have moved such that it no longer touches // its parent. Reparent if necessary. - const int64_t parent_display_id = - display_to_parent_ids_map->at(target_display->id()); - if (parent_display_id == last_intersecting_source_display->id()) { - // It was just de-intersected with the source display in such a way that - // they're touching, and the source display is its parent. So no need to - // do any reparenting. - return; + DisplayPlacement* target_display_placement = nullptr; + auto iter = display_to_parent_ids_map->find(target_display->id()); + if (iter != display_to_parent_ids_map->end()) { + const int64_t parent_display_id = iter->second; + if (parent_display_id == last_intersecting_source_display->id()) { + // It was just de-intersected with the source display in such a way that + // they're touching, and the source display is its parent. So no need to + // do any reparenting. + return; + } + + Display* parent_display = FindDisplayById(display_list, parent_display_id); + DCHECK(parent_display); + + auto target_display_placement_itr = + std::find_if(placement_list->begin(), placement_list->end(), + [&target_display](const DisplayPlacement& p) { + return p.display_id == target_display->id(); + }); + DCHECK(target_display_placement_itr != placement_list->end()); + target_display_placement = &(*target_display_placement_itr); + if (AreDisplaysTouching(*target_display, *parent_display, + target_display_placement->position)) { + return; + } + } else { + // It's a detached display with no parent. Add a new placement for it. + DisplayPlacement new_placement; + new_placement.display_id = target_display->id(); + placement_list->emplace_back(new_placement); + target_display_placement = &placement_list->back(); } - Display* parent_display = FindDisplayById(display_list, parent_display_id); - DCHECK(parent_display); - - auto target_display_placement_itr = - std::find_if(placement_list->begin(), placement_list->end(), - [&target_display](const DisplayPlacement& p) { - return p.display_id == target_display->id(); - }); - DCHECK(target_display_placement_itr != placement_list->end()); - DisplayPlacement& target_display_placement = *target_display_placement_itr; - if (AreDisplaysTouching(*target_display, *parent_display, - target_display_placement.position)) { - return; - } + DCHECK(target_display_placement); // Reparent the target to source and update the position. No need to // update the offset here as it will be done later when UpdateOffsets() // is called. - target_display_placement.parent_display_id = + target_display_placement->parent_display_id = last_intersecting_source_display->id(); // Update the map. (*display_to_parent_ids_map)[target_display->id()] = last_intersecting_source_display->id(); if (last_offset_x) { - target_display_placement.position = + target_display_placement->position = last_offset_x > 0 ? DisplayPlacement::RIGHT : DisplayPlacement::LEFT; } else { - target_display_placement.position = + target_display_placement->position = last_offset_y > 0 ? DisplayPlacement::BOTTOM : DisplayPlacement::TOP; } } @@ -235,18 +258,23 @@ if (d1_depth != d2_depth) return d1_depth < d2_depth; - return d1->bounds().OffsetFromOrigin().LengthSquared() < - d2->bounds().OffsetFromOrigin().LengthSquared(); + const int64_t d1_distance = d1->bounds().OffsetFromOrigin().LengthSquared(); + const int64_t d2_distance = d2->bounds().OffsetFromOrigin().LengthSquared(); + + if (d1_distance != d2_distance) + return d1_distance < d2_distance; + + return d1->id() < d2->id(); }); // This must result in the primary display being at the front of the list. DCHECK_EQ(sorted_displays.front()->id(), primary_id); - for (int i = 1; i < static_cast<int>(sorted_displays.size()); ++i) { + for (size_t i = 1; i < sorted_displays.size(); ++i) { Display* target_display = sorted_displays[i]; const Display* last_intersecting_source_display = nullptr; int last_offset_x = 0; int last_offset_y = 0; - for (int j = i - 1; j >= 0; --j) { + for (size_t j = 0; j < i; ++j) { const Display* source_display = sorted_displays[j]; const gfx::Rect source_bounds = source_display->bounds(); const gfx::Rect target_bounds = target_display->bounds(); @@ -294,8 +322,9 @@ placement_list); } - // The offsets might have changed and we must update them. - UpdateOffsets(display_list, placement_list); + // New placements might have been added and offsets might have changed and we + // must update them. + UpdatePlacementList(display_list, placement_list); } } // namespace
diff --git a/ui/file_manager/compiled_resources2.gyp b/ui/file_manager/compiled_resources2.gyp index 5ea03a6..170c22f 100644 --- a/ui/file_manager/compiled_resources2.gyp +++ b/ui/file_manager/compiled_resources2.gyp
@@ -16,6 +16,7 @@ 'file_manager/foreground/js/metadata/compiled_resources2.gyp:*', 'gallery/js/compiled_resources2.gyp:*', 'image_loader/compiled_resources2.gyp:*', + 'video_player/js/cast/compiled_resources2.gyp:*', 'video_player/js/compiled_resources2.gyp:*', ], },
diff --git a/ui/file_manager/externs/chrome_cast.js b/ui/file_manager/externs/chrome_cast.js index 7642bf3..2672538 100644 --- a/ui/file_manager/externs/chrome_cast.js +++ b/ui/file_manager/externs/chrome_cast.js
@@ -10,7 +10,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.AutoJoinPolicy + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.AutoJoinPolicy */ chrome.cast.AutoJoinPolicy = { TAB_AND_ORIGIN_SCOPED: 'tab_and_origin_scoped', @@ -21,7 +21,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.DefaultActionPolicy + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.DefaultActionPolicy */ chrome.cast.DefaultActionPolicy = { CREATE_SESSION: 'create_session', @@ -31,7 +31,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Capability + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.Capability */ chrome.cast.Capability = { VIDEO_OUT: 'video_out', @@ -43,7 +43,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ErrorCode + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ErrorCode */ chrome.cast.ErrorCode = { CANCEL: 'cancel', @@ -61,7 +61,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAvailability + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAvailability */ chrome.cast.ReceiverAvailability = { AVAILABLE: 'available', @@ -71,7 +71,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderPlatform + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SenderPlatform */ chrome.cast.SenderPlatform = { CHROME: 'chrome', @@ -82,7 +82,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverType */ chrome.cast.ReceiverType = { CAST: 'cast', @@ -93,7 +93,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAction + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.ReceiverAction */ chrome.cast.ReceiverAction = { CAST: 'cast', @@ -103,7 +103,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionStatus + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.SessionStatus */ chrome.cast.SessionStatus = { CONNECTED: 'connected', @@ -120,7 +120,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaCommand + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MediaCommand */ chrome.cast.media.MediaCommand = { PAUSE: 'pause', @@ -132,7 +132,7 @@ /** * @enum {number} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MetadataType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.MetadataType */ chrome.cast.media.MetadataType = { GENERIC: 0, @@ -145,7 +145,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayerState + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.PlayerState */ chrome.cast.media.PlayerState = { IDLE: 'IDLE', @@ -157,7 +157,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.ResumeState + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.ResumeState */ chrome.cast.media.ResumeState = { PLAYBACK_START: 'PLAYBACK_START', @@ -167,7 +167,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StreamType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.StreamType */ chrome.cast.media.StreamType = { BUFFERED: 'BUFFERED', @@ -178,7 +178,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.IdleReason + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.IdleReason */ chrome.cast.media.IdleReason = { CANCELLED: 'CANCELLED', @@ -190,7 +190,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TrackType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TrackType */ chrome.cast.media.TrackType = { TEXT: 'TEXT', @@ -201,7 +201,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackType */ chrome.cast.media.TextTrackType = { SUBTITLES: 'SUBTITLES', @@ -214,7 +214,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackEdgeType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackEdgeType */ chrome.cast.media.TextTrackEdgeType = { NONE: 'NONE', @@ -227,7 +227,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackWindowType + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackWindowType */ chrome.cast.media.TextTrackWindowType = { NONE: 'NONE', @@ -238,7 +238,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontGenericFamily + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontGenericFamily */ chrome.cast.media.TextTrackFontGenericFamily = { SANS_SERIF: 'SANS_SERIF', @@ -253,7 +253,7 @@ /** * @enum {string} - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontStyle + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.TextTrackFontStyle */ chrome.cast.media.TextTrackFontStyle = { NORMAL: 'NORMAL', @@ -553,7 +553,7 @@ /** * @namespace - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.timeout + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.timeout */ chrome.cast.timeout = {}; @@ -1143,7 +1143,7 @@ /** * @namespace - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.timeout */ chrome.cast.media.timeout = {};
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js index c770a25..82cde84 100644 --- a/ui/file_manager/file_manager/background/js/background.js +++ b/ui/file_manager/file_manager/background/js/background.js
@@ -108,6 +108,12 @@ this.stringData = strings; this.initContextMenu_(); + volumeManagerFactory.getInstance().then(function(volumeManager) { + volumeManager.addEventListener( + VolumeManagerCommon.VOLUME_ALREADY_MOUNTED, + this.handleViewEvent_.bind(this)); + }.bind(this)); + this.fileOperationManager = new FileOperationManager(); this.fileOperationHandler_ = new FileOperationHandler( this.fileOperationManager, this.progressCenter);
diff --git a/ui/file_manager/file_manager/background/js/volume_manager_impl.js b/ui/file_manager/file_manager/background/js/volume_manager_impl.js index 7288036..9408688 100644 --- a/ui/file_manager/file_manager/background/js/volume_manager_impl.js +++ b/ui/file_manager/file_manager/background/js/volume_manager_impl.js
@@ -181,6 +181,14 @@ this.finishRequest_(requestKey, event.status, volumeInfo); callback(); }.bind(this)); + } else if (event.status === + VolumeManagerCommon.VolumeError.ALREADY_MOUNTED) { + var navigation_event = + new Event(VolumeManagerCommon.VOLUME_ALREADY_MOUNTED); + navigation_event.volumeId = event.volumeMetadata.volumeId; + this.dispatchEvent(navigation_event); + this.finishRequest_(requestKey, event.status, volumeInfo); + callback(); } else { console.warn('Failed to mount a volume: ' + event.status); this.finishRequest_(requestKey, event.status);
diff --git a/ui/file_manager/file_manager/common/js/volume_manager_common.js b/ui/file_manager/file_manager/common/js/volume_manager_common.js index 2085eac..6c5e942 100644 --- a/ui/file_manager/file_manager/common/js/volume_manager_common.js +++ b/ui/file_manager/file_manager/common/js/volume_manager_common.js
@@ -252,3 +252,10 @@ * }} */ var FakeEntry; + +/** + * An event name trigerred when a user tries to mount the volume which is + * already mounted. The event object must have a volumeId property. + * @const {string} + */ +VolumeManagerCommon.VOLUME_ALREADY_MOUNTED = 'volume_already_mounted';
diff --git a/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp b/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp index e4aeef0..c38db4dc 100644 --- a/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp +++ b/ui/file_manager/file_manager/foreground/js/compiled_resources2.gyp
@@ -123,10 +123,10 @@ # 'target_name': 'metrics_start', # 'includes': ['../../../compile_js2.gypi'], # }, -# { -# 'target_name': 'mouse_inactivity_watcher', -# 'includes': ['../../../compile_js2.gypi'], -# }, + { + 'target_name': 'mouse_inactivity_watcher', + 'includes': ['../../../compile_js2.gypi'], + }, # { # 'target_name': 'naming_controller', # 'includes': ['../../../compile_js2.gypi'],
diff --git a/ui/file_manager/video_player/js/cast/compiled_resources2.gyp b/ui/file_manager/video_player/js/cast/compiled_resources2.gyp index 3ea52f4..672f2c2 100644 --- a/ui/file_manager/video_player/js/cast/compiled_resources2.gyp +++ b/ui/file_manager/video_player/js/cast/compiled_resources2.gyp
@@ -3,21 +3,40 @@ # found in the LICENSE file. { 'targets': [ -# { -# 'target_name': 'cast_extension_discoverer', -# 'includes': ['../../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'cast_video_element', -# 'includes': ['../../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'caster', -# 'includes': ['../../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'media_manager', -# 'includes': ['../../../compile_js2.gypi'], -# }, + { + 'target_name': 'cast_extension_discoverer', + 'dependencies': [ + '../compiled_resources2.gyp:error_util', + ], + 'includes': ['../../../compile_js2.gypi'], + }, + { + 'target_name': 'cast_video_element', + 'dependencies': [ + '../../../externs/compiled_resources2.gyp:chrome_cast', + '../../../externs/compiled_resources2.gyp:platform', + '../compiled_resources2.gyp:error_util', + '../compiled_resources2.gyp:video_player_metrics', + '<(DEPTH)/ui/webui/resources/js/cr/compiled_resources2.gyp:event_target', + 'media_manager', + ], + 'includes': ['../../../compile_js2.gypi'], + }, + { + 'target_name': 'caster', + 'dependencies': [ + '../../../externs/compiled_resources2.gyp:chrome_cast', + '../compiled_resources2.gyp:video_player', + 'cast_extension_discoverer', + ], + 'includes': ['../../../compile_js2.gypi'], + }, + { + 'target_name': 'media_manager', + 'dependencies': [ + '<(EXTERNS_GYP):file_manager_private', + ], + 'includes': ['../../../compile_js2.gypi'], + }, ], }
diff --git a/ui/file_manager/video_player/js/compiled_resources.gyp b/ui/file_manager/video_player/js/compiled_resources.gyp deleted file mode 100644 index 66a7206..0000000 --- a/ui/file_manager/video_player/js/compiled_resources.gyp +++ /dev/null
@@ -1,137 +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. -{ - 'targets': [ - { - 'target_name': 'background', - 'variables': { - 'depends': [ - '../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate', - '../../../webui/resources/js/cr.js', - '../../../webui/resources/js/cr/event_target.js', - '../../../webui/resources/js/cr/ui.js', - '../../../webui/resources/js/cr/ui/array_data_model.js', - '../../../webui/resources/js/promise_resolver.js', - '../../../webui/resources/js/load_time_data.js', - '../../../webui/resources/js/util.js', - '../../file_manager/common/js/util.js', - '../../file_manager/common/js/async_util.js', - '../../file_manager/common/js/file_type.js', - '../../file_manager/common/js/metrics_base.js', - '../../file_manager/common/js/metrics_events.js', - '../../file_manager/common/js/metrics.js', - '../../file_manager/common/js/volume_manager_common.js', - '../../file_manager/background/js/app_window_wrapper.js', - '../../file_manager/background/js/app_windows.js', - '../../file_manager/background/js/background_base.js', - '../../file_manager/background/js/entry_location_impl.js', - '../../file_manager/background/js/volume_info_impl.js', - '../../file_manager/background/js/volume_info_list_impl.js', - '../../file_manager/background/js/volume_manager_factory.js', - '../../file_manager/background/js/volume_manager_impl.js', - '../../file_manager/background/js/volume_manager_util.js', - '../../file_manager/background/js/test_util_base.js', - 'error_util.js', - 'test_util.js', - ], - 'externs': [ - '<(EXTERNS_DIR)/chrome_extensions.js', - '<(EXTERNS_DIR)/chrome_send.js', - '<(EXTERNS_DIR)/file_manager_private.js', - '<(EXTERNS_DIR)/metrics_private.js', - '../../../../third_party/analytics/externs.js', - '../../externs/chrome_test.js', - '../../externs/entry_location.js', - '../../externs/es6_workaround.js', - '../../externs/platform.js', - '../../externs/volume_info.js', - '../../externs/volume_info_list.js', - '../../externs/volume_manager.js', - ], - }, - 'includes': [ - '../../compile_js.gypi', - ], - }, - { - 'target_name': 'video_player', - 'variables': { - 'depends': [ - '../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate', - '../../../../third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/iron-form-element-behavior/iron-form-element-behavior-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/iron-range-behavior/iron-range-behavior-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/paper-progress/paper-progress-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js', - '../../../../third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js', - 'error_util.js', - '../../file_manager/common/js/metrics_base.js', - 'video_player_metrics.js', - '../../../webui/resources/js/cr.js', - '../../../webui/resources/js/load_time_data.js', - '../../../webui/resources/js/event_tracker.js', - '../../../webui/resources/js/promise_resolver.js', - '../../../webui/resources/js/util.js', - '../../../webui/resources/js/cr/ui.js', - '../../../webui/resources/js/cr/event_target.js', - '../../../webui/resources/js/cr/ui/array_data_model.js', - '../../../webui/resources/js/cr/ui/position_util.js', - '../../../webui/resources/js/cr/ui/menu_item.js', - '../../../webui/resources/js/cr/ui/menu.js', - '../../../webui/resources/js/cr/ui/menu_button.js', - '../../../webui/resources/js/cr/ui/command.js', - '../../../webui/resources/js/cr/ui/context_menu_handler.js', - # Referenced in common/js/util.js. - # TODO(yawano): Remove dependency to cr/ui/dialogs from common/js/util.js. - '../../../webui/resources/js/cr/ui/dialogs.js', - '../../../webui/resources/js/compiled_resources.gyp:i18n_template_no_process', - '../../file_manager/common/js/async_util.js', - '../../file_manager/common/js/file_type.js', - '../../file_manager/common/js/lru_cache.js', - '../../file_manager/common/js/metrics_base.js', - '../../file_manager/common/js/metrics_events.js', - '../../file_manager/common/js/metrics.js', - '../../file_manager/common/js/util.js', - '../../file_manager/common/js/volume_manager_common.js', - '../../file_manager/foreground/js/mouse_inactivity_watcher.js', - '../../file_manager/foreground/js/volume_manager_wrapper.js', - # Referenced in volume_manager_wrapper.js. - '../../image_loader/image_loader_client.js', - 'cast/cast_extension_discoverer.js', - 'cast/cast_video_element.js', - 'cast/media_manager.js', - 'cast/caster.js', - 'media_controls.js', - ], - 'externs': [ - '<(EXTERNS_DIR)/chrome_extensions.js', - '<(EXTERNS_DIR)/chrome_send.js', - '<(EXTERNS_DIR)/file_manager_private.js', - '<(EXTERNS_DIR)/media_player_private.js', - '<(EXTERNS_DIR)/metrics_private.js', - '../../../../third_party/analytics/externs.js', - '../../externs/app_window_common.js', - '../../externs/background_window_common.js', - '../../externs/chrome_test.js', - '../../externs/chrome_cast.js', - '../../externs/chrome_webstore_widget_private.js', - '../../externs/entry_location.js', - '../../externs/es6_workaround.js', - '../../externs/platform.js', - '../../externs/volume_info.js', - '../../externs/volume_info_list.js', - '../../externs/volume_manager.js', - ], - }, - 'includes': [ - '../../compile_js.gypi', - ], - } - ], -} -
diff --git a/ui/file_manager/video_player/js/compiled_resources2.gyp b/ui/file_manager/video_player/js/compiled_resources2.gyp index e665539..1828bfa 100644 --- a/ui/file_manager/video_player/js/compiled_resources2.gyp +++ b/ui/file_manager/video_player/js/compiled_resources2.gyp
@@ -3,22 +3,49 @@ # found in the LICENSE file. { 'targets': [ -# { -# 'target_name': 'background', -# 'includes': ['../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'error_util', -# 'includes': ['../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'media_controls', -# 'includes': ['../../compile_js2.gypi'], -# }, -# { -# 'target_name': 'video_player', -# 'includes': ['../../compile_js2.gypi'], -# }, + { + 'target_name': 'background', + 'dependencies': [ + '../../file_manager/background/js/compiled_resources2.gyp:app_window_wrapper', + '../../file_manager/background/js/compiled_resources2.gyp:background_base', + 'error_util', + ], + 'includes': ['../../compile_js2.gypi'], + }, + { + 'target_name': 'error_util', + 'includes': ['../../compile_js2.gypi'], + }, + { + 'target_name': 'media_controls', + 'dependencies': [ + '../../file_manager/common/js/compiled_resources2.gyp:util', + '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-slider/compiled_resources2.gyp:paper-slider-extracted', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu_button', + '<(EXTERNS_GYP):media_player_private', + ], + 'includes': ['../../compile_js2.gypi'], + }, + { + 'target_name': 'video_player', + 'dependencies': [ + '../../externs/compiled_resources2.gyp:chrome_cast', + '../../file_manager/common/js/compiled_resources2.gyp:metrics', + '../../file_manager/common/js/compiled_resources2.gyp:util', + '../../file_manager/foreground/js/compiled_resources2.gyp:mouse_inactivity_watcher', + '../../file_manager/foreground/js/compiled_resources2.gyp:volume_manager_wrapper', + '../../image_loader/compiled_resources2.gyp:image_loader_client', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_template_no_process', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu', + '<(DEPTH)/ui/webui/resources/js/cr/ui/compiled_resources2.gyp:menu_item', + 'cast/compiled_resources2.gyp:cast_video_element', + 'cast/compiled_resources2.gyp:media_manager', + 'error_util', + 'media_controls', + 'video_player_metrics', + ], + 'includes': ['../../compile_js2.gypi'], + }, { 'target_name': 'video_player_metrics', 'dependencies': [ @@ -26,9 +53,5 @@ ], 'includes': ['../../compile_js2.gypi'], }, -# { -# 'target_name': 'video_player_scripts', -# 'includes': ['../../compile_js2.gypi'], -# }, ], }
diff --git a/ui/gfx/color_transform.cc b/ui/gfx/color_transform.cc index 2453f469..14ebf1a 100644 --- a/ui/gfx/color_transform.cc +++ b/ui/gfx/color_transform.cc
@@ -4,6 +4,7 @@ #include "ui/gfx/color_transform.h" +#include <algorithm> #include <vector> #include "base/logging.h" @@ -454,6 +455,19 @@ return c.x() * 0.2627f + c.y() * 0.6780f + c.z() * 0.0593f; } + ColorTransform::TriStim ClipToWhite(ColorTransform::TriStim& c) { + float maximum = std::max(std::max(c.x(), c.y()), c.z()); + if (maximum > 1.0f) { + float l = Luma(c); + c.Scale(1.0f / maximum); + ColorTransform::TriStim white(1.0f, 1.0f, 1.0f); + white.Scale((1.0f - 1.0f / maximum) * l / Luma(white)); + ColorTransform::TriStim black(0.0f, 0.0f, 0.0f); + c += white - black; + } + return c; + } + void transform(ColorTransform::TriStim* colors, size_t num) override { if (fn_valid_) { for (size_t i = 0; i < num; i++) { @@ -472,7 +486,7 @@ ToLinear(ColorSpace::TransferID::SMPTEST2084, colors[i].y()), ToLinear(ColorSpace::TransferID::SMPTEST2084, colors[i].z())); smpte2084.Scale(Luma(ret) / Luma(smpte2084)); - ret = smpte2084; + ret = ClipToWhite(smpte2084); } colors[i] = ret; }
diff --git a/ui/message_center/views/message_center_button_bar.cc b/ui/message_center/views/message_center_button_bar.cc index 7fbdcfe..14f2283 100644 --- a/ui/message_center/views/message_center_button_bar.cc +++ b/ui/message_center/views/message_center_button_bar.cc
@@ -242,7 +242,7 @@ 0); #endif - layout->StartRow(0, 0); + layout->StartRow(0, 0, kButtonSize); if (title_arrow_->visible()) layout->AddView(title_arrow_); layout->AddView(notification_label_); @@ -269,6 +269,14 @@ return close_all_button_; } +views::Button* MessageCenterButtonBar::GetQuietModeButtonForTest() const { + return quiet_mode_button_; +} + +views::Button* MessageCenterButtonBar::GetSettingsButtonForTest() const { + return settings_button_; +} + void MessageCenterButtonBar::SetBackArrowVisible(bool visible) { if (title_arrow_) title_arrow_->SetVisible(visible); @@ -280,6 +288,17 @@ notification_label_->SetText(title); } +void MessageCenterButtonBar::SetButtonsVisible(bool visible) { + settings_button_->SetVisible(visible); + quiet_mode_button_->SetVisible(visible); + + if (close_all_button_) + close_all_button_->SetVisible(visible); + + ViewVisibilityChanged(); + Layout(); +} + void MessageCenterButtonBar::ChildVisibilityChanged(views::View* child) { InvalidateLayout(); }
diff --git a/ui/message_center/views/message_center_button_bar.h b/ui/message_center/views/message_center_button_bar.h index 752ac23..41b40187 100644 --- a/ui/message_center/views/message_center_button_bar.h +++ b/ui/message_center/views/message_center_button_bar.h
@@ -43,6 +43,8 @@ void SetCloseAllButtonEnabled(bool enabled); MESSAGE_CENTER_EXPORT views::Button* GetCloseAllButtonForTest() const; + MESSAGE_CENTER_EXPORT views::Button* GetSettingsButtonForTest() const; + MESSAGE_CENTER_EXPORT views::Button* GetQuietModeButtonForTest() const; // Sometimes we shouldn't see the back arrow (not in settings). void SetBackArrowVisible(bool visible); @@ -50,6 +52,8 @@ // Update the label of the title. void SetTitle(const base::string16& title); + void SetButtonsVisible(bool visible); + private: // Updates the layout manager which can have differing configuration // depending on the visibility of different parts of the button bar.
diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc index 90adbdc..321c9052 100644 --- a/ui/message_center/views/message_center_view.cc +++ b/ui/message_center/views/message_center_view.cc
@@ -621,9 +621,14 @@ } button_bar_->SetBackArrowVisible(mode_ == Mode::SETTINGS); - button_bar_->SetSettingsAndQuietModeButtonsEnabled(!is_locked_); + button_bar_->SetButtonsVisible(!is_locked_); button_bar_->SetTitle(GetButtonBarTitle()); + if (!is_locked_) + EnableCloseAllIfAppropriate(); +} + +void MessageCenterView::EnableCloseAllIfAppropriate() { if (mode_ == Mode::NOTIFICATIONS) { bool no_closable_views = true; for (const auto& view : notification_views_) {
diff --git a/ui/message_center/views/message_center_view.h b/ui/message_center/views/message_center_view.h index 212500e7..f5c3046 100644 --- a/ui/message_center/views/message_center_view.h +++ b/ui/message_center/views/message_center_view.h
@@ -107,6 +107,7 @@ void Update(bool animate); void SetVisibilityMode(Mode mode, bool animate); void UpdateButtonBarStatus(); + void EnableCloseAllIfAppropriate(); void SetNotificationViewForTest(MessageView* view); MessageCenter* message_center_; // Weak reference.
diff --git a/ui/message_center/views/message_center_view_unittest.cc b/ui/message_center/views/message_center_view_unittest.cc index 5a16ecd1..e038a8d 100644 --- a/ui/message_center/views/message_center_view_unittest.cc +++ b/ui/message_center/views/message_center_view_unittest.cc
@@ -755,6 +755,18 @@ EXPECT_TRUE(GetNotificationView(kNotificationId1)->IsDrawn()); EXPECT_TRUE(GetNotificationView(kNotificationId2)->IsDrawn()); + views::Button* close_button = GetButtonBar()->GetCloseAllButtonForTest(); + ASSERT_NE(nullptr, close_button); + views::Button* quiet_mode_button = + GetButtonBar()->GetQuietModeButtonForTest(); + ASSERT_NE(nullptr, quiet_mode_button); + views::Button* settings_button = GetButtonBar()->GetSettingsButtonForTest(); + ASSERT_NE(nullptr, settings_button); + + EXPECT_TRUE(close_button->visible()); + EXPECT_TRUE(quiet_mode_button->visible()); + EXPECT_TRUE(settings_button->visible()); + // Lock! SetLockedState(true); @@ -785,6 +797,10 @@ GetMessageCenterView()->SizeToPreferredSize(); EXPECT_EQ(kLockedMessageCenterViewHeight, GetMessageCenterView()->height()); + EXPECT_FALSE(close_button->visible()); + EXPECT_FALSE(quiet_mode_button->visible()); + EXPECT_FALSE(settings_button->visible()); + // Unlock! SetLockedState(false); @@ -793,6 +809,10 @@ GetMessageCenterView()->SizeToPreferredSize(); EXPECT_NE(kLockedMessageCenterViewHeight, GetMessageCenterView()->height()); + EXPECT_TRUE(close_button->visible()); + EXPECT_TRUE(quiet_mode_button->visible()); + EXPECT_TRUE(settings_button->visible()); + // Lock! SetLockedState(true); @@ -800,6 +820,10 @@ GetMessageCenterView()->SizeToPreferredSize(); EXPECT_EQ(kLockedMessageCenterViewHeight, GetMessageCenterView()->height()); + + EXPECT_FALSE(close_button->visible()); + EXPECT_FALSE(quiet_mode_button->visible()); + EXPECT_FALSE(settings_button->visible()); } TEST_F(MessageCenterViewTest, NoNotification) {
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc index b45f1ca..eb4dd9d1 100644 --- a/ui/views/layout/grid_layout.cc +++ b/ui/views/layout/grid_layout.cc
@@ -684,10 +684,13 @@ StartRow(vertical_resize, column_set_id); } -void GridLayout::StartRow(float vertical_resize, int column_set_id) { +void GridLayout::StartRow(float vertical_resize, + int column_set_id, + int height) { + DCHECK_GE(height, 0); ColumnSet* column_set = GetColumnSet(column_set_id); DCHECK(column_set); - AddRow(base::MakeUnique<Row>(0, vertical_resize, column_set)); + AddRow(base::MakeUnique<Row>(height, vertical_resize, column_set)); } void GridLayout::AddPaddingRow(float vertical_resize, int pixel_count) {
diff --git a/ui/views/layout/grid_layout.h b/ui/views/layout/grid_layout.h index 144fac98..e6a1ee3 100644 --- a/ui/views/layout/grid_layout.h +++ b/ui/views/layout/grid_layout.h
@@ -129,8 +129,9 @@ void StartRowWithPadding(float vertical_resize, int column_set_id, float padding_resize, int padding); - // Starts a new row with the specified column set. - void StartRow(float vertical_resize, int column_set_id); + // Starts a new row with the specified column set and height (0 for + // unspecified height). + void StartRow(float vertical_resize, int column_set_id, int height = 0); // Advances past columns. Use this when the current column should not // contain any views.
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc index 64d61c4..1b834c7 100644 --- a/ui/views/mus/desktop_window_tree_host_mus.cc +++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -9,6 +9,7 @@ #include "base/run_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "ui/aura/client/aura_constants.h" +#include "ui/aura/client/capture_client.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/drag_drop_client.h" #include "ui/aura/client/focus_client.h" @@ -294,8 +295,10 @@ params.parent->GetHost()->window(), window()); } - if (!params.accept_events) - aura::WindowPortMus::Get(window())->SetCanAcceptEvents(false); + if (!params.accept_events) { + aura::WindowPortMus::Get(window())->SetEventTargetingPolicy( + ui::mojom::EventTargetingPolicy::NONE); + } } void DesktopWindowTreeHostMus::OnNativeWidgetCreated( @@ -320,6 +323,9 @@ // client-area and hit-test-mask. SendClientAreaToServer(); SendHitTestMaskToServer(); + + MusClient::Get()->OnCaptureClientSet( + aura::client::GetCaptureClient(window())); } std::unique_ptr<corewm::Tooltip> DesktopWindowTreeHostMus::CreateTooltip() { @@ -349,6 +355,9 @@ } void DesktopWindowTreeHostMus::CloseNow() { + MusClient::Get()->OnCaptureClientUnset( + aura::client::GetCaptureClient(window())); + native_widget_delegate_->OnNativeWidgetDestroying(); // If we have children, close them. Use a copy for iteration because they'll
diff --git a/ui/views/mus/desktop_window_tree_host_mus_unittest.cc b/ui/views/mus/desktop_window_tree_host_mus_unittest.cc index 1620c58..394abfa 100644 --- a/ui/views/mus/desktop_window_tree_host_mus_unittest.cc +++ b/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
@@ -9,7 +9,10 @@ #include "base/memory/ptr_util.h" #include "ui/aura/client/cursor_client.h" #include "ui/aura/client/transient_window_client.h" +#include "ui/aura/mus/capture_synchronizer.h" #include "ui/aura/mus/in_flight_change.h" +#include "ui/aura/mus/window_mus.h" +#include "ui/aura/mus/window_tree_client.h" #include "ui/aura/test/mus/change_completion_waiter.h" #include "ui/aura/window.h" #include "ui/views/mus/mus_client.h" @@ -124,6 +127,50 @@ EXPECT_FALSE(widget->GetNativeView()->parent()->IsVisible()); } +TEST_F(DesktopWindowTreeHostMusTest, Capture) { + std::unique_ptr<Widget> widget1(CreateWidget()); + widget1->Show(); + EXPECT_FALSE(widget1->HasCapture()); + + std::unique_ptr<Widget> widget2(CreateWidget()); + widget2->Show(); + EXPECT_FALSE(widget2->HasCapture()); + + widget1->SetCapture(widget1->GetRootView()); + EXPECT_TRUE(widget1->HasCapture()); + EXPECT_FALSE(widget2->HasCapture()); + EXPECT_EQ(widget1->GetNativeWindow(), MusClient::Get() + ->window_tree_client() + ->capture_synchronizer() + ->capture_window() + ->GetWindow()); + + widget2->SetCapture(widget2->GetRootView()); + EXPECT_TRUE(widget2->HasCapture()); + EXPECT_EQ(widget2->GetNativeWindow(), MusClient::Get() + ->window_tree_client() + ->capture_synchronizer() + ->capture_window() + ->GetWindow()); + + widget1->ReleaseCapture(); + EXPECT_TRUE(widget2->HasCapture()); + EXPECT_FALSE(widget1->HasCapture()); + EXPECT_EQ(widget2->GetNativeWindow(), MusClient::Get() + ->window_tree_client() + ->capture_synchronizer() + ->capture_window() + ->GetWindow()); + + widget2->ReleaseCapture(); + EXPECT_FALSE(widget2->HasCapture()); + EXPECT_FALSE(widget1->HasCapture()); + EXPECT_EQ(nullptr, MusClient::Get() + ->window_tree_client() + ->capture_synchronizer() + ->capture_window()); +} + TEST_F(DesktopWindowTreeHostMusTest, Deactivate) { std::unique_ptr<Widget> widget1(CreateWidget()); widget1->Show();
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc index 743ea284..3d40563e 100644 --- a/ui/views/mus/mus_client.cc +++ b/ui/views/mus/mus_client.cc
@@ -16,6 +16,7 @@ #include "services/ui/public/interfaces/event_matcher.mojom.h" #include "services/ui/public/interfaces/window_manager.mojom.h" #include "ui/aura/env.h" +#include "ui/aura/mus/capture_synchronizer.h" #include "ui/aura/mus/mus_context_factory.h" #include "ui/aura/mus/os_exchange_data_provider_mus.h" #include "ui/aura/mus/property_converter.h" @@ -32,7 +33,6 @@ #include "ui/views/views_delegate.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" #include "ui/views/widget/widget_delegate.h" -#include "ui/wm/core/capture_controller.h" #include "ui/wm/core/wm_state.h" // Widget::InitParams::Type must match that of ui::mojom::WindowType. @@ -222,6 +222,20 @@ return native_widget; } +void MusClient::OnCaptureClientSet( + aura::client::CaptureClient* capture_client) { + pointer_watcher_event_router_->AttachToCaptureClient(capture_client); + window_tree_client_->capture_synchronizer()->AttachToCaptureClient( + capture_client); +} + +void MusClient::OnCaptureClientUnset( + aura::client::CaptureClient* capture_client) { + pointer_watcher_event_router_->DetachFromCaptureClient(capture_client); + window_tree_client_->capture_synchronizer()->DetachFromCaptureClient( + capture_client); +} + void MusClient::AddObserver(MusClientObserver* observer) { observer_list_.AddObserver(observer); } @@ -257,10 +271,6 @@ observer.OnWindowManagerFrameValuesChanged(); } -aura::client::CaptureClient* MusClient::GetCaptureClient() { - return wm::CaptureController::Get(); -} - aura::PropertyConverter* MusClient::GetPropertyConverter() { return property_converter_.get(); }
diff --git a/ui/views/mus/mus_client.h b/ui/views/mus/mus_client.h index cccc44b0..d43579b 100644 --- a/ui/views/mus/mus_client.h +++ b/ui/views/mus/mus_client.h
@@ -12,6 +12,7 @@ #include <vector> #include "base/macros.h" +#include "ui/aura/client/capture_client.h" #include "ui/aura/mus/window_tree_client_delegate.h" #include "ui/base/dragdrop/os_exchange_data_provider_factory.h" #include "ui/views/mus/mus_export.h" @@ -101,6 +102,14 @@ NativeWidget* CreateNativeWidget(const Widget::InitParams& init_params, internal::NativeWidgetDelegate* delegate); + // Called when the capture client has been set for a window to notify + // PointerWatcherEventRouter and CaptureSynchronizer. + void OnCaptureClientSet(aura::client::CaptureClient* capture_client); + + // Called when the capture client will be unset for a window to notify + // PointerWatcherEventRouter and CaptureSynchronizer. + void OnCaptureClientUnset(aura::client::CaptureClient* capture_client); + void AddObserver(MusClientObserver* observer); void RemoveObserver(MusClientObserver* observer); @@ -120,7 +129,6 @@ void OnEmbedRootDestroyed(aura::WindowTreeHostMus* window_tree_host) override; void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target) override; - aura::client::CaptureClient* GetCaptureClient() override; aura::PropertyConverter* GetPropertyConverter() override; // ScreenMusDelegate:
diff --git a/ui/views/mus/pointer_watcher_event_router.cc b/ui/views/mus/pointer_watcher_event_router.cc index 26b4c066..3daf94c0c 100644 --- a/ui/views/mus/pointer_watcher_event_router.cc +++ b/ui/views/mus/pointer_watcher_event_router.cc
@@ -27,14 +27,11 @@ aura::WindowTreeClient* window_tree_client) : window_tree_client_(window_tree_client) { window_tree_client->AddObserver(this); - window_tree_client_->GetCaptureClient()->AddObserver(this); } PointerWatcherEventRouter::~PointerWatcherEventRouter() { - if (window_tree_client_) { + if (window_tree_client_) window_tree_client_->RemoveObserver(this); - window_tree_client_->GetCaptureClient()->RemoveObserver(this); - } } void PointerWatcherEventRouter::AddPointerWatcher(PointerWatcher* watcher, @@ -132,6 +129,16 @@ } } +void PointerWatcherEventRouter::AttachToCaptureClient( + aura::client::CaptureClient* capture_client) { + capture_client->AddObserver(this); +} + +void PointerWatcherEventRouter::DetachFromCaptureClient( + aura::client::CaptureClient* capture_client) { + capture_client->RemoveObserver(this); +} + PointerWatcherEventRouter::EventTypes PointerWatcherEventRouter::DetermineEventTypes() { if (HasPointerWatcher(&move_watchers_)) @@ -161,7 +168,6 @@ // We expect that all observers have been removed by this time. DCHECK_EQ(event_types_, EventTypes::NONE); DCHECK_EQ(client, window_tree_client_); - window_tree_client_->GetCaptureClient()->RemoveObserver(this); window_tree_client_->RemoveObserver(this); window_tree_client_ = nullptr; }
diff --git a/ui/views/mus/pointer_watcher_event_router.h b/ui/views/mus/pointer_watcher_event_router.h index 7414097..4298b78 100644 --- a/ui/views/mus/pointer_watcher_event_router.h +++ b/ui/views/mus/pointer_watcher_event_router.h
@@ -14,6 +14,10 @@ namespace aura { class WindowTreeClient; + +namespace client { +class CaptureClient; +} } namespace ui { @@ -56,6 +60,10 @@ void OnPointerEventObserved(const ui::PointerEvent& event, aura::Window* target); + // Called when the |capture_client| has been set or will be unset. + void AttachToCaptureClient(aura::client::CaptureClient* capture_client); + void DetachFromCaptureClient(aura::client::CaptureClient* capture_client); + private: friend class PointerWatcherEventRouterTest;
diff --git a/ui/views/widget/desktop_aura/desktop_capture_client.cc b/ui/views/widget/desktop_aura/desktop_capture_client.cc index 6c1d0b8..c434a9f 100644 --- a/ui/views/widget/desktop_aura/desktop_capture_client.cc +++ b/ui/views/widget/desktop_aura/desktop_capture_client.cc
@@ -4,6 +4,7 @@ #include "ui/views/widget/desktop_aura/desktop_capture_client.h" +#include "ui/aura/client/capture_client_observer.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tracker.h" @@ -85,6 +86,9 @@ } } } // else case is capture is remaining in our root, nothing to do. + + for (auto& observer : observers_) + observer.OnCaptureChanged(old_capture_window, capture_window_); } void DesktopCaptureClient::ReleaseCapture(aura::Window* window) { @@ -103,12 +107,12 @@ void DesktopCaptureClient::AddObserver( aura::client::CaptureClientObserver* observer) { - NOTREACHED(); + observers_.AddObserver(observer); } void DesktopCaptureClient::RemoveObserver( aura::client::CaptureClientObserver* observer) { - NOTREACHED(); + observers_.RemoveObserver(observer); } } // namespace views
diff --git a/ui/views/widget/desktop_aura/desktop_capture_client.h b/ui/views/widget/desktop_aura/desktop_capture_client.h index 497e896f..1f19ec6 100644 --- a/ui/views/widget/desktop_aura/desktop_capture_client.h +++ b/ui/views/widget/desktop_aura/desktop_capture_client.h
@@ -9,6 +9,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/observer_list.h" #include "ui/aura/client/capture_client.h" #include "ui/views/views_export.h" @@ -57,6 +58,8 @@ // Set of DesktopCaptureClients. static CaptureClients* capture_clients_; + base::ObserverList<aura::client::CaptureClientObserver> observers_; + DISALLOW_COPY_AND_ASSIGN(DesktopCaptureClient); };
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html index 6b2b6b60..9ffd7ea2 100644 --- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html +++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html
@@ -2,6 +2,7 @@ <link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/default-theme.html"> <dom-module id="cr-dialog"> <template> @@ -29,8 +30,7 @@ .title-container { align-items: center; - /* TODO(dbeam): should this be a --settings-separator-line? */ - border-bottom: 1px solid rgba(0, 0, 0, 0.14); + border-bottom: 1px solid var(--divider-color); display: flex; min-height: 52px; } @@ -84,12 +84,15 @@ } :host ::content .footer { - background-color: var(--paper-grey-200); border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; margin: 0; padding: 12px 20px; } + + :host ::content .border-top-divider { + border-top: 1px solid var(--divider-color); + } </style> <div class="title-container"> <content select=".title"></content>
diff --git a/ui/webui/resources/cr_elements/cr_scrollable_behavior.html b/ui/webui/resources/cr_elements/cr_scrollable_behavior.html index 5d29dce..dd48f42 100644 --- a/ui/webui/resources/cr_elements/cr_scrollable_behavior.html +++ b/ui/webui/resources/cr_elements/cr_scrollable_behavior.html
@@ -1 +1,3 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <script src="cr_scrollable_behavior.js"></script>
diff --git a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js index 5589c18e..6e5dd3d 100644 --- a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js +++ b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js
@@ -36,10 +36,9 @@ /** @polymerBehavior */ var CrScrollableBehavior = { - properties: { - /** @private {number|null} */ - intervalId_: {type: Number, value: null} - }, + + /** @private {number|null} */ + intervalId_: null, ready: function() { var scrollableElements = this.root.querySelectorAll('[scrollable]'); @@ -93,6 +92,26 @@ }.bind(this), 10); }, + /** @param {!IronListElement} list */ + saveScroll: function(list) { + // Store a FIFO of saved scroll positions so that multiple updates in a + // frame are applied correctly. Specifically we need to track when '0' is + // saved (but not apply it), and still handle patterns like [30, 0, 32]. + list.savedScrollTops = list.savedScrollTops || []; + list.savedScrollTops.push(list.scrollTarget.scrollTop); + }, + + /** @param {!IronListElement} list */ + restoreScroll: function(list) { + this.async(function() { + var scrollTop = list.savedScrollTops.shift(); + // Ignore scrollTop of 0 in case it was intermittent (we do not need to + // explicity scroll to 0). + if (scrollTop != 0) + list.scroll(0, scrollTop); + }); + }, + /** * Event wrapper for updateScroll_. * @param {!Event} event
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list.html b/ui/webui/resources/cr_elements/network/cr_network_list.html index a723ede..2f0ac3a 100644 --- a/ui/webui/resources/cr_elements/network/cr_network_list.html +++ b/ui/webui/resources/cr_elements/network/cr_network_list.html
@@ -18,9 +18,8 @@ } </style> <div id="container" class="layout vertical flex" scrollable> - <iron-list items="[[getItems_(networks, customItems)]]" - scroll-target="container" selection-enabled - selected-item="{{selectedItem}}"> + <iron-list id="networkList" selection-enabled items="[[listItems_]]" + scroll-target="container" selected-item="{{selectedItem}}"> <template> <cr-network-list-item item="[[item]]" is-list-item show-buttons="[[showButtons]]" tabindex$="[[tabIndex]]">
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list.js b/ui/webui/resources/cr_elements/network/cr_network_list.js index 26cddbe..8dcce41d 100644 --- a/ui/webui/resources/cr_elements/network/cr_network_list.js +++ b/ui/webui/resources/cr_elements/network/cr_network_list.js
@@ -21,7 +21,7 @@ type: Array, value: function() { return []; - } + }, }, /** @@ -32,7 +32,7 @@ type: Array, value: function() { return []; - } + }, }, /** True if action buttons should be shown for the itmes. */ @@ -49,29 +49,35 @@ selectedItem: { type: Object, observer: 'selectedItemChanged_', - } + }, + + /** + * Contains |networks| + |customItems|. + * @private {!Array<!CrNetworkList.CrNetworkListItemType>} + */ + listItems_: { + type: Array, + value: function() { + return []; + }, + }, }, behaviors: [CrScrollableBehavior], - observers: ['listChanged_(networks, customItems)'], + observers: ['updateListItems_(networks, customItems)'], /** @private */ - listChanged_: function() { - this.updateScrollableContents(); - }, + updateListItems_: function() { + this.saveScroll(this.$.networkList); - /** - * Returns a combined list of networks and custom items. - * @return {!Array<!CrNetworkList.CrNetworkListItemType>} - * @private - */ - getItems_: function() { var customItems = this.customItems.slice(); - // Flag the first custom item with isFirstCustomItem = true. if (customItems.length > 0) customItems[0].isFirstCustomItem = true; - return this.networks.concat(customItems); + this.listItems_ = this.networks.concat(customItems); + + this.restoreScroll(this.$.networkList); + this.updateScrollableContents(); }, /**