diff --git a/.gitignore b/.gitignore index dc229236..8bf691f 100644 --- a/.gitignore +++ b/.gitignore
@@ -350,6 +350,7 @@ /third_party/freetype2/src /third_party/gles2_conform /third_party/glslang/src +/third_party/glslang-angle/src /third_party/gnu_binutils/ /third_party/google_appengine_cloudstorage /third_party/google_toolbox_for_mac/src @@ -442,7 +443,9 @@ /third_party/skia /third_party/smhasher/src /third_party/snappy/src +/third_party/spirv-headers/src /third_party/SPIRV-Tools/src +/third_party/spirv-tools-angle/src /third_party/sqlite4java/lib/**/*.dll /third_party/sqlite4java/lib/**/*.jar /third_party/sqlite4java/lib/**/*.jnilib @@ -456,6 +459,7 @@ /third_party/usrsctp/usrsctplib /third_party/v8-i18n /third_party/valgrind +/third_party/vulkan-validation-layers/src /third_party/v4l2capture /third_party/visualmetrics /third_party/wayland/src
diff --git a/DEPS b/DEPS index 1419a49..e197b1a 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # 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': '320573f8fc1eddded223eea5b4dbbb6ff0b545ab', + 'skia_revision': '99c9796dde4cae3c71d0381256fea04eea48218e', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # 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': '9e3b5ede82cd3d804a1638f1d8d118c73ddb20f7', + 'catapult_revision': '5bec04aa94e48ec34ea3b611e6ba64ecd5a6bc72', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -423,7 +423,7 @@ # Graphics buffer allocator for Chrome OS. 'src/third_party/minigbm/src': - Var('chromium_git') + '/chromiumos/platform/minigbm.git' + '@' + '3345977b5e9ef13f97e2e858241297fc4bfc7401', + Var('chromium_git') + '/chromiumos/platform/minigbm.git' + '@' + '71db2b551d3b189b0266052446aee35152a2eae3', # Userspace interface to kernel DRM services. 'src/third_party/libdrm/src':
diff --git a/android_webview/browser/aw_resource_context.h b/android_webview/browser/aw_resource_context.h index 20857c7..5763b17 100644 --- a/android_webview/browser/aw_resource_context.h +++ b/android_webview/browser/aw_resource_context.h
@@ -12,6 +12,8 @@ #include "base/synchronization/lock.h" #include "content/public/browser/resource_context.h" +class GURL; + namespace net { class URLRequestContextGetter; }
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java index f27f3b0..f31b645 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java
@@ -8,6 +8,7 @@ import org.chromium.android_webview.AwContents; import org.chromium.android_webview.AwContentsClient.AwWebResourceRequest; +import org.chromium.base.test.util.DisabledTest; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.net.test.util.TestWebServer; @@ -99,6 +100,7 @@ // Verify that WebView ServiceWorker code can properly handle resource loading errors // that happened in ServiceWorker fetches. + @DisabledTest(message = "Disable for flakyness http://crbug.com/676422") @SmallTest public void testFetchResourceLoadingError() throws Throwable { final String fullIndexUrl = mWebServer.setResponse("/index.html", INDEX_HTML, null);
diff --git a/ash/common/accelerators/accelerator_table.cc b/ash/common/accelerators/accelerator_table.cc index 00a1a32e..11ba4b5 100644 --- a/ash/common/accelerators/accelerator_table.cc +++ b/ash/common/accelerators/accelerator_table.cc
@@ -72,7 +72,7 @@ TOUCH_HUD_CLEAR}, {true, ui::VKEY_P, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOUCH_HUD_PROJECTION_TOGGLE}, - {false, ui::VKEY_H, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, + {true, ui::VKEY_H, ui::EF_COMMAND_DOWN | ui::EF_SHIFT_DOWN, TOGGLE_HIGH_CONTRAST}, {true, ui::VKEY_Z, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN, TOGGLE_SPOKEN_FEEDBACK},
diff --git a/base/memory/discardable_memory_allocator.cc b/base/memory/discardable_memory_allocator.cc index 002a3ba..ee288ff4 100644 --- a/base/memory/discardable_memory_allocator.cc +++ b/base/memory/discardable_memory_allocator.cc
@@ -16,12 +16,7 @@ // static void DiscardableMemoryAllocator::SetInstance( DiscardableMemoryAllocator* allocator) { - DCHECK(allocator); - - // Make sure this function is only called once before the first call - // to GetInstance(). - DCHECK(!g_allocator); - + DCHECK(!allocator || !g_allocator); g_allocator = allocator; }
diff --git a/base/test/test_timeouts.cc b/base/test/test_timeouts.cc index 55e9a798..0dc0f49d 100644 --- a/base/test/test_timeouts.cc +++ b/base/test/test_timeouts.cc
@@ -46,7 +46,10 @@ std::string string_value(base::CommandLine::ForCurrentProcess()-> GetSwitchValueASCII(switch_name)); int timeout; - base::StringToInt(string_value, &timeout); + if (string_value == TestTimeouts::kNoTimeoutSwitchValue) + timeout = kAlmostInfiniteTimeoutMs; + else + base::StringToInt(string_value, &timeout); *value = std::max(*value, timeout); } *value *= kTimeoutMultiplier; @@ -65,6 +68,9 @@ } // namespace // static +constexpr const char TestTimeouts::kNoTimeoutSwitchValue[]; + +// static bool TestTimeouts::initialized_ = false; // The timeout values should increase in the order they appear in this block.
diff --git a/base/test/test_timeouts.h b/base/test/test_timeouts.h index ddaf05b5..9d42eb9 100644 --- a/base/test/test_timeouts.h +++ b/base/test/test_timeouts.h
@@ -13,6 +13,9 @@ // the timeouts for different environments (like Valgrind). class TestTimeouts { public: + // Argument that can be passed on the command line to indicate "no timeout". + static constexpr const char kNoTimeoutSwitchValue[] = "-1"; + // Initializes the timeouts. Non thread-safe. Should be called exactly once // by the test suite. static void Initialize();
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc index 258406c..3b505d7d 100644 --- a/base/trace_event/memory_dump_manager.cc +++ b/base/trace_event/memory_dump_manager.cc
@@ -277,6 +277,11 @@ new MemoryDumpProviderInfo(mdp, name, std::move(task_runner), options, whitelisted_for_background_mode); + if (options.is_fast_polling_supported) { + DCHECK(!mdpinfo->task_runner) << "MemoryDumpProviders capable of fast " + "polling must NOT be thread bound."; + } + { AutoLock lock(lock_); bool already_registered = !dump_providers_.insert(mdpinfo).second; @@ -351,10 +356,7 @@ } if ((*mdp_iter)->options.is_fast_polling_supported && dump_thread_) { - DCHECK(take_mdp_ownership_and_delete_async) - << "MemoryDumpProviders capable of fast polling must NOT be thread " - "bound and hence must be destroyed using " - "UnregisterAndDeleteDumpProviderSoon()"; + DCHECK(take_mdp_ownership_and_delete_async); dump_thread_->task_runner()->PostTask( FROM_HERE, Bind(&MemoryDumpManager::UnregisterPollingMDPOnDumpThread, Unretained(this), *mdp_iter)); @@ -371,7 +373,6 @@ void MemoryDumpManager::RegisterPollingMDPOnDumpThread( scoped_refptr<MemoryDumpManager::MemoryDumpProviderInfo> mdpinfo) { - DCHECK(!mdpinfo->task_runner); AutoLock lock(lock_); dump_providers_for_polling_.insert(mdpinfo); }
diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc index 48a5061..0da230a7 100644 --- a/base/trace_event/memory_dump_manager_unittest.cc +++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -72,8 +72,10 @@ mdm->set_dumper_registrations_ignored_for_testing(true); } -void RegisterDumpProvider(MemoryDumpProvider* mdp) { - RegisterDumpProvider(mdp, nullptr, MemoryDumpProvider::Options()); +void RegisterDumpProvider( + MemoryDumpProvider* mdp, + scoped_refptr<base::SingleThreadTaskRunner> task_runner) { + RegisterDumpProvider(mdp, task_runner, MemoryDumpProvider::Options()); } void RegisterDumpProviderWithSequencedTaskRunner( @@ -299,7 +301,7 @@ TEST_F(MemoryDumpManagerTest, SingleDumper) { InitializeMemoryDumpManager(false /* is_coordinator */); MockMemoryDumpProvider mdp; - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); // Check that the dumper is not called if the memory category is not enabled. EnableTracingWithLegacyCategories("foobar-but-not-memory"); @@ -340,7 +342,7 @@ InitializeMemoryDumpManager(false /* is_coordinator */); MockMemoryDumpProvider mdp; - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); EXPECT_CALL(mdp, OnMemoryDump(IsDetailedDump(), _)).WillOnce(Return(true)); @@ -351,7 +353,7 @@ // Check that requesting dumps with low level of detail actually propagates to // OnMemoryDump() call on dump providers. - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); EXPECT_CALL(mdp, OnMemoryDump(IsLightDump(), _)).WillOnce(Return(true)); @@ -366,8 +368,8 @@ InitializeMemoryDumpManager(false /* is_coordinator */); MockMemoryDumpProvider mdp1; MockMemoryDumpProvider mdp2; - RegisterDumpProvider(&mdp1); - RegisterDumpProvider(&mdp2); + RegisterDumpProvider(&mdp1, nullptr); + RegisterDumpProvider(&mdp2, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); const MemoryDumpSessionState* session_state = @@ -403,7 +405,7 @@ MockMemoryDumpProvider mdp2; // Enable only mdp1. - RegisterDumpProvider(&mdp1); + RegisterDumpProvider(&mdp1, ThreadTaskRunnerHandle::Get()); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); EXPECT_CALL(mdp1, OnMemoryDump(_, _)).WillOnce(Return(true)); @@ -414,7 +416,7 @@ // Invert: enable mdp1 and disable mdp2. mdm_->UnregisterDumpProvider(&mdp1); - RegisterDumpProvider(&mdp2); + RegisterDumpProvider(&mdp2, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); EXPECT_CALL(mdp1, OnMemoryDump(_, _)).Times(0); @@ -424,7 +426,7 @@ DisableTracing(); // Enable both mdp1 and mdp2. - RegisterDumpProvider(&mdp1); + RegisterDumpProvider(&mdp1, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); EXPECT_CALL(mdp1, OnMemoryDump(_, _)).WillOnce(Return(true)); @@ -440,7 +442,7 @@ InitializeMemoryDumpManager(false /* is_coordinator */); MockMemoryDumpProvider mdp; - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); { EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); @@ -462,7 +464,7 @@ DisableTracing(); } - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); mdm_->UnregisterDumpProvider(&mdp); { @@ -474,9 +476,9 @@ DisableTracing(); } - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); mdm_->UnregisterDumpProvider(&mdp); - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, ThreadTaskRunnerHandle::Get()); { EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(1); @@ -598,8 +600,8 @@ MockMemoryDumpProvider mdp1; MockMemoryDumpProvider mdp2; - RegisterDumpProvider(&mdp1); - RegisterDumpProvider(&mdp2); + RegisterDumpProvider(&mdp1, nullptr); + RegisterDumpProvider(&mdp2, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); const int kNumDumps = 2 * GetMaxConsecutiveFailuresCount(); @@ -632,7 +634,7 @@ MockMemoryDumpProvider mdp1; MockMemoryDumpProvider mdp2; - RegisterDumpProvider(&mdp1); + RegisterDumpProvider(&mdp1, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(4); @@ -642,7 +644,7 @@ .WillOnce(Return(true)) .WillOnce( Invoke([&mdp2](const MemoryDumpArgs&, ProcessMemoryDump*) -> bool { - RegisterDumpProvider(&mdp2); + RegisterDumpProvider(&mdp2, nullptr); return true; })) .WillRepeatedly(Return(true)); @@ -865,7 +867,7 @@ TEST_F(MemoryDumpManagerTest, CallbackCalledOnFailure) { InitializeMemoryDumpManager(false /* is_coordinator */); MockMemoryDumpProvider mdp1; - RegisterDumpProvider(&mdp1); + RegisterDumpProvider(&mdp1, nullptr); EXPECT_CALL(*delegate_, RequestGlobalMemoryDump(_, _)).Times(0); EXPECT_CALL(mdp1, OnMemoryDump(_, _)).Times(0); @@ -880,7 +882,7 @@ // began, it will still late-join the party (real use case: startup tracing). TEST_F(MemoryDumpManagerTest, InitializedAfterStartOfTracing) { MockMemoryDumpProvider mdp; - RegisterDumpProvider(&mdp); + RegisterDumpProvider(&mdp, nullptr); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); // First check that a RequestGlobalDump() issued before the MemoryDumpManager @@ -1063,7 +1065,7 @@ // Create both same-thread MDP and another MDP with dedicated thread MockMemoryDumpProvider mdp1; - RegisterDumpProvider(&mdp1); + RegisterDumpProvider(&mdp1, nullptr); MockMemoryDumpProvider mdp2; RegisterDumpProvider(&mdp2, mdp_thread->task_runner(), kDefaultOptions); EnableTracingWithLegacyCategories(MemoryDumpManager::kTraceCategory); @@ -1213,7 +1215,7 @@ InitializeMemoryDumpManager(false /* is_coordinator */); SetDumpProviderWhitelistForTesting(kTestMDPWhitelist); std::unique_ptr<MockMemoryDumpProvider> mdp1(new MockMemoryDumpProvider); - RegisterDumpProvider(mdp1.get()); + RegisterDumpProvider(mdp1.get(), nullptr); std::unique_ptr<MockMemoryDumpProvider> mdp2(new MockMemoryDumpProvider); RegisterDumpProvider(mdp2.get(), nullptr, kDefaultOptions, kWhitelistedMDPName);
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn index 8cf51b0..e742546 100644 --- a/build/config/sanitizers/BUILD.gn +++ b/build/config/sanitizers/BUILD.gn
@@ -447,9 +447,6 @@ } } -# UBSan is still in bring-up. Chrome builds with is_ubsan=true, but if you -# set is_ubsan=true is_ubsan_no_recover = true, then many tests are still -# failing. config("ubsan_flags") { cflags = [] if (is_ubsan) { @@ -462,7 +459,6 @@ # enabled. See http://crbug.com/489901 # "-fsanitize=bounds", "-fsanitize=float-divide-by-zero", - "-fsanitize=float-cast-overflow", "-fsanitize=integer-divide-by-zero", "-fsanitize=null", "-fsanitize=object-size",
diff --git a/chrome/android/java/res/xml/single_website_preferences.xml b/chrome/android/java/res/xml/single_website_preferences.xml index 978be12..c3e187a 100644 --- a/chrome/android/java/res/xml/single_website_preferences.xml +++ b/chrome/android/java/res/xml/single_website_preferences.xml
@@ -48,8 +48,6 @@ <org.chromium.chrome.browser.preferences.ChromeBaseListPreference android:key="background_sync_permission_list" /> <org.chromium.chrome.browser.preferences.ChromeBaseListPreference - android:key="keygen_permission_list" /> - <org.chromium.chrome.browser.preferences.ChromeBaseListPreference android:key="protected_media_identifier_permission_list" /> <org.chromium.chrome.browser.preferences.ChromeBaseListPreference android:key="autoplay_permission_list" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 243db83..e18d378 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -479,7 +479,9 @@ if (CommandLine.getInstance().hasSwitch(ContentSwitches.ENABLE_TEST_INTENTS)) { handleDebugIntent(intent); } - if (mVrShellDelegate.isVrIntent(intent)) mVrShellDelegate.enterVRFromIntent(intent); + if (mVrShellDelegate.isDaydreamVrIntent(intent)) { + mVrShellDelegate.enterVRFromIntent(intent); + } } finally { TraceEvent.end("ChromeTabbedActivity.onNewIntentWithNative"); } @@ -646,7 +648,7 @@ mIntentWithEffect = false; if ((mIsOnFirstRun || getSavedInstanceState() == null) && intent != null) { - if (mVrShellDelegate.isVrIntent(intent)) { + if (mVrShellDelegate.isDaydreamVrIntent(intent)) { // TODO(mthiesse): Improve startup when started from a VR intent. Right now // we launch out of VR, partially load out of VR, then switch into VR. mVrShellDelegate.enterVRIfNecessary();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java index a110e30..6c148ea20 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java
@@ -118,12 +118,6 @@ R.string.javascript_permission_title, ContentSetting.ALLOW, ContentSetting.BLOCK, R.string.website_settings_category_javascript_allowed, 0)); - localMap.put(ContentSettingsType.CONTENT_SETTINGS_TYPE_KEYGEN, - new ResourceItem(R.drawable.permission_keygen, - R.string.keygen_permission_title, - R.string.keygen_permission_title, ContentSetting.ALLOW, - ContentSetting.BLOCK, - 0, R.string.website_settings_category_blocked_recommended)); localMap.put( ContentSettingsType.CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, new ResourceItem(R.drawable.permission_camera,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/KeygenInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/KeygenInfo.java deleted file mode 100644 index bc60362..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/KeygenInfo.java +++ /dev/null
@@ -1,24 +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. - -package org.chromium.chrome.browser.preferences.website; - -/** - * Keygen information for a given origin. - */ -public class KeygenInfo extends PermissionInfo { - public KeygenInfo(String origin, String embedder, boolean isIncognito) { - super(origin, embedder, isIncognito); - } - - protected int getNativePreferenceValue(String origin, String embedder, boolean isIncognito) { - return WebsitePreferenceBridge.nativeGetKeygenSettingForOrigin( - origin, embedder, isIncognito); - } - - protected void setNativePreferenceValue( - String origin, String embedder, ContentSetting value, boolean isIncognito) { - WebsitePreferenceBridge.nativeSetKeygenSettingForOrigin(origin, value.toInt(), isIncognito); - } -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java index efb31a1..9b010af 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
@@ -73,7 +73,6 @@ public static final String PREF_CAMERA_CAPTURE_PERMISSION = "camera_permission_list"; public static final String PREF_COOKIES_PERMISSION = "cookies_permission_list"; public static final String PREF_JAVASCRIPT_PERMISSION = "javascript_permission_list"; - public static final String PREF_KEYGEN_PERMISSION = "keygen_permission_list"; public static final String PREF_LOCATION_ACCESS = "location_access_list"; public static final String PREF_MIC_CAPTURE_PERMISSION = "microphone_permission_list"; public static final String PREF_MIDI_SYSEX_PERMISSION = "midi_sysex_permission_list"; @@ -90,7 +89,6 @@ PREF_CAMERA_CAPTURE_PERMISSION, PREF_COOKIES_PERMISSION, PREF_JAVASCRIPT_PERMISSION, - PREF_KEYGEN_PERMISSION, PREF_LOCATION_ACCESS, PREF_MIC_CAPTURE_PERMISSION, PREF_MIDI_SYSEX_PERMISSION, @@ -125,13 +123,6 @@ // TODO(mvanouwerkerk): Avoid modifying the outer class from this inner class. mSite = mergePermissionInfoForTopLevelOrigin(mSiteAddress, sites); - // Display Keygen Content Setting if Keygen is blocked. - if (mSite.getKeygenInfo() == null && mWebContents != null - && WebsitePreferenceBridge.getKeygenBlocked(mWebContents)) { - String origin = mSiteAddress.getOrigin(); - mSite.setKeygenInfo(new KeygenInfo(origin, origin, false)); - } - displaySitePermissions(); } } @@ -204,10 +195,6 @@ && permissionInfoIsForTopLevelOrigin(other.getGeolocationInfo(), origin)) { merged.setGeolocationInfo(other.getGeolocationInfo()); } - if (merged.getKeygenInfo() == null && other.getKeygenInfo() != null - && permissionInfoIsForTopLevelOrigin(other.getKeygenInfo(), origin)) { - merged.setKeygenInfo(other.getKeygenInfo()); - } if (merged.getMidiInfo() == null && other.getMidiInfo() != null && permissionInfoIsForTopLevelOrigin(other.getMidiInfo(), origin)) { merged.setMidiInfo(other.getMidiInfo()); @@ -304,8 +291,6 @@ setUpListPreference(preference, mSite.getCookiePermission()); } else if (PREF_JAVASCRIPT_PERMISSION.equals(preference.getKey())) { setUpListPreference(preference, mSite.getJavaScriptPermission()); - } else if (PREF_KEYGEN_PERMISSION.equals(preference.getKey())) { - setUpListPreference(preference, mSite.getKeygenPermission()); } else if (PREF_LOCATION_ACCESS.equals(preference.getKey())) { setUpLocationPreference(preference); } else if (PREF_MIC_CAPTURE_PERMISSION.equals(preference.getKey())) { @@ -537,8 +522,6 @@ return ContentSettingsType.CONTENT_SETTINGS_TYPE_COOKIES; case PREF_JAVASCRIPT_PERMISSION: return ContentSettingsType.CONTENT_SETTINGS_TYPE_JAVASCRIPT; - case PREF_KEYGEN_PERMISSION: - return ContentSettingsType.CONTENT_SETTINGS_TYPE_KEYGEN; case PREF_LOCATION_ACCESS: return ContentSettingsType.CONTENT_SETTINGS_TYPE_GEOLOCATION; case PREF_MIC_CAPTURE_PERMISSION: @@ -599,8 +582,6 @@ mSite.setCookiePermission(permission); } else if (PREF_JAVASCRIPT_PERMISSION.equals(preference.getKey())) { mSite.setJavaScriptPermission(permission); - } else if (PREF_KEYGEN_PERMISSION.equals(preference.getKey())) { - mSite.setKeygenPermission(permission); } else if (PREF_LOCATION_ACCESS.equals(preference.getKey())) { mSite.setGeolocationPermission(permission); } else if (PREF_MIC_CAPTURE_PERMISSION.equals(preference.getKey())) { @@ -679,7 +660,6 @@ mSite.setCookiePermission(ContentSetting.DEFAULT); mSite.setGeolocationPermission(ContentSetting.DEFAULT); mSite.setJavaScriptPermission(ContentSetting.DEFAULT); - mSite.setKeygenPermission(ContentSetting.DEFAULT); mSite.setMicrophonePermission(ContentSetting.DEFAULT); mSite.setMidiPermission(ContentSetting.DEFAULT); mSite.setNotificationPermission(ContentSetting.DEFAULT);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java index d544054..1d7ad795 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
@@ -32,7 +32,6 @@ private ContentSettingException mCookieException; private GeolocationInfo mGeolocationInfo; private ContentSettingException mJavaScriptException; - private KeygenInfo mKeygenInfo; private LocalStorageInfo mLocalStorageInfo; private MicrophoneInfo mMicrophoneInfo; private MidiInfo mMidiInfo; @@ -236,33 +235,6 @@ } /** - * Sets the KeygenInfo object for this Website. - */ - public void setKeygenInfo(KeygenInfo info) { - mKeygenInfo = info; - } - - public KeygenInfo getKeygenInfo() { - return mKeygenInfo; - } - - /** - * Returns what permission governs keygen access. - */ - public ContentSetting getKeygenPermission() { - return mKeygenInfo != null ? mKeygenInfo.getContentSetting() : null; - } - - /** - * Configure keygen access setting for this site. - */ - public void setKeygenPermission(ContentSetting value) { - if (mKeygenInfo != null) { - mKeygenInfo.setContentSetting(value); - } - } - - /** * Sets microphone capture info class. */ public void setMicrophoneInfo(MicrophoneInfo info) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java index 6cd00bb..3322c8c3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
@@ -55,8 +55,6 @@ queue.add(new MidiInfoFetcher()); // Cookies are stored per-host. queue.add(new CookieExceptionInfoFetcher()); - // Keygen permissions are per-origin. - queue.add(new KeygenInfoFetcher()); // Local storage info is per-origin. queue.add(new LocalStorageInfoFetcher()); // Website storage is per-host. @@ -269,18 +267,6 @@ } } - private class KeygenInfoFetcher extends Task { - @Override - public void run() { - for (KeygenInfo info : WebsitePreferenceBridge.getKeygenInfo()) { - WebsiteAddress origin = WebsiteAddress.create(info.getOrigin()); - if (origin == null) continue; - WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder()); - findOrCreateSite(origin, embedder).setKeygenInfo(info); - } - } - } - private class LocalStorageInfoFetcher extends Task { @Override public void runAsync(final TaskQueue queue) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java index 1a2787d0..59fd067 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
@@ -7,7 +7,6 @@ import org.chromium.base.Callback; import org.chromium.base.annotations.CalledByNative; import org.chromium.chrome.browser.preferences.PrefServiceBridge; -import org.chromium.content_public.browser.WebContents; import java.util.ArrayList; import java.util.HashMap; @@ -28,30 +27,6 @@ } /** - * @return the list of all origins that have keygen permissions in non-incognito mode. - */ - @SuppressWarnings("unchecked") - public static List<KeygenInfo> getKeygenInfo() { - ArrayList<KeygenInfo> list = new ArrayList<KeygenInfo>(); - nativeGetKeygenOrigins(list); - return list; - } - - @CalledByNative - private static void insertKeygenInfoIntoList( - ArrayList<KeygenInfo> list, String origin, String embedder) { - list.add(new KeygenInfo(origin, embedder, false)); - } - - /** - * @return whether we've blocked key generation in the current tab. - */ - @SuppressWarnings("unchecked") - public static boolean getKeygenBlocked(WebContents webContents) { - return nativeGetKeygenBlocked(webContents); - } - - /** * @return the list of all origins that have geolocation permissions in non-incognito mode. */ @SuppressWarnings("unchecked") @@ -247,12 +222,6 @@ String origin, String embedder, boolean isIncognito); public static native void nativeSetGeolocationSettingForOrigin( String origin, String embedder, int value, boolean isIncognito); - private static native void nativeGetKeygenOrigins(Object list); - static native int nativeGetKeygenSettingForOrigin( - String origin, String embedder, boolean isIncognito); - static native void nativeSetKeygenSettingForOrigin( - String origin, int value, boolean isIncognito); - private static native boolean nativeGetKeygenBlocked(Object webContents); private static native void nativeGetMidiOrigins(Object list); static native int nativeGetMidiSettingForOrigin( String origin, String embedder, boolean isIncognito);
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 03aa22c..374e6c7 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
@@ -60,7 +60,6 @@ // TODO(bshe): These should be replaced by string provided by NDK. Currently, it only available // in SDK and we don't want add dependency to SDK just to get these strings. - private static final String DAYDREAM_VR_EXTRA = "android.intent.extra.VR_LAUNCH"; private static final String DAYDREAM_CATEGORY = "com.google.intent.category.DAYDREAM"; private static final String CARDBOARD_CATEGORY = "com.google.intent.category.CARDBOARD"; @@ -175,7 +174,7 @@ public void enterVRFromIntent(Intent intent) { // Vr Intent is only used on Daydream devices. if (mVrSupportLevel != VR_DAYDREAM) return; - assert isVrIntent(intent); + assert isDaydreamVrIntent(intent); if (mListeningForWebVrActivateBeforePause && !mRequestedWebVR) { nativeDisplayActivate(mNativeVrShellDelegate); return; @@ -556,14 +555,9 @@ /** * Whether or not the intent is a Daydream VR Intent. */ - public boolean isVrIntent(Intent intent) { - if (intent == null) return false; - if (intent.getBooleanExtra(DAYDREAM_VR_EXTRA, false)) return true; - if (intent.getCategories() != null) { - if (intent.getCategories().contains(DAYDREAM_CATEGORY)) return true; - if (intent.getCategories().contains(CARDBOARD_CATEGORY)) return true; - } - return false; + public boolean isDaydreamVrIntent(Intent intent) { + if (intent == null || intent.getCategories() == null) return false; + return intent.getCategories().contains(DAYDREAM_CATEGORY); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java index df399e8c..47cbccd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
@@ -28,6 +28,7 @@ public class WebApkActivity extends WebappActivity { /** Manages whether to check update for the WebAPK, and starts update check if needed. */ private WebApkUpdateManager mUpdateManager; + @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); @@ -117,7 +118,7 @@ /** * Returns the WebAPK's package name. */ - private String getWebApkPackageName() { + public String getWebApkPackageName() { return getWebappInfo().webApkPackageName(); }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd index 74cf94a..46e1ec0 100644 --- a/chrome/android/java/strings/android_chrome_strings.grd +++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -596,9 +596,6 @@ <message name="IDS_JAVASCRIPT_PERMISSION_TITLE" desc="Title of the permission to run javascript [CHAR-LIMIT=32]"> JavaScript </message> - <message name="IDS_KEYGEN_PERMISSION_TITLE" desc="Title of the permission to allow a form to perform client-side key generation [CHAR-LIMIT=32]"> - Key generation - </message> <message name="IDS_MEDIA_PERMISSION_TITLE" desc="Title of the menu containing the media permissions [CHAR-LIMIT=32]"> Media </message>
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index cd1f440..e3fffa1 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -830,7 +830,6 @@ "java/src/org/chromium/chrome/browser/preferences/website/ContentSettingException.java", "java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java", "java/src/org/chromium/chrome/browser/preferences/website/GeolocationInfo.java", - "java/src/org/chromium/chrome/browser/preferences/website/KeygenInfo.java", "java/src/org/chromium/chrome/browser/preferences/website/LocalStorageInfo.java", "java/src/org/chromium/chrome/browser/preferences/website/LocationCategory.java", "java/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivity.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java index 36583da0..ec00cd5 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java
@@ -16,7 +16,6 @@ import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.infobar.InfoBarContainer; import org.chromium.chrome.browser.preferences.ChromeBaseCheckBoxPreference; -import org.chromium.chrome.browser.preferences.ChromeBaseListPreference; import org.chromium.chrome.browser.preferences.ChromeSwitchPreference; import org.chromium.chrome.browser.preferences.LocationSettings; import org.chromium.chrome.browser.preferences.PrefServiceBridge; @@ -260,28 +259,6 @@ preferenceActivity.finish(); } - private void setEnableKeygen(final String origin, final boolean enabled) { - WebsiteAddress address = WebsiteAddress.create(origin); - Website website = new Website(address, address); - website.setKeygenInfo(new KeygenInfo(origin, origin, false)); - final Preferences preferenceActivity = startSingleWebsitePreferences(website); - - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - SingleWebsitePreferences websitePreferences = - (SingleWebsitePreferences) preferenceActivity.getFragmentForTest(); - ChromeBaseListPreference keygen = - (ChromeBaseListPreference) websitePreferences.findPreference( - SingleWebsitePreferences.PREF_KEYGEN_PERMISSION); - websitePreferences.onPreferenceChange(keygen, enabled - ? ContentSetting.ALLOW.toString() - : ContentSetting.BLOCK.toString()); - } - }); - preferenceActivity.finish(); - } - private void setEnableBackgroundSync(final boolean enabled) { final Preferences preferenceActivity = startSiteSettingsCategory(SiteSettingsCategory.CATEGORY_BACKGROUND_SYNC); @@ -398,48 +375,6 @@ } /** - * Sets Allow Keygen Enabled to be false and make sure it is set correctly. - * @throws Exception - */ - @SmallTest - @Feature({"Preferences"}) - public void testKeygenBlocked() throws Exception { - final String origin = "http://example.com/"; - setEnableKeygen(origin, false); - - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - WebsiteAddress address = WebsiteAddress.create(origin); - Website site = new Website(address, address); - site.setKeygenInfo(new KeygenInfo(origin, origin, false)); - assertEquals(site.getKeygenPermission(), ContentSetting.BLOCK); - } - }); - } - - /** - * Sets Allow Keygen Enabled to be true and make sure it is set correctly. - * @throws Exception - */ - @SmallTest - @Feature({"Preferences"}) - public void testKeygenNotBlocked() throws Exception { - final String origin = "http://example.com/"; - setEnableKeygen(origin, true); - - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - WebsiteAddress address = WebsiteAddress.create(origin); - Website site = new Website(address, address); - site.setKeygenInfo(new KeygenInfo(origin, origin, false)); - assertEquals(site.getKeygenPermission(), ContentSetting.ALLOW); - } - }); - } - - /** * Test that showing the Site Settings menu doesn't crash (crbug.com/610576). * @throws Exception */
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 378c48b..84b8c583 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -308,9 +308,6 @@ <message name="IDS_WEBSITE_SETTINGS_TYPE_JAVASCRIPT" desc="The label used for JavaScript permission controls in the Website Settings popup."> JavaScript </message> - <message name="IDS_WEBSITE_SETTINGS_TYPE_KEYGEN" desc="The label used for the key generation permission controls in the Website Settings popup."> - Key Generation - </message> <message name="IDS_WEBSITE_SETTINGS_TYPE_POPUPS" desc="The label used for popups permission controls in the Website Settings popup."> Popups </message> @@ -8174,18 +8171,6 @@ <message name="IDS_JS_DONOTALLOW_RADIO" desc="A radio button in the Content Settings dialog for preventing JavaScript use on any site."> Do not allow any site to run JavaScript </message> - <message name="IDS_KEYGEN_TAB_LABEL" desc="Label for key generation tab on Content Settings dialog"> - Key generation - </message> - <message name="IDS_KEYGEN_HEADER" desc="Label for key generation exception management page on Content Settings dialog"> - Key generation exceptions - </message> - <message name="IDS_KEYGEN_ALLOW_RADIO" desc="A radio button in the Content Settings dialog for allowing forms to use key generation on any site."> - Allow all sites to use key generation in forms. - </message> - <message name="IDS_KEYGEN_DONOTALLOW_RADIO" desc="A radio button in the Content Settings dialog for preventing forms from using key generation on any site."> - Do not allow any site to use key generation in forms (recommended) - </message> <message name="IDS_PDF_TAB_LABEL" desc="Label for the pdf plugin tab on Content Settings dialog"> PDF Documents </message> @@ -9174,9 +9159,6 @@ <message name="IDS_CRYPTO_MODULE_AUTH_DIALOG_TITLE" desc="The title in the dialog that prompts for security device password."> Sign in to Security Device </message> - <message name="IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_KEYGEN" desc="The text in the dialog that prompts for security device password for key generation."> - Please sign in to <ph name="TOKEN_NAME">$1<ex>Software Security Device</ex></ph> to generate a key for <ph name="HOST_NAME">$2<ex>www.google.com</ex></ph>. - </message> <message name="IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT" desc="The text in the dialog that prompts for security device password for cert enrollment."> Please sign in to <ph name="TOKEN_NAME">$1<ex>Software Security Device</ex></ph> to import client certificate from <ph name="HOST_NAME">$2<ex>www.google.com</ex></ph>. </message> @@ -15561,9 +15543,12 @@ <message name="IDS_FLAGS_ENABLE_CONSISTENT_OMNIBOX_GEOLOCATION_DESCRIPTION" desc="Desciption for the flag to enable consistent omnibox geolocation" translateable="false"> Have consistent geolocation access between the omnibox and default search engine. </message> - <message name="IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT" desc="Text to put in the infobar disclosing Google Search's usage of location. The message contains a link to a settings page. The link text is a separate string in the translation console and appears here as a placeholder text."> + <message name="IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_CONTROL_TEXT" desc="Text to put in the infobar disclosing Google Search's usage of location. The message contains a link to a settings page. The link text is a separate string in the translation console and appears here as a placeholder text. This version of the text is old but is being kept to allow us to compare performance of the new text."> Google uses your location to provide a better local experience. You can change this in <ph name="SETTINGS_LINK">$1<ex>Link to Settings page</ex></ph>. </message> + <message name="IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT" desc="Text to put in the infobar disclosing Google Search's usage of location. The message contains a link to a settings page. The link text is a separate string in the translation console and appears here as a placeholder text."> + Google uses your location to give you local content. You can change this in <ph name="SETTINGS_LINK">$1<ex>Link to Settings page</ex></ph>. + </message> <message name="IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_SETTINGS_LINK_TEXT" desc="Text to put in the link to the Settings page in the search geolocation disclosure UI."> Settings </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index d5b0bdf8..69481a0 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1728,9 +1728,6 @@ <message name="IDS_SETTINGS_SITE_SETTINGS_LOCATION" desc="Label for the location site settings."> Location </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_KEYGEN" desc="Label for the key generation site settings."> - Key generation - </message> <message name="IDS_SETTINGS_SITE_SETTINGS_MIC" desc="Label for the microphone site settings."> Microphone </message> @@ -1836,15 +1833,6 @@ <message name="IDS_SETTINGS_SITE_SETTINGS_HANDLERS_BLOCKED" desc="The block label for protocol handlers in site settings."> Do not allow any site to handle protocols </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_KEYGEN_ALLOW" desc="The allow label for keygen in site settings."> - Allow all sites to use key generation in forms - </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_KEYGEN_BLOCK" desc="The block label for key generation in site settings."> - Do not allow any site to use key generation in forms - </message> - <message name="IDS_SETTINGS_SITE_SETTINGS_KEYGEN_BLOCK_RECOMMENDED" desc="The block label for key generation in site settings (with the 'recommended' suffix)."> - Do not allow any site to use key generation in forms (recommended) - </message> <message name="IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOAD_ASK" desc="The allow label for automatic download in site settings."> Ask when a site tries to download files automatically after the first file </message>
diff --git a/chrome/app/theme/default_100_percent/common/allowed_keygen.png b/chrome/app/theme/default_100_percent/common/allowed_keygen.png deleted file mode 100644 index 4de1b93..0000000 --- a/chrome/app/theme/default_100_percent/common/allowed_keygen.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/blocked_keygen.png b/chrome/app/theme/default_100_percent/common/blocked_keygen.png deleted file mode 100644 index bb0e5d6..0000000 --- a/chrome/app/theme/default_100_percent/common/blocked_keygen.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/allowed_keygen.png b/chrome/app/theme/default_200_percent/common/allowed_keygen.png deleted file mode 100644 index 328481f..0000000 --- a/chrome/app/theme/default_200_percent/common/allowed_keygen.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/blocked_keygen.png b/chrome/app/theme/default_200_percent/common/blocked_keygen.png deleted file mode 100644 index 63ab2886..0000000 --- a/chrome/app/theme/default_200_percent/common/blocked_keygen.png +++ /dev/null Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index f4cfaac..5e450291 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd
@@ -32,7 +32,6 @@ <structure type="chrome_scaled_image" name="IDR_ALLOWED_FULLSCREEN" file="common/allowed_fullscreen.png" /> <structure type="chrome_scaled_image" name="IDR_ALLOWED_IMAGES" file="common/allowed_images.png" /> <structure type="chrome_scaled_image" name="IDR_ALLOWED_JAVASCRIPT" file="common/allowed_script.png" /> - <structure type="chrome_scaled_image" name="IDR_ALLOWED_KEYGEN" file="common/allowed_keygen.png" /> <structure type="chrome_scaled_image" name="IDR_ALLOWED_LOCATION" file="common/allowed_location.png" /> <structure type="chrome_scaled_image" name="IDR_ALLOWED_MIC" file="common/allowed_mic.png" /> <structure type="chrome_scaled_image" name="IDR_ALLOWED_MIDI_SYSEX" file="common/allowed_midi.png" /> @@ -83,7 +82,6 @@ <structure type="chrome_scaled_image" name="IDR_BLOCKED_EXTENSION_SCRIPT" file="common/blocked_extension_script.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_IMAGES" file="common/blocked_images.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_JAVASCRIPT" file="common/blocked_script.png" /> - <structure type="chrome_scaled_image" name="IDR_BLOCKED_KEYGEN" file="common/blocked_keygen.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_LOCATION" file="common/blocked_location.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_MIC" file="common/blocked_mic.png" /> <structure type="chrome_scaled_image" name="IDR_BLOCKED_MIDI_SYSEX" file="common/blocked_midi.png" />
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 6bb5213c..4afb92b 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -980,7 +980,7 @@ "disable-accelerated-video-decode", IDS_FLAGS_ACCELERATED_VIDEO_DECODE_NAME, IDS_FLAGS_ACCELERATED_VIDEO_DECODE_DESCRIPTION, - kOsMac | kOsWin | kOsCrOS, + kOsMac | kOsWin | kOsCrOS | kOsAndroid, SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), }, #if defined(USE_ASH)
diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc index 757c3e6..f87de66 100644 --- a/chrome/browser/android/preferences/website_preference_bridge.cc +++ b/chrome/browser/android/preferences/website_preference_bridge.cc
@@ -213,42 +213,6 @@ static_cast<ContentSetting>(value), is_incognito); } -static void GetKeygenOrigins(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jobject>& list) { - GetOrigins(env, CONTENT_SETTINGS_TYPE_KEYGEN, - &Java_WebsitePreferenceBridge_insertKeygenInfoIntoList, list, - false); -} - -static jint GetKeygenSettingForOrigin(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jstring>& origin, - const JavaParamRef<jstring>& embedder, - jboolean is_incognito) { - return GetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_KEYGEN, origin, - embedder, is_incognito); -} - -static void SetKeygenSettingForOrigin(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jstring>& origin, - jint value, - jboolean is_incognito) { - // Here 'nullptr' indicates that keygen uses wildcard for embedder. - SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_KEYGEN, origin, nullptr, - static_cast<ContentSetting>(value), is_incognito); -} - -static jboolean GetKeygenBlocked(JNIEnv* env, - const JavaParamRef<jclass>& clazz, - const JavaParamRef<jobject>& java_web_contents) { - content::WebContents* web_contents = - content::WebContents::FromJavaWebContents(java_web_contents); - return TabSpecificContentSettings::FromWebContents( - web_contents)->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN); -} - static void GetMidiOrigins(JNIEnv* env, const JavaParamRef<jclass>& clazz, const JavaParamRef<jobject>& list) {
diff --git a/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc b/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc index 9389974..8f031c4 100644 --- a/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc +++ b/chrome/browser/android/search_geolocation_disclosure_infobar_delegate.cc
@@ -10,12 +10,26 @@ #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/android/infobars/search_geolocation_disclosure_infobar.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "components/prefs/pref_service.h" +#include "components/variations/variations_associated_data.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" +namespace { + +const char kUseControlTextVariation[] = "UseControlText"; + +int ShouldUseControlText() { + std::string variation = variations::GetVariationParamValueByFeature( + features::kConsistentOmniboxGeolocation, kUseControlTextVariation); + return !variation.empty(); +} + +} // namespace + // This enum is used in histograms, and is thus append only. Do not remove or // re-order items. enum class SearchGeolocationDisclosureInfoBarDelegate::DisclosureResult { @@ -85,7 +99,10 @@ IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_SETTINGS_LINK_TEXT); size_t offset; message_text_ = l10n_util::GetStringFUTF16( - IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT, link, &offset); + ShouldUseControlText() + ? IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_CONTROL_TEXT + : IDS_SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_TEXT, + link, &offset); inline_link_range_ = gfx::Range(offset, offset + link.length()); }
diff --git a/chrome/browser/android/search_geolocation_disclosure_tab_helper.cc b/chrome/browser/android/search_geolocation_disclosure_tab_helper.cc index c671b62..82942d1 100644 --- a/chrome/browser/android/search_geolocation_disclosure_tab_helper.cc +++ b/chrome/browser/android/search_geolocation_disclosure_tab_helper.cc
@@ -90,6 +90,10 @@ void SearchGeolocationDisclosureTabHelper:: MaybeShowDefaultSearchGeolocationDisclosure(const GURL& gurl) { + // Don't show in incognito. + if (GetProfile()->IsOffTheRecord()) + return; + // Only show the disclosure for default search navigations from the omnibox. TemplateURLService* template_url_service = TemplateURLServiceFactory::GetForProfile(GetProfile());
diff --git a/chrome/browser/android/webapk/webapk_update_manager.cc b/chrome/browser/android/webapk/webapk_update_manager.cc index aef343c..a00af61 100644 --- a/chrome/browser/android/webapk/webapk_update_manager.cc +++ b/chrome/browser/android/webapk/webapk_update_manager.cc
@@ -80,6 +80,7 @@ info.scope = scope; info.name = ConvertJavaStringToUTF16(env, java_name); info.short_name = ConvertJavaStringToUTF16(env, java_short_name); + info.user_title = info.short_name; info.display = static_cast<blink::WebDisplayMode>(java_display_mode); info.orientation = static_cast<blink::WebScreenOrientationLockType>(java_orientation);
diff --git a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc index a0db7495..f994b1c 100644 --- a/chrome/browser/apps/custom_launcher_page_browsertest_views.cc +++ b/chrome/browser/apps/custom_launcher_page_browsertest_views.cc
@@ -10,14 +10,14 @@ #include "build/build_config.h" #include "chrome/browser/apps/app_browsertest_util.h" #include "chrome/browser/ui/app_list/app_list_service.h" -#include "chrome/browser/ui/app_list/app_list_service_views.h" -#include "chrome/browser/ui/app_list/app_list_shower_views.h" +#include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "extensions/common/extension.h" #include "extensions/common/switches.h" #include "extensions/test/extension_test_message_listener.h" #include "ui/app_list/app_list_switches.h" +#include "ui/app_list/presenter/app_list_presenter_impl.h" #include "ui/app_list/views/app_list_main_view.h" #include "ui/app_list/views/app_list_view.h" #include "ui/app_list/views/contents_view.h" @@ -29,11 +29,6 @@ #include "ui/views/controls/webview/webview.h" #include "ui/views/focus/focus_manager.h" -#if defined(OS_CHROMEOS) -#include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" -#include "ui/app_list/presenter/app_list_presenter_impl.h" -#endif - namespace { // The path of the test application within the "platform_apps" directory. @@ -75,18 +70,9 @@ app_list::AppListView* GetAppListView() { app_list::AppListView* app_list_view = nullptr; -#if defined(OS_CHROMEOS) AppListServiceAshTestApi service_test; app_list_view = service_test.GetAppListView(); EXPECT_TRUE(service_test.GetAppListPresenter()->GetTargetVisibility()); -#else - AppListServiceViews* service = - static_cast<AppListServiceViews*>(AppListService::Get()); - // The app list should have loaded instantly since the profile is already - // loaded. - EXPECT_TRUE(service->IsAppListVisible()); - app_list_view = service->shower().app_list(); -#endif return app_list_view; } @@ -222,16 +208,13 @@ const int num_steps = 5; const int num_fingers = 2; -#if defined(OS_CHROMEOS) - // Gesture events need to be in host coordinates. On Desktop platforms, the - // Widget is the host, so nothing needs to be done. On ChromeOS, the points - // need to be put into screen coordinates. This works because the root window - // assumes it fills the screen. + // Gesture events need to be in host coordinates. The points need to be put + // into screen coordinates. This works because the root window assumes it + // fills the screen. point_in_clickzone = bounds.CenterPoint(); point_above_clickzone.SetPoint(point_in_clickzone.x(), bounds.y() - 10); views::View::ConvertPointToScreen(contents_view, &point_above_clickzone); views::View::ConvertPointToScreen(contents_view, &point_in_clickzone); -#endif // Back to the start page. And send a scroll gesture. SetActiveStateAndVerify(app_list::AppListModel::STATE_START);
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index b5190ebb..dbdaad2 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -2096,17 +2096,6 @@ } #endif // BUILDFLAG(ENABLE_WEBRTC) -bool ChromeContentBrowserClient::AllowKeygen( - const GURL& url, - content::ResourceContext* context) { - HostContentSettingsMap* content_settings = - ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); - - return content_settings->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()) == - CONTENT_SETTING_ALLOW; -} - ChromeContentBrowserClient::AllowWebBluetoothResult ChromeContentBrowserClient::AllowWebBluetooth( content::BrowserContext* browser_context,
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 66455e0f..509a4c5 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -161,7 +161,6 @@ const GURL& first_party_url, content::ResourceContext* context) override; #endif // BUILDFLAG(ENABLE_WEBRTC) - bool AllowKeygen(const GURL& url, content::ResourceContext* context) override; AllowWebBluetoothResult AllowWebBluetooth( content::BrowserContext* browser_context, const url::Origin& requesting_origin,
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc index cf8a8b2..a03442c5 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -1079,10 +1079,6 @@ &AccessibilityManager::UpdateChromeOSAccessibilityHistograms, base::Unretained(this))); - chromevox_loader_->SetProfile( - profile, base::Bind(&AccessibilityManager::PostSwitchChromeVoxProfile, - weak_ptr_factory_.GetWeakPtr())); - extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry::Get(profile); if (!extension_registry_observer_.IsObserving(registry))
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index f779dd7b7..e8fd7c40 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -164,9 +164,6 @@ EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetDefaultContentSetting( CONTENT_SETTINGS_TYPE_POPUPS, NULL)); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetDefaultContentSetting( - CONTENT_SETTINGS_TYPE_KEYGEN, NULL)); } TEST_F(HostContentSettingsMapTest, IndividualSettings) { @@ -224,13 +221,6 @@ host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); host_content_settings_map->SetContentSettingDefaultScope( - host, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_ALLOW); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - - host_content_settings_map->SetContentSettingDefaultScope( host, GURL(), CONTENT_SETTINGS_TYPE_AUTOPLAY, std::string(), CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, @@ -576,25 +566,6 @@ CONTENT_SETTINGS_TYPE_POPUPS, std::string())); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting( - host_ending_with_dot, host_ending_with_dot, - CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - host_content_settings_map->SetContentSettingDefaultScope( - host_ending_with_dot, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_ALLOW); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting( - host_ending_with_dot, host_ending_with_dot, - CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - host_content_settings_map->SetContentSettingDefaultScope( - host_ending_with_dot, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_DEFAULT); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting( - host_ending_with_dot, host_ending_with_dot, - CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, @@ -1098,23 +1069,6 @@ host_content_settings_map->GetDefaultContentSetting( CONTENT_SETTINGS_TYPE_PLUGINS, NULL)); #endif - - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetDefaultContentSetting( - CONTENT_SETTINGS_TYPE_KEYGEN, NULL)); - - // Set managed-default content setting through the coresponding preferences. - prefs->SetManagedPref(prefs::kManagedDefaultKeygenSetting, - new base::FundamentalValue(CONTENT_SETTING_ALLOW)); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - host_content_settings_map->GetDefaultContentSetting( - CONTENT_SETTINGS_TYPE_KEYGEN, NULL)); - - // Remove managed-default content settings preferences. - prefs->RemoveManagedPref(prefs::kManagedDefaultKeygenSetting); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetDefaultContentSetting( - CONTENT_SETTINGS_TYPE_KEYGEN, NULL)); } TEST_F(HostContentSettingsMapTest, @@ -1368,56 +1322,6 @@ EXPECT_TRUE(all_settings_dictionary->empty()); } -TEST_F(HostContentSettingsMapTest, MigrateKeygenSettings) { - TestingProfile profile; - HostContentSettingsMap* host_content_settings_map = - HostContentSettingsMapFactory::GetForProfile(&profile); - - // Set old formatted settings. - GURL host("http://example.com/"); - ContentSettingsPattern pattern = - ContentSettingsPattern::FromURLNoWildcard(host); - - // Default setting is BLOCK. - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - - host_content_settings_map->SetContentSettingCustomScope( - pattern, pattern, CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_ALLOW); - // Because of the old formatted setting entry which has two same patterns, - // SetContentSetting() to (host, GURL()) will be ignored. - host_content_settings_map->SetContentSettingDefaultScope( - host, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_BLOCK); - EXPECT_EQ(CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - - host_content_settings_map->MigrateKeygenSettings(); - - ContentSettingsForOneType settings; - host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_KEYGEN, - std::string(), &settings); - for (const ContentSettingPatternSource& setting_entry : settings) { - EXPECT_EQ(setting_entry.secondary_pattern, - ContentSettingsPattern::Wildcard()); - } - - EXPECT_EQ(CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); - - // After migrating old settings, changes to the setting works. - host_content_settings_map->SetContentSettingDefaultScope( - host, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - CONTENT_SETTING_BLOCK); - EXPECT_EQ(CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string())); -} - TEST_F(HostContentSettingsMapTest, MigrateDomainScopedSettings) { TestingProfile profile; HostContentSettingsMap* host_content_settings_map =
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 71276ae..b6ef7e9 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -247,8 +247,7 @@ content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA || content_type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER || content_type == CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS || - content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX || - content_type == CONTENT_SETTINGS_TYPE_KEYGEN) { + content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { const auto& it = content_settings_status_.find(content_type); if (it != content_settings_status_.end()) return it->second.blocked; @@ -538,16 +537,6 @@ content::NotificationService::NoDetails()); } -void TabSpecificContentSettings::OnDidUseKeygen(const GURL& origin_url) { - HostContentSettingsMap* map = HostContentSettingsMapFactory::GetForProfile( - Profile::FromBrowserContext(web_contents()->GetBrowserContext())); - GURL url = web_contents()->GetLastCommittedURL(); - if (map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_KEYGEN, - std::string()) != CONTENT_SETTING_ALLOW) { - OnContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN); - } -} - #if defined(OS_ANDROID) || defined(OS_CHROMEOS) void TabSpecificContentSettings::OnProtectedMediaIdentifierPermissionSet( const GURL& requesting_origin, @@ -790,7 +779,6 @@ IPC_BEGIN_MESSAGE_MAP(TabSpecificContentSettings, message) IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ContentBlocked, OnContentBlockedWithDetail) - IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DidUseKeygen, OnDidUseKeygen) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled;
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h index 3acdb2d..6cf2dc7 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.h +++ b/chrome/browser/content_settings/tab_specific_content_settings.h
@@ -357,7 +357,6 @@ bool blocked_by_policy); void OnGeolocationPermissionSet(const GURL& requesting_frame, bool allowed); - void OnDidUseKeygen(const GURL& url); #if defined(OS_ANDROID) || defined(OS_CHROMEOS) void OnProtectedMediaIdentifierPermissionSet(const GURL& requesting_frame, bool allowed);
diff --git a/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc b/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc index 50b1488..9f161cb 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings_unittest.cc
@@ -67,8 +67,6 @@ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC)); EXPECT_FALSE(content_settings->IsContentBlocked( CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA)); - EXPECT_FALSE( - content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN)); // Set a cookie, block access to images, block mediastream access and block a // popup. @@ -109,8 +107,6 @@ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC)); EXPECT_TRUE(content_settings->IsContentBlocked( CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA)); - EXPECT_FALSE( - content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN)); content_settings->OnCookieChanged(GURL("http://google.com"), GURL("http://google.com"), "A=B", @@ -151,8 +147,6 @@ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC)); EXPECT_FALSE(content_settings->IsContentBlocked( CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA)); - EXPECT_FALSE( - content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN)); content_settings->ClearNavigationRelatedContentSettings(); #if !defined(OS_ANDROID) @@ -171,8 +165,6 @@ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC)); EXPECT_FALSE(content_settings->IsContentBlocked( CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA)); - EXPECT_FALSE( - content_settings->IsContentBlocked(CONTENT_SETTINGS_TYPE_KEYGEN)); } TEST_F(TabSpecificContentSettingsTest, BlockedFileSystems) {
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index d37d2f8..bfbf7347 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -1322,6 +1322,7 @@ NULL, NULL); break; + case DevToolsToggleAction::kShowElementsPanel: case DevToolsToggleAction::kShowConsolePanel: case DevToolsToggleAction::kShow: case DevToolsToggleAction::kToggle:
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index fb151ea..666f0714 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -178,9 +178,6 @@ { key::kDefaultPopupsSetting, prefs::kManagedDefaultPopupsSetting, base::Value::Type::INTEGER }, - { key::kDefaultKeygenSetting, - prefs::kManagedDefaultKeygenSetting, - base::Value::Type::INTEGER }, { key::kAutoSelectCertificateForUrls, prefs::kManagedAutoSelectCertificateForUrls, base::Value::Type::LIST }, @@ -217,12 +214,6 @@ { key::kPopupsBlockedForUrls, prefs::kManagedPopupsBlockedForUrls, base::Value::Type::LIST }, - { key::kKeygenAllowedForUrls, - prefs::kManagedKeygenAllowedForUrls, - base::Value::Type::LIST }, - { key::kKeygenBlockedForUrls, - prefs::kManagedKeygenBlockedForUrls, - base::Value::Type::LIST }, { key::kNotificationsAllowedForUrls, prefs::kManagedNotificationsAllowedForUrls, base::Value::Type::LIST },
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index d6bdacb..e24a0ed 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc
@@ -82,7 +82,6 @@ #include "content/public/browser/resource_context.h" #include "content/public/common/content_switches.h" #include "extensions/features/features.h" -#include "net/base/keygen_handler.h" #include "net/cert/cert_verifier.h" #include "net/cert/ct_log_verifier.h" #include "net/cert/multi_log_ct_verifier.h" @@ -364,17 +363,6 @@ } #endif // defined(OS_CHROMEOS) -#if defined(USE_NSS_CERTS) -void InitializeAndPassKeygenHandler( - std::unique_ptr<net::KeygenHandler> keygen_handler, - const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback, - std::unique_ptr<ChromeNSSCryptoModuleDelegate> delegate) { - if (delegate) - keygen_handler->set_crypto_module_delegate(std::move(delegate)); - callback.Run(std::move(keygen_handler)); -} -#endif // defined(USE_NSS_CERTS) - // For safe shutdown, must be called before the ProfileIOData is destroyed. void NotifyContextGettersOfShutdownOnIO( std::unique_ptr<ProfileIOData::ChromeURLRequestContextGetterVector> @@ -965,32 +953,6 @@ return request_context_; } -void ProfileIOData::ResourceContext::CreateKeygenHandler( - uint32_t key_size_in_bits, - const std::string& challenge_string, - const GURL& url, - const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { - DCHECK(!callback.is_null()); -#if defined(USE_NSS_CERTS) - std::unique_ptr<net::KeygenHandler> keygen_handler( - new net::KeygenHandler(key_size_in_bits, challenge_string, url)); - - base::Callback<void(std::unique_ptr<ChromeNSSCryptoModuleDelegate>)> - got_delegate_callback = - base::Bind(&InitializeAndPassKeygenHandler, - base::Passed(&keygen_handler), callback); - - ChromeNSSCryptoModuleDelegate::CreateForResourceContext( - chrome::kCryptoModulePasswordKeygen, - net::HostPortPair::FromURL(url), - this, - got_delegate_callback); -#else - callback.Run(base::MakeUnique<net::KeygenHandler>(key_size_in_bits, - challenge_string, url)); -#endif -} - std::string ProfileIOData::ResourceContext::GetMediaDeviceIDSalt() { if (io_data_->HasMediaDeviceIDSalt()) return io_data_->GetMediaDeviceIDSalt();
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h index adfdefc..4a56662 100644 --- a/chrome/browser/profiles/profile_io_data.h +++ b/chrome/browser/profiles/profile_io_data.h
@@ -440,12 +440,6 @@ // ResourceContext implementation: net::HostResolver* GetHostResolver() override; net::URLRequestContext* GetRequestContext() override; - void CreateKeygenHandler( - uint32_t key_size_in_bits, - const std::string& challenge_string, - const GURL& url, - const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& - callback) override; std::string GetMediaDeviceIDSalt() override; private:
diff --git a/chrome/browser/resources/options/content_settings.html b/chrome/browser/resources/options/content_settings.html index 149be9d..0f49085 100644 --- a/chrome/browser/resources/options/content_settings.html +++ b/chrome/browser/resources/options/content_settings.html
@@ -113,36 +113,6 @@ </div> </div> </section> - <!-- Keygen filter --> - <section> - <h3 i18n-content="keygenTabLabel"></h3> - <div> - <div class="radio controlled-setting-with-label"> - <label> - <input type="radio" name="keygen" value="allow"> - <span> - <span i18n-content="keygenAllow"></span> - <span class="controlled-setting-indicator" - content-setting="keygen" value="allow"></span> - </span> - </label> - </div> - <div class="radio controlled-setting-with-label"> - <label> - <input type="radio" name="keygen" value="block"> - <span> - <span i18n-content="keygenBlock"></span> - <span class="controlled-setting-indicator" - content-setting="keygen" value="block"></span> - </span> - </label> - </div> - <div class="settings-row"> - <button class="exceptions-list-button" contentType="keygen" - i18n-content="manageExceptions"></button> - </div> - </div> - </section> <!-- Handlers settings --> <section id="handlers-section"> <h3 i18n-content="handlersTabLabel"></h3>
diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.html b/chrome/browser/resources/options/content_settings_exceptions_area.html index 7dfad1c..079080f 100644 --- a/chrome/browser/resources/options/content_settings_exceptions_area.html +++ b/chrome/browser/resources/options/content_settings_exceptions_area.html
@@ -151,14 +151,6 @@ <list mode="otr"></list> </div> </div> - <div contentType="keygen"> - <list mode="normal"></list> - <div> - <span class="otr-explanation" i18n-content="otrExceptionsExplanation"> - </span> - <list mode="otr"></list> - </div> - </div> </div> <div class="action-area"> <div class="hbox stretch">
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chrome/browser/resources/settings/privacy_page/privacy_page.html index a91c6989..76fbc1a6 100644 --- a/chrome/browser/resources/settings/privacy_page/privacy_page.html +++ b/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -313,17 +313,6 @@ </category-setting-exceptions> </settings-subpage> </template> - <template is="dom-if" route-path="/content/keygen" no-search> - <settings-subpage page-title="$i18n{siteSettingsKeygen}"> - <button class="icon-help subpage-title-extra" - is="paper-icon-button-light" on-tap="onHelpTap_"></button> - <category-default-setting category="{{ContentSettingsTypes.KEYGEN}}"> - </category-default-setting> - <category-setting-exceptions - category="{{ContentSettingsTypes.KEYGEN}}"> - </category-setting-exceptions> - </settings-subpage> - </template> <template is="dom-if" route-path="/content/microphone" no-search> <settings-subpage page-title="$i18n{siteSettingsCategoryMicrophone}"> <button class="icon-help subpage-title-extra"
diff --git a/chrome/browser/resources/settings/route.js b/chrome/browser/resources/settings/route.js index 2e888f6..9d5a774 100644 --- a/chrome/browser/resources/settings/route.js +++ b/chrome/browser/resources/settings/route.js
@@ -160,7 +160,6 @@ r.SITE_SETTINGS_COOKIES.createChild('/cookies/detail'); r.SITE_SETTINGS_IMAGES = r.SITE_SETTINGS.createChild('images'); r.SITE_SETTINGS_JAVASCRIPT = r.SITE_SETTINGS.createChild('javascript'); - r.SITE_SETTINGS_KEYGEN = r.SITE_SETTINGS.createChild('keygen'); r.SITE_SETTINGS_LOCATION = r.SITE_SETTINGS.createChild('location'); r.SITE_SETTINGS_MICROPHONE = r.SITE_SETTINGS.createChild('microphone'); r.SITE_SETTINGS_NOTIFICATIONS = r.SITE_SETTINGS.createChild('notifications');
diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.html b/chrome/browser/resources/settings/site_settings/category_default_setting.html index af670e01..e46a561 100644 --- a/chrome/browser/resources/settings/site_settings/category_default_setting.html +++ b/chrome/browser/resources/settings/site_settings/category_default_setting.html
@@ -1,6 +1,6 @@ <link rel="import" href="chrome://resources/html/polymer.html"> -<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> +<link rel="import" href="/controls/settings_toggle_button.html"> <link rel="import" href="/settings_shared_css.html"> <link rel="import" href="/site_settings/constants.html"> <link rel="import" href="/site_settings/site_settings_behavior.html"> @@ -11,20 +11,18 @@ <style include="settings-shared"></style> <div class="settings-box first two-line"> <div class="start secondary">[[sliderDescription_]]</div> - <paper-toggle-button id="toggle" checked="{{categoryEnabled}}" - on-change="onChangePermissionControl_"></paper-toggle-button> + <settings-toggle-button id="toggle" pref="{{controlParams_}}"> + </settings-toggle-button> </div> - <template is="dom-if" if="[[subOptionLabel]]"> <div class="settings-box"> <div class="start"> [[subOptionLabel]] <div class="secondary">[[subOptionSecondary]]</div> </div> - <paper-toggle-button checked="{{subOptionEnabled_}}" - disabled="[[!categoryEnabled]]" id="subOptionToggle" - on-change="onChangePermissionControl_"> - </paper-toggle-button> + <settings-toggle-button disabled$="[[!controlParams_.value]]" + id="subOptionToggle" pref="{{subControlParams_}}"> + </settings-toggle-button> </div> </template> </template>
diff --git a/chrome/browser/resources/settings/site_settings/category_default_setting.js b/chrome/browser/resources/settings/site_settings/category_default_setting.js index 609f37e2..d360ef9 100644 --- a/chrome/browser/resources/settings/site_settings/category_default_setting.js +++ b/chrome/browser/resources/settings/site_settings/category_default_setting.js
@@ -13,12 +13,21 @@ behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], properties: { - /** - * Represents the state of the main toggle shown for the category. For - * example, the Location category can be set to Block/Ask so false, in that - * case, represents Block and true represents Ask. - */ - categoryEnabled: Boolean, + /** @private {chrome.settingsPrivate.PrefObject} */ + controlParams_: { + type: Object, + value: function() { + return /** @type {chrome.settingsPrivate.PrefObject} */({}); + }, + }, + + /** @private {!DefaultContentSetting} */ + priorDefaultContentSetting_: { + type: Object, + value: function() { + return /** @type {DefaultContentSetting} */({}); + }, + }, /** * The description to be shown next to the slider. @@ -27,32 +36,32 @@ sliderDescription_: String, /** - * A sub-option toggle is used to represent tri-state categories. - * @private + * Cookies and Flash settings have a sub-control that is used to mimic a + * tri-state value. + * @private {chrome.settingsPrivate.PrefObject} */ - subOptionEnabled_: { - type: Boolean, - value: true, + subControlParams_: { + type: Object, + value: function() { + return /** @type {chrome.settingsPrivate.PrefObject} */({}); + }, }, }, observers: [ 'onCategoryChanged_(category)', + 'onChangePermissionControl_(category, controlParams_.value, ' + + 'subControlParams_.value)', ], ready: function() { this.addWebUIListener('contentSettingCategoryChanged', - this.defaultValueForCategoryChanged_.bind(this)); + this.onCategoryChanged_.bind(this)); }, - /** - * Called when the default value for a category has been changed. - * @param {number} category The category that changed. - * @private - */ - defaultValueForCategoryChanged_: function(category) { - if (category == this.category) - this.onCategoryChanged_(); + /** @return {boolean} */ + get categoryEnabled() { + return !!assert(this.controlParams_).value; }, /** @@ -64,7 +73,6 @@ case settings.ContentSettingsTypes.BACKGROUND_SYNC: case settings.ContentSettingsTypes.IMAGES: case settings.ContentSettingsTypes.JAVASCRIPT: - case settings.ContentSettingsTypes.KEYGEN: case settings.ContentSettingsTypes.POPUPS: case settings.ContentSettingsTypes.PROTOCOL_HANDLERS: // "Allowed" vs "Blocked". @@ -92,7 +100,7 @@ // browser quits". var value = settings.PermissionValues.BLOCK; if (this.categoryEnabled) { - value = this.subOptionEnabled_ ? + value = this.subControlParams_.value ? settings.PermissionValues.SESSION_ONLY : settings.PermissionValues.ALLOW; } @@ -102,7 +110,7 @@ // This category is tri-state: "Allow", "Block", "Ask before running". var value = settings.PermissionValues.BLOCK; if (this.categoryEnabled) { - value = this.subOptionEnabled_ ? + value = this.subControlParams_.value ? settings.PermissionValues.IMPORTANT_CONTENT : settings.PermissionValues.ALLOW; } @@ -114,43 +122,76 @@ }, /** + * Update the control parameter values from the content settings. + * @param {!DefaultContentSetting} update + * @private + */ + updateControlParams_: function(update) { + // Early out if there is no actual change. + if (this.priorDefaultContentSetting_.setting == update.setting && + this.priorDefaultContentSetting_.source == update.source) { + return; + } + this.priorDefaultContentSetting_ = update; + + var basePref = { + 'key': 'controlParams', + 'type': chrome.settingsPrivate.PrefType.BOOLEAN, + }; + if (update.source !== undefined && + update.source != ContentSettingProvider.PREFERENCE) { + basePref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED; + basePref.controlledBy = + update.source == ContentSettingProvider.EXTENSION ? + chrome.settingsPrivate.ControlledBy.EXTENSION : + chrome.settingsPrivate.ControlledBy.USER_POLICY; + } + + var prefValue = this.computeIsSettingEnabled(update.setting); + // The controlParams_ must be replaced (rather than just value changes) so + // that observers will be notified of the change. + this.controlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */( + Object.assign({'value': prefValue}, basePref)); + + var subPrefValue = false; + if (this.category == settings.ContentSettingsTypes.PLUGINS || + this.category == settings.ContentSettingsTypes.COOKIES) { + if (this.category == settings.ContentSettingsTypes.PLUGINS && + update.setting == settings.PermissionValues.IMPORTANT_CONTENT) { + subPrefValue = true; + } else if (this.category == settings.ContentSettingsTypes.COOKIES && + update.setting == settings.PermissionValues.SESSION_ONLY) { + subPrefValue = true; + } + } + // The subControlParams_ must be replaced (rather than just value changes) + // so that observers will be notified of the change. + this.subControlParams_ = /** @type {chrome.settingsPrivate.PrefObject} */( + Object.assign({'value': subPrefValue}, basePref)); + }, + + /** * Handles changes to the category pref and the |category| member variable. * @private */ onCategoryChanged_: function() { this.browserProxy - .getDefaultValueForContentType(this.category) - .then(function(defaultValue) { - var setting = defaultValue.setting; - this.categoryEnabled = this.computeIsSettingEnabled(setting); + .getDefaultValueForContentType( + this.category).then(function(defaultValue) { + this.updateControlParams_(defaultValue); - // Flash only shows ALLOW or BLOCK descriptions on the slider. - var sliderSetting = setting; - if (this.category == settings.ContentSettingsTypes.PLUGINS && - setting == settings.PermissionValues.IMPORTANT_CONTENT) { - sliderSetting = settings.PermissionValues.ALLOW; - } else if ( - this.category == settings.ContentSettingsTypes.COOKIES && - setting == settings.PermissionValues.SESSION_ONLY) { - sliderSetting = settings.PermissionValues.ALLOW; - } - this.sliderDescription_ = - this.computeCategoryDesc(this.category, sliderSetting, true); - - if (this.category == settings.ContentSettingsTypes.PLUGINS) { - // The checkbox should only be cleared when the Flash setting - // is explicitly set to ALLOW. - if (setting == settings.PermissionValues.ALLOW) - this.subOptionEnabled_ = false; - if (setting == settings.PermissionValues.IMPORTANT_CONTENT) - this.subOptionEnabled_ = true; - } else if ( - this.category == settings.ContentSettingsTypes.COOKIES) { - if (setting == settings.PermissionValues.ALLOW) - this.subOptionEnabled_ = false; - else if (setting == settings.PermissionValues.SESSION_ONLY) - this.subOptionEnabled_ = true; - } - }.bind(this)); + // Flash only shows ALLOW or BLOCK descriptions on the slider. + var setting = defaultValue.setting; + if (this.category == settings.ContentSettingsTypes.PLUGINS && + setting == settings.PermissionValues.IMPORTANT_CONTENT) { + setting = settings.PermissionValues.ALLOW; + } else if ( + this.category == settings.ContentSettingsTypes.COOKIES && + setting == settings.PermissionValues.SESSION_ONLY) { + setting = settings.PermissionValues.ALLOW; + } + this.sliderDescription_ = + this.computeCategoryDesc(this.category, setting, true); + }.bind(this)); }, });
diff --git a/chrome/browser/resources/settings/site_settings/constants.js b/chrome/browser/resources/settings/site_settings/constants.js index 61948c0..5e324182 100644 --- a/chrome/browser/resources/settings/site_settings/constants.js +++ b/chrome/browser/resources/settings/site_settings/constants.js
@@ -25,7 +25,6 @@ PROTOCOL_HANDLERS: 'register-protocol-handler', UNSANDBOXED_PLUGINS: 'ppapi-broker', AUTOMATIC_DOWNLOADS: 'multiple-automatic-downloads', - KEYGEN: 'keygen', BACKGROUND_SYNC: 'background-sync', USB_DEVICES: 'usb-chooser-data', ZOOM_LEVELS: 'zoom-levels',
diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html index 325c064..0898ee3 100644 --- a/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chrome/browser/resources/settings/site_settings/site_details.html
@@ -97,10 +97,6 @@ icon="settings:sync" id="backgroundSync" label="$i18n{siteSettingsBackgroundSync}" site="[[site]]"> </site-details-permission> - <site-details-permission category="{{ContentSettingsTypes.KEYGEN}}" - icon="settings:code" id="keygen"label="$i18n{siteSettingsKeygen}" - site="[[site]]"> - </site-details-permission> <site-details-permission category="{{ContentSettingsTypes.AUTOMATIC_DOWNLOADS}}" icon="cr:file-download" id="automaticDownloads"
diff --git a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js index 2a38a6a..8c07d7e 100644 --- a/chrome/browser/resources/settings/site_settings/site_settings_behavior.js +++ b/chrome/browser/resources/settings/site_settings/site_settings_behavior.js
@@ -119,14 +119,6 @@ loadTimeData.getString( 'siteSettingsAllowRecentlyClosedSitesRecommended') : loadTimeData.getString('siteSettingsAllowRecentlyClosedSites'); - case settings.ContentSettingsTypes.KEYGEN: - // "Allow sites to use keygen" vs "Do not allow". - if (categoryEnabled) { - return loadTimeData.getString('siteSettingsKeygenAllow'); - } - return showRecommendation ? - loadTimeData.getString('siteSettingsKeygenBlockRecommended') : - loadTimeData.getString('siteSettingsKeygenBlock'); case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS: // "Ask when a site wants to auto-download multiple" vs "Do not allow". if (!categoryEnabled) {
diff --git a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html index 8efa74b..cb801ce9 100644 --- a/chrome/browser/resources/settings/site_settings_page/site_settings_page.html +++ b/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -126,16 +126,6 @@ <button class="subpage-arrow" is="paper-icon-button-light"></button> </div> <div class="settings-box two-line" - category$="[[ContentSettingsTypes.KEYGEN]]" - data-route="SITE_SETTINGS_KEYGEN" on-tap="onTapNavigate_" actionable> - <iron-icon icon="settings:code"></iron-icon> - <div class="middle"> - $i18n{siteSettingsKeygen} - <div class="secondary">[[default_.keygen]]</div> - </div> - <button class="subpage-arrow" is="paper-icon-button-light"></button> - </div> - <div class="settings-box two-line" category$="[[ContentSettingsTypes.AUTOMATIC_DOWNLOADS]]" data-route="SITE_SETTINGS_AUTOMATIC_DOWNLOADS" on-tap="onTapNavigate_" actionable>
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 755c8b5..77fe097 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3141,8 +3141,6 @@ "app_list/app_list_controller_delegate_impl.h", "app_list/app_list_model_builder.cc", "app_list/app_list_model_builder.h", - "app_list/app_list_positioner.cc", - "app_list/app_list_positioner.h", "app_list/app_list_service.cc", "app_list/app_list_service.h", "app_list/app_list_service_impl.cc", @@ -3163,8 +3161,6 @@ "app_list/extension_app_model_builder.h", "app_list/extension_uninstaller.cc", "app_list/extension_uninstaller.h", - "app_list/fast_show_pickler.cc", - "app_list/fast_show_pickler.h", "app_list/google_now_extension.cc", "app_list/google_now_extension.h", "app_list/launcher_page_event_dispatcher.cc", @@ -3275,24 +3271,6 @@ "views/arc_app_dialog_view.cc", ] } - if (is_desktop_linux) { - sources += [ - "views/app_list/linux/app_list_linux.cc", - "views/app_list/linux/app_list_linux.h", - "views/app_list/linux/app_list_service_linux.cc", - "views/app_list/linux/app_list_service_linux.h", - ] - } - if (!is_mac && !use_ash) { - sources += [ - "app_list/app_list_controller_delegate_views.cc", - "app_list/app_list_controller_delegate_views.h", - "app_list/app_list_service_views.cc", - "app_list/app_list_service_views.h", - "app_list/app_list_shower_views.cc", - "app_list/app_list_shower_views.h", - ] - } deps += [ "//ui/app_list" ] } else { sources += [
diff --git a/chrome/browser/ui/android/page_info/website_settings_popup_android.cc b/chrome/browser/ui/android/page_info/website_settings_popup_android.cc index 635464b3..40528df 100644 --- a/chrome/browser/ui/android/page_info/website_settings_popup_android.cc +++ b/chrome/browser/ui/android/page_info/website_settings_popup_android.cc
@@ -111,7 +111,6 @@ permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_IMAGES); permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_JAVASCRIPT); permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_POPUPS); - permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_KEYGEN); permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_AUTOPLAY); std::map<ContentSettingsType, ContentSetting>
diff --git a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc index 9337262..bc5ddf4 100644 --- a/chrome/browser/ui/app_list/app_list_controller_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_controller_browsertest.cc
@@ -21,6 +21,8 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/chromeos_switches.h" +#include "components/user_manager/user_names.h" #include "ui/app_list/app_list_model.h" #include "ui/app_list/app_list_switches.h" #include "ui/app_list/search_box_model.h" @@ -28,11 +30,6 @@ #include "ui/app_list/search_result_observer.h" #include "ui/base/models/list_model_observer.h" -#if defined(OS_CHROMEOS) -#include "chromeos/chromeos_switches.h" -#include "components/user_manager/user_names.h" -#endif // defined(OS_CHROMEOS) - // Browser Test for AppListController that runs on all platforms supporting // app_list. typedef InProcessBrowserTest AppListControllerBrowserTest; @@ -165,8 +162,6 @@ service->DismissAppList(); } -#if defined(OS_CHROMEOS) - class AppListControllerGuestModeBrowserTest : public InProcessBrowserTest { public: AppListControllerGuestModeBrowserTest() {} @@ -196,5 +191,3 @@ service->ShowForProfile(browser()->profile()); EXPECT_EQ(browser()->profile(), service->GetCurrentAppListProfile()); } - -#endif // defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate_views.cc b/chrome/browser/ui/app_list/app_list_controller_delegate_views.cc deleted file mode 100644 index 6b38b8c..0000000 --- a/chrome/browser/ui/app_list/app_list_controller_delegate_views.cc +++ /dev/null
@@ -1,50 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_controller_delegate_views.h" - -#include "chrome/browser/ui/app_list/app_list_service_views.h" -#include "ui/app_list/views/app_list_view.h" - -AppListControllerDelegateViews::AppListControllerDelegateViews( - AppListServiceViews* service) - : AppListControllerDelegateImpl(service), - service_(service) { -} - -AppListControllerDelegateViews::~AppListControllerDelegateViews() {} - -gfx::Rect AppListControllerDelegateViews::GetAppListBounds() { - // We use the bounds of the app list view here because the bounds of the app - // list window include the shadow behind it (and the shadow size varies across - // platforms). - app_list::AppListView* app_list_view = service_->shower().app_list(); - if (app_list_view) - return app_list_view->GetBoundsInScreen(); - return gfx::Rect(); -} - -void AppListControllerDelegateViews::ViewClosing() { - service_->OnViewBeingDestroyed(); -} - -void AppListControllerDelegateViews::OnShowChildDialog() { - DCHECK(service_->shower().app_list()); - service_->shower().app_list()->SetAppListOverlayVisible(true); - service_->set_can_dismiss(false); -} - -void AppListControllerDelegateViews::OnCloseChildDialog() { - // If the app list is closed while a child dialog is open (for example, - // through an OS-level close command), then the app list view will already - // have been cleared from the shower by - // AppListShower::HandleViewBeingDestroyed(). - if (service_->shower().app_list()) - service_->shower().app_list()->SetAppListOverlayVisible(false); - service_->set_can_dismiss(true); -} - -bool AppListControllerDelegateViews::CanDoCreateShortcutsFlow() { - return true; -}
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate_views.h b/chrome/browser/ui/app_list/app_list_controller_delegate_views.h deleted file mode 100644 index d5da711..0000000 --- a/chrome/browser/ui/app_list/app_list_controller_delegate_views.h +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_DELEGATE_VIEWS_H_ -#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_DELEGATE_VIEWS_H_ - -#include "base/macros.h" -#include "chrome/browser/ui/app_list/app_list_controller_delegate_impl.h" - -class AppListServiceViews; - -// Conveys messages from a views-backed app list to the AppListService that -// created it. -class AppListControllerDelegateViews : public AppListControllerDelegateImpl { - public: - explicit AppListControllerDelegateViews(AppListServiceViews* service); - ~AppListControllerDelegateViews() override; - - // AppListControllerDelegate overrides: - gfx::Rect GetAppListBounds() override; - void ViewClosing() override; - void OnShowChildDialog() override; - void OnCloseChildDialog() override; - bool CanDoCreateShortcutsFlow() override; - - private: - AppListServiceViews* service_; // Weak. Owns us. - - DISALLOW_COPY_AND_ASSIGN(AppListControllerDelegateViews); -}; - -#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_CONTROLLER_DELEGATE_VIEWS_H_
diff --git a/chrome/browser/ui/app_list/app_list_positioner.cc b/chrome/browser/ui/app_list/app_list_positioner.cc deleted file mode 100644 index 6ba2488b..0000000 --- a/chrome/browser/ui/app_list/app_list_positioner.cc +++ /dev/null
@@ -1,204 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_positioner.h" - -#include <algorithm> - -#include "base/logging.h" -#include "ui/gfx/geometry/point.h" -#include "ui/gfx/geometry/rect.h" - -AppListPositioner::AppListPositioner(const display::Display& display, - const gfx::Size& window_size, - int min_distance_from_edge) - : display_(display), - window_size_(window_size), - min_distance_from_edge_(min_distance_from_edge) {} - -void AppListPositioner::WorkAreaSubtract(const gfx::Rect& rect) { - gfx::Rect work_area = display_.work_area(); - work_area.Subtract(rect); - display_.set_work_area(work_area); -} - -void AppListPositioner::WorkAreaInset(int left, - int top, - int right, - int bottom) { - gfx::Rect work_area = display_.work_area(); - work_area.Inset(left, top, right, bottom); - display_.set_work_area(work_area); -} - -gfx::Point AppListPositioner::GetAnchorPointForScreenCenter() const { - return display_.bounds().CenterPoint(); -} - -gfx::Point AppListPositioner::GetAnchorPointForScreenCorner( - ScreenCorner corner) const { - const gfx::Rect& screen_rect = display_.bounds(); - gfx::Point anchor; - switch (corner) { - case SCREEN_CORNER_TOP_LEFT: - anchor = screen_rect.origin(); - break; - case SCREEN_CORNER_TOP_RIGHT: - anchor = screen_rect.top_right(); - break; - case SCREEN_CORNER_BOTTOM_LEFT: - anchor = screen_rect.bottom_left(); - break; - case SCREEN_CORNER_BOTTOM_RIGHT: - anchor = screen_rect.bottom_right(); - break; - default: - NOTREACHED(); - anchor = gfx::Point(); - } - return ClampAnchorPoint(anchor); -} - -gfx::Point AppListPositioner::GetAnchorPointForShelfCorner( - ScreenEdge shelf_edge) const { - const gfx::Rect& screen_rect = display_.bounds(); - const gfx::Rect& work_area = display_.work_area(); - gfx::Point anchor; - switch (shelf_edge) { - case SCREEN_EDGE_LEFT: - anchor = gfx::Point(work_area.x(), screen_rect.y()); - break; - case SCREEN_EDGE_RIGHT: - anchor = gfx::Point(work_area.right(), screen_rect.y()); - break; - case SCREEN_EDGE_TOP: - anchor = gfx::Point(screen_rect.x(), work_area.y()); - break; - case SCREEN_EDGE_BOTTOM: - anchor = gfx::Point(screen_rect.x(), work_area.bottom()); - break; - default: - NOTREACHED(); - anchor = gfx::Point(); - } - return ClampAnchorPoint(anchor); -} - -gfx::Point AppListPositioner::GetAnchorPointForShelfCenter( - ScreenEdge shelf_edge) const { - const gfx::Rect& work_area = display_.work_area(); - gfx::Point anchor; - switch (shelf_edge) { - case SCREEN_EDGE_LEFT: - anchor = - gfx::Point(work_area.x(), work_area.y() + work_area.height() / 2); - break; - case SCREEN_EDGE_RIGHT: - anchor = - gfx::Point(work_area.right(), work_area.y() + work_area.height() / 2); - break; - case SCREEN_EDGE_TOP: - anchor = gfx::Point(work_area.x() + work_area.width() / 2, work_area.y()); - break; - case SCREEN_EDGE_BOTTOM: - anchor = - gfx::Point(work_area.x() + work_area.width() / 2, work_area.bottom()); - break; - default: - NOTREACHED(); - anchor = gfx::Point(); - } - return ClampAnchorPoint(anchor); -} - -gfx::Point AppListPositioner::GetAnchorPointForShelfCursor( - ScreenEdge shelf_edge, - const gfx::Point& cursor) const { - const gfx::Rect& work_area = display_.work_area(); - gfx::Point anchor; - switch (shelf_edge) { - case SCREEN_EDGE_LEFT: - anchor = gfx::Point(work_area.x(), cursor.y()); - break; - case SCREEN_EDGE_RIGHT: - anchor = gfx::Point(work_area.right(), cursor.y()); - break; - case SCREEN_EDGE_TOP: - anchor = gfx::Point(cursor.x(), work_area.y()); - break; - case SCREEN_EDGE_BOTTOM: - anchor = gfx::Point(cursor.x(), work_area.bottom()); - break; - default: - NOTREACHED(); - anchor = gfx::Point(); - } - return ClampAnchorPoint(anchor); -} - -AppListPositioner::ScreenEdge AppListPositioner::GetShelfEdge( - const gfx::Rect& shelf_rect) const { - const gfx::Rect& screen_rect = display_.bounds(); - const gfx::Rect& work_area = display_.work_area(); - - // If we can't find the shelf, return SCREEN_EDGE_UNKNOWN. If the display - // size is the same as the work area, and does not contain the shelf, either - // the shelf is hidden or on another monitor. - if (work_area == screen_rect && !work_area.Contains(shelf_rect)) - return SCREEN_EDGE_UNKNOWN; - - // Note: On Windows 8 the work area won't include split windows on the left or - // right, and neither will |shelf_rect|. - if (shelf_rect.x() == work_area.x() && - shelf_rect.width() == work_area.width()) { - // Shelf is horizontal. - if (shelf_rect.bottom() == screen_rect.bottom()) - return SCREEN_EDGE_BOTTOM; - else if (shelf_rect.y() == screen_rect.y()) - return SCREEN_EDGE_TOP; - } else if (shelf_rect.y() == work_area.y() && - shelf_rect.height() == work_area.height()) { - // Shelf is vertical. - if (shelf_rect.x() == screen_rect.x()) - return SCREEN_EDGE_LEFT; - else if (shelf_rect.right() == screen_rect.right()) - return SCREEN_EDGE_RIGHT; - } - - return SCREEN_EDGE_UNKNOWN; -} - -int AppListPositioner::GetCursorDistanceFromShelf( - ScreenEdge shelf_edge, - const gfx::Point& cursor) const { - const gfx::Rect& work_area = display_.work_area(); - switch (shelf_edge) { - case SCREEN_EDGE_UNKNOWN: - return 0; - case SCREEN_EDGE_LEFT: - return std::max(0, cursor.x() - work_area.x()); - case SCREEN_EDGE_RIGHT: - return std::max(0, work_area.right() - cursor.x()); - case SCREEN_EDGE_TOP: - return std::max(0, cursor.y() - work_area.y()); - case SCREEN_EDGE_BOTTOM: - return std::max(0, work_area.bottom() - cursor.y()); - default: - NOTREACHED(); - return 0; - } -} - -gfx::Point AppListPositioner::ClampAnchorPoint(gfx::Point anchor) const { - gfx::Rect bounds_rect(display_.work_area()); - - // Anchor the center of the window in a region that prevents the window - // showing outside of the work area. - bounds_rect.Inset(window_size_.width() / 2 + min_distance_from_edge_, - window_size_.height() / 2 + min_distance_from_edge_); - - anchor.SetToMax(bounds_rect.origin()); - anchor.SetToMin(bounds_rect.bottom_right()); - return anchor; -}
diff --git a/chrome/browser/ui/app_list/app_list_positioner.h b/chrome/browser/ui/app_list/app_list_positioner.h deleted file mode 100644 index 52a0a08e..0000000 --- a/chrome/browser/ui/app_list/app_list_positioner.h +++ /dev/null
@@ -1,116 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_POSITIONER_H_ -#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_POSITIONER_H_ - -#include "ui/display/display.h" -#include "ui/gfx/geometry/size.h" - -namespace gfx { -class Point; -class Rect; -} - -// Helps anchor the App List, onto the shelf (taskbar, dock or similar) or to -// the corner of a display. This class does not impose any particular policy for -// when and how to anchor the window. The platform-specific code that uses this -// class is free to decide, for example, when the window should be anchored to -// the cursor versus the corner of the shelf. This class just performs the -// calculations necessary to position the App List correctly. -class AppListPositioner { - public: - // Represents one of the four edges of the screen. - enum ScreenEdge { - SCREEN_EDGE_UNKNOWN, - SCREEN_EDGE_LEFT, - SCREEN_EDGE_RIGHT, - SCREEN_EDGE_TOP, - SCREEN_EDGE_BOTTOM - }; - - // Represents one of the four corners of the screen. - enum ScreenCorner { - SCREEN_CORNER_TOP_LEFT, - SCREEN_CORNER_TOP_RIGHT, - SCREEN_CORNER_BOTTOM_LEFT, - SCREEN_CORNER_BOTTOM_RIGHT - }; - - // The |display| pointer is borrowed, and must outlive this object's lifetime. - // |window_size| is the size of the App List. - // |min_distance_from_edge| is the minimum distance, in pixels, to position - // the app list from the shelf or edge of screen. - AppListPositioner(const display::Display& display, - const gfx::Size& window_size, - int min_distance_from_edge); - - // Subtracts a rectangle from the display's work area. This can be used to - // ensure that the app list does not overlap the shelf, even in situations - // where the shelf is considered part of the work area. - void WorkAreaSubtract(const gfx::Rect& rect); - - // Shrinks the display's work area by the given amount on each side. - void WorkAreaInset(int left, int top, int right, int bottom); - - // Finds the position for a window to anchor it to a corner of the screen. - // |corner| specifies which corner to anchor the window to. Returns the - // intended coordinates for the center of the window. This should only be used - // when there is no shelf on the display, because if there is, the returned - // anchor point will potentially position the window under it. - gfx::Point GetAnchorPointForScreenCorner(ScreenCorner corner) const; - - // Finds the position for a window to anchor it to the center of the screen. - // Returns the intended coordinates for the center of the window. - gfx::Point GetAnchorPointForScreenCenter() const; - - // Finds the position for a window to anchor it to the corner of the shelf. - // The window will be aligned to the left of the work area for horizontal - // shelves, or to the top for vertical shelves. |shelf_edge| specifies the - // location of the shelf. |shelf_edge| must not be SCREEN_EDGE_UNKNOWN. - // Returns the intended coordinates for the center of the window. - gfx::Point GetAnchorPointForShelfCorner(ScreenEdge shelf_edge) const; - - // Finds the position for a window to anchor it to the center of the shelf. - // |shelf_edge| specifies the location of the shelf. It must not be - // SCREEN_EDGE_UNKNOWN. Returns the intended coordinates for the center of the - // window. - gfx::Point GetAnchorPointForShelfCenter(ScreenEdge shelf_edge) const; - - // Finds the position for a window to anchor it to the shelf at a point - // closest to the user's mouse cursor. |shelf_edge| specifies the location of - // the shelf; |cursor| specifies the location of the user's mouse cursor. - // |shelf_edge| must not be SCREEN_EDGE_UNKNOWN. Returns the intended - // coordinates for the center of the window. - gfx::Point GetAnchorPointForShelfCursor(ScreenEdge shelf_edge, - const gfx::Point& cursor) const; - - // Determines which edge of the screen the shelf is attached to. Returns - // SCREEN_EDGE_UNKNOWN if the shelf is unavailable, hidden, or not on the - // current screen. - ScreenEdge GetShelfEdge(const gfx::Rect& shelf_rect) const; - - // Gets the lateral distance of the mouse cursor from the edge of the shelf. - // For horizontal shelves, this is the vertical distance; for vertical - // shelves, this is the horizontal distance. If the cursor is inside the - // shelf, returns 0. - int GetCursorDistanceFromShelf(ScreenEdge shelf_edge, - const gfx::Point& cursor) const; - - private: - // Ensures that an anchor point will result in a window that is fully within - // the work area. Returns the updated anchor point. - gfx::Point ClampAnchorPoint(gfx::Point anchor) const; - - display::Display display_; - - // Size of the App List. - gfx::Size window_size_; - - // The minimum distance, in pixels, to position the app list from the shelf - // or edge of screen. - int min_distance_from_edge_; -}; - -#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_POSITIONER_H_
diff --git a/chrome/browser/ui/app_list/app_list_positioner_unittest.cc b/chrome/browser/ui/app_list/app_list_positioner_unittest.cc deleted file mode 100644 index 24fce11..0000000 --- a/chrome/browser/ui/app_list/app_list_positioner_unittest.cc +++ /dev/null
@@ -1,339 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_positioner.h" - -#include <memory> - -#include "testing/gtest/include/gtest/gtest.h" - -namespace { - -const int kScreenWidth = 800; -const int kScreenHeight = 600; - -const int kWindowWidth = 100; -const int kWindowHeight = 200; - -// Size of the menu bar along the top of the screen. -const int kMenuBarSize = 22; -// Size of the normal (non-hidden) shelf. -const int kShelfSize = 30; - -// The distance the shelf will appear from the edge of the screen. -const int kMinDistanceFromEdge = 3; - -// A cursor position that is within the shelf. This must be < kShelfSize. -const int kCursorOnShelf = kShelfSize / 2; -// A cursor position that should be ignored. -const int kCursorIgnore = -300; - -// A position for the center of the window that causes the window to overlap the -// edge of the screen. This must be < kWindowWidth / 2 and < kWindowHeight / 2. -const int kWindowNearEdge = kWindowWidth / 4; -// A position for the center of the window that places the window away from all -// edges of the screen. This must be > kWindowWidth / 2, > kWindowHeight / 2, < -// kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. -const int kWindowAwayFromEdge = 158; - -} // namespace - -class AppListPositionerUnitTest : public testing::Test { - public: - void ResetPositioner() { - gfx::Size view_size(kWindowWidth, kWindowHeight); - positioner_.reset( - new AppListPositioner(display_, view_size, kMinDistanceFromEdge)); - } - - void SetUp() override { - display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); - // Assume there is a menu bar at the top of the screen, as on Mac and Unity. - // This is for cases where the work area does not fill the entire screen. - display_.set_work_area( - gfx::Rect(0, kMenuBarSize, kScreenWidth, kScreenHeight - kMenuBarSize)); - ResetPositioner(); - cursor_ = gfx::Point(); - } - - // Sets up the test environment with the shelf along a given edge of the work - // area. - void PlaceShelf(AppListPositioner::ScreenEdge edge) { - ResetPositioner(); - switch (edge) { - case AppListPositioner::SCREEN_EDGE_UNKNOWN: - break; - case AppListPositioner::SCREEN_EDGE_LEFT: - positioner_->WorkAreaInset(kShelfSize, 0, 0, 0); - break; - case AppListPositioner::SCREEN_EDGE_RIGHT: - positioner_->WorkAreaInset(0, 0, kShelfSize, 0); - break; - case AppListPositioner::SCREEN_EDGE_TOP: - positioner_->WorkAreaInset(0, kShelfSize, 0, 0); - break; - case AppListPositioner::SCREEN_EDGE_BOTTOM: - positioner_->WorkAreaInset(0, 0, 0, kShelfSize); - break; - } - } - - // Set up the test mouse cursor in a given location. - void PlaceCursor(int x, int y) { - cursor_ = gfx::Point(x, y); - } - - gfx::Point DoGetAnchorPointForScreenCorner( - AppListPositioner::ScreenCorner corner) const { - return positioner_->GetAnchorPointForScreenCorner(corner); - } - - gfx::Point DoGetAnchorPointForShelfCorner( - AppListPositioner::ScreenEdge shelf_edge) const { - return positioner_->GetAnchorPointForShelfCorner(shelf_edge); - } - - gfx::Point DoGetAnchorPointForShelfCenter( - AppListPositioner::ScreenEdge shelf_edge) const { - return positioner_->GetAnchorPointForShelfCenter(shelf_edge); - } - - gfx::Point DoGetAnchorPointForShelfCursor( - AppListPositioner::ScreenEdge shelf_edge) const { - return positioner_->GetAnchorPointForShelfCursor(shelf_edge, cursor_); - } - - AppListPositioner::ScreenEdge DoGetShelfEdge( - const gfx::Rect& shelf_rect) const { - return positioner_->GetShelfEdge(shelf_rect); - } - - int DoGetCursorDistanceFromShelf( - AppListPositioner::ScreenEdge shelf_edge) const { - return positioner_->GetCursorDistanceFromShelf(shelf_edge, cursor_); - } - - private: - display::Display display_; - std::unique_ptr<AppListPositioner> positioner_; - gfx::Point cursor_; -}; - -TEST_F(AppListPositionerUnitTest, ScreenCorner) { - // Position the app list in a corner of the screen. - // Top-left corner. - EXPECT_EQ(gfx::Point(kWindowWidth / 2 + kMinDistanceFromEdge, - kMenuBarSize + kWindowHeight / 2 + kMinDistanceFromEdge), - DoGetAnchorPointForScreenCorner( - AppListPositioner::SCREEN_CORNER_TOP_LEFT)); - - // Top-right corner. - EXPECT_EQ(gfx::Point(kScreenWidth - kWindowWidth / 2 - kMinDistanceFromEdge, - kMenuBarSize + kWindowHeight / 2 + kMinDistanceFromEdge), - DoGetAnchorPointForScreenCorner( - AppListPositioner::SCREEN_CORNER_TOP_RIGHT)); - - // Bottom-left corner. - EXPECT_EQ( - gfx::Point(kWindowWidth / 2 + kMinDistanceFromEdge, - kScreenHeight - kWindowHeight / 2 - kMinDistanceFromEdge), - DoGetAnchorPointForScreenCorner( - AppListPositioner::SCREEN_CORNER_BOTTOM_LEFT)); - - // Bottom-right corner. - EXPECT_EQ( - gfx::Point(kScreenWidth - kWindowWidth / 2 - kMinDistanceFromEdge, - kScreenHeight - kWindowHeight / 2 - kMinDistanceFromEdge), - DoGetAnchorPointForScreenCorner( - AppListPositioner::SCREEN_CORNER_BOTTOM_RIGHT)); -} - -TEST_F(AppListPositionerUnitTest, ShelfCorner) { - // Position the app list on the shelf, aligned with the top or left corner. - // Shelf on left. Expect app list in top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - EXPECT_EQ( - gfx::Point(kShelfSize + kWindowWidth / 2 + kMinDistanceFromEdge, - kMenuBarSize + kWindowHeight / 2 + kMinDistanceFromEdge), - DoGetAnchorPointForShelfCorner(AppListPositioner::SCREEN_EDGE_LEFT)); - - // Shelf on right. Expect app list in top-right corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - EXPECT_EQ( - gfx::Point( - kScreenWidth - kShelfSize - kWindowWidth / 2 - kMinDistanceFromEdge, - kMenuBarSize + kWindowHeight / 2 + kMinDistanceFromEdge), - DoGetAnchorPointForShelfCorner(AppListPositioner::SCREEN_EDGE_RIGHT)); - - // Shelf on top. Expect app list in top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - EXPECT_EQ(gfx::Point(kWindowWidth / 2 + kMinDistanceFromEdge, - kMenuBarSize + kShelfSize + kWindowHeight / 2 + - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCorner(AppListPositioner::SCREEN_EDGE_TOP)); - - // Shelf on bottom. Expect app list in bottom-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - EXPECT_EQ( - gfx::Point(kWindowWidth / 2 + kMinDistanceFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2 - - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCorner(AppListPositioner::SCREEN_EDGE_BOTTOM)); -} - -TEST_F(AppListPositionerUnitTest, ShelfCenter) { - // Position the app list on the shelf, aligned with the shelf center. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - // Shelf on left. Expect app list to be center-left. - EXPECT_EQ( - gfx::Point(kShelfSize + kWindowWidth / 2 + kMinDistanceFromEdge, - (kMenuBarSize + kScreenHeight) / 2), - DoGetAnchorPointForShelfCenter(AppListPositioner::SCREEN_EDGE_LEFT)); - - // Shelf on right. Expect app list to be center-right. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - EXPECT_EQ( - gfx::Point( - kScreenWidth - kShelfSize - kWindowWidth / 2 - kMinDistanceFromEdge, - (kMenuBarSize + kScreenHeight) / 2), - DoGetAnchorPointForShelfCenter(AppListPositioner::SCREEN_EDGE_RIGHT)); - - // Shelf on top. Expect app list to be top-center. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - EXPECT_EQ(gfx::Point(kScreenWidth / 2, - kMenuBarSize + kShelfSize + kWindowHeight / 2 + - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCenter(AppListPositioner::SCREEN_EDGE_TOP)); - - // Shelf on bottom. Expect app list to be bottom-center. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - EXPECT_EQ( - gfx::Point(kScreenWidth / 2, - kScreenHeight - kShelfSize - kWindowHeight / 2 - - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCenter(AppListPositioner::SCREEN_EDGE_BOTTOM)); -} - -TEST_F(AppListPositionerUnitTest, ShelfCursor) { - // Position the app list on the shelf, aligned with the mouse cursor. - - // Shelf on left. Expect app list in top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - PlaceCursor(kCursorIgnore, kWindowAwayFromEdge); - EXPECT_EQ( - gfx::Point(kShelfSize + kWindowWidth / 2 + kMinDistanceFromEdge, - kWindowAwayFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_LEFT)); - - // Shelf on right. Expect app list in top-right corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - PlaceCursor(kCursorIgnore, kWindowAwayFromEdge); - EXPECT_EQ( - gfx::Point( - kScreenWidth - kShelfSize - kWindowWidth / 2 - kMinDistanceFromEdge, - kWindowAwayFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_RIGHT)); - - // Shelf on top. Expect app list in top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - PlaceCursor(kWindowAwayFromEdge, kCursorIgnore); - EXPECT_EQ(gfx::Point(kWindowAwayFromEdge, - kMenuBarSize + kShelfSize + kWindowHeight / 2 + - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_TOP)); - - // Shelf on bottom. Expect app list in bottom-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowAwayFromEdge, kCursorIgnore); - EXPECT_EQ( - gfx::Point(kWindowAwayFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2 - - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_BOTTOM)); - - // Shelf on bottom. Mouse near left edge. App list must not go off screen. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowNearEdge, kCursorIgnore); - EXPECT_EQ( - gfx::Point(kWindowWidth / 2 + kMinDistanceFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2 - - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_BOTTOM)); - - // Shelf on bottom. Mouse near right edge. App list must not go off screen. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kScreenWidth - kWindowNearEdge, kCursorIgnore); - EXPECT_EQ( - gfx::Point(kScreenWidth - kWindowWidth / 2 - kMinDistanceFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2 - - kMinDistanceFromEdge), - DoGetAnchorPointForShelfCursor(AppListPositioner::SCREEN_EDGE_BOTTOM)); -} - -TEST_F(AppListPositionerUnitTest, GetShelfEdge) { - gfx::Rect shelf_rect; - // Shelf on left. - shelf_rect = - gfx::Rect(0, kMenuBarSize, kShelfSize, kScreenHeight - kMenuBarSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_LEFT, DoGetShelfEdge(shelf_rect)); - - // Shelf on right. - shelf_rect = gfx::Rect(kScreenWidth - kShelfSize, - kMenuBarSize, - kShelfSize, - kScreenHeight - kMenuBarSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_RIGHT, DoGetShelfEdge(shelf_rect)); - - // Shelf on top. - shelf_rect = gfx::Rect(0, 0, kScreenWidth, kShelfSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_TOP, DoGetShelfEdge(shelf_rect)); - - // Shelf on bottom. - shelf_rect = - gfx::Rect(0, kScreenHeight - kShelfSize, kScreenWidth, kShelfSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_BOTTOM, DoGetShelfEdge(shelf_rect)); - - // A couple of inconclusive cases, which should return unknown. - shelf_rect = gfx::Rect(); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_UNKNOWN, DoGetShelfEdge(shelf_rect)); - shelf_rect = gfx::Rect(-10, 0, kScreenWidth, kShelfSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_UNKNOWN, DoGetShelfEdge(shelf_rect)); - shelf_rect = gfx::Rect(10, 0, kScreenWidth - 20, kShelfSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_UNKNOWN, DoGetShelfEdge(shelf_rect)); - shelf_rect = gfx::Rect(0, kShelfSize, kScreenWidth, 60); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_UNKNOWN, DoGetShelfEdge(shelf_rect)); -} - -TEST_F(AppListPositionerUnitTest, GetCursorDistanceFromShelf) { - // Shelf on left. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - PlaceCursor(kWindowAwayFromEdge, kCursorIgnore); - EXPECT_EQ(kWindowAwayFromEdge - kShelfSize, - DoGetCursorDistanceFromShelf(AppListPositioner::SCREEN_EDGE_LEFT)); - - // Shelf on right. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - PlaceCursor(kScreenWidth - kWindowAwayFromEdge, kCursorIgnore); - EXPECT_EQ(kWindowAwayFromEdge - kShelfSize, - DoGetCursorDistanceFromShelf(AppListPositioner::SCREEN_EDGE_RIGHT)); - - // Shelf on top. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - PlaceCursor(kCursorIgnore, kMenuBarSize + kWindowAwayFromEdge); - EXPECT_EQ(kWindowAwayFromEdge - kShelfSize, - DoGetCursorDistanceFromShelf(AppListPositioner::SCREEN_EDGE_TOP)); - - // Shelf on bottom. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kCursorIgnore, kScreenHeight - kWindowAwayFromEdge); - EXPECT_EQ( - kWindowAwayFromEdge - kShelfSize, - DoGetCursorDistanceFromShelf(AppListPositioner::SCREEN_EDGE_BOTTOM)); - - // Shelf on bottom. Cursor inside shelf; expect 0. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kCursorIgnore, kScreenHeight - kCursorOnShelf); - EXPECT_EQ( - 0, DoGetCursorDistanceFromShelf(AppListPositioner::SCREEN_EDGE_BOTTOM)); -}
diff --git a/chrome/browser/ui/app_list/app_list_service_impl_browsertest.cc b/chrome/browser/ui/app_list/app_list_service_impl_browsertest.cc index ff86404..536fd9f 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_service_impl_browsertest.cc
@@ -77,13 +77,9 @@ // Just requesting the profile path shouldn't set it. EXPECT_FALSE(local_state->HasPrefPath(prefs::kAppListProfile)); - // Loading the Profile* should be lazy, except on ChromeOS where it is bound - // to ChromeLauncherController, which always has a profile. -#if defined(OS_CHROMEOS) + // The app list service is bound to ChromeLauncherController, which should + // always have a profile. EXPECT_TRUE(service_->GetCurrentAppListProfile()); -#else - EXPECT_FALSE(service_->GetCurrentAppListProfile()); -#endif // Showing the app list for an unspecified profile, uses the loaded profile. service_->Show(); @@ -92,27 +88,9 @@ EXPECT_FALSE(test_api_->profile_loader()->IsAnyProfileLoading()); EXPECT_EQ(service_->GetCurrentAppListProfile(), browser()->profile()); -#if defined(OS_CHROMEOS) // ChromeOS doesn't record the app list profile pref, and doesn't do profile // switching. EXPECT_FALSE(local_state->HasPrefPath(prefs::kAppListProfile)); - -#else - // Preference should be updated automatically. - EXPECT_TRUE(local_state->HasPrefPath(prefs::kAppListProfile)); - EXPECT_EQ(local_state->GetString(prefs::kAppListProfile), - browser()->profile()->GetPath().BaseName().MaybeAsASCII()); - - // Show for a second, pre-loaded profile without dismissing. Don't try this on - // ChromeOS because it does not support profile switching the app list. - Profile* profile2 = test::CreateSecondProfileAsync(); - service_->ShowForProfile(profile2); - - // Current profile and saved path should update synchronously. - EXPECT_FALSE(test_api_->profile_loader()->IsAnyProfileLoading()); - EXPECT_EQ(profile2->GetPath(), service_->GetProfilePath(user_data_dir)); - EXPECT_EQ(profile2, service_->GetCurrentAppListProfile()); -#endif } // Tests that the AppListViewDelegate is created lazily. @@ -122,38 +100,6 @@ EXPECT_TRUE(test_api_->view_delegate()); } -// Tests that deleting a profile properly clears the app list view delegate, but -// doesn't destroy it. Not built on ChromeOS, since profiles can't be deleted -// this way (the second profile isn't signed in, so the test fails when creating -// UserCloudPolicyManagerChromeOS). -#if !defined(OS_CHROMEOS) -IN_PROC_BROWSER_TEST_F(AppListServiceImplBrowserTest, - DeletingProfileUpdatesViewDelegate) { - Profile* second_profile = test::CreateSecondProfileAsync(); - service_->ShowForProfile(second_profile); - AppListViewDelegate* view_delegate = test_api_->view_delegate(); - - EXPECT_TRUE(view_delegate); - EXPECT_EQ(view_delegate->profile(), second_profile); - - ProfileManager* profile_manager = g_browser_process->profile_manager(); - - // Delete the profile being used by the app list. - profile_manager->ScheduleProfileForDeletion(second_profile->GetPath(), - ProfileManager::CreateCallback()); - - // View delegate doesn't change when changing profiles. - EXPECT_EQ(view_delegate, test_api_->view_delegate()); - - // But the profile gets cleared until shown again. - EXPECT_FALSE(view_delegate->profile()); - service_->ShowForProfile(browser()->profile()); - - EXPECT_EQ(view_delegate, test_api_->view_delegate()); - EXPECT_EQ(view_delegate->profile(), browser()->profile()); -} -#endif // !defined(OS_CHROMEOS) - // Test that all the items in the context menu for a hosted app have valid // labels. IN_PROC_BROWSER_TEST_F(AppListServiceImplBrowserTest, ShowContextMenu) {
diff --git a/chrome/browser/ui/app_list/app_list_service_views.cc b/chrome/browser/ui/app_list/app_list_service_views.cc deleted file mode 100644 index 2362a1e..0000000 --- a/chrome/browser/ui/app_list/app_list_service_views.cc +++ /dev/null
@@ -1,132 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_service_views.h" - -#include <utility> - -#include "chrome/browser/lifetime/keep_alive_types.h" -#include "chrome/browser/lifetime/scoped_keep_alive.h" -#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" -#include "ui/app_list/app_list_switches.h" -#include "ui/app_list/views/app_list_main_view.h" -#include "ui/app_list/views/app_list_view.h" -#include "ui/app_list/views/contents_view.h" - -AppListServiceViews::AppListServiceViews( - std::unique_ptr<AppListControllerDelegate> controller_delegate) - : shower_(this), - can_dismiss_(true), - controller_delegate_(std::move(controller_delegate)) {} - -AppListServiceViews::~AppListServiceViews() {} - -void AppListServiceViews::OnViewBeingDestroyed() { - can_dismiss_ = true; - shower_.HandleViewBeingDestroyed(); -} - -void AppListServiceViews::Init(Profile* initial_profile) { - PerformStartupChecks(initial_profile); -} - -void AppListServiceViews::ShowForProfile(Profile* requested_profile) { - // App list profiles should not be off-the-record. - DCHECK(!requested_profile->IsOffTheRecord()); - DCHECK(!requested_profile->IsGuestSession()); - - ShowForProfileInternal(requested_profile, - app_list::AppListModel::INVALID_STATE); -} - -void AppListServiceViews::ShowForAppInstall(Profile* profile, - const std::string& extension_id, - bool start_discovery_tracking) { - ShowForProfileInternal(profile, app_list::AppListModel::STATE_APPS); - AppListServiceImpl::ShowForAppInstall(profile, extension_id, - start_discovery_tracking); -} - -void AppListServiceViews::ShowForCustomLauncherPage(Profile* profile) { - ShowForProfileInternal(profile, - app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); -} - -void AppListServiceViews::HideCustomLauncherPage() { - if (!shower_.IsAppListVisible()) - return; - - app_list::ContentsView* contents_view = - shower_.app_list()->app_list_main_view()->contents_view(); - - if (contents_view->IsStateActive( - app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) { - contents_view->SetActiveState(app_list::AppListModel::STATE_START, true); - } -} - -void AppListServiceViews::DismissAppList() { - if (!can_dismiss_) - return; - - shower_.DismissAppList(); -} - -bool AppListServiceViews::IsAppListVisible() const { - return shower_.IsAppListVisible(); -} - -gfx::NativeWindow AppListServiceViews::GetAppListWindow() { - return shower_.GetWindow(); -} - -Profile* AppListServiceViews::GetCurrentAppListProfile() { - return shower_.profile(); -} - -AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() { - return controller_delegate_.get(); -} - -void AppListServiceViews::CreateForProfile(Profile* requested_profile) { - DCHECK(requested_profile); - InvalidatePendingProfileLoads(); - shower_.CreateViewForProfile(requested_profile); - SetProfilePath(shower_.profile()->GetPath()); -} - -void AppListServiceViews::DestroyAppList() { - if (!shower_.HasView()) - return; - - // Use CloseNow(). This can't be asynchronous because the profile will be - // deleted once this function returns. - shower_.app_list()->GetWidget()->CloseNow(); - DCHECK(!shower_.HasView()); -} - -AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() { - return GetViewDelegate(shower_.profile()); -} - -void AppListServiceViews::ShowForProfileInternal( - Profile* profile, - app_list::AppListModel::State state) { - DCHECK(profile); - - ScopedKeepAlive keep_alive(KeepAliveOrigin::APP_LIST_SERVICE_VIEWS, - KeepAliveRestartOption::DISABLED); - - CreateForProfile(profile); - - if (state != app_list::AppListModel::INVALID_STATE) { - app_list::ContentsView* contents_view = - shower_.app_list()->app_list_main_view()->contents_view(); - contents_view->SetActiveState(state, - shower_.IsAppListVisible() /* animate */); - } - - shower_.ShowForCurrentProfile(); - RecordAppListLaunch(); -}
diff --git a/chrome/browser/ui/app_list/app_list_service_views.h b/chrome/browser/ui/app_list/app_list_service_views.h deleted file mode 100644 index dfe2af1..0000000 --- a/chrome/browser/ui/app_list/app_list_service_views.h +++ /dev/null
@@ -1,72 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ -#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_ - -#include <memory> - -#include "base/macros.h" -#include "chrome/browser/ui/app_list/app_list_service_impl.h" -#include "chrome/browser/ui/app_list/app_list_shower_delegate.h" -#include "chrome/browser/ui/app_list/app_list_shower_views.h" -#include "ui/app_list/app_list_model.h" - -class AppListControllerDelegate; - -// AppListServiceViews manages a desktop app list that uses toolkit-views. -class AppListServiceViews : public AppListServiceImpl, - public AppListShowerDelegate { - public: - explicit AppListServiceViews( - std::unique_ptr<AppListControllerDelegate> controller_delegate); - ~AppListServiceViews() override; - - // Set |can_dismiss| to prevent the app list dismissing when losing focus. For - // example, while showing a window-modal dialog. - void set_can_dismiss(bool can_dismiss) { can_dismiss_ = can_dismiss; } - - AppListShower& shower() { return shower_; } - - // Called by the AppListControllerDelegate when it is told that the app list - // view must be destroyed. - virtual void OnViewBeingDestroyed(); - - // AppListService overrides: - void Init(Profile* initial_profile) override; - void ShowForProfile(Profile* requested_profile) override; - void ShowForAppInstall(Profile* profile, - const std::string& extension_id, - bool start_discovery_tracking) override; - void ShowForCustomLauncherPage(Profile* profile) override; - void HideCustomLauncherPage() override; - void DismissAppList() override; - bool IsAppListVisible() const override; - gfx::NativeWindow GetAppListWindow() override; - Profile* GetCurrentAppListProfile() override; - AppListControllerDelegate* GetControllerDelegate() override; - - // AppListServiceImpl overrides: - void CreateForProfile(Profile* requested_profile) override; - void DestroyAppList() override; - - // AppListShowerDelegate overrides: - AppListViewDelegate* GetViewDelegateForCreate() override; - - private: - // Switches to |state|, unless it is |INVALID_STATE| (in which case, opens on - // the default state). - void ShowForProfileInternal(Profile* profile, - app_list::AppListModel::State state); - - // Responsible for creating the app list and responding to profile changes. - AppListShower shower_; - - bool can_dismiss_; - std::unique_ptr<AppListControllerDelegate> controller_delegate_; - - DISALLOW_COPY_AND_ASSIGN(AppListServiceViews); -}; - -#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SERVICE_VIEWS_H_
diff --git a/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc b/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc deleted file mode 100644 index 7c43b1d..0000000 --- a/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc +++ /dev/null
@@ -1,270 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_service_views.h" - -#include "base/macros.h" -#include "base/path_service.h" -#include "base/run_loop.h" -#include "build/build_config.h" -#include "chrome/browser/chrome_notification_types.h" -#include "chrome/browser/extensions/extension_browsertest.h" -#include "chrome/browser/lifetime/keep_alive_registry.h" -#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" -#include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_commands.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/test/base/in_process_browser_test.h" -#include "content/public/browser/notification_service.h" -#include "content/public/test/test_utils.h" -#include "ui/app_list/app_list_switches.h" -#include "ui/app_list/views/app_list_main_view.h" -#include "ui/app_list/views/app_list_view.h" -#include "ui/app_list/views/contents_view.h" -#include "ui/app_list/views/test/app_list_view_test_api.h" -#include "ui/events/test/event_generator.h" -#include "ui/views/widget/widget.h" - -#if defined(OS_CHROMEOS) -#include "ash/shell.h" -#include "chrome/browser/chromeos/arc/arc_session_manager.h" -#include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" -#include "chromeos/chromeos_switches.h" -#endif - -namespace { - -app_list::AppListView* GetAppListView(AppListService* service) { -#if defined(OS_CHROMEOS) - return AppListServiceAshTestApi().GetAppListView(); -#else - return static_cast<AppListServiceViews*>(service)->shower().app_list(); -#endif -} - -} // namespace - -// Browser Test for AppListService on Views platforms. -typedef InProcessBrowserTest AppListServiceViewsBrowserTest; - -// Test closing the native app list window as if via a request from the OS. -IN_PROC_BROWSER_TEST_F(AppListServiceViewsBrowserTest, NativeClose) { - AppListService* service = AppListService::Get(); - EXPECT_FALSE(service->GetAppListWindow()); - - // Since the profile is loaded, this will create a view immediately. This is - // important, because anything asynchronous would need an interactive_uitest - // due to the possibility of the app list being dismissed, and - // AppListService::GetAppListWindow returning NULL. - service->ShowForProfile(browser()->profile()); - gfx::NativeWindow window = service->GetAppListWindow(); - EXPECT_TRUE(window); - - views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); - EXPECT_TRUE(widget); - widget->Close(); - - // Close is asynchronous (dismiss is not) so sink the message queue. - base::RunLoop().RunUntilIdle(); - EXPECT_FALSE(service->GetAppListWindow()); - - // Show again to get some code coverage for possibly stale pointers. - service->ShowForProfile(browser()->profile()); - EXPECT_TRUE(service->GetAppListWindow()); - service->DismissAppList(); // Note: in Ash, this will invalidate the window. - - // Note: no need to sink message queue. - EXPECT_FALSE(service->GetAppListWindow()); -} - -// Dismiss the app list via an accelerator when it is the only thing keeping -// Chrome alive and expect everything to clean up properly. This is a regression -// test for http://crbug.com/395937. -// Flaky on Linux. https://crbug.com/477697 -#if defined(OS_LINUX) -#define MAYBE_AcceleratorClose DISABLED_AcceleratorClose -#else -#define MAYBE_AcceleratorClose AcceleratorClose -#endif -IN_PROC_BROWSER_TEST_F(AppListServiceViewsBrowserTest, MAYBE_AcceleratorClose) { - AppListService* service = AppListService::Get(); - service->ShowForProfile(browser()->profile()); - EXPECT_TRUE(service->GetAppListWindow()); - - content::WindowedNotificationObserver close_observer( - chrome::NOTIFICATION_BROWSER_CLOSED, content::Source<Browser>(browser())); - chrome::CloseWindow(browser()); - close_observer.Wait(); - - ui::test::EventGenerator generator(service->GetAppListWindow()); - generator.PressKey(ui::VKEY_ESCAPE, 0); - -#if !defined(OS_CHROMEOS) - EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsKeepingAlive()); -#endif - - base::RunLoop().RunUntilIdle(); - -#if !defined(OS_CHROMEOS) - EXPECT_FALSE(KeepAliveRegistry::GetInstance()->IsKeepingAlive()); -#endif - EXPECT_FALSE(service->GetAppListWindow()); -} - -// Tests for opening the app info dialog from the app list. -class AppListControllerAppInfoDialogBrowserTest : - public ExtensionBrowserTest, - public testing::WithParamInterface<bool> { - public: - AppListControllerAppInfoDialogBrowserTest() {} - ~AppListControllerAppInfoDialogBrowserTest() override {} - - protected: - // content::BrowserTestBase: - void SetUpCommandLine(base::CommandLine* command_line) override { - ExtensionBrowserTest::SetUpCommandLine(command_line); -#if defined(OS_CHROMEOS) - if (GetParam()) - command_line->AppendSwitch(chromeos::switches::kEnableArc); -#endif - } - - void SetUpInProcessBrowserTestFixture() override { - ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); -#if defined(OS_CHROMEOS) - arc::ArcSessionManager::DisableUIForTesting(); -#endif - } - - void SetUpOnMainThread() override { -#if defined(OS_CHROMEOS) - if (GetParam()) - arc::ArcSessionManager::Get()->EnableArc(); -#endif - ExtensionBrowserTest::SetUpOnMainThread(); - - // Install a test extension. - base::FilePath test_extension_path; - EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); - test_extension_path = test_extension_path.AppendASCII("extensions") - .AppendASCII("platform_apps") - .AppendASCII("minimal"); - extension_ = InstallExtension( - test_extension_path, 1 /* expected_change: new install */); - EXPECT_TRUE(extension_); - - // Open the app list. - service_ = AppListService::Get(); - EXPECT_FALSE(service_->GetAppListWindow()); - service_->ShowForProfile(browser()->profile()); - app_list_view_ = GetAppListView(service_); - EXPECT_TRUE(app_list_view_); - native_view_ = app_list_view_->GetWidget()->GetNativeView(); - EXPECT_TRUE(native_view_); - } - - // Opens app info for default test extension. - void OpenAppInfoDialog() { - OpenAppInfoDialog(extension_->id()); - } - - void OpenAppInfoDialog(const std::string& app_id) { - AppListControllerDelegate* controller = service_->GetControllerDelegate(); - EXPECT_TRUE(controller); - EXPECT_TRUE(controller->GetAppListWindow()); - controller->DoShowAppInfoFlow(browser()->profile(), app_id); - } - - AppListService* service_; - const extensions::Extension* extension_; - app_list::AppListView* app_list_view_; - gfx::NativeView native_view_; - - private: - DISALLOW_COPY_AND_ASSIGN(AppListControllerAppInfoDialogBrowserTest); -}; - -// Test the DoShowAppInfoFlow function of the controller delegate. -// flaky: http://crbug.com/378251 -IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, - DISABLED_DoShowAppInfoFlow) { - app_list::test::AppListViewTestApi test_api(app_list_view_); - - views::Widget::Widgets owned_widgets; - views::Widget::GetAllOwnedWidgets(native_view_, &owned_widgets); - EXPECT_EQ(0U, owned_widgets.size()); - EXPECT_FALSE(test_api.is_overlay_visible()); - - OpenAppInfoDialog(); - - owned_widgets.clear(); - views::Widget::GetAllOwnedWidgets(native_view_, &owned_widgets); - EXPECT_EQ(1U, owned_widgets.size()); - EXPECT_TRUE(test_api.is_overlay_visible()); - - // Close the app info dialog. - views::Widget* app_info_dialog = *owned_widgets.begin(); - app_info_dialog->CloseNow(); - - owned_widgets.clear(); - views::Widget::GetAllOwnedWidgets(native_view_, &owned_widgets); - EXPECT_EQ(0U, owned_widgets.size()); - EXPECT_FALSE(test_api.is_overlay_visible()); -} - -// Check that the app list can be closed with the app info dialog -// open without crashing. This is a regression test for http://crbug.com/443066. -IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, - CanCloseAppListWithAppInfoOpen) { - OpenAppInfoDialog(); - - // Close the app list window. - app_list_view_->GetWidget()->CloseNow(); - EXPECT_FALSE(GetAppListView(service_)); -} - -// Check that the app info can be safely opened for Chrome. -IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, - OpenAppInfoForChrome) { - OpenAppInfoDialog(extension_misc::kChromeAppId); -} - -#if defined(OS_CHROMEOS) -INSTANTIATE_TEST_CASE_P(AppListControllerAppInfoDialogBrowserTestInstance, - AppListControllerAppInfoDialogBrowserTest, - testing::Bool()); -#else -INSTANTIATE_TEST_CASE_P(AppListControllerAppInfoDialogBrowserTestInstance, - AppListControllerAppInfoDialogBrowserTest, - testing::Values(false)); -#endif - -using AppListServiceViewsExtensionBrowserTest = ExtensionBrowserTest; - -IN_PROC_BROWSER_TEST_F(AppListServiceViewsExtensionBrowserTest, - ShowForAppInstall) { - // Install an extension to open the dialog for. - base::FilePath test_extension_path; - ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); - test_extension_path = test_extension_path.AppendASCII("extensions") - .AppendASCII("platform_apps") - .AppendASCII("minimal"); - const extensions::Extension* extension = InstallExtension( - test_extension_path, 1 /* expected_change: new install */); - ASSERT_TRUE(extension); - - // Open the app list window for the app. - AppListService* service = AppListService::Get(); - EXPECT_FALSE(service->GetAppListWindow()); - - service->ShowForAppInstall(browser()->profile(), extension->id(), false); - app_list::AppListView* app_list_view = GetAppListView(service); - ASSERT_TRUE(app_list_view); - - app_list::ContentsView* contents_view = - app_list_view->app_list_main_view()->contents_view(); - - EXPECT_TRUE(contents_view->IsStateActive(app_list::AppListModel::STATE_APPS)); -}
diff --git a/chrome/browser/ui/app_list/app_list_shower_views.cc b/chrome/browser/ui/app_list/app_list_shower_views.cc deleted file mode 100644 index 8f4ee0a..0000000 --- a/chrome/browser/ui/app_list/app_list_shower_views.cc +++ /dev/null
@@ -1,154 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/app_list_shower_views.h" - -#include "base/bind.h" -#include "base/location.h" -#include "base/profiler/scoped_tracker.h" -#include "base/single_thread_task_runner.h" -#include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/lifetime/keep_alive_types.h" -#include "chrome/browser/lifetime/scoped_keep_alive.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/app_list/app_list_shower_delegate.h" -#include "chrome/browser/ui/app_list/app_list_view_delegate.h" -#include "ui/app_list/views/app_list_view.h" -#include "ui/display/screen.h" -#include "ui/gfx/geometry/point.h" - -AppListShower::AppListShower(AppListShowerDelegate* delegate) - : delegate_(delegate), - profile_(NULL), - app_list_(NULL), - window_icon_updated_(false) { -} - -AppListShower::~AppListShower() { -} - -void AppListShower::ShowForCurrentProfile() { - DCHECK(HasView()); - keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::APP_LIST_SHOWER, - KeepAliveRestartOption::DISABLED)); - - // If the app list is already displaying |profile| just activate it (in case - // we have lost focus). - if (!IsAppListVisible()) - delegate_->MoveNearCursor(app_list_); - - Show(); -} - -gfx::NativeWindow AppListShower::GetWindow() { - if (!IsAppListVisible()) - return NULL; - return app_list_->GetWidget()->GetNativeWindow(); -} - -void AppListShower::CreateViewForProfile(Profile* requested_profile) { - DCHECK(requested_profile); - if (HasView() && requested_profile->IsSameProfile(profile_)) - return; - - profile_ = requested_profile->GetOriginalProfile(); - if (HasView()) { - UpdateViewForNewProfile(); - return; - } - app_list_ = MakeViewForCurrentProfile(); - - // TODO(tapted): Remove ScopedTracker below once crbug.com/431326 is fixed. - tracked_objects::ScopedTracker tracking_profile( - FROM_HERE_WITH_EXPLICIT_FUNCTION( - "431326 AppListShowerDelegate::OnViewCreated()")); - - delegate_->OnViewCreated(); -} - -void AppListShower::DismissAppList() { - if (HasView()) { - Hide(); - delegate_->OnViewDismissed(); - // This can be reached by pressing the dismiss accelerator. To prevent - // events from being processed with a destroyed dispatcher, delay the reset - // of the keep alive. - ResetKeepAliveSoon(); - } -} - -void AppListShower::HandleViewBeingDestroyed() { - app_list_ = NULL; - profile_ = NULL; - - // We may end up here as the result of the OS deleting the AppList's - // widget (WidgetObserver::OnWidgetDestroyed). If this happens and there - // are no browsers around then deleting the keep alive will result in - // deleting the Widget again (by way of CloseAllSecondaryWidgets). When - // the stack unravels we end up back in the Widget that was deleted and - // crash. By delaying deletion of the keep alive we ensure the Widget has - // correctly been destroyed before ending the keep alive so that - // CloseAllSecondaryWidgets() won't attempt to delete the AppList's Widget - // again. - ResetKeepAliveSoon(); -} - -bool AppListShower::IsAppListVisible() const { - return app_list_ && app_list_->GetWidget()->IsVisible(); -} - -bool AppListShower::HasView() const { - return !!app_list_; -} - -app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { - app_list::AppListView* view; - { - // TODO(tapted): Remove ScopedTracker below once crbug.com/431326 is fixed. - tracked_objects::ScopedTracker tracking_profile1( - FROM_HERE_WITH_EXPLICIT_FUNCTION("431326 AppListView()")); - - // The app list view manages its own lifetime. - view = new app_list::AppListView(delegate_->GetViewDelegateForCreate()); - } - - gfx::Point cursor = display::Screen::GetScreen()->GetCursorScreenPoint(); - view->InitAsBubbleAtFixedLocation(NULL, - 0, - cursor, - views::BubbleBorder::FLOAT, - false /* border_accepts_events */); - return view; -} - -void AppListShower::UpdateViewForNewProfile() { - app_list_->SetProfileByPath(profile_->GetPath()); -} - -void AppListShower::Show() { - app_list_->GetWidget()->Show(); - if (!window_icon_updated_) { - app_list_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon(); - window_icon_updated_ = true; - } - app_list_->GetWidget()->Activate(); -} - -void AppListShower::Hide() { - app_list_->GetWidget()->Hide(); -} - -void AppListShower::ResetKeepAliveSoon() { - if (base::ThreadTaskRunnerHandle::IsSet()) { // Not set in tests. - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&AppListShower::ResetKeepAlive, base::Unretained(this))); - return; - } - ResetKeepAlive(); -} - -void AppListShower::ResetKeepAlive() { - keep_alive_.reset(); -}
diff --git a/chrome/browser/ui/app_list/app_list_shower_views.h b/chrome/browser/ui/app_list/app_list_shower_views.h deleted file mode 100644 index 013b617..0000000 --- a/chrome/browser/ui/app_list/app_list_shower_views.h +++ /dev/null
@@ -1,75 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_ -#define CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_ - -#include <memory> - -#include "base/macros.h" -#include "ui/gfx/native_widget_types.h" - -namespace app_list { -class AppListView; -} - -class AppListShowerDelegate; -class AppListShowerUnitTest; -class Profile; -class ScopedKeepAlive; - -// Creates and shows an AppList as needed for non-Ash desktops. It is owned by -// AppListServiceViews. -class AppListShower { - public: - explicit AppListShower(AppListShowerDelegate* delegate); - virtual ~AppListShower(); - - void ShowForCurrentProfile(); - gfx::NativeWindow GetWindow(); - - app_list::AppListView* app_list() { return app_list_; } - Profile* profile() const { return profile_; } - - // Create or recreate, and initialize |app_list_| from |requested_profile|. - void CreateViewForProfile(Profile* requested_profile); - - void DismissAppList(); - - // Virtual functions mocked out in tests. - virtual void HandleViewBeingDestroyed(); - virtual bool IsAppListVisible() const; - virtual bool HasView() const; - - protected: - virtual app_list::AppListView* MakeViewForCurrentProfile(); - virtual void UpdateViewForNewProfile(); - - // Shows the app list, activates it, and ensures the taskbar icon is updated. - virtual void Show(); - virtual void Hide(); - - private: - friend class ::AppListShowerUnitTest; - - void ResetKeepAliveSoon(); - void ResetKeepAlive(); - - AppListShowerDelegate* delegate_; // Weak. Owns this. - - // The profile currently shown by |app_list_|. - Profile* profile_; - - // The view, once created. Owned by native widget. - app_list::AppListView* app_list_; - - // Used to keep the browser process alive while the app list is visible. - std::unique_ptr<ScopedKeepAlive> keep_alive_; - - bool window_icon_updated_; - - DISALLOW_COPY_AND_ASSIGN(AppListShower); -}; - -#endif // CHROME_BROWSER_UI_APP_LIST_APP_LIST_SHOWER_VIEWS_H_
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc index d672c13..34d171f 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -679,6 +679,7 @@ void ArcAppListPrefs::OnInstanceClosed() { DisableAllApps(); + installing_packages_count_ = 0; binding_.Close(); if (sync_service_) { @@ -1119,24 +1120,33 @@ AppListService* service = AppListService::Get(); CHECK(service); service->ShowForAppInstall(profile_, app_id, false); + last_shown_batch_installation_revision_ = + current_batch_installation_revision_; break; } } +bool ArcAppListPrefs::IsUnknownPackage(const std::string& package_name) const { + return !GetPackage(package_name) && + !sync_service_->IsPackageSyncing(package_name); +} + void ArcAppListPrefs::OnPackageAdded( arc::mojom::ArcPackageInfoPtr package_info) { DCHECK(IsArcEnabled()); // Ignore packages installed by internal sync. DCHECK(sync_service_); - const bool new_package_in_system = !GetPackage(package_info->package_name) && - !sync_service_->IsPackageSyncing(package_info->package_name); + const bool unknown_package = IsUnknownPackage(package_info->package_name); AddOrUpdatePackagePrefs(prefs_, *package_info); for (auto& observer : observer_list_) observer.OnPackageInstalled(*package_info); - if (new_package_in_system) + if (unknown_package && + current_batch_installation_revision_ != + last_shown_batch_installation_revision_) { MaybeShowPackageInAppLauncher(*package_info); + } } void ArcAppListPrefs::OnPackageModified( @@ -1244,6 +1254,21 @@ observer.OnAppIconUpdated(app_id, scale_factor); } +void ArcAppListPrefs::OnInstallationStarted() { + // Start new batch installation group if this is first installation. + if (!installing_packages_count_) + ++current_batch_installation_revision_; + ++installing_packages_count_; +} + +void ArcAppListPrefs::OnInstallationFinished() { + if (!installing_packages_count_) { + VLOG(2) << "Received unexpected installation finished event"; + return; + } + --installing_packages_count_; +} + ArcAppListPrefs::AppInfo::AppInfo(const std::string& name, const std::string& package_name, const std::string& activity,
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h index ae51dede..4d48e18 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h
@@ -289,6 +289,9 @@ int32_t task_id, const arc::mojom::OrientationLock orientation_lock) override; + void OnInstallationStarted() override; + void OnInstallationFinished() override; + void StartPrefs(); void UpdateDefaultAppsHiddenState(); @@ -349,6 +352,10 @@ void MaybeShowPackageInAppLauncher( const arc::mojom::ArcPackageInfo& package_info); + // Returns true is specified package is new in the system, was not installed + // and it is not scheduled to install by sync. + bool IsUnknownPackage(const std::string& package_name) const; + Profile* const profile_; // Owned by the BrowserContext. @@ -365,6 +372,8 @@ std::unordered_set<std::string> ready_apps_; // Contains set of ARC apps that are currently tracked. std::unordered_set<std::string> tracked_apps_; + // Contains number of ARC packages that are currently installing. + int installing_packages_count_ = 0; // Keeps deferred icon load requests. Each app may contain several requests // for different scale factor. Scale factor is defined by specific bit // position. @@ -383,6 +392,8 @@ bool default_apps_ready_ = false; ArcDefaultAppList default_apps_; base::Closure default_apps_ready_callback_; + int last_shown_batch_installation_revision_ = -1; + int current_batch_installation_revision_ = 0; base::WeakPtrFactory<ArcAppListPrefs> weak_ptr_factory_;
diff --git a/chrome/browser/ui/app_list/fast_show_pickler.cc b/chrome/browser/ui/app_list/fast_show_pickler.cc deleted file mode 100644 index 5aa2b475..0000000 --- a/chrome/browser/ui/app_list/fast_show_pickler.cc +++ /dev/null
@@ -1,244 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/fast_show_pickler.h" - -#include <stddef.h> -#include <utility> - -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/app_list/app_list_item.h" -#include "ui/gfx/image/image_skia_rep.h" - -namespace { - -using app_list::AppListItem; -using app_list::AppListModel; - -// These have the same meaning as SkBitmap::Config. Reproduced here to insure -// against their value changing in Skia. If the order of these changes kVersion -// should be incremented. -enum ImageFormat { - NONE, - A8, - INDEX_8, - RGB_565, - ARGB_4444, - ARGB_8888, -}; - -bool FormatToColorType(ImageFormat format, SkColorType* out) { - switch (format) { - case NONE: - *out = kUnknown_SkColorType; - break; - case A8: - *out = kAlpha_8_SkColorType; - break; - case INDEX_8: - *out = kIndex_8_SkColorType; - break; - case RGB_565: - *out = kRGB_565_SkColorType; - break; - case ARGB_4444: - *out = kARGB_4444_SkColorType; - break; - case ARGB_8888: - *out = kN32_SkColorType; - break; - default: return false; - } - return true; -} - -bool ColorTypeToFormat(SkColorType colorType, ImageFormat* out) { - switch (colorType) { - case kUnknown_SkColorType: - *out = NONE; - break; - case kAlpha_8_SkColorType: - *out = A8; - break; - case kIndex_8_SkColorType: - *out = INDEX_8; - break; - case kRGB_565_SkColorType: - *out = RGB_565; - break; - case kARGB_4444_SkColorType: - *out = ARGB_4444; - break; - case kN32_SkColorType: - *out = ARGB_8888; - break; - default: return false; - } - return true; -} - -bool PickleImage(base::Pickle* pickle, const gfx::ImageSkia& image) { - std::vector<gfx::ImageSkiaRep> reps(image.image_reps()); - pickle->WriteInt(static_cast<int>(reps.size())); - for (std::vector<gfx::ImageSkiaRep>::const_iterator it = reps.begin(); - it != reps.end(); ++it) { - pickle->WriteFloat(it->scale()); - pickle->WriteInt(it->pixel_width()); - pickle->WriteInt(it->pixel_height()); - ImageFormat format = NONE; - if (!ColorTypeToFormat(it->sk_bitmap().colorType(), &format)) - return false; - pickle->WriteInt(static_cast<int>(format)); - int size = static_cast<int>(it->sk_bitmap().getSafeSize()); - pickle->WriteInt(size); - SkBitmap bitmap = it->sk_bitmap(); - SkAutoLockPixels lock(bitmap); - pickle->WriteBytes(bitmap.getPixels(), size); - } - return true; -} - -bool UnpickleImage(base::PickleIterator* it, gfx::ImageSkia* out) { - int rep_count = 0; - if (!it->ReadInt(&rep_count)) - return false; - - gfx::ImageSkia result; - for (int i = 0; i < rep_count; ++i) { - float scale = 0.0f; - if (!it->ReadFloat(&scale)) - return false; - - int width = 0; - if (!it->ReadInt(&width)) - return false; - - int height = 0; - if (!it->ReadInt(&height)) - return false; - - int format_int = 0; - if (!it->ReadInt(&format_int)) - return false; - ImageFormat format = static_cast<ImageFormat>(format_int); - SkColorType color_type = kUnknown_SkColorType; - if (!FormatToColorType(format, &color_type)) - return false; - - int size = 0; - if (!it->ReadInt(&size)) - return false; - - const char* pixels = NULL; - if (!it->ReadBytes(&pixels, size)) - return false; - - SkBitmap bitmap; - if (!bitmap.tryAllocPixels(SkImageInfo::Make( - width, height, color_type, kPremul_SkAlphaType))) - return false; - - memcpy(bitmap.getPixels(), pixels, bitmap.getSize()); - result.AddRepresentation(gfx::ImageSkiaRep(bitmap, scale)); - } - - *out = result; - return true; -} - -} // namespace - -std::unique_ptr<AppListItem> FastShowPickler::UnpickleAppListItem( - base::PickleIterator* it) { - std::string id; - if (!it->ReadString(&id)) - return std::unique_ptr<AppListItem>(); - std::unique_ptr<AppListItem> result(new AppListItem(id)); - std::string name; - if (!it->ReadString(&name)) - return std::unique_ptr<AppListItem>(); - std::string short_name; - if (!it->ReadString(&short_name)) - return std::unique_ptr<AppListItem>(); - result->SetNameAndShortName(name, short_name); - gfx::ImageSkia icon; - if (!UnpickleImage(it, &icon)) - return std::unique_ptr<AppListItem>(); - result->SetIcon(icon); - return result; -} - -bool FastShowPickler::PickleAppListItem(base::Pickle* pickle, - AppListItem* item) { - if (!pickle->WriteString(item->id())) - return false; - if (!pickle->WriteString(item->name())) - return false; - if (!pickle->WriteString(item->short_name())) - return false; - if (!PickleImage(pickle, item->icon())) - return false; - return true; -} - -void FastShowPickler::CopyOverItem(AppListItem* src_item, - AppListItem* dest_item) { - dest_item->SetNameAndShortName(src_item->name(), src_item->short_name()); - dest_item->SetIcon(src_item->icon()); - // Do not set folder_id, pass that to AppListModel::AddItemToFolder() instead. -} - -// The version of the pickle format defined here. This needs to be incremented -// whenever this format is changed so new clients can invalidate old versions. -const int FastShowPickler::kVersion = 4; - -std::unique_ptr<base::Pickle> FastShowPickler::PickleAppListModelForFastShow( - AppListModel* model) { - std::unique_ptr<base::Pickle> result(new base::Pickle); - if (!result->WriteInt(kVersion)) - return std::unique_ptr<base::Pickle>(); - if (!result->WriteInt((int)model->top_level_item_list()->item_count())) - return std::unique_ptr<base::Pickle>(); - for (size_t i = 0; i < model->top_level_item_list()->item_count(); ++i) { - if (!PickleAppListItem(result.get(), - model->top_level_item_list()->item_at(i))) { - return std::unique_ptr<base::Pickle>(); - } - } - return result; -} - -void FastShowPickler::CopyOver(AppListModel* src, AppListModel* dest) { - DCHECK_EQ(0u, dest->top_level_item_list()->item_count()); - for (size_t i = 0; i < src->top_level_item_list()->item_count(); i++) { - AppListItem* src_item = src->top_level_item_list()->item_at(i); - std::unique_ptr<AppListItem> dest_item(new AppListItem(src_item->id())); - CopyOverItem(src_item, dest_item.get()); - dest->AddItemToFolder(std::move(dest_item), src_item->folder_id()); - } -} - -std::unique_ptr<AppListModel> FastShowPickler::UnpickleAppListModelForFastShow( - base::Pickle* pickle) { - base::PickleIterator it(*pickle); - int read_version = 0; - if (!it.ReadInt(&read_version)) - return std::unique_ptr<AppListModel>(); - if (read_version != kVersion) - return std::unique_ptr<AppListModel>(); - int app_count = 0; - if (!it.ReadInt(&app_count)) - return std::unique_ptr<AppListModel>(); - - std::unique_ptr<AppListModel> model(new AppListModel); - for (int i = 0; i < app_count; ++i) { - std::unique_ptr<AppListItem> item(UnpickleAppListItem(&it)); - if (!item) - return std::unique_ptr<AppListModel>(); - std::string folder_id = item->folder_id(); - model->AddItemToFolder(std::move(item), folder_id); - } - - return model; -}
diff --git a/chrome/browser/ui/app_list/fast_show_pickler.h b/chrome/browser/ui/app_list/fast_show_pickler.h deleted file mode 100644 index 64a15a94..0000000 --- a/chrome/browser/ui/app_list/fast_show_pickler.h +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_APP_LIST_FAST_SHOW_PICKLER_H_ -#define CHROME_BROWSER_UI_APP_LIST_FAST_SHOW_PICKLER_H_ - -#include <memory> -#include <string> - -#include "base/pickle.h" -#include "ui/app_list/app_list_model.h" - -// Functions for pickling/unpickling AppListModel for fast show. Fast show is -// where the app list is put on the screen using data retrieved from a cache -// before the extension system has loaded. -class FastShowPickler { - public: - // The version that this pickler understands. - static const int kVersion; - - // Pickles a subset of the data in |model| that is useful for doing a fast - // show of the app list. - static std::unique_ptr<base::Pickle> PickleAppListModelForFastShow( - app_list::AppListModel* model); - - // Given a Pickle created by PickleAppListModelForFastShow(), this creates an - // AppListModel that represents it. - static std::unique_ptr<app_list::AppListModel> - UnpickleAppListModelForFastShow(base::Pickle* pickle); - - // Copies parts that are needed to show the app list quickly on startup from - // |src| to |dest|. - static void CopyOver( - app_list::AppListModel* src, app_list::AppListModel* dest); - - private: - // Private static methods allow friend access to AppListItem methods. - static std::unique_ptr<app_list::AppListItem> UnpickleAppListItem( - base::PickleIterator* it); - static bool PickleAppListItem(base::Pickle* pickle, - app_list::AppListItem* item); - static void CopyOverItem(app_list::AppListItem* src_item, - app_list::AppListItem* dest_item); -}; - -#endif // CHROME_BROWSER_UI_APP_LIST_FAST_SHOW_PICKLER_H_
diff --git a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc b/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc deleted file mode 100644 index 159b5578..0000000 --- a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc +++ /dev/null
@@ -1,116 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/app_list/fast_show_pickler.h" - -#include <stddef.h> - -#include "base/memory/ptr_util.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "third_party/skia/include/core/SkColorPriv.h" -#include "ui/app_list/app_list_item.h" -#include "ui/app_list/app_list_model.h" -#include "ui/app_list/test/app_list_test_model.h" -#include "ui/gfx/image/image_skia.h" -#include "ui/gfx/skia_util.h" - -using app_list::AppListItem; -using app_list::AppListModel; - -class AppListModelPicklerUnitTest : public testing::Test { - protected: - void CheckIsSame(AppListModel* m1, AppListModel* m2) { - ASSERT_EQ(m1->top_level_item_list()->item_count(), - m2->top_level_item_list()->item_count()); - for (size_t i = 0; i < m1->top_level_item_list()->item_count(); i++) { - ASSERT_EQ(m1->top_level_item_list()->item_at(i)->id(), - m2->top_level_item_list()->item_at(i)->id()); - ASSERT_EQ(m1->top_level_item_list()->item_at(i)->name(), - m2->top_level_item_list()->item_at(i)->name()); - ASSERT_EQ(m1->top_level_item_list()->item_at(i)->short_name(), - m2->top_level_item_list()->item_at(i)->short_name()); - CompareImages(m1->top_level_item_list()->item_at(i)->icon(), - m2->top_level_item_list()->item_at(i)->icon()); - } - } - - void CompareImages(const gfx::ImageSkia& image1, - const gfx::ImageSkia& image2) { - std::vector<gfx::ImageSkiaRep> reps1(image1.image_reps()); - std::vector<gfx::ImageSkiaRep> reps2(image2.image_reps()); - ASSERT_EQ(reps1.size(), reps2.size()); - for (size_t i = 0; i < reps1.size(); ++i) { - ASSERT_TRUE( - gfx::BitmapsAreEqual(reps1[i].sk_bitmap(), reps2[i].sk_bitmap())); - ASSERT_EQ(reps1[i].scale(), reps2[i].scale()); - } - } - - std::unique_ptr<AppListModel> CopyViaPickle(AppListModel* model) { - std::unique_ptr<base::Pickle> pickle( - FastShowPickler::PickleAppListModelForFastShow(model)); - return FastShowPickler::UnpickleAppListModelForFastShow(pickle.get()); - } - - void DoConsistencyChecks(AppListModel* model) { - std::unique_ptr<AppListModel> model2(CopyViaPickle(model)); - AppListModel dest_model; - FastShowPickler::CopyOver(model2.get(), &dest_model); - - CheckIsSame(model, model2.get()); - CheckIsSame(model, &dest_model); - CheckIsSame(model2.get(), &dest_model); - } - - gfx::ImageSkia MakeImage() { - const int kWidth = 10; - const int kHeight = 10; - SkBitmap bitmap; - bitmap.allocN32Pixels(kWidth, kHeight); - bitmap.eraseARGB(255, 1, 2, 3); - return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); - } -}; - -TEST_F(AppListModelPicklerUnitTest, EmptyModel) { - AppListModel model; - DoConsistencyChecks(&model); -} - -TEST_F(AppListModelPicklerUnitTest, OneItem) { - AppListModel model; - model.AddItem(base::MakeUnique<AppListItem>("abc")); - DoConsistencyChecks(&model); -} - -TEST_F(AppListModelPicklerUnitTest, TwoItems) { - AppListModel model; - AppListItem* app1 = model.AddItem(base::MakeUnique<AppListItem>("abc")); - model.SetItemNameAndShortName(app1, "hello, there", "ht"); - AppListItem* app2 = model.AddItem(base::MakeUnique<AppListItem>("abc2")); - model.SetItemNameAndShortName(app2, "hello, there 2", "ht2"); - - DoConsistencyChecks(&model); -} - -TEST_F(AppListModelPicklerUnitTest, Images) { - AppListModel model; - AppListItem* app1 = model.AddItem(base::MakeUnique<AppListItem>("abc")); - model.SetItemName(app1, "hello, there"); - app1->SetIcon(MakeImage()); - AppListItem* app2 = model.AddItem(base::MakeUnique<AppListItem>("abc2")); - model.SetItemName(app2, "hello, there 2"); - - DoConsistencyChecks(&model); -} - -TEST_F(AppListModelPicklerUnitTest, EmptyImage) { - AppListModel model; - AppListItem* app1 = model.AddItem(base::MakeUnique<AppListItem>("abc")); - model.SetItemName(app1, "hello, there"); - app1->SetIcon(gfx::ImageSkia()); - - DoConsistencyChecks(&model); -}
diff --git a/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc b/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc index d9cf3d1..4fd6dc88 100644 --- a/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc
@@ -58,6 +58,8 @@ constexpr char kTestShortcutName[] = "Test Shortcut"; constexpr char kTestShortcutName2[] = "Test Shortcut 2"; constexpr char kTestAppPackage[] = "test.arc.app.package"; +constexpr char kTestAppPackage2[] = "test.arc.app.package2"; +constexpr char kTestAppPackage3[] = "test.arc.app.package3"; constexpr char kTestAppActivity[] = "test.arc.app.package.activity"; constexpr char kTestAppActivity2[] = "test.arc.gitapp.package.activity2"; constexpr char kTestShelfGroup[] = "shelf_group"; @@ -65,20 +67,22 @@ constexpr char kTestShelfGroup3[] = "shelf_group_3"; constexpr int kAppAnimatedThresholdMs = 100; -std::string GetTestApp1Id() { - return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity); +std::string GetTestApp1Id(const std::string& package_name) { + return ArcAppListPrefs::GetAppId(package_name, kTestAppActivity); } -std::string GetTestApp2Id() { - return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity2); +std::string GetTestApp2Id(const std::string& package_name) { + return ArcAppListPrefs::GetAppId(package_name, kTestAppActivity2); } -std::vector<arc::mojom::AppInfoPtr> GetTestAppsList(bool multi_app) { +std::vector<arc::mojom::AppInfoPtr> GetTestAppsList( + const std::string& package_name, + bool multi_app) { std::vector<arc::mojom::AppInfoPtr> apps; arc::mojom::AppInfoPtr app(arc::mojom::AppInfo::New()); app->name = kTestAppName; - app->package_name = kTestAppPackage; + app->package_name = package_name; app->activity = kTestAppActivity; app->sticky = false; apps.push_back(std::move(app)); @@ -86,7 +90,7 @@ if (multi_app) { app = arc::mojom::AppInfo::New(); app->name = kTestAppName2; - app->package_name = kTestAppPackage; + app->package_name = package_name; app->activity = kTestAppActivity2; app->sticky = false; apps.push_back(std::move(app)); @@ -165,16 +169,16 @@ arc::ArcSessionManager::Get()->EnableArc(); } - void InstallTestApps(bool multi_app) { - app_host()->OnAppListRefreshed(GetTestAppsList(multi_app)); + void InstallTestApps(const std::string& package_name, bool multi_app) { + app_host()->OnAppListRefreshed(GetTestAppsList(package_name, multi_app)); std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - app_prefs()->GetApp(GetTestApp1Id()); + app_prefs()->GetApp(GetTestApp1Id(package_name)); ASSERT_TRUE(app_info); EXPECT_TRUE(app_info->ready); if (multi_app) { std::unique_ptr<ArcAppListPrefs::AppInfo> app_info2 = - app_prefs()->GetApp(GetTestApp2Id()); + app_prefs()->GetApp(GetTestApp2Id(package_name)); ASSERT_TRUE(app_info2); EXPECT_TRUE(app_info2->ready); } @@ -201,9 +205,9 @@ return shortcut_id; } - void SendPackageAdded(bool package_synced) { + void SendPackageAdded(const std::string& package_name, bool package_synced) { arc::mojom::ArcPackageInfo package_info; - package_info.package_name = kTestAppPackage; + package_info.package_name = package_name; package_info.package_version = 1; package_info.last_backup_android_id = 1; package_info.last_backup_time = 1; @@ -214,12 +218,24 @@ base::RunLoop().RunUntilIdle(); } - void SendPackageUpdated(bool multi_app) { - app_host()->OnPackageAppListRefreshed(kTestAppPackage, - GetTestAppsList(multi_app)); + void SendPackageUpdated(const std::string& package_name, bool multi_app) { + app_host()->OnPackageAppListRefreshed( + package_name, GetTestAppsList(package_name, multi_app)); } - void SendPackageRemoved() { app_host()->OnPackageRemoved(kTestAppPackage); } + void SendPackageRemoved(const std::string& package_name) { + app_host()->OnPackageRemoved(package_name); + } + + void SendInstallationStarted() { + app_host()->OnInstallationStarted(); + base::RunLoop().RunUntilIdle(); + } + + void SendInstallationFinished() { + app_host()->OnInstallationFinished(); + base::RunLoop().RunUntilIdle(); + } void StartInstance() { if (arc_session_manager()->profile() != profile()) @@ -280,10 +296,10 @@ IN_PROC_BROWSER_TEST_P(ArcAppDeferredLauncherBrowserTest, StartAppDeferred) { // Install app to remember existing apps. StartInstance(); - InstallTestApps(false); - SendPackageAdded(false); + InstallTestApps(kTestAppPackage, false); + SendPackageAdded(kTestAppPackage, false); - const std::string app_id = GetTestApp1Id(); + const std::string app_id = GetTestApp1Id(kTestAppPackage); if (is_pinned()) { shelf_delegate()->PinAppWithID(app_id); EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id)); @@ -316,8 +332,8 @@ case TEST_ACTION_START: // Now simulates that Arc is started and app list is refreshed. This // should stop animation and delete icon from the shelf. - InstallTestApps(false); - SendPackageAdded(false); + InstallTestApps(kTestAppPackage, false); + SendPackageAdded(kTestAppPackage, false); EXPECT_TRUE(chrome_controller() ->GetArcDeferredLauncher() ->GetActiveTime(app_id) @@ -361,11 +377,11 @@ // sycing is initialized. app_list::AppListSyncableServiceFactory::GetForProfile(profile())->GetModel(); - InstallTestApps(true); - SendPackageAdded(false); + InstallTestApps(kTestAppPackage, true); + SendPackageAdded(kTestAppPackage, false); - const std::string app_id1 = GetTestApp1Id(); - const std::string app_id2 = GetTestApp2Id(); + const std::string app_id1 = GetTestApp1Id(kTestAppPackage); + const std::string app_id2 = GetTestApp2Id(kTestAppPackage); shelf_delegate()->PinAppWithID(app_id1); shelf_delegate()->PinAppWithID(app_id2); const ash::ShelfID shelf_id1_before = @@ -374,19 +390,19 @@ EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id2)); // Package contains only one app. App list is not shown for updated package. - SendPackageUpdated(false); + SendPackageUpdated(kTestAppPackage, false); // Second pin should gone. EXPECT_EQ(shelf_id1_before, shelf_delegate()->GetShelfIDForAppID(app_id1)); EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id2)); // Package contains two apps. App list is not shown for updated package. - SendPackageUpdated(true); + SendPackageUpdated(kTestAppPackage, true); // Second pin should not appear. EXPECT_EQ(shelf_id1_before, shelf_delegate()->GetShelfIDForAppID(app_id1)); EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id2)); // Package removed. - SendPackageRemoved(); + SendPackageRemoved(kTestAppPackage); // No pin is expected. EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id1)); EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id2)); @@ -401,25 +417,44 @@ EXPECT_FALSE(app_list_service->IsAppListVisible()); + SendInstallationStarted(); + SendInstallationStarted(); + // New package is available. Show app list. - InstallTestApps(false); - SendPackageAdded(true); + SendInstallationFinished(); + InstallTestApps(kTestAppPackage, false); + SendPackageAdded(kTestAppPackage, true); EXPECT_TRUE(app_list_service->IsAppListVisible()); app_list_service->DismissAppList(); EXPECT_FALSE(app_list_service->IsAppListVisible()); // Send package update event. App list is not shown. - SendPackageAdded(true); + SendPackageAdded(kTestAppPackage, true); EXPECT_FALSE(app_list_service->IsAppListVisible()); + + // Install next package from batch. Next new package is available. + // Don't show app list. + SendInstallationFinished(); + InstallTestApps(kTestAppPackage2, false); + SendPackageAdded(kTestAppPackage2, true); + EXPECT_FALSE(app_list_service->IsAppListVisible()); + + // Run next installation batch. App list should be shown again. + SendInstallationStarted(); + SendInstallationFinished(); + InstallTestApps(kTestAppPackage3, false); + SendPackageAdded(kTestAppPackage3, true); + EXPECT_TRUE(app_list_service->IsAppListVisible()); + app_list_service->DismissAppList(); } // Test AppListControllerDelegate::IsAppOpen for Arc apps. IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, IsAppOpen) { StartInstance(); - InstallTestApps(false); - SendPackageAdded(true); - const std::string app_id = GetTestApp1Id(); + InstallTestApps(kTestAppPackage, false); + SendPackageAdded(kTestAppPackage, true); + const std::string app_id = GetTestApp1Id(kTestAppPackage); AppListService* service = AppListService::Get(); AppListControllerDelegate* delegate = service->GetControllerDelegate(); @@ -436,14 +471,14 @@ // Test Shelf Groups IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, ShelfGroup) { StartInstance(); - InstallTestApps(false); - SendPackageAdded(true); + InstallTestApps(kTestAppPackage, false); + SendPackageAdded(kTestAppPackage, true); const std::string shorcut_id1 = InstallShortcut(kTestShortcutName, kTestShelfGroup); const std::string shorcut_id2 = InstallShortcut(kTestShortcutName2, kTestShelfGroup2); - const std::string app_id = GetTestApp1Id(); + const std::string app_id = GetTestApp1Id(kTestAppPackage); std::unique_ptr<ArcAppListPrefs::AppInfo> info = app_prefs()->GetApp(app_id); ASSERT_TRUE(info);
diff --git a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc index dad2c88..ac46f0f 100644 --- a/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc +++ b/chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/ui/autofill/create_card_unmask_prompt_view.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/test/test_browser_dialog.h" #include "chrome/test/base/in_process_browser_test.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/card_unmask_delegate.h" @@ -22,13 +23,14 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_utils.h" -#include "ui/base/test/user_interactive_test_case.h" namespace autofill { namespace { -enum class CreditCardExpiry : uint8_t { EXPIRED, VALID }; +// Forms of the dialog that can be invoked. +constexpr const char kExpiryExpired[] = "expired"; +constexpr const char kExpiryValid[] = "valid"; class TestCardUnmaskDelegate : public CardUnmaskDelegate { public: @@ -85,12 +87,13 @@ DISALLOW_COPY_AND_ASSIGN(TestCardUnmaskPromptController); }; -class CardUnmaskPromptViewBrowserTest : public InProcessBrowserTest { +class CardUnmaskPromptViewBrowserTest : public DialogBrowserTest { public: - CardUnmaskPromptViewBrowserTest() : InProcessBrowserTest() {} + CardUnmaskPromptViewBrowserTest() {} ~CardUnmaskPromptViewBrowserTest() override {} + // DialogBrowserTest: void SetUpOnMainThread() override { runner_ = new content::MessageLoopRunner; contents_ = browser()->tab_strip_model()->GetActiveWebContents(); @@ -98,10 +101,11 @@ delegate_.reset(new TestCardUnmaskDelegate()); } - void ShowUI(CreditCardExpiry expired) { + void ShowDialog(const std::string& name) override { CardUnmaskPromptView* dialog = CreateCardUnmaskPromptView(controller(), contents()); - CreditCard card = (expired == CreditCardExpiry::EXPIRED) + EXPECT_TRUE(name == kExpiryExpired || name == kExpiryValid); + CreditCard card = (name == kExpiryExpired) ? test::GetMaskedServerCard() : test::GetMaskedServerCardAmex(); controller()->ShowPrompt(dialog, card, AutofillClient::UNMASK_FOR_AUTOFILL, @@ -126,23 +130,16 @@ DISALLOW_COPY_AND_ASSIGN(CardUnmaskPromptViewBrowserTest); }; -// Permanently disabled test used to invoke the UI for the card unmask prompt -// with an expired credit card, which shows additional month/year controls. -IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, - DISABLED_InvokeExpired) { - ShowUI(CreditCardExpiry::EXPIRED); - ::test::RunTestInteractively(); +IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, InvokeDialog_expired) { + RunDialog(); } -// Permanently disabled test used to invoke the UI for the card unmask prompt -// with a valid credit card, which only shows the CCV Textfield. -IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DISABLED_InvokeValid) { - ShowUI(CreditCardExpiry::VALID); - ::test::RunTestInteractively(); +IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, InvokeDialog_valid) { + RunDialog(); } IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, DisplayUI) { - ShowUI(CreditCardExpiry::EXPIRED); + ShowDialog(kExpiryExpired); } // TODO(bondd): bring up on Mac. @@ -151,7 +148,7 @@ // message is showing. IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, EarlyCloseAfterSuccess) { - ShowUI(CreditCardExpiry::EXPIRED); + ShowDialog(kExpiryExpired); controller()->OnUnmaskResponse(base::ASCIIToUTF16("123"), base::ASCIIToUTF16("10"), base::ASCIIToUTF16("19"), false); @@ -173,7 +170,7 @@ // https://crbug.com/484376 IN_PROC_BROWSER_TEST_F(CardUnmaskPromptViewBrowserTest, CloseTabWhileDialogShowing) { - ShowUI(CreditCardExpiry::EXPIRED); + ShowDialog(kExpiryExpired); // Simulate AutofillManager (the delegate in production code) being destroyed // before CardUnmaskPromptViewBridge::OnConstrainedWindowClosed() is called. FreeDelegate();
diff --git a/chrome/browser/ui/crypto_module_password_dialog.h b/chrome/browser/ui/crypto_module_password_dialog.h index 86dc0872..36abcc5 100644 --- a/chrome/browser/ui/crypto_module_password_dialog.h +++ b/chrome/browser/ui/crypto_module_password_dialog.h
@@ -14,7 +14,6 @@ // An enum to describe the reason for the password request. enum CryptoModulePasswordReason { - kCryptoModulePasswordKeygen, kCryptoModulePasswordCertEnrollment, kCryptoModulePasswordClientAuth, kCryptoModulePasswordListCerts,
diff --git a/chrome/browser/ui/test/browser_dialog_browsertest.cc b/chrome/browser/ui/test/browser_dialog_browsertest.cc new file mode 100644 index 0000000..2c769d3b --- /dev/null +++ b/chrome/browser/ui/test/browser_dialog_browsertest.cc
@@ -0,0 +1,74 @@ +// 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 "base/command_line.h" +#include "base/process/launch.h" +#include "base/test/launcher/test_launcher.h" +#include "base/test/test_switches.h" +#include "base/test/test_timeouts.h" +#include "chrome/browser/ui/test/test_browser_dialog.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/compositor/compositor_switches.h" + +namespace { + +// Switch for BrowserDialogTest.Invoke to spawn a subprocess testing the +// provided argument under a consistent setup. +constexpr const char kDialogSwitch[] = "dialog"; + +// Pattern to search in test names that indicate support for dialog testing. +constexpr const char kDialogPattern[] = "InvokeDialog_"; + +} // namespace + +// Adds a browser_test entry point into the dialog testing framework. Without a +// --dialog specified, just lists the available dialogs and exits. +TEST(BrowserDialogTest, Invoke) { + const base::CommandLine& invoker = *base::CommandLine::ForCurrentProcess(); + const std::string dialog_name = invoker.GetSwitchValueASCII(kDialogSwitch); + + std::set<std::string> dialog_cases; + const testing::UnitTest* unit_test = testing::UnitTest::GetInstance(); + for (int i = 0; i < unit_test->total_test_case_count(); ++i) { + const testing::TestCase* test_case = unit_test->GetTestCase(i); + for (int j = 0; j < test_case->total_test_count(); ++j) { + const char* name = test_case->GetTestInfo(j)->name(); + if (strstr(name, kDialogPattern)) + dialog_cases.insert(test_case->name() + std::string(".") + name); + } + } + + if (dialog_name.empty()) { + std::string case_list; + for (const std::string& name : dialog_cases) + case_list += "\t" + name + "\n"; + VLOG(0) << "\nPass one of the following after --" << kDialogSwitch << "=\n" + << case_list; + return; + } + + auto it = dialog_cases.find(dialog_name); + ASSERT_NE(it, dialog_cases.end()) << "Dialog '" << dialog_name + << "' not found."; + + base::CommandLine command(invoker); + + // Replace TestBrowserDialog.Invoke with |dialog_name|. + command.AppendSwitchASCII(base::kGTestFilterFlag, dialog_name); + + base::LaunchOptions options; + + // Disable timeouts and generate screen output if --interactive was specified. + if (command.HasSwitch(internal::kInteractiveSwitch)) { + command.AppendSwitchASCII(switches::kUiTestActionMaxTimeout, + TestTimeouts::kNoTimeoutSwitchValue); + command.AppendSwitchASCII(switches::kTestLauncherTimeout, + TestTimeouts::kNoTimeoutSwitchValue); + command.AppendSwitch(switches::kEnablePixelOutputInTests); + } else { + options.wait = true; + } + + base::LaunchProcess(command, options); +}
diff --git a/chrome/browser/ui/test/test_browser_dialog.cc b/chrome/browser/ui/test/test_browser_dialog.cc new file mode 100644 index 0000000..d142e78 --- /dev/null +++ b/chrome/browser/ui/test/test_browser_dialog.cc
@@ -0,0 +1,110 @@ +// 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 "chrome/browser/ui/test/test_browser_dialog.h" + +#include "base/command_line.h" +#include "base/message_loop/message_loop.h" +#include "base/test/gtest_util.h" +#include "chrome/browser/platform_util.h" +#include "ui/base/material_design/material_design_controller.h" +#include "ui/base/test/material_design_controller_test_api.h" +#include "ui/base/test/user_interactive_test_case.h" +#include "ui/base/ui_base_switches.h" +#include "ui/views/widget/widget.h" +#include "ui/views/widget/widget_observer.h" + +namespace { + +// An automatic action for WidgetCloser to post to the RunLoop. +// TODO(tapted): Explore asynchronous Widget::Close() and DialogClientView:: +// {Accept,Cancel}Window() approaches to test other dialog lifetimes. +enum class DialogAction { + INTERACTIVE, // Run interactively. + CLOSE_NOW, // Call Widget::CloseNow(). +}; + +// Helper to break out of the nested run loop that runs a test dialog. +class WidgetCloser : public views::WidgetObserver { + public: + WidgetCloser(views::Widget* widget, DialogAction action) + : widget_(widget), weak_ptr_factory_(this) { + widget->AddObserver(this); + if (action == DialogAction::INTERACTIVE) + return; + + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::Bind(&WidgetCloser::CloseNow, weak_ptr_factory_.GetWeakPtr())); + } + + // WidgetObserver: + void OnWidgetDestroyed(views::Widget* widget) override { + widget_->RemoveObserver(this); + widget_ = nullptr; + base::MessageLoop::current()->QuitNow(); + } + + private: + void CloseNow() { + if (widget_) + widget_->CloseNow(); + } + + views::Widget* widget_; + + base::WeakPtrFactory<WidgetCloser> weak_ptr_factory_; + + DISALLOW_COPY_AND_ASSIGN(WidgetCloser); +}; + +// Extracts the |name| argument for ShowDialog() from the current test case. +// E.g. for InvokeDialog_name (or DISABLED_InvokeDialog_name) returns "name". +std::string NameFromTestCase() { + const std::string name = base::TestNameWithoutDisabledPrefix( + testing::UnitTest::GetInstance()->current_test_info()->name()); + std::string::size_type underscore = name.find('_'); + return underscore == std::string::npos ? std::string() + : name.substr(underscore + 1); +} + +} // namespace + +TestBrowserDialog::TestBrowserDialog() {} + +void TestBrowserDialog::RunDialog() { +#if defined(OS_MACOSX) + // The rest of this method assumes the child dialog is toolkit-views. So, for + // Mac, it will only work if --secondary-ui-md is passed. Without this, a + // Cocoa dialog will be created, which TestBrowserDialog doesn't support. + // Force SecondaryUiMaterial() on Mac to get coverage on the bots. Leave it + // optional elsewhere so that the non-MD dialog can be invoked to compare. + ui::test::MaterialDesignControllerTestAPI md_test_api( + ui::MaterialDesignController::GetMode()); + md_test_api.SetSecondaryUiMaterial(true); +#endif + + gfx::NativeView parent = platform_util::GetViewForWindow(DialogParent()); + views::Widget::Widgets widgets_before; + views::Widget::GetAllChildWidgets(parent, &widgets_before); + + ShowDialog(NameFromTestCase()); + views::Widget::Widgets widgets_after; + views::Widget::GetAllChildWidgets(parent, &widgets_after); + + auto added = base::STLSetDifference<std::vector<views::Widget*>>( + widgets_after, widgets_before); + + // This can fail if no dialog was shown, if the dialog shown wasn't a toolkit- + // views dialog, or if more than one child dialog was shown. + ASSERT_EQ(1u, added.size()); + + const DialogAction action = base::CommandLine::ForCurrentProcess()->HasSwitch( + internal::kInteractiveSwitch) + ? DialogAction::INTERACTIVE + : DialogAction::CLOSE_NOW; + + WidgetCloser closer(added[0], action); + ::test::RunTestInteractively(); +}
diff --git a/chrome/browser/ui/test/test_browser_dialog.h b/chrome/browser/ui/test/test_browser_dialog.h new file mode 100644 index 0000000..9eeac31 --- /dev/null +++ b/chrome/browser/ui/test/test_browser_dialog.h
@@ -0,0 +1,100 @@ +// 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 CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ +#define CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_ + +#include <string> +#include <vector> + +#include "base/macros.h" +#include "chrome/browser/ui/browser_window.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/gfx/native_widget_types.h" + +// TestBrowserDialog provides a way to register an InProcessBrowserTest testing +// harness with a framework that invokes Chrome browser dialogs in a consistent +// way. It optionally provides a way to invoke dialogs "interactively". This +// allows screenshots to be generated easily, with the same test data, to assist +// with UI review. It also provides a registry of dialogs so they can be +// systematically checked for subtle changes and regressions. +// +// To use TestBrowserDialog, a test harness should inherit from +// DialogBrowserTest rather than InProcessBrowserTest. If the dialog under test +// has only a single mode of operation, the only other requirement on the test +// harness is an override: +// +// class FooDialogTest : public DialogBrowserTest { +// public: +// .. +// // DialogBrowserTest: +// void ShowDialog(const std::string& name) override { +// /* Show dialog attached to browser() and leave it open. */ +// } +// .. +// }; +// +// then in the foo_dialog_browsertest.cc, define any number of +// +// IN_PROC_BROWSER_TEST_F(FooDialogTest, InvokeDialog_name) { +// RunDialog(); +// } +// +// The string after "InvokeDialog_" (here, "name") is the argument given to +// ShowDialog(). In a regular test suite run, RunDialog() shows the dialog and +// immediately closes it (after ensuring it was actually created). +// +// To get a list of all available dialogs, run the `BrowserDialogTest.Invoke` +// test case without other arguments. I.e. +// +// browser_tests --gtest_filter=BrowserDialogTest.Invoke +// +// Dialogs listed can be shown interactively using the --dialog argument. E.g. +// +// browser_tests --gtest_filter=BrowserDialogTest.Invoke --interactive \ +// --dialog=FooDialogTest.InvokeDialog_name +class TestBrowserDialog { + protected: + TestBrowserDialog(); + + // Runs the dialog whose name corresponds to the current test case. + void RunDialog(); + + // Show the dialog corresponding to |name| and leave it open. + virtual void ShowDialog(const std::string& name) = 0; + + // The window that owns the dialogs. Used to find where the dialog appears. + virtual gfx::NativeWindow DialogParent() = 0; + + private: + DISALLOW_COPY_AND_ASSIGN(TestBrowserDialog); +}; + +// Helper to mix in a TestBrowserDialog to an existing test harness. |Base| +// must be a descendant of InProcessBrowserTest. +template <class Base> +class SupportsTestDialog : public Base, public TestBrowserDialog { + protected: + SupportsTestDialog() {} + + // TestBrowserDialog: + gfx::NativeWindow DialogParent() override { + return this->browser()->window()->GetNativeWindow(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(SupportsTestDialog); +}; + +using DialogBrowserTest = SupportsTestDialog<InProcessBrowserTest>; + +namespace internal { + +// When present on the command line, runs the test in an interactive mode. +constexpr const char kInteractiveSwitch[] = "interactive"; + +} // namespace internal + +#endif // CHROME_BROWSER_UI_TEST_TEST_BROWSER_DIALOG_H_
diff --git a/chrome/browser/ui/views/app_list/OWNERS b/chrome/browser/ui/views/app_list/OWNERS deleted file mode 100644 index c912e6a..0000000 --- a/chrome/browser/ui/views/app_list/OWNERS +++ /dev/null
@@ -1,4 +0,0 @@ -benwells@chromium.org -calamity@chromium.org -mgiuca@chromium.org -tapted@chromium.org
diff --git a/chrome/browser/ui/views/app_list/linux/OWNERS b/chrome/browser/ui/views/app_list/linux/OWNERS deleted file mode 100644 index 633cc35..0000000 --- a/chrome/browser/ui/views/app_list/linux/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -mgiuca@chromium.org
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_linux.cc b/chrome/browser/ui/views/app_list/linux/app_list_linux.cc deleted file mode 100644 index 8333480..0000000 --- a/chrome/browser/ui/views/app_list/linux/app_list_linux.cc +++ /dev/null
@@ -1,112 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/app_list/linux/app_list_linux.h" - -#include "build/build_config.h" -#include "ui/app_list/app_list_switches.h" -#include "ui/app_list/views/app_list_view.h" -#include "ui/display/screen.h" -#include "ui/views/linux_ui/linux_ui.h" -#include "ui/views/widget/widget.h" - -// static -AppListPositioner::ScreenEdge AppListLinux::ShelfLocationInDisplay( - const display::Display& display) { - // On Linux, it is difficult to find the shelf (due to the large variety of - // desktop environments). The shelf can usually be found on the edge where the - // display edge and work area do not match up, but there can be more than one - // such edge. The shelf is assumed to be on the side of the screen with the - // largest delta between the display edge and the work area edge. Ties are - // broken in the order: top, left, right, bottom. - const gfx::Rect work_area = display.work_area(); - const gfx::Rect display_bounds = display.bounds(); - - int winning_margin = 0; - AppListPositioner::ScreenEdge winning_edge = - AppListPositioner::SCREEN_EDGE_UNKNOWN; - - if (work_area.y() - display_bounds.y() > winning_margin) { - winning_margin = work_area.y() - display_bounds.y(); - winning_edge = AppListPositioner::SCREEN_EDGE_TOP; - } - - if (work_area.x() - display_bounds.x() > winning_margin) { - winning_margin = work_area.x() - display_bounds.x(); - winning_edge = AppListPositioner::SCREEN_EDGE_LEFT; - } - - if (display_bounds.right() - work_area.right() > winning_margin) { - winning_margin = display_bounds.right() - work_area.right(); - winning_edge = AppListPositioner::SCREEN_EDGE_RIGHT; - } - - if (display_bounds.bottom() - work_area.bottom() > winning_margin) { - winning_margin = display_bounds.bottom() - work_area.bottom(); - winning_edge = AppListPositioner::SCREEN_EDGE_BOTTOM; - } - - return winning_edge; -} - -// static -gfx::Point AppListLinux::FindAnchorPoint(const gfx::Size& view_size, - const display::Display& display, - const gfx::Point& cursor, - AppListPositioner::ScreenEdge edge, - bool center_window) { - AppListPositioner positioner(display, view_size, 0); - - // Special case for app list in the center of the screen. - if (center_window) - return positioner.GetAnchorPointForScreenCenter(); - - gfx::Point anchor; - // Snap to the shelf edge. If the cursor is greater than the window - // width/height away, anchor to the corner. Otherwise, anchor to the cursor - // position. - if (edge == AppListPositioner::SCREEN_EDGE_UNKNOWN) { - // If we can't find the shelf, snap to the top left. - return positioner.GetAnchorPointForScreenCorner( - AppListPositioner::SCREEN_CORNER_TOP_LEFT); - } - - int snap_distance = edge == AppListPositioner::SCREEN_EDGE_BOTTOM || - edge == AppListPositioner::SCREEN_EDGE_TOP - ? view_size.height() - : view_size.width(); - if (positioner.GetCursorDistanceFromShelf(edge, cursor) > snap_distance) - return positioner.GetAnchorPointForShelfCorner(edge); - - return positioner.GetAnchorPointForShelfCursor(edge, cursor); -} - -// static -void AppListLinux::MoveNearCursor(app_list::AppListView* view) { - display::Screen* screen = display::Screen::GetScreen(); - gfx::Point cursor = screen->GetCursorScreenPoint(); - display::Display display = screen->GetDisplayNearestPoint(cursor); - - view->SetBubbleArrow(views::BubbleBorder::FLOAT); - - AppListPositioner::ScreenEdge edge; -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) - // In the Unity desktop environment, special case SCREEN_EDGE_LEFT. It is - // always on the left side in Unity, but ShelfLocationInDisplay will not - // detect this if the shelf is hidden. - // TODO(mgiuca): Apply this special case in Gnome Shell also. The same logic - // applies, but we currently have no way to detect whether Gnome Shell is - // running. - views::LinuxUI* ui = views::LinuxUI::instance(); - if (ui && ui->UnityIsRunning()) - edge = AppListPositioner::SCREEN_EDGE_LEFT; - else -#endif - edge = ShelfLocationInDisplay(display); - view->SetAnchorPoint(FindAnchorPoint(view->GetPreferredSize(), - display, - cursor, - edge, - view->ShouldCenterWindow())); -}
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_linux.h b/chrome/browser/ui/views/app_list/linux/app_list_linux.h deleted file mode 100644 index d2ef78156..0000000 --- a/chrome/browser/ui/views/app_list/linux/app_list_linux.h +++ /dev/null
@@ -1,47 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_LINUX_H_ -#define CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_LINUX_H_ - -#include "chrome/browser/ui/app_list/app_list_positioner.h" - -namespace app_list { -class AppListView; -} - -namespace display { -class Display; -} - -namespace gfx { -class Point; -class Size; -} // namespace gfx - -// Responsible for positioning an AppListView on Linux. -// TODO(tapted): Shouldn't be a class - move the static member functions out. -class AppListLinux { - public: - // Determines which screen edge the shelf is aligned to. This tries to find - // the edge of the surface where the user normally launches apps from (so, for - // example, on Gnome Classic, this is the applications menu, not the taskbar). - static AppListPositioner::ScreenEdge ShelfLocationInDisplay( - const display::Display& display); - - // Finds the position for a window to anchor it to the shelf. This chooses the - // most appropriate position for the window based on whether the shelf exists, - // the position of the shelf, and the mouse cursor. Returns the intended - // coordinates for the center of the window. If |shelf_rect| is empty, assumes - // there is no shelf on the given display. - static gfx::Point FindAnchorPoint(const gfx::Size& view_size, - const display::Display& display, - const gfx::Point& cursor, - AppListPositioner::ScreenEdge edge, - bool center_window); - - static void MoveNearCursor(app_list::AppListView* view); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_LINUX_H_
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc b/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc deleted file mode 100644 index e381ec49..0000000 --- a/chrome/browser/ui/views/app_list/linux/app_list_linux_unittest.cc +++ /dev/null
@@ -1,259 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/app_list/linux/app_list_linux.h" - -#include "base/logging.h" -#include "chrome/browser/ui/app_list/app_list_positioner.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/display/display.h" -#include "ui/gfx/geometry/point.h" -#include "ui/gfx/geometry/rect.h" -#include "ui/gfx/geometry/size.h" - -namespace { - -const int kScreenWidth = 800; -const int kScreenHeight = 600; - -const int kWindowWidth = 100; -const int kWindowHeight = 200; - -// Size of the menu bar along the top of the screen. -const int kMenuBarSize = 22; -// Size of the normal (non-hidden) shelf. -const int kShelfSize = 30; - -// A cursor position that is within the shelf. This must be < kShelfSize. -const int kCursorOnShelf = kShelfSize / 2; -// A cursor position that is within kWindowWidth pixels of the shelf. -const int kCursorNearShelfX = kShelfSize + kWindowWidth; -// A cursor position that is more than kWindowWidth pixels away from the shelf. -const int kCursorAwayFromShelfX = kCursorNearShelfX + 1; -// A cursor position that is within kWindowHeight pixels of the shelf. -const int kCursorNearShelfY = kShelfSize + kWindowHeight; -// A cursor position that is more than kWindowHeight pixels away from the shelf. -const int kCursorAwayFromShelfY = kCursorNearShelfY + 1; - -// A position for the center of the window that causes the window to overlap the -// edge of the screen. This must be < kWindowWidth / 2 and < kWindowHeight / 2. -const int kWindowNearEdge = kWindowWidth / 4; -// A position for the center of the window that places the window away from all -// edges of the screen. This must be > kWindowWidth / 2, > kWindowHeight / 2, < -// kScreenWidth - kWindowWidth / 2 and < kScreenHeight - kWindowHeight / 2. -const int kWindowAwayFromEdge = 158; - -} // namespace - -class AppListLinuxUnitTest : public testing::Test { - public: - void SetUp() override { - display_.set_bounds(gfx::Rect(0, 0, kScreenWidth, kScreenHeight)); - display_.set_work_area( - gfx::Rect(0, kMenuBarSize, kScreenWidth, kScreenHeight - kMenuBarSize)); - cursor_ = gfx::Point(); - center_window_ = false; - } - - // Set the display work area. - void SetWorkArea(int x, int y, int width, int height) { - display_.set_work_area(gfx::Rect(x, y, width, height)); - } - - // Sets up the test environment with the shelf along a given edge of the - // work area. - void PlaceShelf(AppListPositioner::ScreenEdge edge) { - switch (edge) { - case AppListPositioner::SCREEN_EDGE_LEFT: - display_.set_work_area(gfx::Rect(kShelfSize, - kMenuBarSize, - kScreenWidth - kShelfSize, - kScreenHeight - kMenuBarSize)); - break; - case AppListPositioner::SCREEN_EDGE_RIGHT: - display_.set_work_area(gfx::Rect(0, - kMenuBarSize, - kScreenWidth - kShelfSize, - kScreenHeight - kMenuBarSize)); - break; - case AppListPositioner::SCREEN_EDGE_TOP: - display_.set_work_area( - gfx::Rect(0, - kMenuBarSize + kShelfSize, - kScreenWidth, - kScreenHeight - kMenuBarSize - kShelfSize)); - break; - case AppListPositioner::SCREEN_EDGE_BOTTOM: - display_.set_work_area( - gfx::Rect(0, - kMenuBarSize, - kScreenWidth, - kScreenHeight - kMenuBarSize - kShelfSize)); - break; - case AppListPositioner::SCREEN_EDGE_UNKNOWN: - NOTREACHED(); - break; - } - } - - // Set up the test mouse cursor in a given location. - void PlaceCursor(int x, int y) { - cursor_ = gfx::Point(x, y); - } - - void EnableWindowCentering() { - center_window_ = true; - } - - AppListPositioner::ScreenEdge ShelfEdge() const { - return AppListLinux::ShelfLocationInDisplay(display_); - } - - gfx::Point DoFindAnchorPoint() const { - return AppListLinux::FindAnchorPoint(gfx::Size(kWindowWidth, kWindowHeight), - display_, - cursor_, - ShelfEdge(), - center_window_); - } - - private: - display::Display display_; - gfx::Point cursor_; - bool center_window_; -}; - -TEST_F(AppListLinuxUnitTest, ShelfLocationInDisplay) { - SetWorkArea(0, 0, kScreenWidth, kScreenHeight); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_UNKNOWN, ShelfEdge()); - - // The BOTTOM, LEFT and RIGHT tests test the case where there are two bars: - // one at the top and one at the bottom/left/right. The bigger one should be - // chosen, so TOP should not win in these cases. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_BOTTOM, ShelfEdge()); - - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_TOP, ShelfEdge()); - - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_LEFT, ShelfEdge()); - - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_RIGHT, ShelfEdge()); - - // Bar at top and bottom, same size. Top should win. - SetWorkArea(0, - kMenuBarSize, - kScreenWidth, - kScreenHeight - kMenuBarSize - kMenuBarSize); - EXPECT_EQ(AppListPositioner::SCREEN_EDGE_TOP, ShelfEdge()); -} - -TEST_F(AppListLinuxUnitTest, FindAnchorPointNoShelf) { - // Position the app list when there is no shelf on the display. - PlaceCursor(0, 0); - // Expect the app list to be in the top-left corner. - EXPECT_EQ(gfx::Point(kWindowWidth / 2, kMenuBarSize + kWindowHeight / 2), - DoFindAnchorPoint()); -} - -TEST_F(AppListLinuxUnitTest, FindAnchorPointMouseOffShelf) { - // Position the app list when the mouse is away from the shelf. - - // Bottom shelf. Expect the app list to be in the bottom-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowAwayFromEdge, kScreenHeight - kCursorAwayFromShelfY); - EXPECT_EQ(gfx::Point(kWindowWidth / 2, - kScreenHeight - kShelfSize - kWindowHeight / 2), - DoFindAnchorPoint()); - - // Top shelf. Expect the app list to be in the top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - PlaceCursor(kWindowAwayFromEdge, kMenuBarSize + kCursorAwayFromShelfY); - EXPECT_EQ(gfx::Point(kWindowWidth / 2, - kMenuBarSize + kShelfSize + kWindowHeight / 2), - DoFindAnchorPoint()); - - // Left shelf. Expect the app list to be in the top-left corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - PlaceCursor(kCursorAwayFromShelfX, kWindowAwayFromEdge); - EXPECT_EQ(gfx::Point(kShelfSize + kWindowWidth / 2, - kMenuBarSize + kWindowHeight / 2), - DoFindAnchorPoint()); - - // Right shelf. Expect the app list to be in the top-right corner. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - PlaceCursor(kScreenWidth - kCursorAwayFromShelfX, kWindowAwayFromEdge); - EXPECT_EQ(gfx::Point(kScreenWidth - kShelfSize - kWindowWidth / 2, - kMenuBarSize + kWindowHeight / 2), - DoFindAnchorPoint()); -} - -TEST_F(AppListLinuxUnitTest, FindAnchorPointMouseOnShelf) { - // Position the app list when the mouse is over the shelf. - - // Bottom shelf (mouse well within shelf). Expect the app list to be at - // the bottom centered on the mouse X coordinate. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowAwayFromEdge, kScreenHeight - kCursorOnShelf); - EXPECT_EQ(gfx::Point(kWindowAwayFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2), - DoFindAnchorPoint()); - - // Bottom shelf (outside the shelf but still close enough). - // Expect the app list to be at the bottom centered on the mouse X coordinate. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowAwayFromEdge, kScreenHeight - kCursorNearShelfY); - EXPECT_EQ(gfx::Point(kWindowAwayFromEdge, - kScreenHeight - kShelfSize - kWindowHeight / 2), - DoFindAnchorPoint()); - - // Top shelf. Expect the app list to be at the top centered on the - // mouse X coordinate. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - PlaceCursor(kWindowAwayFromEdge, kMenuBarSize + kCursorNearShelfY); - EXPECT_EQ(gfx::Point(kWindowAwayFromEdge, - kMenuBarSize + kShelfSize + kWindowHeight / 2), - DoFindAnchorPoint()); - - // Left shelf. Expect the app list to be at the left centered on the - // mouse Y coordinate. - PlaceShelf(AppListPositioner::SCREEN_EDGE_LEFT); - PlaceCursor(kCursorNearShelfX, kWindowAwayFromEdge); - EXPECT_EQ(gfx::Point(kShelfSize + kWindowWidth / 2, kWindowAwayFromEdge), - DoFindAnchorPoint()); - - // Right shelf. Expect the app list to be at the right centered on the - // mouse Y coordinate. - PlaceShelf(AppListPositioner::SCREEN_EDGE_RIGHT); - PlaceCursor(kScreenWidth - kCursorNearShelfX, kWindowAwayFromEdge); - EXPECT_EQ(gfx::Point(kScreenWidth - kShelfSize - kWindowWidth / 2, - kWindowAwayFromEdge), - DoFindAnchorPoint()); - - // Bottom shelf. Mouse near left edge. App list must not go off screen. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kWindowNearEdge, kScreenHeight - kCursorOnShelf); - EXPECT_EQ(gfx::Point(kWindowWidth / 2, - kScreenHeight - kShelfSize - kWindowHeight / 2), - DoFindAnchorPoint()); - - // Bottom shelf. Mouse near right edge. App list must not go off screen. - PlaceShelf(AppListPositioner::SCREEN_EDGE_BOTTOM); - PlaceCursor(kScreenWidth - kWindowNearEdge, kScreenHeight - kCursorOnShelf); - EXPECT_EQ(gfx::Point(kScreenWidth - kWindowWidth / 2, - kScreenHeight - kShelfSize - kWindowHeight / 2), - DoFindAnchorPoint()); -} - -TEST_F(AppListLinuxUnitTest, FindAnchorPointCentered) { - // Cursor on the top shelf; enable centered app list mode. - PlaceShelf(AppListPositioner::SCREEN_EDGE_TOP); - PlaceCursor(0, 0); - EnableWindowCentering(); - // Expect the app list to be in the center of the screen (ignore the cursor). - EXPECT_EQ(gfx::Point(kScreenWidth / 2, kScreenHeight / 2), - DoFindAnchorPoint()); -}
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc b/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc deleted file mode 100644 index 0726b45..0000000 --- a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.cc +++ /dev/null
@@ -1,107 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/app_list/linux/app_list_service_linux.h" - -#include "base/memory/singleton.h" -#include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/shell_integration.h" -#include "chrome/browser/shell_integration_linux.h" -#include "chrome/browser/ui/app_list/app_list_controller_delegate.h" -#include "chrome/browser/ui/app_list/app_list_controller_delegate_views.h" -#include "chrome/browser/ui/app_list/app_list_shower_views.h" -#include "chrome/browser/ui/app_list/app_list_view_delegate.h" -#include "chrome/browser/ui/views/app_list/linux/app_list_linux.h" -#include "chrome/grit/chromium_strings.h" -#include "content/public/browser/browser_thread.h" -#include "ui/app_list/app_list_constants.h" -#include "ui/app_list/app_list_switches.h" -#include "ui/app_list/views/app_list_view.h" -#include "ui/base/l10n/l10n_util.h" - -#if defined(USE_ASH) -#include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" -#endif - -namespace { - -void CreateShortcuts() { - std::string app_list_title = - l10n_util::GetStringUTF8(IDS_APP_LIST_SHORTCUT_NAME); - - if (!shell_integration_linux::CreateAppListDesktopShortcut( - app_list::kAppListWMClass, - app_list_title)) { - LOG(WARNING) << "Unable to create App Launcher shortcut."; - } -} - -} // namespace - -AppListServiceLinux::~AppListServiceLinux() {} - -// static -AppListServiceLinux* AppListServiceLinux::GetInstance() { - return base::Singleton<AppListServiceLinux, base::LeakySingletonTraits< - AppListServiceLinux>>::get(); -} - -void AppListServiceLinux::CreateShortcut() { - content::BrowserThread::PostTask( - content::BrowserThread::FILE, FROM_HERE, base::Bind(&CreateShortcuts)); -} - -void AppListServiceLinux::OnActivationChanged(views::Widget* /*widget*/, - bool active) { - if (active) - return; - - if (app_list::switches::ShouldNotDismissOnBlur()) - return; - - // Dismiss the app list asynchronously. This must be done asynchronously - // or our caller will crash, as it expects the app list to remain alive. - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&AppListServiceLinux::DismissAppList, base::Unretained(this))); -} - -AppListServiceLinux::AppListServiceLinux() - : AppListServiceViews(std::unique_ptr<AppListControllerDelegate>( - new AppListControllerDelegateViews(this))) {} - -void AppListServiceLinux::OnViewCreated() { - shower().app_list()->AddObserver(this); -} - -void AppListServiceLinux::OnViewBeingDestroyed() { - shower().app_list()->RemoveObserver(this); - AppListServiceViews::OnViewBeingDestroyed(); -} - -void AppListServiceLinux::OnViewDismissed() { -} - -void AppListServiceLinux::MoveNearCursor(app_list::AppListView* view) { - AppListLinux::MoveNearCursor(view); -} - -// static -AppListService* AppListService::Get() { -#if defined(USE_ASH) - return AppListServiceAsh::GetInstance(); -#else - return AppListServiceLinux::GetInstance(); -#endif -} - -// static -void AppListService::InitAll(Profile* initial_profile, - const base::FilePath& profile_path) { -#if defined(USE_ASH) - AppListServiceAsh::GetInstance()->Init(initial_profile); -#else - AppListServiceLinux::GetInstance()->Init(initial_profile); -#endif -}
diff --git a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.h b/chrome/browser/ui/views/app_list/linux/app_list_service_linux.h deleted file mode 100644 index fb7cf76..0000000 --- a/chrome/browser/ui/views/app_list/linux/app_list_service_linux.h +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_ -#define CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_ - -#include "base/macros.h" -#include "chrome/browser/ui/app_list/app_list_service_views.h" -#include "ui/app_list/views/app_list_view_observer.h" - -namespace base { -template <typename T> struct DefaultSingletonTraits; -} - -// AppListServiceLinux manages global resources needed for the app list to -// operate, and controls when the app list is opened and closed. -class AppListServiceLinux : public AppListServiceViews, - public app_list::AppListViewObserver { - public: - ~AppListServiceLinux() override; - - static AppListServiceLinux* GetInstance(); - - // AppListService overrides: - void CreateShortcut() override; - - // app_list::AppListViewObserver overrides: - void OnActivationChanged(views::Widget* widget, bool active) override; - - private: - friend struct base::DefaultSingletonTraits<AppListServiceLinux>; - - // AppListShowerDelegate overrides: - void OnViewCreated() override; - void OnViewBeingDestroyed() override; - void OnViewDismissed() override; - void MoveNearCursor(app_list::AppListView* view) override; - - AppListServiceLinux(); - - DISALLOW_COPY_AND_ASSIGN(AppListServiceLinux); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_SERVICE_LINUX_H_
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc index 7fecb9e..93fd590 100644 --- a/chrome/browser/ui/views/crypto_module_password_dialog_view.cc +++ b/chrome/browser/ui/views/crypto_module_password_dialog_view.cc
@@ -86,10 +86,6 @@ const base::string16& hostname16 = base::UTF8ToUTF16(hostname); const base::string16& slot16 = base::UTF8ToUTF16(slot_name); switch (reason) { - case chrome::kCryptoModulePasswordKeygen: - text = l10n_util::GetStringFUTF8( - IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_KEYGEN, slot16, hostname16); - break; case chrome::kCryptoModulePasswordCertEnrollment: text = l10n_util::GetStringFUTF8( IDS_CRYPTO_MODULE_AUTH_DIALOG_TEXT_CERT_ENROLLMENT,
diff --git a/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc b/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc index 5d2138e..22cca40 100644 --- a/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/crypto_module_password_dialog_view_unittest.cc
@@ -25,7 +25,7 @@ void CreateCryptoDialog(const CryptoModulePasswordCallback& callback) { dialog_.reset(new CryptoModulePasswordDialogView("slot", - kCryptoModulePasswordKeygen, "server", callback)); + kCryptoModulePasswordCertEnrollment, "server", callback)); } std::string text_;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view_interactive_uitest.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view_interactive_uitest.cc index 12fd8c1..7e3a3a02a 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_action_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view_interactive_uitest.cc
@@ -270,8 +270,8 @@ // Tests that clicking on the toolbar action a second time when the action is // already open results in closing the popup, and doesn't re-open it. -#if defined(OS_WIN) -// Flaky on Windows; see https://crbug.com/617056. +#if defined(OS_WIN) || defined(OS_LINUX) || (OS_CHROMEOS) +// Flaky on Windows, Linux and ChromeOS; see https://crbug.com/617056. #define MAYBE_DoubleClickToolbarActionToClose \ DISABLED_DoubleClickToolbarActionToClose #else
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc index c1562185..c9dae32d 100644 --- a/chrome/browser/ui/website_settings/website_settings.cc +++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -107,7 +107,6 @@ #endif CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, - CONTENT_SETTINGS_TYPE_KEYGEN, CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, CONTENT_SETTINGS_TYPE_AUTOPLAY, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, @@ -730,13 +729,6 @@ NULL); } - if (permission_info.type == CONTENT_SETTINGS_TYPE_KEYGEN && - (permission_info.setting == CONTENT_SETTING_DEFAULT || - permission_info.setting == permission_info.default_setting) && - !tab_specific_content_settings()->IsContentBlocked( - permission_info.type)) { - continue; - } permission_info_list.push_back(permission_info); }
diff --git a/chrome/browser/ui/website_settings/website_settings_ui.cc b/chrome/browser/ui/website_settings/website_settings_ui.cc index 5baf4e6..fffcdb8 100644 --- a/chrome/browser/ui/website_settings/website_settings_ui.cc +++ b/chrome/browser/ui/website_settings/website_settings_ui.cc
@@ -109,8 +109,6 @@ IDR_ALLOWED_DOWNLOADS}, {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_WEBSITE_SETTINGS_TYPE_MIDI_SYSEX, IDR_BLOCKED_MIDI_SYSEX, IDR_ALLOWED_MIDI_SYSEX}, - {CONTENT_SETTINGS_TYPE_KEYGEN, IDS_WEBSITE_SETTINGS_TYPE_KEYGEN, - IDR_BLOCKED_KEYGEN, IDR_ALLOWED_KEYGEN}, {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, IDS_WEBSITE_SETTINGS_TYPE_BACKGROUND_SYNC, IDR_BLOCKED_BACKGROUND_SYNC, IDR_ALLOWED_BACKGROUND_SYNC},
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 81f1017..e98857f9 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -156,10 +156,6 @@ UserMetricsAction( "Options_DefaultProtectedMediaIdentifierSettingChanged")))); #endif - exceptions_info_map.insert(std::make_pair( - CONTENT_SETTINGS_TYPE_KEYGEN, - ContentSettingWithExceptions( - true, UserMetricsAction("Options_DefaultKeygenSettingChanged")))); // Without OTR exceptions. exceptions_info_map.insert(std::make_pair( @@ -484,11 +480,6 @@ // Zoom levels. {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, - // Keygen filter. - {"keygenTabLabel", IDS_KEYGEN_TAB_LABEL}, - {"keygenHeader", IDS_KEYGEN_HEADER}, - {"keygenAllow", IDS_KEYGEN_ALLOW_RADIO}, - {"keygenBlock", IDS_KEYGEN_DONOTALLOW_RADIO}, // PDF Plugin filter. {"pdfTabLabel", IDS_PDF_TAB_LABEL}, {"pdfEnable", IDS_PDF_ENABLE_CHECKBOX}, @@ -561,7 +552,6 @@ IDS_BACKGROUND_SYNC_HEADER); RegisterTitle(localized_strings, "zoomlevels", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); - RegisterTitle(localized_strings, "keygen", IDS_KEYGEN_TAB_LABEL); localized_strings->SetString("exceptionsLearnMoreUrl", kExceptionsLearnMoreUrl);
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 1e0405c..1b6f120 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
@@ -1518,7 +1518,6 @@ {"siteSettingsCamera", IDS_SETTINGS_SITE_SETTINGS_CAMERA}, {"siteSettingsCookies", IDS_SETTINGS_SITE_SETTINGS_COOKIES}, {"siteSettingsHandlers", IDS_SETTINGS_SITE_SETTINGS_HANDLERS}, - {"siteSettingsKeygen", IDS_SETTINGS_SITE_SETTINGS_KEYGEN}, {"siteSettingsLocation", IDS_SETTINGS_SITE_SETTINGS_LOCATION}, {"siteSettingsMic", IDS_SETTINGS_SITE_SETTINGS_MIC}, {"siteSettingsNotifications", IDS_SETTINGS_SITE_SETTINGS_NOTIFICATIONS}, @@ -1560,10 +1559,6 @@ IDS_SETTINGS_SITE_SETTINGS_HANDLERS_ASK_RECOMMENDED}, {"siteSettingsHandlersBlocked", IDS_SETTINGS_SITE_SETTINGS_HANDLERS_BLOCKED}, - {"siteSettingsKeygenAllow", IDS_SETTINGS_SITE_SETTINGS_KEYGEN_ALLOW}, - {"siteSettingsKeygenBlock", IDS_SETTINGS_SITE_SETTINGS_KEYGEN_BLOCK}, - {"siteSettingsKeygenBlockRecommended", - IDS_SETTINGS_SITE_SETTINGS_KEYGEN_BLOCK_RECOMMENDED}, {"siteSettingsAutoDownloadAsk", IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DOWNLOAD_ASK}, {"siteSettingsAutoDownloadAskRecommended",
diff --git a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc index b2b131e..2e9c467 100644 --- a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc +++ b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
@@ -41,22 +41,22 @@ void ProtocolHandlersHandler::RegisterMessages() { web_ui()->RegisterMessageCallback("initializeProtocolHandlerList", - base::Bind(&ProtocolHandlersHandler::InitializeProtocolHandlerList, + base::Bind(&ProtocolHandlersHandler::HandleInitializeList, base::Unretained(this))); web_ui()->RegisterMessageCallback("clearDefault", - base::Bind(&ProtocolHandlersHandler::ClearDefault, + base::Bind(&ProtocolHandlersHandler::HandleClearDefault, base::Unretained(this))); web_ui()->RegisterMessageCallback("removeHandler", - base::Bind(&ProtocolHandlersHandler::RemoveHandler, + base::Bind(&ProtocolHandlersHandler::HandleRemoveHandler, base::Unretained(this))); web_ui()->RegisterMessageCallback("setHandlersEnabled", - base::Bind(&ProtocolHandlersHandler::SetHandlersEnabled, + base::Bind(&ProtocolHandlersHandler::HandleSetHandlersEnabled, base::Unretained(this))); web_ui()->RegisterMessageCallback("setDefault", - base::Bind(&ProtocolHandlersHandler::SetDefault, + base::Bind(&ProtocolHandlersHandler::HandleSetDefault, base::Unretained(this))); web_ui()->RegisterMessageCallback("removeIgnoredHandler", - base::Bind(&ProtocolHandlersHandler::RemoveIgnoredHandler, + base::Bind(&ProtocolHandlersHandler::HandleRemoveIgnoredHandler, base::Unretained(this))); } @@ -131,7 +131,7 @@ *ignored_handlers); } -void ProtocolHandlersHandler::InitializeProtocolHandlerList( +void ProtocolHandlersHandler::HandleInitializeList( const base::ListValue* args) { AllowJavascript(); SendHandlersEnabledValue(); @@ -145,7 +145,7 @@ GetProtocolHandlerRegistry()->enabled())); } -void ProtocolHandlersHandler::RemoveHandler(const base::ListValue* args) { +void ProtocolHandlersHandler::HandleRemoveHandler(const base::ListValue* args) { const base::ListValue* list; if (!args->GetList(0, &list)) { NOTREACHED(); @@ -160,7 +160,7 @@ // then. } -void ProtocolHandlersHandler::RemoveIgnoredHandler( +void ProtocolHandlersHandler::HandleRemoveIgnoredHandler( const base::ListValue* args) { const base::ListValue* list; if (!args->GetList(0, &list)) { @@ -172,7 +172,8 @@ GetProtocolHandlerRegistry()->RemoveIgnoredHandler(handler); } -void ProtocolHandlersHandler::SetHandlersEnabled(const base::ListValue* args) { +void ProtocolHandlersHandler::HandleSetHandlersEnabled( + const base::ListValue* args) { bool enabled = true; CHECK(args->GetBoolean(0, &enabled)); if (enabled) @@ -181,7 +182,7 @@ GetProtocolHandlerRegistry()->Disable(); } -void ProtocolHandlersHandler::ClearDefault(const base::ListValue* args) { +void ProtocolHandlersHandler::HandleClearDefault(const base::ListValue* args) { const base::Value* value; CHECK(args->Get(0, &value)); std::string protocol_to_clear; @@ -189,7 +190,7 @@ GetProtocolHandlerRegistry()->ClearDefault(protocol_to_clear); } -void ProtocolHandlersHandler::SetDefault(const base::ListValue* args) { +void ProtocolHandlersHandler::HandleSetDefault(const base::ListValue* args) { const base::ListValue* list; CHECK(args->GetList(0, &list)); const ProtocolHandler& handler(ParseHandlerFromArgs(list));
diff --git a/chrome/browser/ui/webui/settings/protocol_handlers_handler.h b/chrome/browser/ui/webui/settings/protocol_handlers_handler.h index 87a38241..8911534 100644 --- a/chrome/browser/ui/webui/settings/protocol_handlers_handler.h +++ b/chrome/browser/ui/webui/settings/protocol_handlers_handler.h
@@ -45,20 +45,20 @@ private: // Called to fetch the initial list of data to show. - void InitializeProtocolHandlerList(const base::ListValue* args); + void HandleInitializeList(const base::ListValue* args); // Notifies the JS side whether the handlers are enabled or not. void SendHandlersEnabledValue(); // Called when the user toggles whether custom handlers are enabled. - void SetHandlersEnabled(const base::ListValue* args); + void HandleSetHandlersEnabled(const base::ListValue* args); // Called when the user sets a new default handler for a protocol. - void SetDefault(const base::ListValue* args); + void HandleSetDefault(const base::ListValue* args); // Called when the user clears the default handler for a protocol. // |args| is the string name of the protocol to clear. - void ClearDefault(const base::ListValue* args); + void HandleClearDefault(const base::ListValue* args); // Parses a ProtocolHandler out of the arguments passed back from the view. // |args| is a list of [protocol, url, title]. @@ -77,11 +77,11 @@ // Remove a handler. // |args| is a list of [protocol, url, title]. - void RemoveHandler(const base::ListValue* args); + void HandleRemoveHandler(const base::ListValue* args); // Remove an ignored handler. // |args| is a list of [protocol, url, title]. - void RemoveIgnoredHandler(const base::ListValue* args); + void HandleRemoveIgnoredHandler(const base::ListValue* args); ProtocolHandlerRegistry* GetProtocolHandlerRegistry();
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc index 9e47611..3a0954a 100644 --- a/chrome/browser/ui/webui/settings/site_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -535,7 +535,6 @@ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, - CONTENT_SETTINGS_TYPE_KEYGEN, CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT,
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc index 9cba22a..a79e82b 100644 --- a/chrome/browser/ui/webui/site_settings_helper.cc +++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -72,7 +72,6 @@ #if defined(OS_CHROMEOS) {CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"}, #endif - {CONTENT_SETTINGS_TYPE_KEYGEN, "keygen"}, {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync"}, };
diff --git a/chrome/browser/web_dev_style/css_checker.py b/chrome/browser/web_dev_style/css_checker.py index d55bcca..5bdf88a 100644 --- a/chrome/browser/web_dev_style/css_checker.py +++ b/chrome/browser/web_dev_style/css_checker.py
@@ -210,7 +210,6 @@ 'inner-spin-button', 'input-placeholder', 'input-speech-button', - 'keygen-select', 'media-slider-container', 'media-slider-thumb', 'meter-bar',
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 342c98c..cdd991f 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h
@@ -384,11 +384,6 @@ GURL /* top origin url */, bool /* allowed */) -// Sent by the renderer process when a keygen element is rendered onto the -// current page. -IPC_MESSAGE_ROUTED1(ChromeViewHostMsg_DidUseKeygen, - GURL /* origin_url */) - // Sent by the renderer process to check whether access to FileSystem is // granted by content settings. IPC_MESSAGE_CONTROL4(ChromeViewHostMsg_RequestFileSystemAccessAsync,
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index e9a614c..afbaab3 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc
@@ -415,12 +415,6 @@ FilteredReportInsecureContentDisplayed(GURL(resource_url)); } -void ContentSettingsObserver::didUseKeygen() { - WebFrame* frame = render_frame()->GetWebFrame(); - Send(new ChromeViewHostMsg_DidUseKeygen( - routing_id(), url::Origin(frame->getSecurityOrigin()).GetURL())); -} - void ContentSettingsObserver::didNotAllowPlugins() { DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS); }
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h index 0d284d9..dac71682 100644 --- a/chrome/renderer/content_settings_observer.h +++ b/chrome/renderer/content_settings_observer.h
@@ -80,7 +80,6 @@ bool allowMutationEvents(bool default_value) override; void didNotAllowPlugins() override; void didNotAllowScript() override; - void didUseKeygen() override; bool allowRunningInsecureContent(bool allowed_per_settings, const blink::WebSecurityOrigin& context, const blink::WebURL& url) override;
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 803afb9..8bd7fc3e 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1774,6 +1774,9 @@ "../browser/ui/sync/profile_signin_confirmation_helper_browsertest.cc", "../browser/ui/tab_modal_confirm_dialog_browsertest.cc", "../browser/ui/tab_modal_confirm_dialog_browsertest.h", + "../browser/ui/test/browser_dialog_browsertest.cc", + "../browser/ui/test/test_browser_dialog.cc", + "../browser/ui/test/test_browser_dialog.h", "../browser/ui/toolbar/browser_actions_bar_browsertest.cc", "../browser/ui/toolbar/browser_actions_bar_browsertest.h", "../browser/ui/toolbar/component_toolbar_actions_browsertest.cc", @@ -2552,16 +2555,9 @@ "../browser/apps/drive/drive_app_provider_browsertest.cc", "../browser/ui/app_list/app_list_controller_browsertest.cc", "../browser/ui/app_list/app_list_service_impl_browsertest.cc", - "../browser/ui/app_list/app_list_service_views_browsertest.cc", "../browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc", "../browser/ui/app_list/speech_recognizer_browsertest.cc", ] - if (is_mac) { - # This assumes the AppList is views-based, but Mac only links - # browser parts for the Cocoa implementation. - sources -= - [ "../browser/ui/app_list/app_list_service_views_browsertest.cc" ] - } } if (enable_service_discovery) { sources += [ "../browser/extensions/api/mdns/mdns_apitest.cc" ] @@ -4838,14 +4834,17 @@ sources += [ "../browser/apps/drive/drive_app_mapping_unittest.cc", "../browser/ui/app_list/app_context_menu_unittest.cc", - "../browser/ui/app_list/app_list_positioner_unittest.cc", "../browser/ui/app_list/app_list_service_unittest.cc", "../browser/ui/app_list/app_list_test_util.cc", "../browser/ui/app_list/app_list_test_util.h", + "../browser/ui/app_list/arc/arc_app_test.cc", + "../browser/ui/app_list/arc/arc_app_test.h", + "../browser/ui/app_list/arc/arc_app_unittest.cc", "../browser/ui/app_list/extension_app_model_builder_unittest.cc", "../browser/ui/app_list/profile_loader_unittest.cc", "../browser/ui/app_list/search/app_search_provider_unittest.cc", "../browser/ui/app_list/search/history_unittest.cc", + "../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc", "../browser/ui/app_list/search/omnibox_result_unittest.cc", "../browser/ui/app_list/search/suggestions/suggestions_search_provider_unittest.cc", "../browser/ui/app_list/speech_auth_helper_unittest.cc", @@ -4853,22 +4852,12 @@ "../browser/ui/app_list/test/fake_profile.h", "../browser/ui/app_list/test/fake_profile_store.cc", "../browser/ui/app_list/test/fake_profile_store.h", - "../browser/ui/app_list/test/fast_show_pickler_unittest.cc", - "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc", - ] - deps += [ "//ui/app_list:test_support" ] - } - if (enable_app_list && is_chromeos) { - sources += [ - "../browser/ui/app_list/arc/arc_app_test.cc", - "../browser/ui/app_list/arc/arc_app_test.h", - "../browser/ui/app_list/arc/arc_app_unittest.cc", - "../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc", "../browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc", ] - sources -= - [ "../browser/ui/views/app_list/linux/app_list_linux_unittest.cc" ] - deps += [ "//components/arc:arc_test_support" ] + deps += [ + "//components/arc:arc_test_support", + "//ui/app_list:test_support", + ] } if (enable_plugins && !enable_plugin_installation) { sources -= [ "../browser/plugins/plugin_installer_unittest.cc" ]
diff --git a/chrome/test/data/chromeos/enterprise/policies b/chrome/test/data/chromeos/enterprise/policies index fad3993..35bb3d1 100644 --- a/chrome/test/data/chromeos/enterprise/policies +++ b/chrome/test/data/chromeos/enterprise/policies
@@ -22,7 +22,6 @@ u'DefaultGeolocationSetting': 2, u'DefaultImagesSetting': 2, u'DefaultJavaScriptSetting': 2, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 2, u'DefaultPluginsSetting': 2, u'DefaultPopupsSetting': 2, @@ -84,7 +83,6 @@ u'DefaultGeolocationSetting': 3, u'DefaultImagesSetting': 1, u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 1, u'DefaultPluginsSetting': 1, u'DefaultPopupsSetting': 1, @@ -138,7 +136,6 @@ u'PolicyRefreshRate': 5400000, u'ProxyPacUrl': u'http://proxyconfig.corp.google.com/wpad.dat', u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'RestoreOnStartup': 4, u'DefaultSearchProviderSuggestURL': u'http://search.my.company/suggest?q={searchTerms}', @@ -200,7 +197,6 @@ u'DefaultCookiesSetting': 1, u'DefaultGeolocationSetting': 1, u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 1, u'DefaultPopupsSetting': 2, u'DefaultSearchProviderEnabled': True, @@ -277,7 +273,6 @@ u'DefaultGeolocationSetting': 2, u'DefaultImagesSetting': 2, u'DefaultJavaScriptSetting': 2, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 2, u'DefaultPluginsSetting': 2, u'DefaultPopupsSetting': 2, @@ -339,7 +334,6 @@ u'DefaultGeolocationSetting': 3, u'DefaultImagesSetting': 1, u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 1, u'DefaultPluginsSetting': 1, u'DefaultPopupsSetting': 1, @@ -393,7 +387,6 @@ u'PolicyRefreshRate': 5400000, u'ProxyPacUrl': u'http://proxyconfig.corp.google.com/wpad.dat', u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'RestoreOnStartup': 4, u'DefaultSearchProviderSuggestURL': u'http://search.my.company/suggest?q={searchTerms}', @@ -455,7 +448,6 @@ u'DefaultCookiesSetting': 1, u'DefaultGeolocationSetting': 1, u'DefaultJavaScriptSetting': 1, - u'DefaultKeygenSetting': 2, u'DefaultNotificationsSetting': 1, u'DefaultPopupsSetting': 2, u'DefaultSearchProviderEnabled': True,
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index b7d88e6a..4c5cf7d 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -1095,21 +1095,7 @@ }, "DefaultKeygenSetting": { - "os": ["win", "linux", "mac", "chromeos", "android"], - "test_policy": { "DefaultKeygenSetting": 2 }, - "pref_mappings": [ - { "pref": "profile.managed_default_content_settings.keygen", - "indicator_selector": "[content-setting=keygen]", - "indicator_tests": [ - { "policy": { "DefaultKeygenSetting": 1 }, - "value": "allow"}, - { "policy": { "DefaultKeygenSetting": 2 }, - "value": "block"} - ] - } - ], - - "note": "TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." + "note": "This policy is retired, see https://crbug.com/568184." }, "DefaultPluginsSetting": { @@ -1445,35 +1431,11 @@ }, "KeygenAllowedForUrls": { - "os": ["win", "linux", "mac", "chromeos", "android"], - "test_policy": { "KeygenAllowedForUrls": ["[*.]google.com"] }, - "pref_mappings": [ - { "pref": "profile.managed_keygen_allowed_for_urls", - "indicator_test_setup_js": "document.querySelector('button.exceptions-list-button[contentType=keygen]').click();", - "indicator_selector": "[content-exception=keygen]", - "indicator_tests": [ - { "policy": { "KeygenAllowedForUrls": ["[*.]google.com"] } } - ] - } - ], - - "note": "TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." + "note": "This policy is retired, see https://crbug.com/568184." }, "KeygenBlockedForUrls": { - "os": ["win", "linux", "mac", "chromeos", "android"], - "test_policy": { "KeygenBlockedForUrls": ["[*.]google.com"] }, - "pref_mappings": [ - { "pref": "profile.managed_keygen_blocked_for_urls", - "indicator_test_setup_js": "document.querySelector('button.exceptions-list-button[contentType=keygen]').click();", - "indicator_selector": "[content-exception=keygen]", - "indicator_tests": [ - { "policy": { "KeygenBlockedForUrls": ["[*.]google.com"] } } - ] - } - ], - - "note": "TODO(bartfab): Flag this with can_be_recommended when http://crbug.com/106682 is fixed." + "note": "This policy is retired, see https://crbug.com/568184." }, "PluginsAllowedForUrls": {
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 59a191b..306e535 100644 --- a/chrome/test/data/webui/settings/category_default_setting_tests.js +++ b/chrome/test/data/webui/settings/category_default_setting_tests.js
@@ -113,7 +113,8 @@ assertEquals( settings.ContentSettingsTypes.GEOLOCATION, contentType); assertEquals(enabled, testElement.categoryEnabled); - MockInteractions.tap(testElement.$.toggle); + browserProxy.resetResolver('setDefaultValueForContentType'); + MockInteractions.tap(testElement.$.toggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { assertEquals( @@ -192,10 +193,12 @@ assertEquals(category, contentType); assertTrue(testElement.categoryEnabled); + assertTrue(testElement.categoryEnabled); assertFalse(secondaryToggle.disabled); assertTrue(secondaryToggle.checked); - MockInteractions.tap(testElement.$.toggle); + browserProxy.resetResolver('setDefaultValueForContentType'); + MockInteractions.tap(testElement.$.toggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check THIRD_STATE => BLOCK transition succeeded. @@ -208,7 +211,7 @@ assertTrue(secondaryToggle.checked); browserProxy.resetResolver('setDefaultValueForContentType'); - MockInteractions.tap(testElement.$.toggle); + MockInteractions.tap(testElement.$.toggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check BLOCK => THIRD_STATE transition succeeded. @@ -221,7 +224,7 @@ assertTrue(secondaryToggle.checked); browserProxy.resetResolver('setDefaultValueForContentType'); - MockInteractions.tap(secondaryToggle); + MockInteractions.tap(secondaryToggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check THIRD_STATE => ALLOW transition succeeded. @@ -235,7 +238,7 @@ assertFalse(secondaryToggle.checked); browserProxy.resetResolver('setDefaultValueForContentType'); - MockInteractions.tap(testElement.$.toggle); + MockInteractions.tap(testElement.$.toggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check ALLOW => BLOCK transition succeeded. @@ -248,7 +251,7 @@ assertFalse(secondaryToggle.checked); browserProxy.resetResolver('setDefaultValueForContentType'); - MockInteractions.tap(testElement.$.toggle); + MockInteractions.tap(testElement.$.toggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check BLOCK => ALLOW transition succeeded. @@ -261,7 +264,7 @@ assertFalse(secondaryToggle.checked); browserProxy.resetResolver('setDefaultValueForContentType'); - MockInteractions.tap(secondaryToggle); + MockInteractions.tap(secondaryToggle.$.control); return browserProxy.whenCalled('setDefaultValueForContentType'); }).then(function(args) { // Check ALLOW => THIRD_STATE transition succeeded.
diff --git a/chrome/test/data/webui/settings/site_details_tests.js b/chrome/test/data/webui/settings/site_details_tests.js index 708772c..a4e83b2c 100644 --- a/chrome/test/data/webui/settings/site_details_tests.js +++ b/chrome/test/data/webui/settings/site_details_tests.js
@@ -65,14 +65,6 @@ source: 'preference', }, ], - keygen: [ - { - embeddingOrigin: 'https://foo-allow.com:443', - origin: 'https://foo-allow.com:443', - setting: 'allow', - source: 'preference', - }, - ], mic: [ { embeddingOrigin: 'https://foo-allow.com:443',
diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js index b43a0cc..a8e60e97 100644 --- a/chrome/test/data/webui/settings/site_list_tests.js +++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -58,7 +58,6 @@ ], images: [], javascript: [], - keygen: [], mic: [], notifications: [], plugins: [], @@ -148,7 +147,6 @@ source: 'preference', }, ], - keygen: [], mic: [], notifications: [], plugins: [], @@ -184,7 +182,6 @@ ], images: [], javascript: [], - keygen: [], mic: [], notifications: [ {
diff --git a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js index a2785d1..a0ef8dcf 100644 --- a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
@@ -14,7 +14,6 @@ cookies: '', geolocation: '', javascript: '', - keygen: '', mic: '', notifications: '', plugins: '', @@ -28,7 +27,6 @@ cookies: [], geolocation: [], javascript: [], - keygen: [], mic: [], notifications: [], plugins: [], @@ -145,8 +143,6 @@ pref = this.prefs_.defaults.images; } else if (contentType == settings.ContentSettingsTypes.JAVASCRIPT) { pref = this.prefs_.defaults.javascript; - } else if (contentType == settings.ContentSettingsTypes.KEYGEN) { - pref = this.prefs_.defaults.keygen; } else if (contentType == settings.ContentSettingsTypes.MIC) { pref = this.prefs_.defaults.mic; } else if (contentType == settings.ContentSettingsTypes.NOTIFICATIONS) { @@ -187,8 +183,6 @@ pref = this.prefs_.exceptions.images; else if (contentType == settings.ContentSettingsTypes.JAVASCRIPT) pref = this.prefs_.exceptions.javascript; - else if (contentType == settings.ContentSettingsTypes.KEYGEN) - pref = this.prefs_.exceptions.keygen; else if (contentType == settings.ContentSettingsTypes.MIC) pref = this.prefs_.exceptions.mic; else if (contentType == settings.ContentSettingsTypes.NOTIFICATIONS)
diff --git a/chromecast/BUILD.gn b/chromecast/BUILD.gn index 0ecc41f..56cec5d 100644 --- a/chromecast/BUILD.gn +++ b/chromecast/BUILD.gn
@@ -218,17 +218,11 @@ gtest_excludes = [ "*" ] } else if (target_os == "linux" && !is_cast_desktop_build) { # Run net_unittests first to avoid random failures due to slow python startup - # KeygenHandlerTest.SmokeTest and KeygenHandlerTest.ConcurrencyTest fail due to - # readonly certdb (b/8153161) # URLRequestTestHTTP.GetTest_ManyCookies takes roughly 55s to run. Increase # timeout to 90s from 45s to allow it to pass (b/19821476) # ProxyScriptFetcherImplTest.HttpMimeType is flaking (b/19848784) # Running a batch of net_unittests has high overhead. Run tests in batches of 50 to reduce number of batches (b/23156294). - gtest_excludes = [ - "KeygenHandlerTest.SmokeTest", - "KeygenHandlerTest.ConcurrencyTest", - "ProxyScriptFetcherImplTest.HttpMimeType", - ] + gtest_excludes = [ "ProxyScriptFetcherImplTest.HttpMimeType" ] args = [ "--test-launcher-timeout=90000", "--test-launcher-batch-limit=50",
diff --git a/chromecast/media/base/BUILD.gn b/chromecast/media/base/BUILD.gn index 6cdce89..4f85c03 100644 --- a/chromecast/media/base/BUILD.gn +++ b/chromecast/media/base/BUILD.gn
@@ -53,6 +53,7 @@ deps = [ "//base", "//chromecast/base", + "//chromecast/media/cma/backend", "//crypto", "//crypto:platform", "//media",
diff --git a/components/arc/common/app.mojom b/components/arc/common/app.mojom index 2cad0d4..6aedc0d 100644 --- a/components/arc/common/app.mojom +++ b/components/arc/common/app.mojom
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// Next MinVersion: 16 +// Next MinVersion: 17 module arc.mojom; @@ -69,7 +69,7 @@ MANAGE_LINKS = 1, }; -// Next method ID: 14 +// Next method ID: 16 interface AppHost { // Sends newly added ARC app to Chrome. This message is sent when ARC receives // package added notification. Multiple apps may be added in the one package. @@ -129,6 +129,12 @@ // Notifies that an application shortcut needs to be created. [MinVersion=9] OnInstallShortcut@11(ShortcutInfo shortcut); + // Notifies that Play Store installation has been started. + [MinVersion=16] OnInstallationStarted@14(); + + // Notifies that Play Store installation is finished. + [MinVersion=16] OnInstallationFinished@15(); + // Notifies that task requested orientation lock. [MinVersion=12] OnTaskOrientationLockRequested@12(int32 task_id, OrientationLock lock);
diff --git a/components/content_settings/core/browser/content_settings_default_provider.cc b/components/content_settings/core/browser/content_settings_default_provider.cc index f68ac5a5..261fedb 100644 --- a/components/content_settings/core/browser/content_settings_default_provider.cc +++ b/components/content_settings/core/browser/content_settings_default_provider.cc
@@ -177,11 +177,6 @@ GetPrefName(CONTENT_SETTINGS_TYPE_MIDI_SYSEX))), CONTENT_SETTING_NUM_SETTINGS); UMA_HISTOGRAM_ENUMERATION( - "ContentSettings.DefaultKeygenSetting", - IntToContentSetting(prefs_->GetInteger( - GetPrefName(CONTENT_SETTINGS_TYPE_KEYGEN))), - CONTENT_SETTING_NUM_SETTINGS); - UMA_HISTOGRAM_ENUMERATION( "ContentSettings.DefaultWebBluetoothGuardSetting", IntToContentSetting(prefs_->GetInteger( GetPrefName(CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD))),
diff --git a/components/content_settings/core/browser/content_settings_policy_provider.cc b/components/content_settings/core/browser/content_settings_policy_provider.cc index 8a7587b..81a059b 100644 --- a/components/content_settings/core/browser/content_settings_policy_provider.cc +++ b/components/content_settings/core/browser/content_settings_policy_provider.cc
@@ -55,11 +55,7 @@ {prefs::kManagedPopupsAllowedForUrls, CONTENT_SETTINGS_TYPE_POPUPS, CONTENT_SETTING_ALLOW}, {prefs::kManagedPopupsBlockedForUrls, CONTENT_SETTINGS_TYPE_POPUPS, - CONTENT_SETTING_BLOCK}, - {prefs::kManagedKeygenAllowedForUrls, - CONTENT_SETTINGS_TYPE_KEYGEN, CONTENT_SETTING_ALLOW}, - {prefs::kManagedKeygenBlockedForUrls, - CONTENT_SETTINGS_TYPE_KEYGEN, CONTENT_SETTING_BLOCK}}; + CONTENT_SETTING_BLOCK}}; } // namespace @@ -89,7 +85,6 @@ prefs::kManagedDefaultNotificationsSetting}, {CONTENT_SETTINGS_TYPE_PLUGINS, prefs::kManagedDefaultPluginsSetting}, {CONTENT_SETTINGS_TYPE_POPUPS, prefs::kManagedDefaultPopupsSetting}, - {CONTENT_SETTINGS_TYPE_KEYGEN, prefs::kManagedDefaultKeygenSetting}, {CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, prefs::kManagedDefaultWebBluetoothGuardSetting}, }; @@ -111,8 +106,6 @@ registry->RegisterListPref(prefs::kManagedPluginsBlockedForUrls); registry->RegisterListPref(prefs::kManagedPopupsAllowedForUrls); registry->RegisterListPref(prefs::kManagedPopupsBlockedForUrls); - registry->RegisterListPref(prefs::kManagedKeygenAllowedForUrls); - registry->RegisterListPref(prefs::kManagedKeygenBlockedForUrls); // Preferences for default content setting policies. If a policy is not set of // the corresponding preferences below is set to CONTENT_SETTING_DEFAULT. registry->RegisterIntegerPref(prefs::kManagedDefaultCookiesSetting, @@ -131,8 +124,6 @@ CONTENT_SETTING_DEFAULT); registry->RegisterIntegerPref(prefs::kManagedDefaultPopupsSetting, CONTENT_SETTING_DEFAULT); - registry->RegisterIntegerPref(prefs::kManagedDefaultKeygenSetting, - CONTENT_SETTING_DEFAULT); registry->RegisterIntegerPref(prefs::kManagedDefaultWebBluetoothGuardSetting, CONTENT_SETTING_DEFAULT); } @@ -162,8 +153,6 @@ pref_change_registrar_.Add(prefs::kManagedPluginsBlockedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedPopupsAllowedForUrls, callback); pref_change_registrar_.Add(prefs::kManagedPopupsBlockedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedKeygenAllowedForUrls, callback); - pref_change_registrar_.Add(prefs::kManagedKeygenBlockedForUrls, callback); // The following preferences are only used to indicate if a default content // setting is managed and to hold the managed default setting value. If the // value for any of the following preferences is set then the corresponding @@ -182,7 +171,6 @@ prefs::kManagedDefaultMediaStreamSetting, callback); pref_change_registrar_.Add(prefs::kManagedDefaultPluginsSetting, callback); pref_change_registrar_.Add(prefs::kManagedDefaultPopupsSetting, callback); - pref_change_registrar_.Add(prefs::kManagedDefaultKeygenSetting, callback); pref_change_registrar_.Add(prefs::kManagedDefaultWebBluetoothGuardSetting, callback); } @@ -428,9 +416,7 @@ name == prefs::kManagedPluginsAllowedForUrls || name == prefs::kManagedPluginsBlockedForUrls || name == prefs::kManagedPopupsAllowedForUrls || - name == prefs::kManagedPopupsBlockedForUrls || - name == prefs::kManagedKeygenAllowedForUrls || - name == prefs::kManagedKeygenBlockedForUrls) { + name == prefs::kManagedPopupsBlockedForUrls) { ReadManagedContentSettings(true); ReadManagedDefaultSettings(); }
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc index d922270..917c6cc 100644 --- a/components/content_settings/core/browser/content_settings_registry.cc +++ b/components/content_settings/core/browser/content_settings_registry.cc
@@ -256,14 +256,6 @@ WebsiteSettingsRegistry::PLATFORM_ANDROID, ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); - Register(CONTENT_SETTINGS_TYPE_KEYGEN, "keygen", CONTENT_SETTING_BLOCK, - WebsiteSettingsInfo::SYNCABLE, WhitelistedSchemes(), - ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), - WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, - WebsiteSettingsRegistry::DESKTOP | - WebsiteSettingsRegistry::PLATFORM_ANDROID, - ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); - Register(CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync", CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(),
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc index 89fae03..4ebb241f 100644 --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -210,7 +210,6 @@ default_provider->AddObserver(this); content_settings_providers_[DEFAULT_PROVIDER] = std::move(default_provider); - MigrateKeygenSettings(); MigrateDomainScopedSettings(false); RecordExceptionMetrics(); } @@ -501,45 +500,6 @@ resource_identifier, setting); } -void HostContentSettingsMap::MigrateKeygenSettings() { - const content_settings::ContentSettingsInfo* info = - content_settings::ContentSettingsRegistry::GetInstance()->Get( - CONTENT_SETTINGS_TYPE_KEYGEN); - if (info) { - ContentSettingsForOneType settings; - GetSettingsForOneType(CONTENT_SETTINGS_TYPE_KEYGEN, std::string(), - &settings); - - for (const ContentSettingPatternSource& setting_entry : settings) { - // Migrate user preference settings only. - if (setting_entry.source != "preference") - continue; - // Migrate old-format settings only. - if (setting_entry.secondary_pattern != - ContentSettingsPattern::Wildcard()) { - GURL url(setting_entry.primary_pattern.ToString()); - // Pull out the value of the old-format setting. Only do this if the - // patterns are as we expect them to be, otherwise the setting will just - // be removed for safety. - ContentSetting content_setting = CONTENT_SETTING_DEFAULT; - if (setting_entry.primary_pattern == setting_entry.secondary_pattern && - url.is_valid()) { - content_setting = GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()); - } - // Remove the old pattern. - SetContentSettingCustomScope(setting_entry.primary_pattern, - setting_entry.secondary_pattern, - CONTENT_SETTINGS_TYPE_KEYGEN, - std::string(), CONTENT_SETTING_DEFAULT); - // Set the new pattern. - SetContentSettingDefaultScope(url, GURL(), CONTENT_SETTINGS_TYPE_KEYGEN, - std::string(), content_setting); - } - } - } -} - void HostContentSettingsMap::MigrateDomainScopedSettings(bool after_sync) { DomainToOriginMigrationStatus status = static_cast<DomainToOriginMigrationStatus>(
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h index e970af8..b74865a 100644 --- a/components/content_settings/core/browser/host_content_settings_map.h +++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -314,7 +314,6 @@ DomainToOriginMigrationStatus); FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest, MigrateDomainScopedSettings); - FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest, MigrateKeygenSettings); friend class content_settings::TestUtils; @@ -330,16 +329,6 @@ ContentSettingsType content_type, ProviderType* provider_type) const; - // Migrate Keygen settings which only use a primary pattern. Settings which - // only used a primary pattern were inconsistent in what they did with the - // secondary pattern. Some stored a ContentSettingsPattern::Wildcard() whereas - // others stored the same pattern twice. This function migrates all such - // settings to use ContentSettingsPattern::Wildcard(). This allows us to make - // the scoping code consistent across different settings. - // TODO(lshang): Remove this when clients have migrated (~M53). We should - // leave in some code to remove old-format settings for a long time. - void MigrateKeygenSettings(); - // Collect UMA data of exceptions. void RecordExceptionMetrics();
diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc index 5e382002..5139efc 100644 --- a/components/content_settings/core/common/content_settings.cc +++ b/components/content_settings/core/common/content_settings.cc
@@ -52,7 +52,7 @@ CONTENT_SETTINGS_TYPE_APP_BANNER, CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, - CONTENT_SETTINGS_TYPE_KEYGEN, + CONTENT_SETTINGS_TYPE_DEFAULT, // KEYGEN (removed) CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, CONTENT_SETTINGS_TYPE_AUTOPLAY,
diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h index f4c8d739..f681464 100644 --- a/components/content_settings/core/common/content_settings_types.h +++ b/components/content_settings/core/common/content_settings_types.h
@@ -40,7 +40,6 @@ CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, - CONTENT_SETTINGS_TYPE_KEYGEN, CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, CONTENT_SETTINGS_TYPE_AUTOPLAY, CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT,
diff --git a/components/content_settings/core/common/pref_names.cc b/components/content_settings/core/common/pref_names.cc index 36a7e62..08bb3112 100644 --- a/components/content_settings/core/common/pref_names.cc +++ b/components/content_settings/core/common/pref_names.cc
@@ -42,8 +42,6 @@ "profile.managed_default_content_settings.plugins"; const char kManagedDefaultPopupsSetting[] = "profile.managed_default_content_settings.popups"; -const char kManagedDefaultKeygenSetting[] = - "profile.managed_default_content_settings.keygen"; const char kManagedDefaultWebBluetoothGuardSetting[] = "profile.managed_default_content_settings.web_bluetooth_guard"; @@ -77,9 +75,4 @@ "profile.managed_popups_allowed_for_urls"; const char kManagedPopupsBlockedForUrls[] = "profile.managed_popups_blocked_for_urls"; -const char kManagedKeygenAllowedForUrls[] = - "profile.managed_keygen_allowed_for_urls"; -const char kManagedKeygenBlockedForUrls[] = - "profile.managed_keygen_blocked_for_urls"; - } // namespace prefs
diff --git a/components/content_settings/core/common/pref_names.h b/components/content_settings/core/common/pref_names.h index 9ddbd4c8..daf1b6c 100644 --- a/components/content_settings/core/common/pref_names.h +++ b/components/content_settings/core/common/pref_names.h
@@ -26,7 +26,6 @@ extern const char kManagedDefaultGeolocationSetting[]; extern const char kManagedDefaultNotificationsSetting[]; extern const char kManagedDefaultMediaStreamSetting[]; -extern const char kManagedDefaultKeygenSetting[]; extern const char kManagedDefaultWebBluetoothGuardSetting[]; extern const char kManagedCookiesAllowedForUrls[]; @@ -43,8 +42,6 @@ extern const char kManagedNotificationsAllowedForUrls[]; extern const char kManagedNotificationsBlockedForUrls[]; extern const char kManagedAutoSelectCertificateForUrls[]; -extern const char kManagedKeygenAllowedForUrls[]; -extern const char kManagedKeygenBlockedForUrls[]; } // namespace prefs
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 30d4181..7ca12a6 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -3277,7 +3277,7 @@ 'caption': '''Do not allow any site to use key generation''', }, ], - 'supported_on': ['chrome.*:49-', 'chrome_os:49-', 'android:49-'], + 'supported_on': ['chrome.*:49-56', 'chrome_os:49-56', 'android:49-56'], 'features': { 'dynamic_refresh': True, 'per_profile': True, @@ -3478,7 +3478,7 @@ 'type': 'array', 'items': { 'type': 'string' }, }, - 'supported_on': ['chrome.*:49-', 'chrome_os:49-', 'android:49-'], + 'supported_on': ['chrome.*:49-56', 'chrome_os:49-56', 'android:49-56'], 'features': { 'dynamic_refresh': True, 'per_profile': True, @@ -3498,7 +3498,7 @@ 'type': 'array', 'items': { 'type': 'string' }, }, - 'supported_on': ['chrome.*:49-', 'chrome_os:49-', 'android:49-'], + 'supported_on': ['chrome.*:49-56', 'chrome_os:49-56', 'android:49-56'], 'features': { 'dynamic_refresh': True, 'per_profile': True,
diff --git a/components/safe_browsing_db/v4_database.cc b/components/safe_browsing_db/v4_database.cc index 62f37226..5edeb3e9 100644 --- a/components/safe_browsing_db/v4_database.cc +++ b/components/safe_browsing_db/v4_database.cc
@@ -175,6 +175,19 @@ return store_state_map; } +bool V4Database::AreStoresAvailable( + const StoresToCheck& stores_to_check) const { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + for (const ListIdentifier& identifier : stores_to_check) { + const auto& store_pair = store_map_->find(identifier); + if (store_pair == store_map_->end()) + return false; // Store not in our list + if (!store_pair->second->HasValidData()) + return false; // Store never properly populated. + } + return true; +} + void V4Database::GetStoresMatchingFullHash( const FullHash& full_hash, const StoresToCheck& stores_to_check,
diff --git a/components/safe_browsing_db/v4_database.h b/components/safe_browsing_db/v4_database.h index a81b9fff..19fee93 100644 --- a/components/safe_browsing_db/v4_database.h +++ b/components/safe_browsing_db/v4_database.h
@@ -116,6 +116,13 @@ // Returns the current state of each of the stores being managed. std::unique_ptr<StoreStateMap> GetStoreStateMap(); + // Check if all the selected stores are available and populated. + // Returns false if any of |stores_to_check| don't have valid data. + // A store may be unavailble if either it hasn't yet gotten a proper + // full-update (just after install, or corrupted/missing file), or if it's + // not supported in this build (i.e. Chromium). + virtual bool AreStoresAvailable(const StoresToCheck& stores_to_check) const; + // Searches for a hash prefix matching the |full_hash| in stores in the // database, filtered by |stores_to_check|, and returns the identifier of the // store along with the matching hash prefix in |matched_hash_prefix_map|.
diff --git a/components/safe_browsing_db/v4_database_unittest.cc b/components/safe_browsing_db/v4_database_unittest.cc index a72e6a8..a9133d7 100644 --- a/components/safe_browsing_db/v4_database_unittest.cc +++ b/components/safe_browsing_db/v4_database_unittest.cc
@@ -29,6 +29,8 @@ return hash_prefix_should_match_ ? full_hash : HashPrefix(); } + bool HasValidData() const override { return true; } + void set_hash_prefix_matches(bool hash_prefix_matches) { hash_prefix_should_match_ = hash_prefix_matches; } @@ -450,4 +452,28 @@ EXPECT_TRUE(verify_checksum_called_back_); } +// Test that we can properly check for unsupported stores +TEST_F(V4DatabaseTest, TestStoresAvailable) { + bool hash_prefix_matches = false; + RegisterFactory(hash_prefix_matches); + + V4Database::Create(task_runner_, database_dirname_, list_infos_, + callback_db_ready_); + created_but_not_called_back_ = true; + WaitForTasksOnTaskRunner(); + EXPECT_EQ(true, created_and_called_back_); + + // Doesn't exist in out list + const ListIdentifier bogus_id(LINUX_PLATFORM, CHROME_EXTENSION, + CSD_WHITELIST); + + EXPECT_TRUE(v4_database_->AreStoresAvailable( + StoresToCheck({linux_malware_id_, win_malware_id_}))); + + EXPECT_FALSE(v4_database_->AreStoresAvailable( + StoresToCheck({linux_malware_id_, bogus_id}))); + + EXPECT_FALSE(v4_database_->AreStoresAvailable(StoresToCheck({bogus_id}))); +} + } // namespace safe_browsing
diff --git a/components/safe_browsing_db/v4_local_database_manager.cc b/components/safe_browsing_db/v4_local_database_manager.cc index 2c89b27c..3b798c5c 100644 --- a/components/safe_browsing_db/v4_local_database_manager.cc +++ b/components/safe_browsing_db/v4_local_database_manager.cc
@@ -240,13 +240,19 @@ bool V4LocalDatabaseManager::CheckResourceUrl(const GURL& url, Client* client) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!enabled_ || !CanCheckUrl(url)) { + StoresToCheck stores_to_check({GetChromeUrlClientIncidentId()}); + + if (!CanCheckUrl(url) || !AreStoresAvailableNow(stores_to_check)) { + // Fail open: Mark resource as safe immediately. + // TODO(nparker): This should queue the request if the DB isn't yet + // loaded, and later decide if this store is available. + // Currently this is the only store that requires full-hash-checks + // AND isn't supported on Chromium, so it's unique. return true; } std::unique_ptr<PendingCheck> check = base::MakeUnique<PendingCheck>( - client, ClientCallbackType::CHECK_RESOURCE_URL, - StoresToCheck({GetChromeUrlClientIncidentId()}), + client, ClientCallbackType::CHECK_RESOURCE_URL, stores_to_check, std::vector<GURL>(1, url)); return HandleCheck(std::move(check)); @@ -255,37 +261,43 @@ bool V4LocalDatabaseManager::MatchCsdWhitelistUrl(const GURL& url) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!enabled_ || !v4_database_) { - // To make sure we are conservative we return true. + StoresToCheck stores_to_check({GetUrlCsdWhitelistId()}); + if (!AreStoresAvailableNow(stores_to_check)) { + // Fail open: Whitelist everything. Otherwise we may run the + // CSD phishing/malware detector on popular domains and generate + // undue load on the client and server. This has the effect of disabling + // CSD phishing/malware detection until the store is first synced. return true; } - return HandleUrlSynchronously(url, StoresToCheck({GetUrlCsdWhitelistId()})); + return HandleUrlSynchronously(url, stores_to_check); } bool V4LocalDatabaseManager::MatchDownloadWhitelistString( const std::string& str) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!enabled_ || !v4_database_) { - // To make sure we are conservative we return true. - return true; + StoresToCheck stores_to_check({GetCertCsdDownloadWhitelistId()}); + if (!AreStoresAvailableNow(stores_to_check)) { + // Fail close: Whitelist nothing. This may generate download-protection + // pings for whitelisted binaries, but that's fine. + return false; } - return HandleHashSynchronously( - str, StoresToCheck({GetCertCsdDownloadWhitelistId()})); + return HandleHashSynchronously(str, stores_to_check); } bool V4LocalDatabaseManager::MatchDownloadWhitelistUrl(const GURL& url) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!enabled_ || !v4_database_) { - // To make sure we are conservative we return true. - return true; + StoresToCheck stores_to_check({GetUrlCsdDownloadWhitelistId()}); + if (!AreStoresAvailableNow(stores_to_check)) { + // Fail close: Whitelist nothing. This may generate download-protection + // pings for whitelisted domains, but that's fine. + return false; } - return HandleUrlSynchronously( - url, StoresToCheck({GetUrlCsdDownloadWhitelistId()})); + return HandleUrlSynchronously(url, stores_to_check); } bool V4LocalDatabaseManager::MatchMalwareIP(const std::string& ip_address) { @@ -308,15 +320,16 @@ const std::string& str) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!enabled_ || !v4_database_) { - // To make sure we are conservative we return true. + StoresToCheck stores_to_check({GetChromeFilenameClientIncidentId()}); + if (!AreStoresAvailableNow(stores_to_check)) { + // Fail open: Whitelist everything. This has the effect of marking + // all DLLs as safe until the DB is synced and loaded. return true; } // str is the module's filename. Convert to hash. FullHash hash = crypto::SHA256HashString(str); - return HandleHashSynchronously( - hash, StoresToCheck({GetChromeFilenameClientIncidentId()})); + return HandleHashSynchronously(hash, stores_to_check); } ThreatSource V4LocalDatabaseManager::GetThreatSource() const { @@ -686,4 +699,10 @@ db_updated_callback_); } +bool V4LocalDatabaseManager::AreStoresAvailableNow( + const StoresToCheck& stores_to_check) const { + return enabled_ && v4_database_ && + v4_database_->AreStoresAvailable(stores_to_check); +} + } // namespace safe_browsing
diff --git a/components/safe_browsing_db/v4_local_database_manager.h b/components/safe_browsing_db/v4_local_database_manager.h index 146714f..32066390 100644 --- a/components/safe_browsing_db/v4_local_database_manager.h +++ b/components/safe_browsing_db/v4_local_database_manager.h
@@ -249,6 +249,10 @@ void UpdateRequestCompleted( std::unique_ptr<ParsedServerResponse> parsed_server_response); + // Return true if we're enabled and have loaded real data for all of + // these stores. + bool AreStoresAvailableNow(const StoresToCheck& stores_to_check) const; + // The base directory under which to create the files that contain hashes. const base::FilePath base_path_;
diff --git a/components/safe_browsing_db/v4_local_database_manager_unittest.cc b/components/safe_browsing_db/v4_local_database_manager_unittest.cc index e809b2c..3b03db0e 100644 --- a/components/safe_browsing_db/v4_local_database_manager_unittest.cc +++ b/components/safe_browsing_db/v4_local_database_manager_unittest.cc
@@ -17,13 +17,26 @@ namespace safe_browsing { +namespace { + +// Utility function for populating hashes. +FullHash HashForUrl(const GURL& url) { + std::vector<FullHash> full_hashes; + V4ProtocolManagerUtil::UrlToFullHashes(url, &full_hashes); + // ASSERT_GE(full_hashes.size(), 1u); + return full_hashes[0]; +} + +} // namespace + class FakeV4Database : public V4Database { public: static void Create( const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, std::unique_ptr<StoreMap> store_map, const StoreAndHashPrefixes& store_and_hash_prefixes, - NewDatabaseReadyCallback new_db_callback) { + NewDatabaseReadyCallback new_db_callback, + bool stores_available) { // Mimics V4Database::Create const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner = base::MessageLoop::current()->task_runner(); @@ -31,9 +44,10 @@ FROM_HERE, base::Bind(&FakeV4Database::CreateOnTaskRunner, db_task_runner, base::Passed(&store_map), store_and_hash_prefixes, - callback_task_runner, new_db_callback)); + callback_task_runner, new_db_callback, stores_available)); } + // V4Database implementation void GetStoresMatchingFullHash( const FullHash& full_hash, const StoresToCheck& stores_to_check, @@ -47,16 +61,22 @@ } } + bool AreStoresAvailable(const StoresToCheck& stores_to_check) const override { + return stores_available_; + } + private: static void CreateOnTaskRunner( const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, std::unique_ptr<StoreMap> store_map, const StoreAndHashPrefixes& store_and_hash_prefixes, const scoped_refptr<base::SingleThreadTaskRunner>& callback_task_runner, - NewDatabaseReadyCallback new_db_callback) { + NewDatabaseReadyCallback new_db_callback, + bool stores_available) { // Mimics the semantics of V4Database::CreateOnTaskRunner - std::unique_ptr<FakeV4Database> fake_v4_database(new FakeV4Database( - db_task_runner, std::move(store_map), store_and_hash_prefixes)); + std::unique_ptr<FakeV4Database> fake_v4_database( + new FakeV4Database(db_task_runner, std::move(store_map), + store_and_hash_prefixes, stores_available)); callback_task_runner->PostTask( FROM_HERE, base::Bind(new_db_callback, base::Passed(&fake_v4_database))); @@ -64,11 +84,14 @@ FakeV4Database(const scoped_refptr<base::SequencedTaskRunner>& db_task_runner, std::unique_ptr<StoreMap> store_map, - const StoreAndHashPrefixes& store_and_hash_prefixes) + const StoreAndHashPrefixes& store_and_hash_prefixes, + bool stores_available) : V4Database(db_task_runner, std::move(store_map)), - store_and_hash_prefixes_(store_and_hash_prefixes) {} + store_and_hash_prefixes_(store_and_hash_prefixes), + stores_available_(stores_available) {} const StoreAndHashPrefixes store_and_hash_prefixes_; + const bool stores_available_; }; class TestClient : public SafeBrowsingDatabaseManager::Client { @@ -147,7 +170,8 @@ return v4_local_database_manager_->queued_checks_; } - void ReplaceV4Database(const StoreAndHashPrefixes& store_and_hash_prefixes) { + void ReplaceV4Database(const StoreAndHashPrefixes& store_and_hash_prefixes, + bool stores_available = false) { // Disable the V4LocalDatabaseManager first so that if the callback to // verify checksum has been scheduled, then it doesn't do anything when it // is called back. @@ -163,7 +187,8 @@ base::Bind(&V4LocalDatabaseManager::DatabaseReadyForChecks, base::Unretained(v4_local_database_manager_.get())); FakeV4Database::Create(task_runner_, base::MakeUnique<StoreMap>(), - store_and_hash_prefixes, db_ready_callback); + store_and_hash_prefixes, db_ready_callback, + stores_available); WaitForTasksOnTaskRunner(); } @@ -196,6 +221,18 @@ base::RunLoop().RunUntilIdle(); } + // For those tests that need the fake manager + void SetupFakeManager() { + // StopLocalDatabaseManager before resetting it because that's what + // ~V4LocalDatabaseManager expects. + StopLocalDatabaseManager(); + v4_local_database_manager_ = + make_scoped_refptr(new FakeV4LocalDatabaseManager(base_dir_.GetPath())); + SetTaskRunnerForTest(); + StartLocalDatabaseManager(); + WaitForTasksOnTaskRunner(); + } + base::ScopedTempDir base_dir_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; content::TestBrowserThreadBundle thread_bundle_; @@ -315,14 +352,7 @@ // it uses a fake V4LocalDatabaseManager to assert that PerformFullHashCheck is // called async. TEST_F(V4LocalDatabaseManagerTest, PerformFullHashCheckCalledAsync) { - // StopLocalDatabaseManager before resetting it because that's what - // ~V4LocalDatabaseManager expects. - StopLocalDatabaseManager(); - v4_local_database_manager_ = - make_scoped_refptr(new FakeV4LocalDatabaseManager(base_dir_.GetPath())); - SetTaskRunnerForTest(); - StartLocalDatabaseManager(); - WaitForTasksOnTaskRunner(); + SetupFakeManager(); net::TestURLFetcherFactory factory; StoreAndHashPrefixes store_and_hash_prefixes; @@ -345,14 +375,7 @@ } TEST_F(V4LocalDatabaseManagerTest, UsingWeakPtrDropsCallback) { - // StopLocalDatabaseManager before resetting it because that's what - // ~V4LocalDatabaseManager expects. - StopLocalDatabaseManager(); - v4_local_database_manager_ = - make_scoped_refptr(new FakeV4LocalDatabaseManager(base_dir_.GetPath())); - SetTaskRunnerForTest(); - StartLocalDatabaseManager(); - WaitForTasksOnTaskRunner(); + SetupFakeManager(); net::TestURLFetcherFactory factory; StoreAndHashPrefixes store_and_hash_prefixes; @@ -375,13 +398,82 @@ WaitForTasksOnTaskRunner(); } +TEST_F(V4LocalDatabaseManagerTest, TestMatchCsdWhitelistUrl) { + SetupFakeManager(); + GURL good_url("http://safe.com"); + GURL other_url("http://iffy.com"); + + StoreAndHashPrefixes store_and_hash_prefixes; + store_and_hash_prefixes.emplace_back(GetUrlCsdWhitelistId(), + HashForUrl(good_url)); + + ReplaceV4Database(store_and_hash_prefixes, false /* not available */); + // No match, but since we never loaded the whitelist (not available), + // it defaults to true. + EXPECT_TRUE(v4_local_database_manager_->MatchCsdWhitelistUrl(good_url)); + + ReplaceV4Database(store_and_hash_prefixes, true /* available */); + // Not whitelisted. + EXPECT_FALSE(v4_local_database_manager_->MatchCsdWhitelistUrl(other_url)); + // Whitelisted. + EXPECT_TRUE(v4_local_database_manager_->MatchCsdWhitelistUrl(good_url)); + + EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( + v4_local_database_manager_)); +} + +TEST_F(V4LocalDatabaseManagerTest, TestMatchDownloadWhitelistString) { + SetupFakeManager(); + FullHash good_hash(crypto::SHA256HashString("Good .exe contents")); + FullHash other_hash(crypto::SHA256HashString("Other .exe contents")); + + StoreAndHashPrefixes store_and_hash_prefixes; + store_and_hash_prefixes.emplace_back(GetCertCsdDownloadWhitelistId(), + good_hash); + + ReplaceV4Database(store_and_hash_prefixes, false /* not available */); + // Verify it defaults to false when DB is not available. + EXPECT_FALSE( + v4_local_database_manager_->MatchDownloadWhitelistString(good_hash)); + + ReplaceV4Database(store_and_hash_prefixes, true /* available */); + // Not whitelisted. + EXPECT_FALSE( + v4_local_database_manager_->MatchDownloadWhitelistString(other_hash)); + // Whitelisted. + EXPECT_TRUE( + v4_local_database_manager_->MatchDownloadWhitelistString(good_hash)); + + EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( + v4_local_database_manager_)); +} + +TEST_F(V4LocalDatabaseManagerTest, TestMatchDownloadWhitelistUrl) { + SetupFakeManager(); + GURL good_url("http://safe.com"); + GURL other_url("http://iffy.com"); + + StoreAndHashPrefixes store_and_hash_prefixes; + store_and_hash_prefixes.emplace_back(GetCertCsdDownloadWhitelistId(), + HashForUrl(good_url)); + + ReplaceV4Database(store_and_hash_prefixes, false /* not available */); + // Verify it defaults to false when DB is not available. + EXPECT_FALSE(v4_local_database_manager_->MatchDownloadWhitelistUrl(good_url)); + + ReplaceV4Database(store_and_hash_prefixes, true /* available */); + // Not whitelisted. + EXPECT_FALSE( + v4_local_database_manager_->MatchDownloadWhitelistUrl(other_url)); + // Whitelisted. + EXPECT_TRUE(v4_local_database_manager_->MatchDownloadWhitelistUrl(good_url)); + + EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( + v4_local_database_manager_)); +} + TEST_F(V4LocalDatabaseManagerTest, TestMatchMalwareIP) { - StopLocalDatabaseManager(); - v4_local_database_manager_ = - make_scoped_refptr(new FakeV4LocalDatabaseManager(base_dir_.GetPath())); - SetTaskRunnerForTest(); - StartLocalDatabaseManager(); - WaitForTasksOnTaskRunner(); + SetupFakeManager(); // >>> hashlib.sha1(socket.inet_pton(socket.AF_INET6, // '::ffff:192.168.1.2')).digest() + chr(128) @@ -394,41 +486,43 @@ ReplaceV4Database(store_and_hash_prefixes); EXPECT_FALSE(v4_local_database_manager_->MatchMalwareIP("")); - EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( - v4_local_database_manager_)); - - // The fake database returns no match. + // Not blacklisted. EXPECT_FALSE(v4_local_database_manager_->MatchMalwareIP("192.168.1.1")); - EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( - v4_local_database_manager_)); - - // The fake database returns a matched hash prefix. + // Blacklisted. EXPECT_TRUE(v4_local_database_manager_->MatchMalwareIP("192.168.1.2")); + EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( v4_local_database_manager_)); } TEST_F(V4LocalDatabaseManagerTest, TestMatchModuleWhitelist) { - StopLocalDatabaseManager(); - v4_local_database_manager_ = - make_scoped_refptr(new FakeV4LocalDatabaseManager(base_dir_.GetPath())); - SetTaskRunnerForTest(); - StartLocalDatabaseManager(); - WaitForTasksOnTaskRunner(); + SetupFakeManager(); StoreAndHashPrefixes store_and_hash_prefixes; store_and_hash_prefixes.emplace_back(GetChromeFilenameClientIncidentId(), crypto::SHA256HashString("chrome.dll")); - ReplaceV4Database(store_and_hash_prefixes); - - // No match -- i.e. not whitelisted - EXPECT_FALSE( + ReplaceV4Database(store_and_hash_prefixes, false /* not available */); + // No match, but since we never loaded the whitelist (not available), + // it defaults to true. + EXPECT_TRUE( v4_local_database_manager_->MatchModuleWhitelistString("badstuff.dll")); + ReplaceV4Database(store_and_hash_prefixes, true /* available */); + // Not whitelisted. + EXPECT_FALSE( + v4_local_database_manager_->MatchModuleWhitelistString("badstuff.dll")); // Whitelisted. EXPECT_TRUE( v4_local_database_manager_->MatchModuleWhitelistString("chrome.dll")); + + EXPECT_FALSE(FakeV4LocalDatabaseManager::PerformFullHashCheckCalled( + v4_local_database_manager_)); } +// TODO(nparker): Add tests for +// CheckDownloadUrl() +// CheckExtensionIDs() +// CheckResourceUrl() + } // namespace safe_browsing
diff --git a/components/safe_browsing_db/v4_store.cc b/components/safe_browsing_db/v4_store.cc index efb548a5..34eaa27 100644 --- a/components/safe_browsing_db/v4_store.cc +++ b/components/safe_browsing_db/v4_store.cc
@@ -191,13 +191,19 @@ DCHECK(state_.empty()); StoreReadResult store_read_result = ReadFromDisk(); + has_valid_data_ = (store_read_result == READ_SUCCESS); RecordStoreReadResult(store_read_result); } +bool V4Store::HasValidData() const { + return has_valid_data_; +} + V4Store::V4Store(const scoped_refptr<base::SequencedTaskRunner>& task_runner, const base::FilePath& store_path, const int64_t old_file_size) : file_size_(old_file_size), + has_valid_data_(false), store_path_(store_path), task_runner_(task_runner) {} @@ -370,11 +376,12 @@ } if (apply_update_result == APPLY_UPDATE_SUCCESS) { + new_store->has_valid_data_ = true; RecordApplyUpdateTime(metric, TimeTicks::Now() - before, store_path_); } else { new_store.reset(); - DVLOG(1) << "Failure: ApplyUpdate: reason: " << apply_update_result - << "; store: " << *this; + DLOG(WARNING) << "Failure: ApplyUpdate: reason: " << apply_update_result + << "; store: " << *this; } RecordApplyUpdateResult(metric, apply_update_result, store_path_); @@ -738,7 +745,10 @@ file_format.SerializeToString(&file_format_string); size_t written = base::WriteFile(new_filename, file_format_string.data(), file_format_string.size()); - DCHECK_EQ(file_format_string.size(), written); + + if (file_format_string.size() != written) { + return UNEXPECTED_BYTES_WRITTEN_FAILURE; + } if (!base::Move(new_filename, store_path_)) { return UNABLE_TO_RENAME_FAILURE;
diff --git a/components/safe_browsing_db/v4_store.h b/components/safe_browsing_db/v4_store.h index a730208..ac990b3 100644 --- a/components/safe_browsing_db/v4_store.h +++ b/components/safe_browsing_db/v4_store.h
@@ -194,6 +194,10 @@ // of the hash prefixes. void Initialize(); + // True if this store has valid contents, either from a successful read + // from disk or a full update. This does not mean the checksum was verified. + virtual bool HasValidData() const; + // Reset internal state. void Reset(); @@ -393,6 +397,10 @@ // The size of the file on disk for this store. int64_t file_size_; + // True if the file was successfully read+parsed or was populated from + // a full update. + bool has_valid_data_; + // The state of the store as returned by the PVer4 server in the last applied // update response. std::string state_;
diff --git a/components/safe_browsing_db/v4_store_unittest.cc b/components/safe_browsing_db/v4_store_unittest.cc index 61af219..2922a7a 100644 --- a/components/safe_browsing_db/v4_store_unittest.cc +++ b/components/safe_browsing_db/v4_store_unittest.cc
@@ -69,19 +69,23 @@ } else { ASSERT_FALSE(store); } + + updated_store_ = std::move(store); } base::ScopedTempDir temp_dir_; base::FilePath store_path_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; content::TestBrowserThreadBundle thread_bundle_; + std::unique_ptr<V4Store> updated_store_; }; TEST_F(V4StoreTest, TestReadFromEmptyFile) { base::CloseFile(base::OpenFile(store_path_, "wb+")); - EXPECT_EQ(FILE_EMPTY_FAILURE, - V4Store(task_runner_, store_path_).ReadFromDisk()); + V4Store store(task_runner_, store_path_); + EXPECT_EQ(FILE_EMPTY_FAILURE, store.ReadFromDisk()); + EXPECT_FALSE(store.HasValidData()); } TEST_F(V4StoreTest, TestReadFromAbsentFile) { @@ -136,6 +140,7 @@ EXPECT_EQ(READ_SUCCESS, store.ReadFromDisk()); EXPECT_TRUE(store.hash_prefix_map_.empty()); EXPECT_EQ(14, store.file_size_); + EXPECT_FALSE(store.HasValidData()); } TEST_F(V4StoreTest, TestAddUnlumpedHashesWithInvalidAddition) { @@ -724,6 +729,7 @@ EXPECT_EQ(APPLY_UPDATE_SUCCESS, store.MergeUpdate(prefix_map_old, prefix_map_additions, nullptr, expected_checksum)); + EXPECT_FALSE(store.HasValidData()); // Never actually read from disk. // At this point, the store map looks like this: // 4: 1111abcdefgh @@ -754,6 +760,9 @@ // This ensures that the callback was called. EXPECT_TRUE(called_back); + // ApplyUpdate was successful, so we have valid data. + ASSERT_TRUE(updated_store_); + EXPECT_TRUE(updated_store_->HasValidData()); } TEST_F(V4StoreTest, TestMergeUpdatesFailsChecksum) { @@ -825,6 +834,14 @@ // the temp store file to |store_path_| it fails. EXPECT_EQ(UNABLE_TO_RENAME_FAILURE, V4Store(task_runner_, temp_dir_.GetPath()).WriteToDisk(Checksum())); + + // Give a location that isn't writable, even for the tmp file. + base::FilePath non_writable_dir = + temp_dir_.GetPath() + .Append(FILE_PATH_LITERAL("nonexistent_dir")) + .Append(FILE_PATH_LITERAL("some.store")); + EXPECT_EQ(UNEXPECTED_BYTES_WRITTEN_FAILURE, + V4Store(task_runner_, non_writable_dir).WriteToDisk(Checksum())); } TEST_F(V4StoreTest, FullUpdateFailsChecksumSynchronously) { @@ -834,6 +851,7 @@ base::Bind(&V4StoreTest::UpdatedStoreReady, base::Unretained(this), &called_back, false /* expect_store */); EXPECT_FALSE(base::PathExists(store.store_path_)); + EXPECT_FALSE(store.HasValidData()); // Never actually read from disk. // Now create a response with invalid checksum. std::unique_ptr<ListUpdateResponse> lur(new ListUpdateResponse); @@ -851,6 +869,7 @@ EXPECT_TRUE(called_back); // Ensure that the file is still not created. EXPECT_FALSE(base::PathExists(store.store_path_)); + EXPECT_FALSE(updated_store_); } } // namespace safe_browsing
diff --git a/components/tracing/child/child_trace_message_filter_browsertest.cc b/components/tracing/child/child_trace_message_filter_browsertest.cc index 156de40f..d0d2d020 100644 --- a/components/tracing/child/child_trace_message_filter_browsertest.cc +++ b/components/tracing/child/child_trace_message_filter_browsertest.cc
@@ -55,7 +55,8 @@ // registered itself by now; this cannot be prevented easily. mock_dump_provider_.reset(new MockDumpProvider()); MemoryDumpManager::GetInstance()->RegisterDumpProvider( - mock_dump_provider_.get(), "MockDumpProvider", nullptr); + mock_dump_provider_.get(), "MockDumpProvider", + base::ThreadTaskRunnerHandle::Get()); MemoryDumpManager::GetInstance() ->set_dumper_registrations_ignored_for_testing(true);
diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc index 43b5341..a93bf11 100644 --- a/components/url_formatter/url_formatter.cc +++ b/components/url_formatter/url_formatter.cc
@@ -462,6 +462,8 @@ // U+0338 is included in the recommended set, while U+05F4 and U+2027 are in // the inclusion set. However, they are blacklisted as a part of Mozilla's // IDN blacklist (http://kb.mozillazine.org/Network.IDN.blacklist_chars). + // U+2010 is in the inclusion set, but we drop it because it can be confused + // with an ASCII U+002D (Hyphen-Minus). // U+0338 and U+2027 are dropped; the former can look like a slash when // rendered with a broken font, and the latter can be confused with U+30FB // (Katakana Middle Dot). U+05F4 (Hebrew Punctuation Gershayim) is kept, @@ -469,6 +471,7 @@ // should be safe. When used with a non-Hebrew script, it'd be filtered by // other checks in place. allowed_set.remove(0x338u); // Combining Long Solidus Overlay + allowed_set.remove(0x2010u); // Hyphen allowed_set.remove(0x2027u); // Hyphenation Point uspoof_setAllowedUnicodeSet(checker_, &allowed_set, status);
diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc index 7261334..c0fe950 100644 --- a/components/url_formatter/url_formatter_unittest.cc +++ b/components/url_formatter/url_formatter_unittest.cc
@@ -290,6 +290,34 @@ // Hebrew Gershayim with Arabic is disallowed. {"xn--5eb7h.eg", L"\x0628\x05f4.eg", false}, + // Hyphens (http://unicode.org/cldr/utility/confusables.jsp?a=-) + // Hyphen-Minus (the only hyphen allowed) + // abc-def + {"abc-def.com", L"abc-def.com", true}, + // Modifier Letter Minus Sign + {"xn--abcdef-5od.com", L"abc\x02d7" L"def.com", false}, + // Hyphen + {"xn--abcdef-dg0c.com", L"abc\x2010" L"def.com", false}, + // Non-Breaking Hyphen + // This is actually an invalid IDNA domain (U+2011 normalizes to U+2010), but + // it is included to ensure that we do not inadvertently allow this character + // to be displayed as Unicode. + {"xn--abcdef-kg0c.com", L"abc\x2011" L"def.com", false}, + // Figure Dash + {"xn--abcdef-rg0c.com", L"abc\x2012" L"def.com", false}, + // En Dash + {"xn--abcdef-yg0c.com", L"abc\x2013" L"def.com", false}, + // Hyphen Bullet + {"xn--abcdef-kq0c.com", L"abc\x2043" L"def.com", false}, + // Minus Sign + {"xn--abcdef-5d3c.com", L"abc\x2212" L"def.com", false}, + // Heavy Minus Sign + {"xn--abcdef-kg1d.com", L"abc\x2796" L"def.com", false}, + // Coptic Capital Letter Dialect-P Ni + {"xn--abcdef-yy8d.com", L"abc\x2cba" L"def.com", false}, + // Small Em Dash + {"xn--abcdef-5g0c.com", L"abc\xfe58" L"def.com", false}, + // Custom dangerous patterns // Two Katakana-Hiragana combining mark in a row {"google.xn--com-oh4ba.evil.jp", L"google.com\x309a\x309a.evil.jp", false},
diff --git a/content/app/strings/content_strings.grd b/content/app/strings/content_strings.grd index f2f53d6a..5d8996a 100644 --- a/content/app/strings/content_strings.grd +++ b/content/app/strings/content_strings.grd
@@ -704,13 +704,6 @@ Year </message> - <message name="IDS_KEYGEN_HIGH_GRADE_KEY" desc="High-grade cryptographic key size menu item"> - 2048 (High Grade) - </message> - <message name="IDS_KEYGEN_MED_GRADE_KEY" desc="Medium-grade cryptographic key size menu item"> - 1024 (Medium Grade) - </message> - <message name="IDS_FORM_INPUT_WEEK_TEMPLATE" desc="A specfic week (1-53) in a specific year shown in a form control"> Week <ph name="WEEKNUMBER">$2<ex>51</ex></ph>, <ph name="YEAR">$1<ex>2012</ex></ph> </message>
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 170b815..766f201 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -1136,10 +1136,6 @@ RunHtmlTest(FILE_PATH_LITERAL("ins.html")); } -IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityKeygen) { - RunHtmlTest(FILE_PATH_LITERAL("keygen.html")); -} - IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityLabel) { RunHtmlTest(FILE_PATH_LITERAL("label.html")); }
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc index fb70d6e..111e3f6 100644 --- a/content/browser/loader/mime_sniffing_resource_handler.cc +++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -365,16 +365,6 @@ ResourceRequestInfoImpl* info = GetRequestInfo(); const std::string& mime_type = response_->head.mime_type; - // https://crbug.com/568184 - Temporary hack to track servers that aren't - // setting Content-Disposition when sending x-x509-user-cert and expecting - // the browser to automatically install certificates; this is being - // deprecated and will be removed upon full <keygen> removal. - if (mime_type == "application/x-x509-user-cert" && response_->head.headers) { - UMA_HISTOGRAM_BOOLEAN( - "UserCert.ContentDisposition", - response_->head.headers->HasHeader("Content-Disposition")); - } - // Allow requests for object/embed tags to be intercepted as streams. if (info->GetResourceType() == content::RESOURCE_TYPE_OBJECT) { DCHECK(!info->allow_download());
diff --git a/content/browser/renderer_host/input/synthetic_gesture.cc b/content/browser/renderer_host/input/synthetic_gesture.cc index cbe9e145..fd09c2a 100644 --- a/content/browser/renderer_host/input/synthetic_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_gesture.cc
@@ -43,6 +43,9 @@ case SyntheticGestureParams::TAP_GESTURE: return CreateGesture<SyntheticTapGesture, SyntheticTapGestureParams>(gesture_params); + case SyntheticGestureParams::POINTER_ACTION_LIST: + return CreateGesture<SyntheticPointerAction, + SyntheticPointerActionListParams>(gesture_params); default: NOTREACHED() << "Invalid synthetic gesture type"; return nullptr;
diff --git a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc index 7a53842..96be0d22 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_controller_unittest.cc
@@ -55,6 +55,45 @@ enum TouchGestureType { TOUCH_SCROLL, TOUCH_DRAG }; +WebTouchPoint::State ToWebTouchPointState( + SyntheticPointerActionParams::PointerActionType action_type) { + switch (action_type) { + case SyntheticPointerActionParams::PointerActionType::PRESS: + return WebTouchPoint::StatePressed; + case SyntheticPointerActionParams::PointerActionType::MOVE: + return WebTouchPoint::StateMoved; + case SyntheticPointerActionParams::PointerActionType::RELEASE: + return WebTouchPoint::StateReleased; + case SyntheticPointerActionParams::PointerActionType::IDLE: + return WebTouchPoint::StateStationary; + case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: + NOTREACHED() + << "Invalid SyntheticPointerActionParams::PointerActionType."; + return WebTouchPoint::StateUndefined; + } + NOTREACHED() << "Invalid SyntheticPointerActionParams::PointerActionType."; + return WebTouchPoint::StateUndefined; +} + +WebInputEvent::Type ToWebMouseEventType( + SyntheticPointerActionParams::PointerActionType action_type) { + switch (action_type) { + case SyntheticPointerActionParams::PointerActionType::PRESS: + return WebInputEvent::MouseDown; + case SyntheticPointerActionParams::PointerActionType::MOVE: + return WebInputEvent::MouseMove; + case SyntheticPointerActionParams::PointerActionType::RELEASE: + return WebInputEvent::MouseUp; + case SyntheticPointerActionParams::PointerActionType::IDLE: + case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: + NOTREACHED() + << "Invalid SyntheticPointerActionParams::PointerActionType."; + return WebInputEvent::Undefined; + } + NOTREACHED() << "Invalid SyntheticPointerActionParams::PointerActionType."; + return WebInputEvent::Undefined; +} + class MockSyntheticGesture : public SyntheticGesture { public: MockSyntheticGesture(bool* finished, int num_steps) @@ -474,21 +513,16 @@ class MockSyntheticPointerActionTarget : public MockSyntheticGestureTarget { public: - MockSyntheticPointerActionTarget() {} + MockSyntheticPointerActionTarget() : num_actions_dispatched_(0) {} ~MockSyntheticPointerActionTarget() override {} - gfx::PointF positions(int index) const { return positions_[index]; } - int indexes(int index) const { return indexes_[index]; } - WebTouchPoint::State states(int index) { return states_[index]; } - unsigned touch_length() const { return touch_length_; } WebInputEvent::Type type() const { return type_; } + int num_actions_dispatched() const { return num_actions_dispatched_; } + void reset_num_actions_dispatched() { num_actions_dispatched_ = 0; } protected: - gfx::PointF positions_[kTouchPointersLength]; - unsigned touch_length_; - int indexes_[kTouchPointersLength]; - WebTouchPoint::State states_[kTouchPointersLength]; WebInputEvent::Type type_; + int num_actions_dispatched_; }; class MockSyntheticPointerTouchActionTarget @@ -498,16 +532,133 @@ ~MockSyntheticPointerTouchActionTarget() override {} void DispatchInputEventToPlatform(const WebInputEvent& event) override { - ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type)); + DCHECK(WebInputEvent::isTouchEventType(event.type)); const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); type_ = touch_event.type; - for (size_t i = 0; i < touch_event.touchesLength; ++i) { + for (size_t i = 0; i < WebTouchEvent::kTouchesLengthCap; ++i) { indexes_[i] = touch_event.touches[i].id; positions_[i] = gfx::PointF(touch_event.touches[i].position); states_[i] = touch_event.touches[i].state; } touch_length_ = touch_event.touchesLength; + num_actions_dispatched_++; } + + testing::AssertionResult SyntheticTouchActionDispatchedCorrectly( + const SyntheticPointerActionParams& param, + int index) { + if (param.pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::PRESS || + param.pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::MOVE) { + if (indexes_[index] != param.index()) { + return testing::AssertionFailure() + << "Pointer index at index " << index << " was " + << indexes_[index] << ", expected " << param.index() << "."; + } + + if (positions_[index] != param.position()) { + return testing::AssertionFailure() + << "Pointer position at index " << index << " was " + << positions_[index].ToString() << ", expected " + << param.position().ToString() << "."; + } + } + + if (states_[index] != ToWebTouchPointState(param.pointer_action_type())) { + return testing::AssertionFailure() + << "Pointer states at index " << index << " was " << states_[index] + << ", expected " + << ToWebTouchPointState(param.pointer_action_type()) << "."; + } + return testing::AssertionSuccess(); + } + + testing::AssertionResult SyntheticTouchActionListDispatchedCorrectly( + const std::vector<SyntheticPointerActionParams>& params_list) { + if (touch_length_ != params_list.size()) { + return testing::AssertionFailure() << "Touch point length was " + << touch_length_ << ", expected " + << params_list.size() << "."; + } + + testing::AssertionResult result = testing::AssertionSuccess(); + for (size_t i = 0; i < params_list.size(); ++i) { + result = SyntheticTouchActionDispatchedCorrectly(params_list[i], + params_list[i].index()); + if (result == testing::AssertionFailure()) + return result; + } + return testing::AssertionSuccess(); + } + + private: + gfx::PointF positions_[kTouchPointersLength]; + unsigned touch_length_; + int indexes_[kTouchPointersLength]; + WebTouchPoint::State states_[kTouchPointersLength]; +}; + +class MockSyntheticPointerMouseActionTarget + : public MockSyntheticPointerActionTarget { + public: + MockSyntheticPointerMouseActionTarget() {} + ~MockSyntheticPointerMouseActionTarget() override {} + + void DispatchInputEventToPlatform(const WebInputEvent& event) override { + ASSERT_TRUE(WebInputEvent::isMouseEventType(event.type)); + const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event); + type_ = mouse_event.type; + position_ = gfx::PointF(mouse_event.x, mouse_event.y); + clickCount_ = mouse_event.clickCount; + button_ = mouse_event.button; + num_actions_dispatched_++; + } + + testing::AssertionResult SyntheticMouseActionDispatchedCorrectly( + const SyntheticPointerActionParams& param, + int click_count) { + if (type_ != ToWebMouseEventType(param.pointer_action_type())) { + return testing::AssertionFailure() + << "Pointer type was " << WebInputEvent::GetName(type_) + << ", expected " << WebInputEvent::GetName(ToWebMouseEventType( + param.pointer_action_type())) << "."; + } + + if (clickCount_ != click_count) { + return testing::AssertionFailure() << "Pointer click count was " + << clickCount_ << ", expected " + << click_count << "."; + } + + if (clickCount_ == 1 && button_ != WebMouseEvent::Button::Left) { + return testing::AssertionFailure() + << "Pointer button was " << (int)button_ << ", expected " + << (int)WebMouseEvent::Button::Left << "."; + } + + if (clickCount_ == 0 && button_ != WebMouseEvent::Button::NoButton) { + return testing::AssertionFailure() + << "Pointer button was " << (int)button_ << ", expected " + << (int)WebMouseEvent::Button::NoButton << "."; + } + + if ((param.pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::PRESS || + param.pointer_action_type() == + SyntheticPointerActionParams::PointerActionType::MOVE) && + position_ != param.position()) { + return testing::AssertionFailure() + << "Pointer position was " << position_.ToString() << ", expected " + << param.position().ToString() << "."; + } + return testing::AssertionSuccess(); + } + + private: + gfx::PointF position_; + int clickCount_; + WebMouseEvent::Button button_; }; class SyntheticGestureControllerTestBase { @@ -1471,6 +1622,148 @@ base::TimeDelta::FromMilliseconds(params.duration_ms)); } +TEST_F(SyntheticGestureControllerTest, PointerTouchAction) { + CreateControllerAndTarget<MockSyntheticPointerTouchActionTarget>(); + + // First, send two touch presses for finger 0 and finger 1. + SyntheticPointerActionListParams::ParamList param_list; + SyntheticPointerActionParams param0 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + SyntheticPointerActionParams param1 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + param0.set_position(gfx::PointF(54, 89)); + param0.set_index(0); + param1.set_position(gfx::PointF(79, 132)); + param1.set_index(1); + param_list.push_back(param0); + param_list.push_back(param1); + SyntheticPointerActionListParams params(param_list); + params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + std::unique_ptr<SyntheticPointerAction> gesture( + new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + FlushInputUntilComplete(); + + MockSyntheticPointerTouchActionTarget* pointer_touch_target = + static_cast<MockSyntheticPointerTouchActionTarget*>(target_); + EXPECT_EQ(1, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_touch_target->num_actions_dispatched(), 1); + EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( + param_list)); + + // Second, send a touch release for finger 0, a touch move for finger 1. + param0.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::MOVE); + param1.set_position(gfx::PointF(183, 239)); + param_list.clear(); + param_list.push_back(param0); + param_list.push_back(param1); + params.PushPointerActionParamsList(param_list); + gesture.reset(new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + pointer_touch_target->reset_num_actions_dispatched(); + FlushInputUntilComplete(); + + EXPECT_EQ(2, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_touch_target->num_actions_dispatched(), 2); + EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( + param_list)); + + // Third, send a touch release for finger 1. + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + param_list.clear(); + param_list.push_back(param1); + params.PushPointerActionParamsList(param_list); + gesture.reset(new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + pointer_touch_target->reset_num_actions_dispatched(); + FlushInputUntilComplete(); + + EXPECT_EQ(3, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_touch_target->num_actions_dispatched(), 3); + EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( + param_list)); +} + +TEST_F(SyntheticGestureControllerTest, PointerMouseAction) { + CreateControllerAndTarget<MockSyntheticPointerMouseActionTarget>(); + + // First, send a mouse move. + SyntheticPointerActionListParams::ParamList param_list; + SyntheticPointerActionParams param = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::MOVE); + + param.set_position(gfx::PointF(54, 89)); + SyntheticPointerActionListParams params; + params.PushPointerActionParams(param); + params.gesture_source_type = SyntheticGestureParams::MOUSE_INPUT; + std::unique_ptr<SyntheticPointerAction> gesture( + new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + FlushInputUntilComplete(); + + MockSyntheticPointerMouseActionTarget* pointer_mouse_target = + static_cast<MockSyntheticPointerMouseActionTarget*>(target_); + EXPECT_EQ(1, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_mouse_target->num_actions_dispatched(), 1); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param, 0)); + + // Second, send a mouse press. + param.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::PRESS); + param.set_position(gfx::PointF(183, 239)); + params.PushPointerActionParams(param); + gesture.reset(new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + pointer_mouse_target->reset_num_actions_dispatched(); + FlushInputUntilComplete(); + + EXPECT_EQ(2, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_mouse_target->num_actions_dispatched(), 2); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param, 1)); + + // Third, send a mouse move. + param.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::MOVE); + param.set_position(gfx::PointF(254, 279)); + params.PushPointerActionParams(param); + gesture.reset(new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + pointer_mouse_target->reset_num_actions_dispatched(); + FlushInputUntilComplete(); + + EXPECT_EQ(3, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_mouse_target->num_actions_dispatched(), 3); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param, 1)); + + // Fourth, send a mouse release. + param.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + params.PushPointerActionParams(param); + gesture.reset(new SyntheticPointerAction(params)); + QueueSyntheticGesture(std::move(gesture)); + pointer_mouse_target->reset_num_actions_dispatched(); + FlushInputUntilComplete(); + + EXPECT_EQ(4, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_EQ(pointer_mouse_target->num_actions_dispatched(), 4); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param, 1)); +} + } // namespace -} // namespace content +} // namespace content \ No newline at end of file
diff --git a/content/browser/renderer_host/input/synthetic_mouse_driver.cc b/content/browser/renderer_host/input/synthetic_mouse_driver.cc index 82dcbdd8..9daaae15 100644 --- a/content/browser/renderer_host/input/synthetic_mouse_driver.cc +++ b/content/browser/renderer_host/input/synthetic_mouse_driver.cc
@@ -18,11 +18,11 @@ target->DispatchInputEventToPlatform(mouse_event_); } -int SyntheticMouseDriver::Press(float x, float y) { +void SyntheticMouseDriver::Press(float x, float y, int index) { + DCHECK_EQ(index, 0); mouse_event_ = SyntheticWebMouseEventBuilder::Build( blink::WebInputEvent::MouseDown, x, y, 0); mouse_event_.clickCount = 1; - return 0; } void SyntheticMouseDriver::Move(float x, float y, int index) { @@ -44,7 +44,7 @@ bool SyntheticMouseDriver::UserInputCheck( const SyntheticPointerActionParams& params) const { - if (params.gesture_source_type != SyntheticGestureParams::MOUSE_INPUT) + if (params.index() != 0) return false; if (params.pointer_action_type() ==
diff --git a/content/browser/renderer_host/input/synthetic_mouse_driver.h b/content/browser/renderer_host/input/synthetic_mouse_driver.h index 1aef9a2..04a00706 100644 --- a/content/browser/renderer_host/input/synthetic_mouse_driver.h +++ b/content/browser/renderer_host/input/synthetic_mouse_driver.h
@@ -20,7 +20,7 @@ void DispatchEvent(SyntheticGestureTarget* target, const base::TimeTicks& timestamp) override; - int Press(float x, float y) override; + void Press(float x, float y, int index = 0) override; void Move(float x, float y, int index = 0) override; void Release(int index = 0) override;
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.cc b/content/browser/renderer_host/input/synthetic_pointer_action.cc index 59981ce..cd3c9552 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.cc +++ b/content/browser/renderer_host/input/synthetic_pointer_action.cc
@@ -11,58 +11,77 @@ namespace content { SyntheticPointerAction::SyntheticPointerAction( - const SyntheticPointerActionParams& params) - : params_(params) {} - -SyntheticPointerAction::SyntheticPointerAction( - std::vector<SyntheticPointerActionParams>* param_list, - SyntheticPointerDriver* synthetic_pointer_driver) - : param_list_(param_list), - synthetic_pointer_driver_(synthetic_pointer_driver) {} + const SyntheticPointerActionListParams& params) + : params_(params), + gesture_source_type_(SyntheticGestureParams::DEFAULT_INPUT), + state_(UNINITIALIZED), + num_actions_dispatched_(0U) {} SyntheticPointerAction::~SyntheticPointerAction() {} SyntheticGesture::Result SyntheticPointerAction::ForwardInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) { - DCHECK(synthetic_pointer_driver_); - return ForwardTouchOrMouseInputEvents(timestamp, target); + if (state_ == UNINITIALIZED) { + gesture_source_type_ = params_.gesture_source_type; + if (gesture_source_type_ == SyntheticGestureParams::DEFAULT_INPUT) + gesture_source_type_ = target->GetDefaultSyntheticGestureSourceType(); + + if (!synthetic_pointer_driver_) { + synthetic_pointer_driver_ = + SyntheticPointerDriver::Create(gesture_source_type_); + } + state_ = RUNNING; + } + + DCHECK_NE(gesture_source_type_, SyntheticGestureParams::DEFAULT_INPUT); + if (gesture_source_type_ == SyntheticGestureParams::DEFAULT_INPUT) + return SyntheticGesture::GESTURE_SOURCE_TYPE_NOT_IMPLEMENTED; + + state_ = ForwardTouchOrMouseInputEvents(timestamp, target); + + if (state_ == INVALID) + return POINTER_ACTION_INPUT_INVALID; + + return (state_ == DONE) ? SyntheticGesture::GESTURE_FINISHED + : SyntheticGesture::GESTURE_RUNNING; } -SyntheticGesture::Result SyntheticPointerAction::ForwardTouchOrMouseInputEvents( +SyntheticPointerAction::GestureState +SyntheticPointerAction::ForwardTouchOrMouseInputEvents( const base::TimeTicks& timestamp, SyntheticGestureTarget* target) { - for (SyntheticPointerActionParams& params : *param_list_) { - if (!synthetic_pointer_driver_->UserInputCheck(params)) - return POINTER_ACTION_INPUT_INVALID; + DCHECK_LT(num_actions_dispatched_, params_.params.size()); + SyntheticPointerActionListParams::ParamList& param_list = + params_.params[num_actions_dispatched_]; + for (SyntheticPointerActionParams& param : param_list) { + if (!synthetic_pointer_driver_->UserInputCheck(param)) + return INVALID; - switch (params.pointer_action_type()) { - case SyntheticPointerActionParams::PointerActionType::PRESS: { - int index = synthetic_pointer_driver_->Press(params.position().x(), - params.position().y()); - params.set_index(index); + switch (param.pointer_action_type()) { + case SyntheticPointerActionParams::PointerActionType::PRESS: + synthetic_pointer_driver_->Press(param.position().x(), + param.position().y(), param.index()); break; - } case SyntheticPointerActionParams::PointerActionType::MOVE: - synthetic_pointer_driver_->Move(params.position().x(), - params.position().y(), params.index()); + synthetic_pointer_driver_->Move(param.position().x(), + param.position().y(), param.index()); break; case SyntheticPointerActionParams::PointerActionType::RELEASE: - synthetic_pointer_driver_->Release(params.index()); - // Only reset the index for touch pointers. - if (params.gesture_source_type != SyntheticGestureParams::MOUSE_INPUT) - params.set_index(-1); + synthetic_pointer_driver_->Release(param.index()); break; case SyntheticPointerActionParams::PointerActionType::IDLE: break; case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: - return POINTER_ACTION_INPUT_INVALID; - case SyntheticPointerActionParams::PointerActionType::FINISH: - return GESTURE_FINISHED; + return INVALID; } } synthetic_pointer_driver_->DispatchEvent(target, timestamp); - return GESTURE_FINISHED; + num_actions_dispatched_++; + if (num_actions_dispatched_ == params_.params.size()) + return DONE; + else + return RUNNING; } -} // namespace content +} // namespace content \ No newline at end of file
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.h b/content/browser/renderer_host/input/synthetic_pointer_action.h index e346e7d..39b3656 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action.h +++ b/content/browser/renderer_host/input/synthetic_pointer_action.h
@@ -10,16 +10,15 @@ #include "content/browser/renderer_host/input/synthetic_gesture_target.h" #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" #include "content/common/content_export.h" +#include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_pointer_action_params.h" -using blink::WebTouchEvent; - namespace content { class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { public: - SyntheticPointerAction(std::vector<SyntheticPointerActionParams>* param_list, - SyntheticPointerDriver* synthetic_pointer_driver); + explicit SyntheticPointerAction( + const SyntheticPointerActionListParams& params); ~SyntheticPointerAction() override; SyntheticGesture::Result ForwardInputEvents( @@ -27,23 +26,18 @@ SyntheticGestureTarget* target) override; private: - explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); - SyntheticGesture::Result ForwardTouchOrMouseInputEvents( - const base::TimeTicks& timestamp, - SyntheticGestureTarget* target); + enum GestureState { UNINITIALIZED, RUNNING, INVALID, DONE }; - // SyntheticGestureController is responsible to create the - // SyntheticPointerActions and control when to forward them. + GestureState ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, + SyntheticGestureTarget* target); - // These two objects will be owned by SyntheticGestureController, which - // will manage their lifetime by initiating them when it starts processing a - // pointer action sequence and resetting them when it finishes. - // param_list_ contains a list of pointer actions which will be dispatched - // together. - std::vector<SyntheticPointerActionParams>* param_list_; - SyntheticPointerDriver* synthetic_pointer_driver_; - - SyntheticPointerActionParams params_; + // params_ contains a list of lists of pointer actions, that each list of + // pointer actions will be dispatched together. + SyntheticPointerActionListParams params_; + std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; + SyntheticGestureParams::GestureSourceType gesture_source_type_; + GestureState state_; + size_t num_actions_dispatched_; DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); };
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc b/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc index 48694180..3ef3d6f 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc +++ b/content/browser/renderer_host/input/synthetic_pointer_action_unittest.cc
@@ -33,7 +33,6 @@ return WebTouchPoint::StateReleased; case SyntheticPointerActionParams::PointerActionType::IDLE: return WebTouchPoint::StateStationary; - case SyntheticPointerActionParams::PointerActionType::FINISH: case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: NOTREACHED() << "Invalid SyntheticPointerActionParams::PointerActionType."; @@ -53,7 +52,6 @@ case SyntheticPointerActionParams::PointerActionType::RELEASE: return WebInputEvent::MouseUp; case SyntheticPointerActionParams::PointerActionType::IDLE: - case SyntheticPointerActionParams::PointerActionType::FINISH: case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: NOTREACHED() << "Invalid SyntheticPointerActionParams::PointerActionType."; @@ -102,7 +100,7 @@ DCHECK(WebInputEvent::isTouchEventType(event.type)); const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event); type_ = touch_event.type; - for (size_t i = 0; i < touch_event.touchesLength; ++i) { + for (size_t i = 0; i < WebTouchEvent::kTouchesLengthCap; ++i) { indexes_[i] = touch_event.touches[i].id; positions_[i] = gfx::PointF(touch_event.touches[i].position); states_[i] = touch_event.touches[i].state; @@ -150,7 +148,8 @@ testing::AssertionResult result = testing::AssertionSuccess(); for (size_t i = 0; i < params_list.size(); ++i) { - result = SyntheticTouchActionDispatchedCorrectly(params_list[i], i); + result = SyntheticTouchActionDispatchedCorrectly(params_list[i], + params_list[i].index()); if (result == testing::AssertionFailure()) return result; } @@ -187,29 +186,28 @@ testing::AssertionResult SyntheticMouseActionDispatchedCorrectly( const SyntheticPointerActionParams& param, int click_count) { - if (type() != ToWebMouseEventType(param.pointer_action_type())) { + if (type_ != ToWebMouseEventType(param.pointer_action_type())) { return testing::AssertionFailure() - << "Pointer type was " << WebInputEvent::GetName(type()) + << "Pointer type was " << WebInputEvent::GetName(type_) << ", expected " << WebInputEvent::GetName(ToWebMouseEventType( - param.pointer_action_type())) - << "."; + param.pointer_action_type())) << "."; } - if (clickCount() != click_count) { + if (clickCount_ != click_count) { return testing::AssertionFailure() << "Pointer click count was " - << clickCount() << ", expected " + << clickCount_ << ", expected " << click_count << "."; } - if (clickCount() == 1 && button() != WebMouseEvent::Button::Left) { + if (clickCount_ == 1 && button_ != WebMouseEvent::Button::Left) { return testing::AssertionFailure() - << "Pointer button was " << (int)button() << ", expected " + << "Pointer button was " << (int)button_ << ", expected " << (int)WebMouseEvent::Button::Left << "."; } - if (clickCount() == 0 && button() != WebMouseEvent::Button::NoButton) { + if (clickCount_ == 0 && button_ != WebMouseEvent::Button::NoButton) { return testing::AssertionFailure() - << "Pointer button was " << (int)button() << ", expected " + << "Pointer button was " << (int)button_ << ", expected " << (int)WebMouseEvent::Button::NoButton << "."; } @@ -217,9 +215,9 @@ SyntheticPointerActionParams::PointerActionType::PRESS || param.pointer_action_type() == SyntheticPointerActionParams::PointerActionType::MOVE) && - position() != param.position()) { + position_ != param.position()) { return testing::AssertionFailure() - << "Pointer position was " << position().ToString() + << "Pointer position was " << position_.ToString() << ", expected " << param.position().ToString() << "."; } return testing::AssertionSuccess(); @@ -230,10 +228,6 @@ return SyntheticGestureParams::MOUSE_INPUT; } - gfx::PointF position() const { return position_; } - int clickCount() const { return clickCount_; } - WebMouseEvent::Button button() const { return button_; } - private: gfx::PointF position_; int clickCount_; @@ -243,7 +237,7 @@ class SyntheticPointerActionTest : public testing::Test { public: SyntheticPointerActionTest() { - action_param_list_.reset(new std::vector<SyntheticPointerActionParams>()); + params_ = SyntheticPointerActionListParams(); num_success_ = 0; num_failure_ = 0; } @@ -258,13 +252,11 @@ } void ForwardSyntheticPointerAction() { - pointer_action_.reset(new SyntheticPointerAction( - action_param_list_.get(), synthetic_pointer_driver_.get())); - SyntheticGesture::Result result = pointer_action_->ForwardInputEvents( base::TimeTicks::Now(), target_.get()); - if (result == SyntheticGesture::GESTURE_FINISHED) + if (result == SyntheticGesture::GESTURE_FINISHED || + result == SyntheticGesture::GESTURE_RUNNING) num_success_++; else num_failure_++; @@ -275,202 +267,201 @@ std::unique_ptr<MockSyntheticPointerActionTarget> target_; std::unique_ptr<SyntheticGesture> pointer_action_; std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; - std::unique_ptr<std::vector<SyntheticPointerActionParams>> action_param_list_; + SyntheticPointerActionListParams params_; }; TEST_F(SyntheticPointerActionTest, PointerTouchAction) { CreateSyntheticPointerActionTarget<MockSyntheticPointerTouchActionTarget>(); // Send a touch press for one finger. - SyntheticPointerActionParams params0 = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::TOUCH_INPUT); - params0.set_position(gfx::PointF(54, 89)); - action_param_list_->push_back(params0); - ForwardSyntheticPointerAction(); + SyntheticPointerActionParams param1 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + param1.set_index(0); + param1.set_position(gfx::PointF(54, 89)); + SyntheticPointerActionListParams::ParamList param_list1; + param_list1.push_back(param1); + params_.PushPointerActionParamsList(param_list1); + // Send a touch move for the first finger and a touch press for the second + // finger. + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::MOVE); + param1.set_position(gfx::PointF(133, 156)); + SyntheticPointerActionParams param2 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + param2.set_index(1); + param2.set_position(gfx::PointF(79, 132)); + SyntheticPointerActionListParams::ParamList param_list2; + param_list2.push_back(param1); + param_list2.push_back(param2); + params_.PushPointerActionParamsList(param_list2); + + // Send a touch move for the second finger. + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::IDLE); + param2.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::MOVE); + param2.set_position(gfx::PointF(87, 253)); + SyntheticPointerActionListParams::ParamList param_list3; + param_list3.push_back(param1); + param_list3.push_back(param2); + params_.PushPointerActionParamsList(param_list3); + + // Send touch releases for both fingers. + SyntheticPointerActionListParams::ParamList param_list4; + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + param2.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + param_list4.push_back(param1); + param_list4.push_back(param2); + params_.PushPointerActionParamsList(param_list4); + pointer_action_.reset(new SyntheticPointerAction(params_)); + + ForwardSyntheticPointerAction(); MockSyntheticPointerTouchActionTarget* pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_.get()); EXPECT_EQ(1, num_success_); EXPECT_EQ(0, num_failure_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list1)); - // Send a touch move for the first finger and a touch press for the second - // finger. - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::MOVE); - action_param_list_->at(0).set_position(gfx::PointF(133, 156)); - SyntheticPointerActionParams params1 = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::TOUCH_INPUT); - params1.set_position(gfx::PointF(79, 132)); - action_param_list_->push_back(params1); ForwardSyntheticPointerAction(); - EXPECT_EQ(2, num_success_); EXPECT_EQ(0, num_failure_); // The type of the SyntheticWebTouchEvent is the action of the last finger. EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list2)); - // Send a touch move for the second finger. - action_param_list_->at(1).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::MOVE); - action_param_list_->at(1).set_position(gfx::PointF(87, 253)); ForwardSyntheticPointerAction(); - EXPECT_EQ(3, num_success_); EXPECT_EQ(0, num_failure_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchMove); EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list3)); - // Send touch releases for both fingers. - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::RELEASE); - action_param_list_->at(1).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::RELEASE); ForwardSyntheticPointerAction(); - EXPECT_EQ(4, num_success_); EXPECT_EQ(0, num_failure_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchEnd); EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list4)); } -TEST_F(SyntheticPointerActionTest, PointerTouchActionWithIdle) { +TEST_F(SyntheticPointerActionTest, PointerTouchActionsMultiPressRelease) { CreateSyntheticPointerActionTarget<MockSyntheticPointerTouchActionTarget>(); int count_success = 1; - // Send a touch press for one finger. - SyntheticPointerActionParams params0 = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::TOUCH_INPUT); - params0.set_position(gfx::PointF(54, 89)); - action_param_list_->push_back(params0); - ForwardSyntheticPointerAction(); + // Send a touch press for one finger. + SyntheticPointerActionParams param1 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + param1.set_index(0); + param1.set_position(gfx::PointF(54, 89)); + SyntheticPointerActionListParams::ParamList param_list1; + param_list1.push_back(param1); + params_.PushPointerActionParamsList(param_list1); + + SyntheticPointerActionParams param2 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::PRESS); + param2.set_index(1); + param2.set_position(gfx::PointF(123, 69)); + param1.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::IDLE); + SyntheticPointerActionListParams::ParamList param_list2; + param_list2.push_back(param1); + param_list2.push_back(param2); + + param2.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + SyntheticPointerActionListParams::ParamList param_list3; + param_list3.push_back(param1); + param_list3.push_back(param2); + for (int i = 0; i < 3; ++i) { + // Send a touch press for the second finger and not move the first finger. + params_.PushPointerActionParamsList(param_list2); + + // Send a touch release for the second finger and not move the first finger. + params_.PushPointerActionParamsList(param_list3); + } + pointer_action_.reset(new SyntheticPointerAction(params_)); + + ForwardSyntheticPointerAction(); MockSyntheticPointerTouchActionTarget* pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_.get()); EXPECT_EQ(count_success++, num_success_); EXPECT_EQ(0, num_failure_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list1)); - SyntheticPointerActionParams params1; - params1.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; - action_param_list_->push_back(params1); - for (int i = 0; i < 3; ++i) { - // Send a touch press for the second finger and not move the first finger. - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::IDLE); - action_param_list_->at(1).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::PRESS); - action_param_list_->at(1).set_position(gfx::PointF(123, 69)); + for (int index = 1; index < 4; ++index) { ForwardSyntheticPointerAction(); - EXPECT_EQ(count_success++, num_success_); EXPECT_EQ(0, num_failure_); // The type of the SyntheticWebTouchEvent is the action of the last finger. EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); EXPECT_TRUE( pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); - - // Send a touch release for the second finger and not move the first finger. - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::IDLE); - action_param_list_->at(1).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::RELEASE); + param_list2)); ForwardSyntheticPointerAction(); - EXPECT_EQ(count_success++, num_success_); EXPECT_EQ(0, num_failure_); // The type of the SyntheticWebTouchEvent is the action of the last finger. EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchEnd); EXPECT_TRUE( pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + param_list3)); } } -TEST_F(SyntheticPointerActionTest, PointerTouchActionSourceTypeInvalid) { - CreateSyntheticPointerActionTarget<MockSyntheticPointerTouchActionTarget>(); - - // Users' gesture source type does not match with the touch action. - SyntheticPointerActionParams params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::MOUSE_INPUT); - params.set_position(gfx::PointF(54, 89)); - action_param_list_->push_back(params); - ForwardSyntheticPointerAction(); - - EXPECT_EQ(0, num_success_); - EXPECT_EQ(1, num_failure_); - - params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::TOUCH_INPUT); - params.set_position(gfx::PointF(54, 89)); - action_param_list_->at(0) = params; - ForwardSyntheticPointerAction(); - - MockSyntheticPointerTouchActionTarget* pointer_touch_target = - static_cast<MockSyntheticPointerTouchActionTarget*>(target_.get()); - EXPECT_EQ(1, num_success_); - EXPECT_EQ(1, num_failure_); - EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); - EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); -} - TEST_F(SyntheticPointerActionTest, PointerTouchActionTypeInvalid) { CreateSyntheticPointerActionTarget<MockSyntheticPointerTouchActionTarget>(); // Cannot send a touch move or touch release without sending a touch press // first. - SyntheticPointerActionParams params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::MOVE, - SyntheticGestureParams::TOUCH_INPUT); - params.set_position(gfx::PointF(54, 89)); - action_param_list_->push_back(params); - ForwardSyntheticPointerAction(); + SyntheticPointerActionParams param = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::MOVE); + param.set_index(0); + param.set_position(gfx::PointF(54, 89)); + params_.PushPointerActionParams(param); + pointer_action_.reset(new SyntheticPointerAction(params_)); + ForwardSyntheticPointerAction(); EXPECT_EQ(0, num_success_); EXPECT_EQ(1, num_failure_); - action_param_list_->at(0).set_pointer_action_type( + param.set_pointer_action_type( SyntheticPointerActionParams::PointerActionType::RELEASE); - ForwardSyntheticPointerAction(); + params_ = SyntheticPointerActionListParams(); + params_.PushPointerActionParams(param); + pointer_action_.reset(new SyntheticPointerAction(params_)); + ForwardSyntheticPointerAction(); EXPECT_EQ(0, num_success_); EXPECT_EQ(2, num_failure_); // Send a touch press for one finger. - action_param_list_->at(0).set_pointer_action_type( + param.set_pointer_action_type( SyntheticPointerActionParams::PointerActionType::PRESS); - ForwardSyntheticPointerAction(); + params_ = SyntheticPointerActionListParams(); + params_.PushPointerActionParams(param); + params_.PushPointerActionParams(param); + pointer_action_.reset(new SyntheticPointerAction(params_)); + ForwardSyntheticPointerAction(); MockSyntheticPointerTouchActionTarget* pointer_touch_target = static_cast<MockSyntheticPointerTouchActionTarget*>(target_.get()); EXPECT_EQ(1, num_success_); EXPECT_EQ(2, num_failure_); EXPECT_EQ(pointer_touch_target->type(), WebInputEvent::TouchStart); - EXPECT_TRUE(pointer_touch_target->SyntheticTouchActionListDispatchedCorrectly( - *action_param_list_.get())); + EXPECT_TRUE( + pointer_touch_target->SyntheticTouchActionDispatchedCorrectly(param, 0)); // Cannot send a touch press again without releasing the finger. - action_param_list_->at(0).gesture_source_type = - SyntheticGestureParams::TOUCH_INPUT; - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::PRESS); ForwardSyntheticPointerAction(); - EXPECT_EQ(1, num_success_); EXPECT_EQ(3, num_failure_); } @@ -479,124 +470,90 @@ CreateSyntheticPointerActionTarget<MockSyntheticPointerMouseActionTarget>(); // Send a mouse move. - SyntheticPointerActionParams params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::MOVE, - SyntheticGestureParams::MOUSE_INPUT); - params.set_position(gfx::PointF(189, 62)); - action_param_list_->push_back(params); - ForwardSyntheticPointerAction(); - - MockSyntheticPointerMouseActionTarget* pointer_mouse_target = - static_cast<MockSyntheticPointerMouseActionTarget*>(target_.get()); - EXPECT_EQ(1, num_success_); - EXPECT_EQ(0, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 0)); + SyntheticPointerActionParams param1 = SyntheticPointerActionParams( + SyntheticPointerActionParams::PointerActionType::MOVE); + param1.set_position(gfx::PointF(189, 62)); + params_.PushPointerActionParams(param1); // Send a mouse down. - action_param_list_->at(0).set_position(gfx::PointF(189, 62)); - action_param_list_->at(0).set_pointer_action_type( + SyntheticPointerActionParams param2 = SyntheticPointerActionParams( SyntheticPointerActionParams::PointerActionType::PRESS); - ForwardSyntheticPointerAction(); - - EXPECT_EQ(2, num_success_); - EXPECT_EQ(0, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 1)); + param2.set_position(gfx::PointF(189, 62)); + params_.PushPointerActionParams(param2); // Send a mouse drag. - action_param_list_->at(0).set_position(gfx::PointF(326, 298)); - action_param_list_->at(0).set_pointer_action_type( + SyntheticPointerActionParams param3 = SyntheticPointerActionParams( SyntheticPointerActionParams::PointerActionType::MOVE); - ForwardSyntheticPointerAction(); - - EXPECT_EQ(3, num_success_); - EXPECT_EQ(0, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 1)); + param3.set_position(gfx::PointF(326, 298)); + params_.PushPointerActionParams(param3); // Send a mouse up. - action_param_list_->at(0).set_pointer_action_type( + SyntheticPointerActionParams param4 = SyntheticPointerActionParams( SyntheticPointerActionParams::PointerActionType::RELEASE); + params_.PushPointerActionParams(param4); + pointer_action_.reset(new SyntheticPointerAction(params_)); + ForwardSyntheticPointerAction(); - - EXPECT_EQ(4, num_success_); - EXPECT_EQ(0, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 1)); -} - -TEST_F(SyntheticPointerActionTest, PointerMouseActionSourceTypeInvalid) { - CreateSyntheticPointerActionTarget<MockSyntheticPointerMouseActionTarget>(); - - // Users' gesture source type does not match with the mouse action. - SyntheticPointerActionParams params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::TOUCH_INPUT); - params.set_position(gfx::PointF(54, 89)); - action_param_list_->push_back(params); - ForwardSyntheticPointerAction(); - - EXPECT_EQ(0, num_success_); - EXPECT_EQ(1, num_failure_); - - params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::PRESS, - SyntheticGestureParams::MOUSE_INPUT); - params.set_position(gfx::PointF(54, 89)); - action_param_list_->at(0) = params; - ForwardSyntheticPointerAction(); - MockSyntheticPointerMouseActionTarget* pointer_mouse_target = static_cast<MockSyntheticPointerMouseActionTarget*>(target_.get()); EXPECT_EQ(1, num_success_); - EXPECT_EQ(1, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 1)); + EXPECT_EQ(0, num_failure_); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param1, 0)); + + ForwardSyntheticPointerAction(); + EXPECT_EQ(2, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param2, 1)); + + ForwardSyntheticPointerAction(); + EXPECT_EQ(3, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param3, 1)); + + ForwardSyntheticPointerAction(); + EXPECT_EQ(4, num_success_); + EXPECT_EQ(0, num_failure_); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param4, 1)); } TEST_F(SyntheticPointerActionTest, PointerMouseActionTypeInvalid) { CreateSyntheticPointerActionTarget<MockSyntheticPointerMouseActionTarget>(); - // Send a mouse move. - SyntheticPointerActionParams params = SyntheticPointerActionParams( - SyntheticPointerActionParams::PointerActionType::MOVE, - SyntheticGestureParams::MOUSE_INPUT); - params.set_position(gfx::PointF(189, 62)); - action_param_list_->push_back(params); - ForwardSyntheticPointerAction(); - - MockSyntheticPointerMouseActionTarget* pointer_mouse_target = - static_cast<MockSyntheticPointerMouseActionTarget*>(target_.get()); - EXPECT_EQ(1, num_success_); - EXPECT_EQ(0, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 0)); - // Cannot send a mouse up without sending a mouse down first. - action_param_list_->at(0).set_pointer_action_type( + SyntheticPointerActionParams param = SyntheticPointerActionParams( SyntheticPointerActionParams::PointerActionType::RELEASE); - ForwardSyntheticPointerAction(); + params_.PushPointerActionParams(param); + pointer_action_.reset(new SyntheticPointerAction(params_)); - EXPECT_EQ(1, num_success_); + ForwardSyntheticPointerAction(); + EXPECT_EQ(0, num_success_); EXPECT_EQ(1, num_failure_); // Send a mouse down for one finger. - action_param_list_->at(0).set_pointer_action_type( + param.set_pointer_action_type( SyntheticPointerActionParams::PointerActionType::PRESS); - ForwardSyntheticPointerAction(); - - EXPECT_EQ(2, num_success_); - EXPECT_EQ(1, num_failure_); - EXPECT_TRUE(pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly( - action_param_list_->at(0), 1)); + param.set_position(gfx::PointF(54, 89)); + params_ = SyntheticPointerActionListParams(); + params_.PushPointerActionParams(param); // Cannot send a mouse down again without releasing the mouse button. - action_param_list_->at(0).set_pointer_action_type( - SyntheticPointerActionParams::PointerActionType::PRESS); - ForwardSyntheticPointerAction(); + params_.PushPointerActionParams(param); + pointer_action_.reset(new SyntheticPointerAction(params_)); - EXPECT_EQ(2, num_success_); + ForwardSyntheticPointerAction(); + MockSyntheticPointerMouseActionTarget* pointer_mouse_target = + static_cast<MockSyntheticPointerMouseActionTarget*>(target_.get()); + EXPECT_EQ(1, num_success_); + EXPECT_EQ(1, num_failure_); + EXPECT_TRUE( + pointer_mouse_target->SyntheticMouseActionDispatchedCorrectly(param, 1)); + + ForwardSyntheticPointerAction(); + EXPECT_EQ(1, num_success_); EXPECT_EQ(2, num_failure_); }
diff --git a/content/browser/renderer_host/input/synthetic_pointer_driver.h b/content/browser/renderer_host/input/synthetic_pointer_driver.h index b060b65e..32579fb 100644 --- a/content/browser/renderer_host/input/synthetic_pointer_driver.h +++ b/content/browser/renderer_host/input/synthetic_pointer_driver.h
@@ -28,7 +28,7 @@ virtual void DispatchEvent(SyntheticGestureTarget* target, const base::TimeTicks& timestamp) = 0; - virtual int Press(float x, float y) = 0; + virtual void Press(float x, float y, int index = 0) = 0; virtual void Move(float x, float y, int index = 0) = 0; virtual void Release(int index = 0) = 0;
diff --git a/content/browser/renderer_host/input/synthetic_touch_driver.cc b/content/browser/renderer_host/input/synthetic_touch_driver.cc index 6340a9a..19b94cb 100644 --- a/content/browser/renderer_host/input/synthetic_touch_driver.cc +++ b/content/browser/renderer_host/input/synthetic_touch_driver.cc
@@ -6,42 +6,51 @@ #include "content/browser/renderer_host/input/synthetic_gesture_target.h" -using blink::WebTouchEvent; - namespace content { -SyntheticTouchDriver::SyntheticTouchDriver() {} +SyntheticTouchDriver::SyntheticTouchDriver() { + std::fill(index_map_.begin(), index_map_.end(), -1); +} SyntheticTouchDriver::SyntheticTouchDriver(SyntheticWebTouchEvent touch_event) - : touch_event_(touch_event) {} + : touch_event_(touch_event) { + std::fill(index_map_.begin(), index_map_.end(), -1); +} SyntheticTouchDriver::~SyntheticTouchDriver() {} void SyntheticTouchDriver::DispatchEvent(SyntheticGestureTarget* target, const base::TimeTicks& timestamp) { touch_event_.timeStampSeconds = ConvertTimestampToSeconds(timestamp); - target->DispatchInputEventToPlatform(touch_event_); + if (touch_event_.type != blink::WebInputEvent::Undefined) + target->DispatchInputEventToPlatform(touch_event_); touch_event_.ResetPoints(); } -int SyntheticTouchDriver::Press(float x, float y) { - int index = touch_event_.PressPoint(x, y); - return index; +void SyntheticTouchDriver::Press(float x, float y, int index) { + DCHECK_GE(index, 0); + DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap); + int touch_index = touch_event_.PressPoint(x, y); + index_map_[index] = touch_index; } void SyntheticTouchDriver::Move(float x, float y, int index) { - touch_event_.MovePoint(index, x, y); + DCHECK_GE(index, 0); + DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap); + touch_event_.MovePoint(index_map_[index], x, y); } void SyntheticTouchDriver::Release(int index) { - touch_event_.ReleasePoint(index); + DCHECK_GE(index, 0); + DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap); + touch_event_.ReleasePoint(index_map_[index]); + index_map_[index] = -1; } bool SyntheticTouchDriver::UserInputCheck( const SyntheticPointerActionParams& params) const { - DCHECK_GE(params.index(), -1); - DCHECK_LT(params.index(), WebTouchEvent::kTouchesLengthCap); - if (params.gesture_source_type != SyntheticGestureParams::TOUCH_INPUT) + if (params.index() < 0 || + params.index() >= blink::WebTouchEvent::kTouchesLengthCap) return false; if (params.pointer_action_type() == @@ -51,19 +60,19 @@ if (params.pointer_action_type() == SyntheticPointerActionParams::PointerActionType::PRESS && - params.index() >= 0) { + index_map_[params.index()] >= 0) { return false; } if (params.pointer_action_type() == SyntheticPointerActionParams::PointerActionType::MOVE && - params.index() == -1) { + index_map_[params.index()] == -1) { return false; } if (params.pointer_action_type() == SyntheticPointerActionParams::PointerActionType::RELEASE && - params.index() == -1) { + index_map_[params.index()] == -1) { return false; }
diff --git a/content/browser/renderer_host/input/synthetic_touch_driver.h b/content/browser/renderer_host/input/synthetic_touch_driver.h index 5db84cf..71d9674 100644 --- a/content/browser/renderer_host/input/synthetic_touch_driver.h +++ b/content/browser/renderer_host/input/synthetic_touch_driver.h
@@ -22,7 +22,7 @@ void DispatchEvent(SyntheticGestureTarget* target, const base::TimeTicks& timestamp) override; - int Press(float x, float y) override; + void Press(float x, float y, int index) override; void Move(float x, float y, int index) override; void Release(int index) override; @@ -30,7 +30,11 @@ const SyntheticPointerActionParams& params) const override; private: + using IndexMap = std::array<int, blink::WebTouchEvent::kTouchesLengthCap>; + SyntheticWebTouchEvent touch_event_; + IndexMap index_map_; + DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver); };
diff --git a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc index 708cb34..8daff81 100644 --- a/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc
@@ -87,8 +87,8 @@ void SyntheticTouchscreenPinchGesture::PressTouchPoints( SyntheticGestureTarget* target, const base::TimeTicks& timestamp) { - synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_0_); - synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_1_); + synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_0_, 0); + synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_1_, 1); synthetic_pointer_driver_->DispatchEvent(target, timestamp); }
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 4e87e46..7a1dfea 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc
@@ -61,7 +61,6 @@ #include "media/base/media_log_event.h" #include "mojo/public/cpp/system/platform_handle.h" #include "net/base/io_buffer.h" -#include "net/base/keygen_handler.h" #include "net/base/mime_util.h" #include "net/base/request_priority.h" #include "net/http/http_cache.h" @@ -181,7 +180,6 @@ IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SetThreadPriority, OnSetThreadPriority) #endif - IPC_MESSAGE_HANDLER_DELAY_REPLY(RenderProcessHostMsg_Keygen, OnKeygen) IPC_MESSAGE_HANDLER(RenderProcessHostMsg_DidGenerateCacheableMetadata, OnCacheableMetadataAvailable) IPC_MESSAGE_HANDLER( @@ -405,76 +403,6 @@ url, expected_response_time, buf, buf_len); } -void RenderMessageFilter::OnKeygen(uint32_t key_size_index, - const std::string& challenge_string, - const GURL& url, - const GURL& top_origin, - IPC::Message* reply_msg) { - if (!resource_context_) - return; - - // Map displayed strings indicating level of keysecurity in the <keygen> - // menu to the key size in bits. (See SSLKeyGeneratorChromium.cpp in WebCore.) - int key_size_in_bits; - switch (key_size_index) { - case 0: - key_size_in_bits = 2048; - break; - case 1: - key_size_in_bits = 1024; - break; - default: - DCHECK(false) << "Illegal key_size_index " << key_size_index; - RenderProcessHostMsg_Keygen::WriteReplyParams(reply_msg, std::string()); - Send(reply_msg); - return; - } - - if (!GetContentClient()->browser()->AllowKeygen(top_origin, - resource_context_)) { - RenderProcessHostMsg_Keygen::WriteReplyParams(reply_msg, std::string()); - Send(reply_msg); - return; - } - - resource_context_->CreateKeygenHandler( - key_size_in_bits, - challenge_string, - url, - base::Bind( - &RenderMessageFilter::PostKeygenToWorkerThread, this, reply_msg)); -} - -void RenderMessageFilter::PostKeygenToWorkerThread( - IPC::Message* reply_msg, - std::unique_ptr<net::KeygenHandler> keygen_handler) { - VLOG(1) << "Dispatching keygen task to worker pool."; - // Dispatch to worker pool, so we do not block the IO thread. - if (!base::WorkerPool::PostTask( - FROM_HERE, - base::Bind(&RenderMessageFilter::OnKeygenOnWorkerThread, - this, - base::Passed(&keygen_handler), - reply_msg), - true)) { - NOTREACHED() << "Failed to dispatch keygen task to worker pool"; - RenderProcessHostMsg_Keygen::WriteReplyParams(reply_msg, std::string()); - Send(reply_msg); - } -} - -void RenderMessageFilter::OnKeygenOnWorkerThread( - std::unique_ptr<net::KeygenHandler> keygen_handler, - IPC::Message* reply_msg) { - DCHECK(reply_msg); - - // Generate a signed public key and challenge, then send it back. - RenderProcessHostMsg_Keygen::WriteReplyParams( - reply_msg, - keygen_handler->GenKeyAndSignChallenge()); - Send(reply_msg); -} - void RenderMessageFilter::OnMediaLogEvents( const std::vector<media::MediaLogEvent>& events) { // OnMediaLogEvents() is always dispatched to the UI thread for handling.
diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 908e3ff..d025771 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h
@@ -54,7 +54,6 @@ namespace net { class IOBuffer; -class KeygenHandler; class URLRequestContextGetter; } @@ -156,17 +155,6 @@ int buf_len, std::unique_ptr<CacheStorageCacheHandle> cache_handle, CacheStorageError error); - void OnKeygen(uint32_t key_size_index, - const std::string& challenge_string, - const GURL& url, - const GURL& top_origin, - IPC::Message* reply_msg); - void PostKeygenToWorkerThread( - IPC::Message* reply_msg, - std::unique_ptr<net::KeygenHandler> keygen_handler); - void OnKeygenOnWorkerThread( - std::unique_ptr<net::KeygenHandler> keygen_handler, - IPC::Message* reply_msg); void OnMediaLogEvents(const std::vector<media::MediaLogEvent>&); bool CheckBenchmarkingEnabled() const;
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc index 22c12ee..62b4396 100644 --- a/content/browser/resource_context_impl.cc +++ b/content/browser/resource_context_impl.cc
@@ -18,7 +18,6 @@ #include "content/browser/webui/url_data_manager_backend.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" -#include "net/base/keygen_handler.h" using base::UserDataAdapter; @@ -42,15 +41,6 @@ return media_device_id_salt_; } -void ResourceContext::CreateKeygenHandler( - uint32_t key_size_in_bits, - const std::string& challenge_string, - const GURL& url, - const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { - callback.Run(base::MakeUnique<net::KeygenHandler>(key_size_in_bits, - challenge_string, url)); -} - // static std::string ResourceContext::CreateRandomMediaDeviceIDSalt() { std::string salt;
diff --git a/content/browser/tracing/memory_tracing_browsertest.cc b/content/browser/tracing/memory_tracing_browsertest.cc index c015532..fe96666 100644 --- a/content/browser/tracing/memory_tracing_browsertest.cc +++ b/content/browser/tracing/memory_tracing_browsertest.cc
@@ -103,8 +103,8 @@ } void TearDown() override { - MemoryDumpManager::GetInstance()->UnregisterDumpProvider( - mock_dump_provider_.get()); + MemoryDumpManager::GetInstance()->UnregisterAndDeleteDumpProviderSoon( + std::move(mock_dump_provider_)); mock_dump_provider_.reset(); ContentBrowserTest::TearDown(); }
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index d6df25e..a87fcd54 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -214,10 +214,6 @@ return IDS_FORM_FILE_NO_FILE_LABEL; case WebLocalizedString::InputElementAltText: return IDS_FORM_INPUT_ALT; - case WebLocalizedString::KeygenMenuHighGradeKeySize: - return IDS_KEYGEN_HIGH_GRADE_KEY; - case WebLocalizedString::KeygenMenuMediumGradeKeySize: - return IDS_KEYGEN_MED_GRADE_KEY; case WebLocalizedString::MissingPluginText: return IDS_PLUGIN_INITIALIZATION_ERROR; case WebLocalizedString::MultipleFileUploadText: @@ -790,14 +786,6 @@ return false; } -blink::WebString BlinkPlatformImpl::signedPublicKeyAndChallengeString( - unsigned key_size_index, - const blink::WebString& challenge, - const blink::WebURL& url, - const blink::WebURL& top_origin) { - return blink::WebString(""); -} - size_t BlinkPlatformImpl::actualMemoryUsageMB() { return GetMemoryUsageKB() >> 10; }
diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h index d0261c9..0deda78 100644 --- a/content/child/blink_platform_impl.h +++ b/content/child/blink_platform_impl.h
@@ -73,11 +73,6 @@ const blink::WebSecurityOrigin& origin) override; bool databaseSetFileSize(const blink::WebString& vfs_file_name, long long size) override; - blink::WebString signedPublicKeyAndChallengeString( - unsigned key_size_index, - const blink::WebString& challenge, - const blink::WebURL& url, - const blink::WebURL& top_origin) override; size_t actualMemoryUsageMB() override; size_t numberOfProcessors() override;
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index a8877794..c9bb374 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -168,6 +168,8 @@ "input/synthetic_gesture_params.h", "input/synthetic_pinch_gesture_params.cc", "input/synthetic_pinch_gesture_params.h", + "input/synthetic_pointer_action_list_params.cc", + "input/synthetic_pointer_action_list_params.h", "input/synthetic_pointer_action_params.cc", "input/synthetic_pointer_action_params.h", "input/synthetic_smooth_drag_gesture_params.cc",
diff --git a/content/common/input/input_param_traits.cc b/content/common/input/input_param_traits.cc index 0fc7a56f..cc3c66b 100644 --- a/content/common/input/input_param_traits.cc +++ b/content/common/input/input_param_traits.cc
@@ -8,7 +8,7 @@ #include "content/common/content_param_traits.h" #include "content/common/input/synthetic_pinch_gesture_params.h" -#include "content/common/input/synthetic_pointer_action_params.h" +#include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" #include "content/common/input_messages.h" @@ -85,9 +85,9 @@ WriteParam(m, *content::SyntheticTapGestureParams::Cast( p.gesture_params())); break; - case content::SyntheticGestureParams::POINTER_ACTION: - WriteParam( - m, *content::SyntheticPointerActionParams::Cast(p.gesture_params())); + case content::SyntheticGestureParams::POINTER_ACTION_LIST: + WriteParam(m, *content::SyntheticPointerActionListParams::Cast( + p.gesture_params())); break; } } @@ -118,11 +118,10 @@ gesture_params = ReadGestureParams<content::SyntheticTapGestureParams>(m, iter); break; - case content::SyntheticGestureParams::POINTER_ACTION: { + case content::SyntheticGestureParams::POINTER_ACTION_LIST: gesture_params = - ReadGestureParams<content::SyntheticPointerActionParams>(m, iter); + ReadGestureParams<content::SyntheticPointerActionListParams>(m, iter); break; - } default: return false; } @@ -156,9 +155,10 @@ *content::SyntheticTapGestureParams::Cast(p.gesture_params()), l); break; - case content::SyntheticGestureParams::POINTER_ACTION: - LogParam(*content::SyntheticPointerActionParams::Cast(p.gesture_params()), - l); + case content::SyntheticGestureParams::POINTER_ACTION_LIST: + LogParam( + *content::SyntheticPointerActionListParams::Cast(p.gesture_params()), + l); break; } }
diff --git a/content/common/input/input_param_traits_unittest.cc b/content/common/input/input_param_traits_unittest.cc index fea7582a..c7e9c0d 100644 --- a/content/common/input/input_param_traits_unittest.cc +++ b/content/common/input/input_param_traits_unittest.cc
@@ -11,6 +11,7 @@ #include "content/common/input/input_event.h" #include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_pointer_action_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" @@ -83,7 +84,6 @@ static void Compare(const SyntheticPointerActionParams* a, const SyntheticPointerActionParams* b) { - EXPECT_EQ(a->gesture_source_type, b->gesture_source_type); EXPECT_EQ(a->pointer_action_type(), b->pointer_action_type()); if (a->pointer_action_type() == SyntheticPointerActionParams::PointerActionType::PRESS || @@ -91,9 +91,18 @@ SyntheticPointerActionParams::PointerActionType::MOVE) { EXPECT_EQ(a->position(), b->position()); } - if (a->pointer_action_type() != - SyntheticPointerActionParams::PointerActionType::FINISH) { - EXPECT_EQ(a->index(), b->index()); + EXPECT_EQ(a->index(), b->index()); + } + + static void Compare(const SyntheticPointerActionListParams* a, + const SyntheticPointerActionListParams* b) { + EXPECT_EQ(a->gesture_source_type, b->gesture_source_type); + EXPECT_EQ(a->params.size(), b->params.size()); + for (size_t i = 0; i < a->params.size(); ++i) { + EXPECT_EQ(a->params[i].size(), b->params[i].size()); + for (size_t j = 0; j < a->params[i].size(); ++j) { + Compare(&a->params[i][j], &b->params[i][j]); + } } } @@ -122,9 +131,9 @@ Compare(SyntheticTapGestureParams::Cast(a->gesture_params()), SyntheticTapGestureParams::Cast(b->gesture_params())); break; - case SyntheticGestureParams::POINTER_ACTION: - Compare(SyntheticPointerActionParams::Cast(a->gesture_params()), - SyntheticPointerActionParams::Cast(b->gesture_params())); + case SyntheticGestureParams::POINTER_ACTION_LIST: + Compare(SyntheticPointerActionListParams::Cast(a->gesture_params()), + SyntheticPointerActionListParams::Cast(b->gesture_params())); break; } } @@ -274,52 +283,71 @@ Verify(packet_in); } -TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsMove) { - std::unique_ptr<SyntheticPointerActionParams> gesture_params = - base::MakeUnique<SyntheticPointerActionParams>( - SyntheticPointerActionParams::PointerActionType::MOVE, - SyntheticGestureParams::TOUCH_INPUT); - gesture_params->set_position(gfx::PointF(356, 287)); - gesture_params->set_index(0); - ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, +TEST_F(InputParamTraitsTest, SyntheticPointerActionListParamsMove) { + SyntheticPointerActionParams action_params( + SyntheticPointerActionParams::PointerActionType::MOVE); + action_params.set_position(gfx::PointF(356, 287)); + action_params.set_index(0); + std::unique_ptr<SyntheticPointerActionListParams> gesture_params = + base::MakeUnique<SyntheticPointerActionListParams>(); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + gesture_params->PushPointerActionParams(action_params); + + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST, gesture_params->GetGestureType()); SyntheticGesturePacket packet_in; packet_in.set_gesture_params(std::move(gesture_params)); Verify(packet_in); } -TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsRelease) { - std::unique_ptr<SyntheticPointerActionParams> gesture_params = - base::MakeUnique<SyntheticPointerActionParams>( - SyntheticPointerActionParams::PointerActionType::RELEASE, - SyntheticGestureParams::TOUCH_INPUT); - gesture_params->set_index(0); - ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, +TEST_F(InputParamTraitsTest, SyntheticPointerActionListParamsPressRelease) { + std::unique_ptr<SyntheticPointerActionListParams> gesture_params = + base::MakeUnique<SyntheticPointerActionListParams>(); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + SyntheticPointerActionParams action_params( + SyntheticPointerActionParams::PointerActionType::PRESS); + action_params.set_index(0); + gesture_params->PushPointerActionParams(action_params); + action_params.set_pointer_action_type( + SyntheticPointerActionParams::PointerActionType::RELEASE); + gesture_params->PushPointerActionParams(action_params); + + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST, gesture_params->GetGestureType()); SyntheticGesturePacket packet_in; packet_in.set_gesture_params(std::move(gesture_params)); Verify(packet_in); } -TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsProcess) { - std::unique_ptr<SyntheticPointerActionParams> gesture_params = - base::MakeUnique<SyntheticPointerActionParams>( - SyntheticPointerActionParams::PointerActionType::IDLE, - SyntheticGestureParams::TOUCH_INPUT); - gesture_params->set_index(0); - ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, +TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsIdle) { + std::unique_ptr<SyntheticPointerActionListParams> gesture_params = + base::MakeUnique<SyntheticPointerActionListParams>(); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + SyntheticPointerActionParams action_params( + SyntheticPointerActionParams::PointerActionType::IDLE); + action_params.set_index(0); + gesture_params->PushPointerActionParams(action_params); + + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST, gesture_params->GetGestureType()); SyntheticGesturePacket packet_in; packet_in.set_gesture_params(std::move(gesture_params)); Verify(packet_in); } -TEST_F(InputParamTraitsTest, SyntheticPointerActionParamsFinish) { - std::unique_ptr<SyntheticPointerActionParams> gesture_params = - base::MakeUnique<SyntheticPointerActionParams>( - SyntheticPointerActionParams::PointerActionType::FINISH, - SyntheticGestureParams::TOUCH_INPUT); - ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, +TEST_F(InputParamTraitsTest, SyntheticPointerActionListParamsTwoPresses) { + SyntheticPointerActionListParams::ParamList param_list; + SyntheticPointerActionParams action_params( + SyntheticPointerActionParams::PointerActionType::PRESS); + action_params.set_index(0); + param_list.push_back(action_params); + action_params.set_index(1); + param_list.push_back(action_params); + std::unique_ptr<SyntheticPointerActionListParams> gesture_params = + base::MakeUnique<SyntheticPointerActionListParams>(param_list); + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; + + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST, gesture_params->GetGestureType()); SyntheticGesturePacket packet_in; packet_in.set_gesture_params(std::move(gesture_params));
diff --git a/content/common/input/synthetic_gesture_params.h b/content/common/input/synthetic_gesture_params.h index 5f308db..6f9a9887 100644 --- a/content/common/input/synthetic_gesture_params.h +++ b/content/common/input/synthetic_gesture_params.h
@@ -49,8 +49,8 @@ SMOOTH_DRAG_GESTURE, PINCH_GESTURE, TAP_GESTURE, - POINTER_ACTION, - SYNTHETIC_GESTURE_TYPE_MAX = POINTER_ACTION + POINTER_ACTION_LIST, + SYNTHETIC_GESTURE_TYPE_MAX = POINTER_ACTION_LIST }; virtual GestureType GetGestureType() const = 0;
diff --git a/content/common/input/synthetic_pointer_action_list_params.cc b/content/common/input/synthetic_pointer_action_list_params.cc new file mode 100644 index 0000000..b5d0a71 --- /dev/null +++ b/content/common/input/synthetic_pointer_action_list_params.cc
@@ -0,0 +1,48 @@ +// 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 "content/common/input/synthetic_pointer_action_list_params.h" + +#include "base/logging.h" + +namespace content { + +SyntheticPointerActionListParams::SyntheticPointerActionListParams() {} + +SyntheticPointerActionListParams::SyntheticPointerActionListParams( + const ParamList& param_list) { + params.push_back(param_list); +} + +SyntheticPointerActionListParams::SyntheticPointerActionListParams( + const SyntheticPointerActionListParams& other) + : SyntheticGestureParams(other), params(other.params) {} + +SyntheticPointerActionListParams::~SyntheticPointerActionListParams() {} + +SyntheticGestureParams::GestureType +SyntheticPointerActionListParams::GetGestureType() const { + return POINTER_ACTION_LIST; +} + +const SyntheticPointerActionListParams* SyntheticPointerActionListParams::Cast( + const SyntheticGestureParams* gesture_params) { + DCHECK(gesture_params); + DCHECK_EQ(POINTER_ACTION_LIST, gesture_params->GetGestureType()); + return static_cast<const SyntheticPointerActionListParams*>(gesture_params); +} + +void SyntheticPointerActionListParams::PushPointerActionParams( + const SyntheticPointerActionParams& param) { + ParamList param_list; + param_list.push_back(param); + params.push_back(param_list); +} + +void SyntheticPointerActionListParams::PushPointerActionParamsList( + const ParamList& param_list) { + params.push_back(param_list); +} + +} // namespace content
diff --git a/content/common/input/synthetic_pointer_action_list_params.h b/content/common/input/synthetic_pointer_action_list_params.h new file mode 100644 index 0000000..97528f8 --- /dev/null +++ b/content/common/input/synthetic_pointer_action_list_params.h
@@ -0,0 +1,39 @@ +// 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 CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_LIST_PARAMS_H_ +#define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_LIST_PARAMS_H_ + +#include <vector> +#include "content/common/content_export.h" +#include "content/common/input/synthetic_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_params.h" + +namespace content { + +struct CONTENT_EXPORT SyntheticPointerActionListParams + : public SyntheticGestureParams { + public: + using ParamList = std::vector<SyntheticPointerActionParams>; + + SyntheticPointerActionListParams(); + SyntheticPointerActionListParams(const ParamList& param_list); + SyntheticPointerActionListParams( + const SyntheticPointerActionListParams& other); + ~SyntheticPointerActionListParams() override; + + GestureType GetGestureType() const override; + + void PushPointerActionParams(const SyntheticPointerActionParams& param); + void PushPointerActionParamsList(const ParamList& param_list); + + std::vector<ParamList> params; + + static const SyntheticPointerActionListParams* Cast( + const SyntheticGestureParams* gesture_params); +}; + +} // namespace content + +#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_LIST_PARAMS_H_
diff --git a/content/common/input/synthetic_pointer_action_params.cc b/content/common/input/synthetic_pointer_action_params.cc index 5ed7c700..84efe47 100644 --- a/content/common/input/synthetic_pointer_action_params.cc +++ b/content/common/input/synthetic_pointer_action_params.cc
@@ -7,50 +7,12 @@ namespace content { SyntheticPointerActionParams::SyntheticPointerActionParams() - : pointer_action_type_(PointerActionType::NOT_INITIALIZED) { - index_ = gesture_source_type != MOUSE_INPUT ? -1 : 0; -} + : pointer_action_type_(PointerActionType::NOT_INITIALIZED), index_(0) {} SyntheticPointerActionParams::SyntheticPointerActionParams( - PointerActionType action_type, - GestureSourceType source_type) - : pointer_action_type_(action_type) { - gesture_source_type = source_type; - index_ = gesture_source_type != MOUSE_INPUT ? -1 : 0; -} - -SyntheticPointerActionParams::SyntheticPointerActionParams( - const SyntheticPointerActionParams& other) - : SyntheticGestureParams(other), - pointer_action_type_(other.pointer_action_type()) { - switch (other.pointer_action_type()) { - case PointerActionType::PRESS: - case PointerActionType::MOVE: - index_ = other.index(); - position_ = other.position(); - break; - case PointerActionType::RELEASE: - case PointerActionType::IDLE: - case PointerActionType::NOT_INITIALIZED: - index_ = other.index(); - break; - case PointerActionType::FINISH: - break; - } -} + PointerActionType action_type) + : pointer_action_type_(action_type), index_(0) {} SyntheticPointerActionParams::~SyntheticPointerActionParams() {} -SyntheticGestureParams::GestureType -SyntheticPointerActionParams::GetGestureType() const { - return POINTER_ACTION; -} - -const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( - const SyntheticGestureParams* gesture_params) { - DCHECK(gesture_params); - DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); - return static_cast<const SyntheticPointerActionParams*>(gesture_params); -} - -} // namespace content +} // namespace content \ No newline at end of file
diff --git a/content/common/input/synthetic_pointer_action_params.h b/content/common/input/synthetic_pointer_action_params.h index dc6fa50..6b4e74c 100644 --- a/content/common/input/synthetic_pointer_action_params.h +++ b/content/common/input/synthetic_pointer_action_params.h
@@ -18,41 +18,30 @@ namespace content { -struct CONTENT_EXPORT SyntheticPointerActionParams - : public SyntheticGestureParams { +struct CONTENT_EXPORT SyntheticPointerActionParams { public: // All the pointer actions that will be dispatched together will be grouped - // in an array. A FINISH action will be received when we reach the end of the - // action sequence. + // in an array. enum class PointerActionType { NOT_INITIALIZED, PRESS, MOVE, RELEASE, IDLE, - FINISH, - POINTER_ACTION_TYPE_MAX = FINISH + POINTER_ACTION_TYPE_MAX = IDLE }; SyntheticPointerActionParams(); - SyntheticPointerActionParams(PointerActionType action_type, - GestureSourceType source_type); - SyntheticPointerActionParams(const SyntheticPointerActionParams& other); - ~SyntheticPointerActionParams() override; - - GestureType GetGestureType() const override; - - static const SyntheticPointerActionParams* Cast( - const SyntheticGestureParams* gesture_params); + SyntheticPointerActionParams(PointerActionType action_type); + ~SyntheticPointerActionParams(); void set_pointer_action_type(PointerActionType pointer_action_type) { pointer_action_type_ = pointer_action_type; } void set_index(int index) { - DCHECK(pointer_action_type_ != PointerActionType::FINISH); - // For mouse pointers, the index should always be 0. - DCHECK(gesture_source_type != MOUSE_INPUT || index == 0); + DCHECK_GE(index, 0); + DCHECK_LT(index, blink::WebTouchEvent::kTouchesLengthCap); index_ = index; } @@ -65,9 +54,8 @@ PointerActionType pointer_action_type() const { return pointer_action_type_; } int index() const { - DCHECK(pointer_action_type_ != PointerActionType::FINISH); - // For mouse pointers, the index should always be 0. - DCHECK(gesture_source_type != MOUSE_INPUT || index_ == 0); + DCHECK_GE(index_, 0); + DCHECK_LT(index_, blink::WebTouchEvent::kTouchesLengthCap); return index_; } @@ -82,12 +70,13 @@ friend struct ipc_fuzzer::FuzzTraits<content::SyntheticPointerActionParams>; PointerActionType pointer_action_type_; - // Pass a position value when sending a press or move action. + // The position of the pointer, where it presses or moves to. gfx::PointF position_; - // Pass an index value except if the pointer_action_type_ is PROCESS. + // The index of the pointer in the pointer action sequence passed from the + // user API. int index_; }; } // namespace content -#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ +#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ \ No newline at end of file
diff --git a/content/common/input_messages.h b/content/common/input_messages.h index e57fac2c..914440d 100644 --- a/content/common/input_messages.h +++ b/content/common/input_messages.h
@@ -20,6 +20,7 @@ #include "content/common/input/synthetic_gesture_packet.h" #include "content/common/input/synthetic_gesture_params.h" #include "content/common/input/synthetic_pinch_gesture_params.h" +#include "content/common/input/synthetic_pointer_action_list_params.h" #include "content/common/input/synthetic_pointer_action_params.h" #include "content/common/input/synthetic_smooth_drag_gesture_params.h" #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" @@ -111,12 +112,16 @@ IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(content::SyntheticPointerActionParams) - IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) IPC_STRUCT_TRAITS_MEMBER(pointer_action_type_) IPC_STRUCT_TRAITS_MEMBER(index_) IPC_STRUCT_TRAITS_MEMBER(position_) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(content::SyntheticPointerActionListParams) + IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) + IPC_STRUCT_TRAITS_MEMBER(params) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(content::InputEventAck) IPC_STRUCT_TRAITS_MEMBER(source) IPC_STRUCT_TRAITS_MEMBER(type)
diff --git a/content/common/render_process_messages.h b/content/common/render_process_messages.h index 77bd8de..7ae52ee 100644 --- a/content/common/render_process_messages.h +++ b/content/common/render_process_messages.h
@@ -38,16 +38,6 @@ //////////////////////////////////////////////////////////////////////////////// // Messages sent from the render process to the browser. -// Asks the browser process to generate a keypair for grabbing a client -// certificate from a CA (<keygen> tag), and returns the signed public -// key and challenge string. -IPC_SYNC_MESSAGE_CONTROL4_1(RenderProcessHostMsg_Keygen, - uint32_t /* key size index */, - std::string /* challenge string */, - GURL /* URL of requestor */, - GURL /* Origin of top-level frame */, - std::string /* signed public key and challenge */) - // Message sent from the renderer to the browser to request that the browser // cache |data| associated with |url| and |expected_response_time|. IPC_MESSAGE_CONTROL3(RenderProcessHostMsg_DidGenerateCacheableMetadata,
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index b9b5d10c..279bede 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -211,11 +211,6 @@ } #endif // BUILDFLAG(ENABLE_WEBRTC) -bool ContentBrowserClient::AllowKeygen(const GURL& url, - content::ResourceContext* context) { - return true; -} - ContentBrowserClient::AllowWebBluetoothResult ContentBrowserClient::AllowWebBluetooth( content::BrowserContext* browser_context,
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index dbf96388..4c4c1cf6 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -387,9 +387,6 @@ ResourceContext* context); #endif // BUILDFLAG(ENABLE_WEBRTC) - // Allow the embedder to control whether we can use <keygen>. - virtual bool AllowKeygen(const GURL& url, content::ResourceContext* context); - // Allow the embedder to control whether we can use Web Bluetooth. // TODO(crbug.com/589228): Replace this with a use of the permission system. enum class AllowWebBluetoothResult {
diff --git a/content/public/browser/resource_context.h b/content/public/browser/resource_context.h index d2eeb30e..602f935 100644 --- a/content/public/browser/resource_context.h +++ b/content/public/browser/resource_context.h
@@ -15,11 +15,8 @@ #include "build/build_config.h" #include "content/common/content_export.h" -class GURL; - namespace net { class HostResolver; -class KeygenHandler; class URLRequestContext; } @@ -39,15 +36,6 @@ // with a BrowsingContext. virtual net::URLRequestContext* GetRequestContext() = 0; - // Create a platform KeygenHandler and pass it to |callback|. The |callback| - // may be run synchronously. - virtual void CreateKeygenHandler( - uint32_t key_size_in_bits, - const std::string& challenge_string, - const GURL& url, - const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& - callback); - // Returns a random salt string that is used for creating media device IDs. // Returns a random string by default. virtual std::string GetMediaDeviceIDSalt();
diff --git a/content/renderer/media/canvas_capture_handler.cc b/content/renderer/media/canvas_capture_handler.cc index 822da6a..fef1dc6f 100644 --- a/content/renderer/media/canvas_capture_handler.cc +++ b/content/renderer/media/canvas_capture_handler.cc
@@ -17,6 +17,7 @@ #include "content/renderer/media/media_stream_video_track.h" #include "content/renderer/media/webrtc_uma_histograms.h" #include "content/renderer/render_thread_impl.h" +#include "media/base/limits.h" #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/libyuv/include/libyuv.h" @@ -38,11 +39,14 @@ // This class is single threaded and pinned to main render thread. class VideoCapturerSource : public media::VideoCapturerSource { public: - explicit VideoCapturerSource(base::WeakPtr<CanvasCaptureHandler> - canvas_handler, - double frame_rate) - : frame_rate_(frame_rate), - canvas_handler_(canvas_handler) {} + VideoCapturerSource(base::WeakPtr<CanvasCaptureHandler> canvas_handler, + double frame_rate) + : frame_rate_(static_cast<float>( + std::min(static_cast<double>(media::limits::kMaxFramesPerSecond), + frame_rate))), + canvas_handler_(canvas_handler) { + DCHECK_LE(0, frame_rate_); + } protected: void GetCurrentSupportedFormats( @@ -79,7 +83,7 @@ } private: - const double frame_rate_; + const float frame_rate_; // Bound to Main Render thread. base::ThreadChecker main_render_thread_checker_; // CanvasCaptureHandler is owned by CanvasDrawListener in blink and might be
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index eb3de78..3d91912 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -782,20 +782,6 @@ //------------------------------------------------------------------------------ -blink::WebString RendererBlinkPlatformImpl::signedPublicKeyAndChallengeString( - unsigned key_size_index, - const blink::WebString& challenge, - const blink::WebURL& url, - const blink::WebURL& top_origin) { - std::string signed_public_key; - RenderThread::Get()->Send(new RenderProcessHostMsg_Keygen( - static_cast<uint32_t>(key_size_index), challenge.utf8(), GURL(url), - GURL(top_origin), &signed_public_key)); - return WebString::fromUTF8(signed_public_key); -} - -//------------------------------------------------------------------------------ - blink::WebScrollbarBehavior* RendererBlinkPlatformImpl::scrollbarBehavior() { return web_scrollbar_behavior_.get(); }
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 9c41bdc0..6c9ac66 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h
@@ -116,11 +116,6 @@ const blink::WebSecurityOrigin& origin) override; cc::FrameSinkId generateFrameSinkId() override; - blink::WebString signedPublicKeyAndChallengeString( - unsigned key_size_index, - const blink::WebString& challenge, - const blink::WebURL& url, - const blink::WebURL& top_origin) override; void getPluginList(bool refresh, const blink::WebSecurityOrigin& mainFrameOrigin, blink::WebPluginListBuilder* builder) override;
diff --git a/content/test/data/accessibility/html/keygen-expected-win.txt b/content/test/data/accessibility/html/keygen-expected-win.txt deleted file mode 100644 index 11e72f74..0000000 --- a/content/test/data/accessibility/html/keygen-expected-win.txt +++ /dev/null
@@ -1,7 +0,0 @@ -ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE -++IA2_ROLE_SECTION role_name='body' -++++IA2_ROLE_SECTION FOCUSABLE role_name='keygen' -++++++ROLE_SYSTEM_COMBOBOX COLLAPSED FOCUSABLE HASPOPUP -++++++++ROLE_SYSTEM_LIST INVISIBLE -++++++++++ROLE_SYSTEM_LISTITEM SELECTED FOCUSABLE SELECTABLE -++++++++++ROLE_SYSTEM_LISTITEM INVISIBLE FOCUSABLE SELECTABLE
diff --git a/content/test/data/accessibility/html/keygen.html b/content/test/data/accessibility/html/keygen.html deleted file mode 100644 index ce904c2..0000000 --- a/content/test/data/accessibility/html/keygen.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!-- -@WIN-ALLOW:SELECTED -@WIN-ALLOW:SELECTABLE -@WIN-ALLOW:role_name* -@WIN-ALLOW:COLLAPSED -@WIN-ALLOW:INVISIBLE -@WIN-ALLOW:HASPOPUP -@WIN-DENY:name='* ---> -<!DOCTYPE html> -<html> -<body> - <keygen name="security"> -</body> -</html>
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 68944bb..7b26540a 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -50,8 +50,6 @@ bug=660844) # WebGL 2.0.1 self.Fail('conformance2/rendering/read-draw-when-missing-image.html', ['linux', 'nvidia', 'opengl'], bug=672719) # WebGL 2.0.1 - self.Fail('conformance2/glsl3/float-parsing.html', - bug=672722) # WebGL 2.0.1 self.Fail('conformance2/textures/misc/' + 'integer-cubemap-specification-order-bug.html', bug=483282) # owner:cwallez, test might be buggy @@ -70,65 +68,6 @@ self.Fail('conformance2/rendering/blitframebuffer-stencil-only.html', ['win', 'amd'], bug=483282) # owner:jmadill - # Failing due to the 16.12.1 driver upgrade - self.Fail('conformance2/textures/canvas/tex-3d-rgb16f-rgb-float.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/canvas/' + - 'tex-2d-rgb8ui-rgb_integer-unsigned_byte.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/canvas_sub_rectangle/' + - 'tex-3d-rgb8-rgb-unsigned_byte.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/canvas_sub_rectangle/' + - 'tex-3d-rgb565-rgb-unsigned_byte.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/canvas_sub_rectangle/' + - 'tex-3d-rgb565-rgb-unsigned_short_5_6_5.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/canvas_sub_rectangle/' + - 'tex-3d-rgb32f-rgb-float.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/canvas_sub_rectangle/' + - 'tex-3d-rgb16f-rgb-half_float.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/image/' + - 'tex-3d-rgb565-rgb-unsigned_byte.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/image/tex-3d-rgb32f-rgb-float.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/image/' + - 'tex-3d-rgb565-rgb-unsigned_short_5_6_5.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/image/tex-3d-rgb16f-rgb-float.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/image/' + - 'tex-3d-srgb8-rgb-unsigned_byte.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/image_data/' + - 'tex-3d-rgb16f-rgb-half_float.html', ['win', 'amd', 'd3d11'], - bug=676333) - self.Fail('conformance2/textures/image_data/tex-3d-rgb32f-rgb-float.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/video/tex-3d-rgb8-rgb-unsigned_byte.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_texsubimage3d_00.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_texsubimage3d_01.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_texsubimage3d_03.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_teximage3d_3d_00.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_teximage3d_3d_02.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'basic_teximage3d_3d_03.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturespecification/' + - 'teximage3d_pbo_3d_01.html', ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('deqp/functional/gles3/texturefiltering/3d_formats_05.html', - ['win', 'amd', 'd3d11'], bug=676333) - self.Fail('conformance2/textures/misc/tex-unpack-params.html', - ['win', 'amd', 'd3d11'], bug=676333) - # Failing on old R5 230 configuration. self.Fail('deqp/functional/gles3/shadertexturefunction/' + 'texelfetchoffset.html',
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc index 0ab0cc4..e0625c1 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc +++ b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc
@@ -44,7 +44,6 @@ #include "ios/chrome/browser/net/ios_chrome_url_request_context_getter.h" #include "ios/chrome/browser/net/proxy_service_factory.h" #include "ios/web/public/web_thread.h" -#include "net/base/keygen_handler.h" #include "net/cert/cert_verifier.h" #include "net/cert/multi_log_ct_verifier.h" #include "net/cookies/canonical_cookie.h"
diff --git a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm index 09d8d61..5539e74 100644 --- a/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm +++ b/ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm
@@ -196,6 +196,8 @@ // Setup/tearDown methods are used to register values when the delegate is set. - (void)tearDown; - (void)setup; +// Resets scroll view's top content inset to |self.initialContentInset|. +- (void)resetScrollViewTopContentInset; // Access the headerView from the delegate. - (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView; // Locking/unlocking methods used to disable/enable the overscroll actions @@ -381,8 +383,7 @@ // restored to initial value. if (contentOffset.y >= 0 || self.overscrollState == ios_internal::OverscrollState::NO_PULL_STARTED) { - [self setScrollViewContentInset:UIEdgeInsetsMake(self.initialContentInset, - 0, 0, 0)]; + [self resetScrollViewTopContentInset]; } [self triggerActionIfNeeded]; @@ -590,6 +591,12 @@ [_webViewScrollViewProxy setContentInset:contentInset]; } +- (void)resetScrollViewTopContentInset { + UIEdgeInsets contentInset = self.scrollView.contentInset; + contentInset.top = self.initialContentInset; + [self setScrollViewContentInset:contentInset]; +} + - (UIView<RelaxedBoundsConstraintsHitTestSupport>*)headerView { return [self.delegate headerView]; }
diff --git a/ios/web/web_state/js/resources/core.js b/ios/web/web_state/js/resources/core.js index 5562258..6ab7caca 100644 --- a/ios/web/web_state/js/resources/core.js +++ b/ios/web/web_state/js/resources/core.js
@@ -591,88 +591,77 @@ return window.getComputedStyle(element, null)['webkitTouchCallout']; }; - /** - * This method applies the various document-level overrides. Sometimes the - * document object gets reset in the early stages of the page lifecycle, so - * this is exposed as a method for the application to invoke later. That way - * the window-level overrides can be applied as soon as possible. - */ - __gCrWeb.core.documentInject = function() { - // Flush the message queue. - if (__gCrWeb.message) { - __gCrWeb.message.invokeQueues(); + // Flush the message queue. + if (__gCrWeb.message) { + __gCrWeb.message.invokeQueues(); + } + + document.addEventListener('click', function(evt) { + var node = getTargetLink_(evt.target); + + if (!node) + return; + + if (isInternaLink_(node)) { + return; } - - document.addEventListener('click', function(evt) { - var node = getTargetLink_(evt.target); - - if (!node) - return; - - if (isInternaLink_(node)) { - return; - } - setExternalRequest_(node.href, node.target); - // Add listener to the target and its immediate ancesters. These event - // listeners will be removed if they get called. The listeners for some - // elements might never be removed, but if multiple identical event - // listeners are registered on the same event target with the same - // parameters the duplicate instances are discarded. - for (var level = 0; level < 5; ++level) { - if (node && node != document) { - node.addEventListener('click', clickBubbleListener_, false); - node = node.parentNode; - } else { - break; - } - } - }, true); - - // Intercept clicks on anchors (links) during bubbling phase so that the - // browser can handle target type appropriately. - document.addEventListener('click', function(evt) { - var node = getTargetLink_(evt.target); - - if (!node) - return; - - if (isInternaLink_(node)) { - return; + setExternalRequest_(node.href, node.target); + // Add listener to the target and its immediate ancesters. These event + // listeners will be removed if they get called. The listeners for some + // elements might never be removed, but if multiple identical event + // listeners are registered on the same event target with the same + // parameters the duplicate instances are discarded. + for (var level = 0; level < 5; ++level) { + if (node && node != document) { + node.addEventListener('click', clickBubbleListener_, false); + node = node.parentNode; } else { - // Resets the external request if it has been canceled, otherwise - // updates the href in case it has been changed. - if (evt['defaultPrevented']) - resetExternalRequest_(); - else - setExternalRequest_(node.href, node.target); + break; } - }, false); + } + }, true); - // Capture form submit actions. - document.addEventListener('submit', function(evt) { + // Intercept clicks on anchors (links) during bubbling phase so that the + // browser can handle target type appropriately. + document.addEventListener('click', function(evt) { + var node = getTargetLink_(evt.target); + + if (!node) + return; + + if (isInternaLink_(node)) { + return; + } else { + // Resets the external request if it has been canceled, otherwise + // updates the href in case it has been changed. if (evt['defaultPrevented']) - return; + resetExternalRequest_(); + else + setExternalRequest_(node.href, node.target); + } + }, false); - var form = evt.target; - var targetsFrame = form.target && hasFrame_(window, form.target); - // TODO(stuartmorgan): Handle external targets. crbug.com/233543 + // Capture form submit actions. + document.addEventListener('submit', function(evt) { + if (evt['defaultPrevented']) + return; - var action = form.getAttribute('action'); - // Default action is to re-submit to same page. - if (!action) - action = document.location.href; - invokeOnHost_({ - 'command': 'document.submit', - 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement), - 'href': __gCrWeb['getFullyQualifiedURL'](action), - 'targetsFrame': targetsFrame - }); - }, false); + var form = evt.target; + var targetsFrame = form.target && hasFrame_(window, form.target); + // TODO(stuartmorgan): Handle external targets. crbug.com/233543 - addFormEventListeners_(); + var action = form.getAttribute('action'); + // Default action is to re-submit to same page. + if (!action) + action = document.location.href; + invokeOnHost_({ + 'command': 'document.submit', + 'formName': __gCrWeb.common.getFormIdentifier(evt.srcElement), + 'href': __gCrWeb['getFullyQualifiedURL'](action), + 'targetsFrame': targetsFrame + }); + }, false); - return true; - }; + addFormEventListeners_(); - __gCrWeb.core.documentInject(); }()); // End of anonymous object
diff --git a/net/BUILD.gn b/net/BUILD.gn index 9a22c35..8d1b3b6 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -150,9 +150,6 @@ if (!use_openssl_certs) { sources -= [ "base/crypto_module_openssl.cc", - "base/keygen_handler_openssl.cc", - "base/openssl_private_key_store.h", - "base/openssl_private_key_store_memory.cc", "cert/cert_database_openssl.cc", "cert/cert_verify_proc_openssl.cc", "cert/cert_verify_proc_openssl.h", @@ -161,14 +158,10 @@ "ssl/openssl_client_key_store.cc", "ssl/openssl_client_key_store.h", ] - if (is_android) { - sources -= [ "base/openssl_private_key_store_android.cc" ] - } } else { if (is_android) { # Android doesn't use these even when using OpenSSL. sources -= [ - "base/openssl_private_key_store_memory.cc", "cert/cert_database_openssl.cc", "cert/cert_verify_proc_openssl.cc", "cert/test_root_certs_openssl.cc", @@ -190,7 +183,6 @@ if (!use_nss_certs) { sources -= [ "base/crypto_module_nss.cc", - "base/keygen_handler_nss.cc", "cert/cert_database_nss.cc", "cert/internal/cert_issuer_source_nss.cc", "cert/internal/cert_issuer_source_nss.h", @@ -201,8 +193,6 @@ "cert/x509_certificate_nss.cc", "ssl/client_cert_store_nss.cc", "ssl/client_cert_store_nss.h", - "third_party/mozilla_security_manager/nsKeygenHandler.cpp", - "third_party/mozilla_security_manager/nsKeygenHandler.h", "third_party/mozilla_security_manager/nsNSSCertificateDB.cpp", "third_party/mozilla_security_manager/nsNSSCertificateDB.h", "third_party/mozilla_security_manager/nsPKCS12Blob.cpp", @@ -1456,8 +1446,6 @@ sources -= [ # TODO(droger): The following tests are disabled because the # implementation is missing or incomplete. - # KeygenHandler::GenKeyAndSignChallenge() is not ported to iOS. - "base/keygen_handler_unittest.cc", "disk_cache/backend_unittest.cc", "disk_cache/blockfile/block_files_unittest.cc",
diff --git a/net/android/network_library.h b/net/android/network_library.h index 60d9abd..2045346 100644 --- a/net/android/network_library.h +++ b/net/android/network_library.h
@@ -36,15 +36,6 @@ // Removes all root certificates added by |AddTestRootCertificate| calls. void ClearTestRootCertificates(); -// Helper for the <keygen> handler. Passes the DER-encoded key pair via JNI to -// the Credentials store. The public key should be a DER-encoded -// SubjectPublicKeyInfo (X.509) and the private key a DER-encode PrivateKeyInfo -// (PKCS#8). -bool StoreKeyPair(const uint8_t* public_key, - size_t public_len, - const uint8_t* private_key, - size_t private_len); - // Returns true if cleartext traffic to |host| is allowed by the app. Always // true on L and older. bool IsCleartextPermitted(const std::string& host);
diff --git a/net/base/int128_unittest.cc b/net/base/int128_unittest.cc index 2d740d3..9a902897 100644 --- a/net/base/int128_unittest.cc +++ b/net/base/int128_unittest.cc
@@ -10,9 +10,9 @@ #include "net/base/int128.h" #include "testing/gtest/include/gtest/gtest.h" -using net::uint128; -using net::uint128_pod; -using net::kuint128max; +namespace net { + +namespace test { TEST(Int128, AllTests) { uint128 zero(0); @@ -264,3 +264,7 @@ x3 += x3; EXPECT_EQ(x4, x3); } + +} // namespace test + +} // namespace net
diff --git a/net/base/keygen_handler.cc b/net/base/keygen_handler.cc deleted file mode 100644 index d1e91a4..0000000 --- a/net/base/keygen_handler.cc +++ /dev/null
@@ -1,29 +0,0 @@ -// 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. - -#include "net/base/keygen_handler.h" - -#if defined(USE_NSS_CERTS) -#include "crypto/nss_crypto_module_delegate.h" -#endif // defined(USE_NSS_CERTS) - -namespace net { - -// The constructor and destructor must be defined in a .cc file so that -// CryptoModuleBlockingPasswordDelegate can be forward-declared on platforms -// which use NSS. - -KeygenHandler::KeygenHandler(int key_size_in_bits, - const std::string& challenge, - const GURL& url) - : key_size_in_bits_(key_size_in_bits), - challenge_(challenge), - url_(url), - stores_key_(true) { -} - -KeygenHandler::~KeygenHandler() { -} - -} // namespace net
diff --git a/net/base/keygen_handler.h b/net/base/keygen_handler.h deleted file mode 100644 index 67a11bc..0000000 --- a/net/base/keygen_handler.h +++ /dev/null
@@ -1,66 +0,0 @@ -// 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. - -#ifndef NET_BASE_KEYGEN_HANDLER_H_ -#define NET_BASE_KEYGEN_HANDLER_H_ - -#include <memory> -#include <string> - -#include "base/callback_forward.h" -#include "build/build_config.h" -#include "net/base/net_export.h" -#include "url/gurl.h" - -namespace crypto { -class NSSCryptoModuleDelegate; -} - -namespace net { - -// This class handles keypair generation for generating client -// certificates via the <keygen> tag. -// <http://dev.w3.org/html5/spec/Overview.html#the-keygen-element> -// <https://developer.mozilla.org/En/HTML/HTML_Extensions/KEYGEN_Tag> - -class NET_EXPORT KeygenHandler { - public: - // Creates a handler that will generate a key with the given key size and - // incorporate the |challenge| into the Netscape SPKAC structure. The request - // for the key originated from |url|. - KeygenHandler(int key_size_in_bits, - const std::string& challenge, - const GURL& url); - ~KeygenHandler(); - - // Actually generates the key-pair and the cert request (SPKAC), and returns - // a base64-encoded string suitable for use as the form value of <keygen>. - std::string GenKeyAndSignChallenge(); - - // Exposed only for unit tests. - void set_stores_key(bool store) { stores_key_ = store;} - -#if defined(USE_NSS_CERTS) - // Register the delegate to be used to get the token to store the key in, and - // to get the password if the token is unauthenticated. - // GenKeyAndSignChallenge runs on a worker thread, so using a blocking - // password callback is okay here. - void set_crypto_module_delegate( - std::unique_ptr<crypto::NSSCryptoModuleDelegate> delegate); -#endif // defined(USE_NSS_CERTS) - - private: - int key_size_in_bits_; // key size in bits (usually 2048) - std::string challenge_; // challenge string sent by server - GURL url_; // the URL that requested the key - bool stores_key_; // should the generated key-pair be stored persistently? -#if defined(USE_NSS_CERTS) - // The callback for requesting a password to the PKCS#11 token. - std::unique_ptr<crypto::NSSCryptoModuleDelegate> crypto_module_delegate_; -#endif // defined(USE_NSS_CERTS) -}; - -} // namespace net - -#endif // NET_BASE_KEYGEN_HANDLER_H_
diff --git a/net/base/keygen_handler_mac.cc b/net/base/keygen_handler_mac.cc deleted file mode 100644 index 13814fe..0000000 --- a/net/base/keygen_handler_mac.cc +++ /dev/null
@@ -1,339 +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 "net/base/keygen_handler.h" - -#include <Security/SecAsn1Coder.h> -#include <Security/SecAsn1Templates.h> -#include <Security/Security.h> - -#include "base/base64.h" -#include "base/logging.h" -#include "base/mac/mac_logging.h" -#include "base/mac/scoped_cftyperef.h" -#include "base/strings/string_util.h" -#include "base/strings/sys_string_conversions.h" -#include "base/synchronization/lock.h" -#include "crypto/cssm_init.h" -#include "crypto/mac_security_services_lock.h" - -// CSSM functions are deprecated as of OSX 10.7, but have no replacement. -// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -// These are in Security.framework but not declared in a public header. -extern const SecAsn1Template kSecAsn1AlgorithmIDTemplate[]; -extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[]; - -namespace net { - -// Declarations of Netscape keygen cert structures for ASN.1 encoding: - -struct PublicKeyAndChallenge { - CSSM_X509_SUBJECT_PUBLIC_KEY_INFO spki; - CSSM_DATA challenge_string; -}; - -// This is a copy of the built-in kSecAsn1IA5StringTemplate, but without the -// 'streamable' flag, which was causing bogus data to be written. -const SecAsn1Template kIA5StringTemplate[] = { - { SEC_ASN1_IA5_STRING, 0, NULL, sizeof(CSSM_DATA) } -}; - -static const SecAsn1Template kPublicKeyAndChallengeTemplate[] = { - { - SEC_ASN1_SEQUENCE, - 0, - NULL, - sizeof(PublicKeyAndChallenge) - }, - { - SEC_ASN1_INLINE, - offsetof(PublicKeyAndChallenge, spki), - kSecAsn1SubjectPublicKeyInfoTemplate - }, - { - SEC_ASN1_INLINE, - offsetof(PublicKeyAndChallenge, challenge_string), - kIA5StringTemplate - }, - { - 0 - } -}; - -struct SignedPublicKeyAndChallenge { - PublicKeyAndChallenge pkac; - CSSM_X509_ALGORITHM_IDENTIFIER signature_algorithm; - CSSM_DATA signature; -}; - -static const SecAsn1Template kSignedPublicKeyAndChallengeTemplate[] = { - { - SEC_ASN1_SEQUENCE, - 0, - NULL, - sizeof(SignedPublicKeyAndChallenge) - }, - { - SEC_ASN1_INLINE, - offsetof(SignedPublicKeyAndChallenge, pkac), - kPublicKeyAndChallengeTemplate - }, - { - SEC_ASN1_INLINE, - offsetof(SignedPublicKeyAndChallenge, signature_algorithm), - kSecAsn1AlgorithmIDTemplate - }, - { - SEC_ASN1_BIT_STRING, - offsetof(SignedPublicKeyAndChallenge, signature) - }, - { - 0 - } -}; - - -static OSStatus CreateRSAKeyPair(int size_in_bits, - SecAccessRef initial_access, - SecKeyRef* out_pub_key, - SecKeyRef* out_priv_key); -static OSStatus SignData(CSSM_DATA data, - SecKeyRef private_key, - CSSM_DATA* signature); - -std::string KeygenHandler::GenKeyAndSignChallenge() { - std::string result; - OSStatus err; - SecAccessRef initial_access = NULL; - SecKeyRef public_key = NULL; - SecKeyRef private_key = NULL; - SecAsn1CoderRef coder = NULL; - CSSM_DATA signature = {0, NULL}; - - { - if (url_.has_host()) { - // TODO(davidben): Use something like "Key generated for - // example.com", but localize it. - base::ScopedCFTypeRef<CFStringRef> label( - base::SysUTF8ToCFStringRef(url_.host())); - // Create an initial access object to set the SecAccessRef. This - // sets a label on the Keychain dialogs. Pass NULL as the second - // argument to use the default trusted list; only allow the - // current application to access without user confirmation. - err = SecAccessCreate(label, NULL, &initial_access); - // If we fail, just continue without a label. - if (err) - crypto::LogCSSMError("SecAccessCreate", err); - } - - // Create the key-pair. - err = CreateRSAKeyPair(key_size_in_bits_, initial_access, - &public_key, &private_key); - if (err) - goto failure; - - // Get the public key data (DER sequence of modulus, exponent). - CFDataRef key_data = NULL; - err = SecKeychainItemExport(public_key, kSecFormatBSAFE, 0, NULL, - &key_data); - if (err) { - crypto::LogCSSMError("SecKeychainItemExpor", err); - goto failure; - } - base::ScopedCFTypeRef<CFDataRef> scoped_key_data(key_data); - - // Create an ASN.1 encoder. - err = SecAsn1CoderCreate(&coder); - if (err) { - crypto::LogCSSMError("SecAsn1CoderCreate", err); - goto failure; - } - - // The DER encoding of a NULL. - static const uint8_t kNullDer[] = {0x05, 0x00}; - - // Fill in and DER-encode the PublicKeyAndChallenge: - SignedPublicKeyAndChallenge spkac; - memset(&spkac, 0, sizeof(spkac)); - spkac.pkac.spki.algorithm.algorithm = CSSMOID_RSA; - spkac.pkac.spki.algorithm.parameters.Data = const_cast<uint8_t*>(kNullDer); - spkac.pkac.spki.algorithm.parameters.Length = sizeof(kNullDer); - spkac.pkac.spki.subjectPublicKey.Length = - CFDataGetLength(key_data) * 8; // interpreted as a _bit_ count - spkac.pkac.spki.subjectPublicKey.Data = - const_cast<uint8_t*>(CFDataGetBytePtr(key_data)); - spkac.pkac.challenge_string.Length = challenge_.length(); - spkac.pkac.challenge_string.Data = - reinterpret_cast<uint8_t*>(const_cast<char*>(challenge_.data())); - - CSSM_DATA encoded; - err = SecAsn1EncodeItem(coder, &spkac.pkac, - kPublicKeyAndChallengeTemplate, &encoded); - if (err) { - crypto::LogCSSMError("SecAsn1EncodeItem", err); - goto failure; - } - - // Compute a signature of the result: - err = SignData(encoded, private_key, &signature); - if (err) - goto failure; - spkac.signature.Data = signature.Data; - spkac.signature.Length = signature.Length * 8; // a _bit_ count - spkac.signature_algorithm.algorithm = CSSMOID_MD5WithRSA; - spkac.signature_algorithm.parameters.Data = const_cast<uint8_t*>(kNullDer); - spkac.signature_algorithm.parameters.Length = sizeof(kNullDer); - // TODO(snej): MD5 is weak. Can we use SHA1 instead? - // See <https://bugzilla.mozilla.org/show_bug.cgi?id=549460> - - // DER-encode the entire SignedPublicKeyAndChallenge: - err = SecAsn1EncodeItem(coder, &spkac, - kSignedPublicKeyAndChallengeTemplate, &encoded); - if (err) { - crypto::LogCSSMError("SecAsn1EncodeItem", err); - goto failure; - } - - // Base64 encode the result. - std::string input(reinterpret_cast<char*>(encoded.Data), encoded.Length); - base::Base64Encode(input, &result); - } - - failure: - if (err) - OSSTATUS_LOG(ERROR, err) << "SSL Keygen failed!"; - else - VLOG(1) << "SSL Keygen succeeded! Output is: " << result; - - // Remove keys from keychain if asked to during unit testing: - if (!stores_key_) { - if (public_key) - SecKeychainItemDelete(reinterpret_cast<SecKeychainItemRef>(public_key)); - if (private_key) - SecKeychainItemDelete(reinterpret_cast<SecKeychainItemRef>(private_key)); - } - - // Clean up: - free(signature.Data); - if (coder) - SecAsn1CoderRelease(coder); - if (initial_access) - CFRelease(initial_access); - if (public_key) - CFRelease(public_key); - if (private_key) - CFRelease(private_key); - return result; -} - - -// Create an RSA key pair with size |size_in_bits|. |initial_access| -// is passed as the initial access control list in Keychain. The -// public and private keys are placed in |out_pub_key| and -// |out_priv_key|, respectively. -static OSStatus CreateRSAKeyPair(int size_in_bits, - SecAccessRef initial_access, - SecKeyRef* out_pub_key, - SecKeyRef* out_priv_key) { - OSStatus err; - SecKeychainRef keychain; - err = SecKeychainCopyDefault(&keychain); - if (err) { - crypto::LogCSSMError("SecKeychainCopyDefault", err); - return err; - } - base::ScopedCFTypeRef<SecKeychainRef> scoped_keychain(keychain); - { - base::AutoLock locked(crypto::GetMacSecurityServicesLock()); - err = SecKeyCreatePair( - keychain, - CSSM_ALGID_RSA, - size_in_bits, - 0LL, - // public key usage and attributes: - CSSM_KEYUSE_ENCRYPT | CSSM_KEYUSE_VERIFY | CSSM_KEYUSE_WRAP, - CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_PERMANENT, - // private key usage and attributes: - CSSM_KEYUSE_DECRYPT | CSSM_KEYUSE_SIGN | CSSM_KEYUSE_UNWRAP, - CSSM_KEYATTR_EXTRACTABLE | CSSM_KEYATTR_PERMANENT | - CSSM_KEYATTR_SENSITIVE, - initial_access, - out_pub_key, out_priv_key); - } - if (err) - crypto::LogCSSMError("SecKeyCreatePair", err); - return err; -} - -static OSStatus CreateSignatureContext(SecKeyRef key, - CSSM_ALGORITHMS algorithm, - CSSM_CC_HANDLE* out_cc_handle) { - OSStatus err; - const CSSM_ACCESS_CREDENTIALS* credentials = NULL; - { - base::AutoLock locked(crypto::GetMacSecurityServicesLock()); - err = SecKeyGetCredentials(key, - CSSM_ACL_AUTHORIZATION_SIGN, - kSecCredentialTypeDefault, - &credentials); - } - if (err) { - crypto::LogCSSMError("SecKeyGetCredentials", err); - return err; - } - - CSSM_CSP_HANDLE csp_handle = 0; - { - base::AutoLock locked(crypto::GetMacSecurityServicesLock()); - err = SecKeyGetCSPHandle(key, &csp_handle); - } - if (err) { - crypto::LogCSSMError("SecKeyGetCSPHandle", err); - return err; - } - - const CSSM_KEY* cssm_key = NULL; - { - base::AutoLock locked(crypto::GetMacSecurityServicesLock()); - err = SecKeyGetCSSMKey(key, &cssm_key); - } - if (err) { - crypto::LogCSSMError("SecKeyGetCSSMKey", err); - return err; - } - - err = CSSM_CSP_CreateSignatureContext(csp_handle, - algorithm, - credentials, - cssm_key, - out_cc_handle); - if (err) - crypto::LogCSSMError("CSSM_CSP_CreateSignatureContext", err); - return err; -} - -static OSStatus SignData(CSSM_DATA data, - SecKeyRef private_key, - CSSM_DATA* signature) { - CSSM_CC_HANDLE cc_handle; - OSStatus err = CreateSignatureContext(private_key, - CSSM_ALGID_MD5WithRSA, - &cc_handle); - if (err) { - crypto::LogCSSMError("CreateSignatureContext", err); - return err; - } - err = CSSM_SignData(cc_handle, &data, 1, CSSM_ALGID_NONE, signature); - if (err) - crypto::LogCSSMError("CSSM_SignData", err); - CSSM_DeleteContext(cc_handle); - return err; -} - -} // namespace net - -#pragma clang diagnostic pop // "-Wdeprecated-declarations"
diff --git a/net/base/keygen_handler_nss.cc b/net/base/keygen_handler_nss.cc deleted file mode 100644 index 97e0018f5..0000000 --- a/net/base/keygen_handler_nss.cc +++ /dev/null
@@ -1,48 +0,0 @@ -// 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. - -#include "net/base/keygen_handler.h" - -#include <utility> - -#include "base/logging.h" -#include "crypto/nss_crypto_module_delegate.h" -#include "crypto/nss_util.h" -#include "crypto/scoped_nss_types.h" -#include "net/third_party/mozilla_security_manager/nsKeygenHandler.h" - -// PSM = Mozilla's Personal Security Manager. -namespace psm = mozilla_security_manager; - -namespace net { - -std::string KeygenHandler::GenKeyAndSignChallenge() { - crypto::EnsureNSSInit(); - - crypto::ScopedPK11Slot slot; - if (crypto_module_delegate_) { - slot = crypto_module_delegate_->RequestSlot(); - } else { - LOG(ERROR) << "Could not get an NSS key slot."; - return std::string(); - } - - // Authenticate to the token. - if (SECSuccess != PK11_Authenticate(slot.get(), - PR_TRUE, - crypto_module_delegate_->wincx())) { - LOG(ERROR) << "Could not authenticate to the key slot."; - return std::string(); - } - - return psm::GenKeyAndSignChallenge(key_size_in_bits_, challenge_, url_, - slot.get(), stores_key_); -} - -void KeygenHandler::set_crypto_module_delegate( - std::unique_ptr<crypto::NSSCryptoModuleDelegate> delegate) { - crypto_module_delegate_ = std::move(delegate); -} - -} // namespace net
diff --git a/net/base/keygen_handler_openssl.cc b/net/base/keygen_handler_openssl.cc deleted file mode 100644 index 161a5b74..0000000 --- a/net/base/keygen_handler_openssl.cc +++ /dev/null
@@ -1,122 +0,0 @@ -// 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. - -#include <stdint.h> - -#include <memory> - -#include "base/base64.h" -#include "base/location.h" -#include "base/logging.h" -#include "base/strings/string_piece.h" -#include "crypto/openssl_util.h" -#include "crypto/rsa_private_key.h" -#include "net/base/keygen_handler.h" -#include "net/base/openssl_private_key_store.h" -#include "third_party/boringssl/src/include/openssl/bytestring.h" -#include "third_party/boringssl/src/include/openssl/digest.h" -#include "third_party/boringssl/src/include/openssl/evp.h" -#include "third_party/boringssl/src/include/openssl/mem.h" - -namespace net { - -std::string KeygenHandler::GenKeyAndSignChallenge() { - std::unique_ptr<crypto::RSAPrivateKey> key( - crypto::RSAPrivateKey::Create(key_size_in_bits_)); - EVP_PKEY* pkey = key->key(); - - if (stores_key_) - OpenSSLPrivateKeyStore::StoreKeyPair(url_, pkey); - - // Serialize the following structure, from - // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen. - // - // PublicKeyAndChallenge ::= SEQUENCE { - // spki SubjectPublicKeyInfo, - // challenge IA5STRING - // } - // - // SignedPublicKeyAndChallenge ::= SEQUENCE { - // publicKeyAndChallenge PublicKeyAndChallenge, - // signatureAlgorithm AlgorithmIdentifier, - // signature BIT STRING - // } - // - // The signature is over the PublicKeyAndChallenge. - - // TODO(davidben): If we gain another consumer, factor this code out into - // shared logic, sharing OID definitions with the verifier, to support signing - // other X.509-style structures. - - crypto::OpenSSLErrStackTracer tracer(FROM_HERE); - - // Serialize up to the PublicKeyAndChallenge. - bssl::ScopedCBB cbb; - CBB spkac, public_key_and_challenge, challenge; - if (!CBB_init(cbb.get(), 0) || - !CBB_add_asn1(cbb.get(), &spkac, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&spkac, &public_key_and_challenge, CBS_ASN1_SEQUENCE) || - !EVP_marshal_public_key(&public_key_and_challenge, pkey) || - !CBB_add_asn1(&public_key_and_challenge, &challenge, - CBS_ASN1_IA5STRING) || - !CBB_add_bytes(&challenge, - reinterpret_cast<const uint8_t*>(challenge_.data()), - challenge_.size()) || - !CBB_flush(&spkac)) { - return std::string(); - } - - // Hash what's been written so far. - bssl::ScopedEVP_MD_CTX ctx; - if (!EVP_DigestSignInit(ctx.get(), nullptr, EVP_md5(), nullptr, pkey) || - !EVP_DigestSignUpdate(ctx.get(), CBB_data(&spkac), CBB_len(&spkac))) { - return std::string(); - } - - // The DER encoding of 1.2.840.113549.1.1.4, MD5 with RSA encryption. - static const uint8_t kMd5WithRsaEncryption[] = { - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x04, - }; - - // Write the signatureAlgorithm. - CBB algorithm, oid, null; - if (!CBB_add_asn1(&spkac, &algorithm, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || - !CBB_add_bytes(&oid, kMd5WithRsaEncryption, - sizeof(kMd5WithRsaEncryption)) || - !CBB_add_asn1(&algorithm, &null, CBS_ASN1_NULL)) { - return std::string(); - } - - // Compute and write the signature. Note that X.509 signatures, although - // always byte strings for RSA, are encoded as BIT STRINGS with a multiple of - // 8 bits. - CBB sig_bitstring; - uint8_t* sig; - size_t sig_len; - if (!CBB_add_asn1(&spkac, &sig_bitstring, CBS_ASN1_BITSTRING) || - !CBB_add_u8(&sig_bitstring, 0 /* no unused bits */) || - // Determine the maximum length of the signature. - !EVP_DigestSignFinal(ctx.get(), nullptr, &sig_len) || - // Reserve |sig_len| bytes and write the signature to |spkac|. - !CBB_reserve(&sig_bitstring, &sig, sig_len) || - !EVP_DigestSignFinal(ctx.get(), sig, &sig_len) || - !CBB_did_write(&sig_bitstring, sig_len)) { - return std::string(); - } - - // Finally, the structure is base64-encoded. - uint8_t* der; - size_t der_len; - if (!CBB_finish(cbb.get(), &der, &der_len)) { - return std::string(); - } - std::string result; - base::Base64Encode( - base::StringPiece(reinterpret_cast<const char*>(der), der_len), &result); - OPENSSL_free(der); - return result; -} - -} // namespace net
diff --git a/net/base/keygen_handler_unittest.cc b/net/base/keygen_handler_unittest.cc deleted file mode 100644 index af21274..0000000 --- a/net/base/keygen_handler_unittest.cc +++ /dev/null
@@ -1,226 +0,0 @@ -// 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. - -#include "net/base/keygen_handler.h" - -#include <stdint.h> - -#include <string> -#include <utility> - -#include "base/base64.h" -#include "base/bind.h" -#include "base/location.h" -#include "base/logging.h" -#include "base/strings/string_piece.h" -#include "base/synchronization/waitable_event.h" -#include "base/threading/worker_pool.h" -#include "build/build_config.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/boringssl/src/include/openssl/bytestring.h" -#include "third_party/boringssl/src/include/openssl/evp.h" - -#if defined(USE_NSS_CERTS) -#include <private/pprthred.h> // PR_DetachThread -#include "crypto/nss_crypto_module_delegate.h" -#include "crypto/scoped_test_nss_db.h" -#endif - -namespace net { - -namespace { - -#if defined(USE_NSS_CERTS) -class StubCryptoModuleDelegate : public crypto::NSSCryptoModuleDelegate { - public: - explicit StubCryptoModuleDelegate(crypto::ScopedPK11Slot slot) - : slot_(std::move(slot)) {} - - std::string RequestPassword(const std::string& slot_name, - bool retry, - bool* cancelled) override { - return std::string(); - } - - crypto::ScopedPK11Slot RequestSlot() override { - return crypto::ScopedPK11Slot(PK11_ReferenceSlot(slot_.get())); - } - - private: - crypto::ScopedPK11Slot slot_; -}; -#endif - -const char kChallenge[] = "some challenge"; - -class KeygenHandlerTest : public ::testing::Test { - public: - KeygenHandlerTest() {} - ~KeygenHandlerTest() override {} - - std::unique_ptr<KeygenHandler> CreateKeygenHandler() { - std::unique_ptr<KeygenHandler> handler( - new KeygenHandler(768, kChallenge, GURL("http://www.example.com"))); -#if defined(USE_NSS_CERTS) - handler->set_crypto_module_delegate( - std::unique_ptr<crypto::NSSCryptoModuleDelegate>( - new StubCryptoModuleDelegate(crypto::ScopedPK11Slot( - PK11_ReferenceSlot(test_nss_db_.slot()))))); -#endif - return handler; - } - - private: -#if defined(USE_NSS_CERTS) - crypto::ScopedTestNSSDB test_nss_db_; -#endif -}; - -base::StringPiece StringPieceFromCBS(const CBS& cbs) { - return base::StringPiece(reinterpret_cast<const char*>(CBS_data(&cbs)), - CBS_len(&cbs)); -} - -// Assert that |result| is a valid output for KeygenHandler given challenge -// string of |challenge|. -void AssertValidSignedPublicKeyAndChallenge(const std::string& result, - const std::string& challenge) { - // Verify it's valid base64: - std::string spkac; - ASSERT_TRUE(base::Base64Decode(result, &spkac)); - - // Parse the following structure: - // - // PublicKeyAndChallenge ::= SEQUENCE { - // spki SubjectPublicKeyInfo, - // challenge IA5STRING - // } - // SignedPublicKeyAndChallenge ::= SEQUENCE { - // publicKeyAndChallenge PublicKeyAndChallenge, - // signatureAlgorithm AlgorithmIdentifier, - // signature BIT STRING - // } - - CBS cbs; - CBS_init(&cbs, reinterpret_cast<const uint8_t*>(spkac.data()), spkac.size()); - - // The input should consist of a SEQUENCE. - CBS child; - ASSERT_TRUE(CBS_get_asn1(&cbs, &child, CBS_ASN1_SEQUENCE)); - ASSERT_EQ(0u, CBS_len(&cbs)); - - // Extract the raw PublicKeyAndChallenge. - CBS public_key_and_challenge_raw; - ASSERT_TRUE(CBS_get_asn1_element(&child, &public_key_and_challenge_raw, - CBS_ASN1_SEQUENCE)); - - // Parse out the PublicKeyAndChallenge. - CBS copy = public_key_and_challenge_raw; - CBS public_key_and_challenge; - ASSERT_TRUE( - CBS_get_asn1(©, &public_key_and_challenge, CBS_ASN1_SEQUENCE)); - ASSERT_EQ(0u, CBS_len(©)); - bssl::UniquePtr<EVP_PKEY> key( - EVP_parse_public_key(&public_key_and_challenge)); - ASSERT_TRUE(key); - CBS challenge_spkac; - ASSERT_TRUE(CBS_get_asn1(&public_key_and_challenge, &challenge_spkac, - CBS_ASN1_IA5STRING)); - ASSERT_EQ(0u, CBS_len(&public_key_and_challenge)); - - // The challenge must match. - ASSERT_EQ(challenge, StringPieceFromCBS(challenge_spkac)); - - // The next element must be the AlgorithmIdentifier for MD5 with RSA. - static const uint8_t kMd5WithRsaEncryption[] = { - 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, - 0xf7, 0x0d, 0x01, 0x01, 0x04, 0x05, 0x00, - }; - CBS algorithm; - ASSERT_TRUE(CBS_get_bytes(&child, &algorithm, sizeof(kMd5WithRsaEncryption))); - ASSERT_EQ( - base::StringPiece(reinterpret_cast<const char*>(kMd5WithRsaEncryption), - sizeof(kMd5WithRsaEncryption)), - StringPieceFromCBS(algorithm)); - - // Finally, parse the signature. - CBS signature; - ASSERT_TRUE(CBS_get_asn1(&child, &signature, CBS_ASN1_BITSTRING)); - ASSERT_EQ(0u, CBS_len(&child)); - uint8_t pad; - ASSERT_TRUE(CBS_get_u8(&signature, &pad)); - ASSERT_EQ(0u, pad); - - // Check the signature. - bssl::ScopedEVP_MD_CTX ctx; - ASSERT_TRUE( - EVP_DigestVerifyInit(ctx.get(), nullptr, EVP_md5(), nullptr, key.get())); - ASSERT_TRUE(EVP_DigestVerifyUpdate(ctx.get(), - CBS_data(&public_key_and_challenge_raw), - CBS_len(&public_key_and_challenge_raw))); - ASSERT_TRUE(EVP_DigestVerifyFinal(ctx.get(), CBS_data(&signature), - CBS_len(&signature))); -} - -TEST_F(KeygenHandlerTest, SmokeTest) { - std::unique_ptr<KeygenHandler> handler(CreateKeygenHandler()); - handler->set_stores_key(false); // Don't leave the key-pair behind - std::string result = handler->GenKeyAndSignChallenge(); - VLOG(1) << "KeygenHandler produced: " << result; - AssertValidSignedPublicKeyAndChallenge(result, kChallenge); -} - -void ConcurrencyTestCallback(const std::string& challenge, - base::WaitableEvent* event, - std::unique_ptr<KeygenHandler> handler, - std::string* result) { - handler->set_stores_key(false); // Don't leave the key-pair behind. - *result = handler->GenKeyAndSignChallenge(); - event->Signal(); -#if defined(USE_NSS_CERTS) - // Detach the thread from NSPR. - // Calling NSS functions attaches the thread to NSPR, which stores - // the NSPR thread ID in thread-specific data. - // The threads in our thread pool terminate after we have called - // PR_Cleanup. Unless we detach them from NSPR, net_unittests gets - // segfaults on shutdown when the threads' thread-specific data - // destructors run. - PR_DetachThread(); -#endif -} - -// We asynchronously generate the keys so as not to hang up the IO thread. This -// test tries to catch concurrency problems in the keygen implementation. -TEST_F(KeygenHandlerTest, ConcurrencyTest) { - const int NUM_HANDLERS = 5; - base::WaitableEvent* events[NUM_HANDLERS] = { NULL }; - std::string results[NUM_HANDLERS]; - for (int i = 0; i < NUM_HANDLERS; i++) { - std::unique_ptr<KeygenHandler> handler(CreateKeygenHandler()); - events[i] = new base::WaitableEvent( - base::WaitableEvent::ResetPolicy::AUTOMATIC, - base::WaitableEvent::InitialState::NOT_SIGNALED); - base::WorkerPool::PostTask(FROM_HERE, - base::Bind(ConcurrencyTestCallback, - "some challenge", - events[i], - base::Passed(&handler), - &results[i]), - true); - } - - for (int i = 0; i < NUM_HANDLERS; i++) { - // Make sure the job completed - events[i]->Wait(); - delete events[i]; - events[i] = NULL; - - VLOG(1) << "KeygenHandler " << i << " produced: " << results[i]; - AssertValidSignedPublicKeyAndChallenge(results[i], "some challenge"); - } -} - -} // namespace - -} // namespace net
diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc deleted file mode 100644 index f88e7e1..0000000 --- a/net/base/keygen_handler_win.cc +++ /dev/null
@@ -1,218 +0,0 @@ -// 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. - -#include "net/base/keygen_handler.h" - -#include <windows.h> -#include <rpc.h> - -#include <list> -#include <string> -#include <vector> - -#include "base/base64.h" -#include "base/logging.h" -#include "base/strings/string_piece.h" -#include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" -#include "crypto/capi_util.h" -#include "crypto/scoped_capi_types.h" -#include "crypto/wincrypt_shim.h" - -namespace net { - -// Assigns the contents of a CERT_PUBLIC_KEY_INFO structure for the signing -// key in |prov| to |output|. Returns true if encoding was successful. -bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector<BYTE>* output) { - BOOL ok; - DWORD size = 0; - - // From the private key stored in HCRYPTPROV, obtain the public key, stored - // as a CERT_PUBLIC_KEY_INFO structure. Currently, only RSA public keys are - // supported. - ok = CryptExportPublicKeyInfoEx(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING, - const_cast<char*>(szOID_RSA_RSA), 0, NULL, - NULL, &size); - DCHECK(ok); - if (!ok) - return false; - - output->resize(size); - - PCERT_PUBLIC_KEY_INFO public_key_casted = - reinterpret_cast<PCERT_PUBLIC_KEY_INFO>(&(*output)[0]); - ok = CryptExportPublicKeyInfoEx(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING, - const_cast<char*>(szOID_RSA_RSA), 0, NULL, - public_key_casted, &size); - DCHECK(ok); - if (!ok) - return false; - - output->resize(size); - - return true; -} - -// Generates a DER encoded SignedPublicKeyAndChallenge structure from the -// signing key of |prov| and the specified ASCII |challenge| string and -// appends it to |output|. -// True if the encoding was successfully generated. -bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov, - const std::string& challenge, - std::string* output) { - base::string16 challenge16 = base::ASCIIToUTF16(challenge); - std::vector<BYTE> spki; - - if (!GetSubjectPublicKeyInfo(prov, &spki)) - return false; - - // PublicKeyAndChallenge ::= SEQUENCE { - // spki SubjectPublicKeyInfo, - // challenge IA5STRING - // } - CERT_KEYGEN_REQUEST_INFO pkac; - pkac.dwVersion = CERT_KEYGEN_REQUEST_V1; - pkac.SubjectPublicKeyInfo = - *reinterpret_cast<PCERT_PUBLIC_KEY_INFO>(&spki[0]); - pkac.pwszChallengeString = const_cast<base::char16*>(challenge16.c_str()); - - CRYPT_ALGORITHM_IDENTIFIER sig_alg; - memset(&sig_alg, 0, sizeof(sig_alg)); - sig_alg.pszObjId = const_cast<char*>(szOID_RSA_MD5RSA); - - BOOL ok; - DWORD size = 0; - std::vector<BYTE> signed_pkac; - ok = CryptSignAndEncodeCertificate(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING, - X509_KEYGEN_REQUEST_TO_BE_SIGNED, - &pkac, &sig_alg, NULL, - NULL, &size); - DCHECK(ok); - if (!ok) - return false; - - signed_pkac.resize(size); - ok = CryptSignAndEncodeCertificate(prov, AT_KEYEXCHANGE, X509_ASN_ENCODING, - X509_KEYGEN_REQUEST_TO_BE_SIGNED, - &pkac, &sig_alg, NULL, - &signed_pkac[0], &size); - DCHECK(ok); - if (!ok) - return false; - - output->assign(reinterpret_cast<char*>(&signed_pkac[0]), size); - return true; -} - -// Generates a unique name for the container which will store the key that is -// generated. The traditional Windows approach is to use a GUID here. -std::wstring GetNewKeyContainerId() { - RPC_STATUS status = RPC_S_OK; - std::wstring result; - - UUID id = { 0 }; - status = UuidCreateSequential(&id); - if (status != RPC_S_OK && status != RPC_S_UUID_LOCAL_ONLY) - return result; - - RPC_WSTR rpc_string = NULL; - status = UuidToString(&id, &rpc_string); - if (status != RPC_S_OK) - return result; - - // RPC_WSTR is unsigned short*. wchar_t is a built-in type of Visual C++, - // so the type cast is necessary. - result.assign(reinterpret_cast<wchar_t*>(rpc_string)); - RpcStringFree(&rpc_string); - - return result; -} - -// This is a helper struct designed to optionally delete a key after releasing -// the associated provider. -struct KeyContainer { - public: - explicit KeyContainer(bool delete_keyset) - : delete_keyset_(delete_keyset) {} - - ~KeyContainer() { - if (provider_) { - provider_.reset(); - if (delete_keyset_ && !key_id_.empty()) { - HCRYPTPROV provider; - crypto::CryptAcquireContextLocked(&provider, key_id_.c_str(), NULL, - PROV_RSA_FULL, CRYPT_SILENT | CRYPT_DELETEKEYSET); - } - } - } - - crypto::ScopedHCRYPTPROV provider_; - std::wstring key_id_; - - private: - bool delete_keyset_; -}; - -std::string KeygenHandler::GenKeyAndSignChallenge() { - KeyContainer key_container(!stores_key_); - - // TODO(rsleevi): Have the user choose which provider they should use, which - // needs to be filtered by those providers which can provide the key type - // requested or the key size requested. This is especially important for - // generating certificates that will be stored on smart cards. - const int kMaxAttempts = 5; - int attempt; - for (attempt = 0; attempt < kMaxAttempts; ++attempt) { - // Per MSDN documentation for CryptAcquireContext, if applications will be - // creating their own keys, they should ensure unique naming schemes to - // prevent overlap with any other applications or consumers of CSPs, and - // *should not* store new keys within the default, NULL key container. - key_container.key_id_ = GetNewKeyContainerId(); - if (key_container.key_id_.empty()) - return std::string(); - - // Only create new key containers, so that existing key containers are not - // overwritten. - if (crypto::CryptAcquireContextLocked(key_container.provider_.receive(), - key_container.key_id_.c_str(), NULL, PROV_RSA_FULL, - CRYPT_SILENT | CRYPT_NEWKEYSET)) - break; - - if (GetLastError() != static_cast<DWORD>(NTE_BAD_KEYSET)) { - LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider " - "context: " << GetLastError(); - return std::string(); - } - } - if (attempt == kMaxAttempts) { - LOG(ERROR) << "Keygen failed: Couldn't acquire a CryptoAPI provider " - "context: Max retries exceeded"; - return std::string(); - } - - { - crypto::ScopedHCRYPTKEY key; - if (!CryptGenKey(key_container.provider_, CALG_RSA_KEYX, - (key_size_in_bits_ << 16) | CRYPT_EXPORTABLE, key.receive())) { - LOG(ERROR) << "Keygen failed: Couldn't generate an RSA key"; - return std::string(); - } - - std::string spkac; - if (!GetSignedPublicKeyAndChallenge(key_container.provider_, challenge_, - &spkac)) { - LOG(ERROR) << "Keygen failed: Couldn't generate the signed public key " - "and challenge"; - return std::string(); - } - - std::string result; - base::Base64Encode(spkac, &result); - - VLOG(1) << "Keygen succeeded"; - return result; - } -} - -} // namespace net
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 27e8005..8c79551 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h
@@ -740,11 +740,11 @@ // The server's response was insecure (e.g. there was a cert error). NET_ERROR(INSECURE_RESPONSE, -501) -// The server responded to a <keygen> with a generated client cert that we -// don't have the matching private key for. +// An attempt to import a client certificate failed, as the user's key +// database lacked a corresponding private key. NET_ERROR(NO_PRIVATE_KEY_FOR_CERT, -502) -// An error adding to the OS certificate database (e.g. OS X Keychain). +// An error adding a certificate to the OS certificate database. NET_ERROR(ADD_USER_CERT_FAILED, -503) // *** Code -600 is reserved (was FTP_PASV_COMMAND_FAILED). ***
diff --git a/net/base/openssl_private_key_store.h b/net/base/openssl_private_key_store.h deleted file mode 100644 index 54a5498..0000000 --- a/net/base/openssl_private_key_store.h +++ /dev/null
@@ -1,51 +0,0 @@ -// Copyright (c) 2010 The Chromium 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 NET_BASE_OPENSSL_PRIVATE_KEY_STORE_H_ -#define NET_BASE_OPENSSL_PRIVATE_KEY_STORE_H_ - -#include <vector> - -// Avoid including <openssl/evp.h> -typedef struct evp_pkey_st EVP_PKEY; - -#include "base/macros.h" -#include "net/base/net_export.h" - -class GURL; - -namespace net { - -// OpenSSLPrivateKeyStore provides an interface for storing -// public/private key pairs to system storage on platforms where -// OpenSSL is used. -// This class shall only be used from the network thread. -class NET_EXPORT OpenSSLPrivateKeyStore { - public: - // Called to permanently store a private/public key pair, generated - // via <keygen> while visiting |url|, to an appropriate system - // location. Increments |pkey|'s reference count, so the caller is still - // responsible for calling EVP_PKEY_free on it. - // |url| is the corresponding server URL. - // |pkey| is the key pair handle. - // Returns false if an error occurred whilst attempting to store the key. - static bool StoreKeyPair(const GURL& url, EVP_PKEY* pkey); - - // Checks that the private key for a given public key is installed. - // |pub_key| a public key. - // Returns true if there is a private key that was previously - // recorded through StoreKeyPair(). - // NOTE: Intentionally not implemented on Android because there is no - // platform API that can perform this operation silently. - static bool HasPrivateKey(EVP_PKEY* pub_key); - - private: - OpenSSLPrivateKeyStore(); // not implemented. - ~OpenSSLPrivateKeyStore(); // not implemented. - DISALLOW_COPY_AND_ASSIGN(OpenSSLPrivateKeyStore); -}; - -} // namespace net - -#endif // NET_BASE_OPENSSL_PRIVATE_KEY_STORE_H_
diff --git a/net/base/openssl_private_key_store_android.cc b/net/base/openssl_private_key_store_android.cc deleted file mode 100644 index 59cd8b0..0000000 --- a/net/base/openssl_private_key_store_android.cc +++ /dev/null
@@ -1,47 +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 "net/base/openssl_private_key_store.h" - -#include "base/logging.h" -#include "base/memory/singleton.h" -#include "crypto/openssl_util.h" -#include "net/android/network_library.h" -#include "third_party/boringssl/src/include/openssl/bytestring.h" -#include "third_party/boringssl/src/include/openssl/evp.h" -#include "third_party/boringssl/src/include/openssl/mem.h" - -namespace net { - -bool OpenSSLPrivateKeyStore::StoreKeyPair(const GURL& url, EVP_PKEY* pkey) { - // Always clear openssl errors on exit. - crypto::OpenSSLErrStackTracer err_trace(FROM_HERE); - - uint8_t* public_key; - size_t public_len; - bssl::ScopedCBB cbb; - if (!CBB_init(cbb.get(), 0) || !EVP_marshal_public_key(cbb.get(), pkey) || - !CBB_finish(cbb.get(), &public_key, &public_len)) { - return false; - } - bssl::UniquePtr<uint8_t> free_public_key(public_key); - - uint8_t* private_key; - size_t private_len; - cbb.Reset(); - if (!CBB_init(cbb.get(), 0) || !EVP_marshal_private_key(cbb.get(), pkey) || - !CBB_finish(cbb.get(), &private_key, &private_len)) { - return false; - } - bssl::UniquePtr<uint8_t> free_private_key(private_key); - - if (!android::StoreKeyPair(public_key, public_len, private_key, - private_len)) { - LOG(ERROR) << "StoreKeyPair failed. public_len = " << public_len - << " private_len = " << private_len; - } - return true; -} - -} // namespace net
diff --git a/net/base/openssl_private_key_store_memory.cc b/net/base/openssl_private_key_store_memory.cc deleted file mode 100644 index a5b5067..0000000 --- a/net/base/openssl_private_key_store_memory.cc +++ /dev/null
@@ -1,73 +0,0 @@ -// 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. - -// Defines an in-memory private key store, primarily used for testing. - -#include "net/base/openssl_private_key_store.h" - -#include "base/logging.h" -#include "base/macros.h" -#include "base/memory/singleton.h" -#include "base/synchronization/lock.h" -#include "third_party/boringssl/src/include/openssl/evp.h" - -namespace net { - -namespace { - -// A small in-memory store for public/private key pairs held in -// a single EVP_PKEY object. This is intentionally distinct from -// net::SSLClientKeyStore. -class MemoryKeyPairStore { - public: - MemoryKeyPairStore() {} - - static MemoryKeyPairStore* GetInstance() { - return base::Singleton<MemoryKeyPairStore>::get(); - } - - ~MemoryKeyPairStore() { - base::AutoLock lock(lock_); - for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); - it != keys_.end(); ++it) { - EVP_PKEY_free(*it); - } - } - - bool StoreKeyPair(EVP_PKEY* pkey) { - EVP_PKEY_up_ref(pkey); - base::AutoLock lock(lock_); - keys_.push_back(pkey); - return true; - } - - bool HasPrivateKey(EVP_PKEY* pkey) { - base::AutoLock lock(lock_); - for (std::vector<EVP_PKEY*>::iterator it = keys_.begin(); - it != keys_.end(); ++it) { - if (EVP_PKEY_cmp(*it, pkey) == 1) - return true; - } - return false; - } - - private: - std::vector<EVP_PKEY*> keys_; - base::Lock lock_; - - DISALLOW_COPY_AND_ASSIGN(MemoryKeyPairStore); -}; - -} // namespace - -bool OpenSSLPrivateKeyStore::StoreKeyPair(const GURL& url, - EVP_PKEY* pkey) { - return MemoryKeyPairStore::GetInstance()->StoreKeyPair(pkey); -} - -bool OpenSSLPrivateKeyStore::HasPrivateKey(EVP_PKEY* pub_key) { - return MemoryKeyPairStore::GetInstance()->HasPrivateKey(pub_key); -} - -} // namespace net
diff --git a/net/net.gypi b/net/net.gypi index c69b8b3..31d46a0c 100644 --- a/net/net.gypi +++ b/net/net.gypi
@@ -46,9 +46,6 @@ 'base/network_interfaces.cc', 'base/network_interfaces.h', 'base/network_interfaces_posix.cc', - 'base/openssl_private_key_store.h', - 'base/openssl_private_key_store_android.cc', - 'base/openssl_private_key_store_memory.cc', 'base/parse_number.cc', 'base/parse_number.h', 'base/port_util.cc', @@ -316,12 +313,6 @@ 'base/iovec.h', 'base/ip_pattern.cc', 'base/ip_pattern.h', - 'base/keygen_handler.cc', - 'base/keygen_handler.h', - 'base/keygen_handler_mac.cc', - 'base/keygen_handler_nss.cc', - 'base/keygen_handler_openssl.cc', - 'base/keygen_handler_win.cc', # TODO(tc): gnome-vfs? xdgmime? /etc/mime.types? 'base/layered_network_delegate.cc', 'base/layered_network_delegate.h', @@ -1430,8 +1421,6 @@ 'ssl/test_ssl_private_key.h', 'ssl/threaded_ssl_private_key.cc', 'ssl/threaded_ssl_private_key.h', - 'third_party/mozilla_security_manager/nsKeygenHandler.cpp', - 'third_party/mozilla_security_manager/nsKeygenHandler.h', 'third_party/mozilla_security_manager/nsNSSCertificateDB.cpp', 'third_party/mozilla_security_manager/nsNSSCertificateDB.h', 'third_party/mozilla_security_manager/nsPKCS12Blob.cpp', @@ -1560,7 +1549,6 @@ 'base/ip_address_unittest.cc', 'base/ip_endpoint_unittest.cc', 'base/ip_pattern_unittest.cc', - 'base/keygen_handler_unittest.cc', 'base/layered_network_delegate_unittest.cc', 'base/lookup_string_in_fixed_set_unittest.cc', 'base/mime_sniffer_unittest.cc',
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc index 5da56649..3aab8ae 100644 --- a/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc +++ b/net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc
@@ -44,9 +44,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::IsError; -using net::test::IsOk; - namespace net { namespace test {
diff --git a/net/quic/chromium/quic_chromium_client_stream_test.cc b/net/quic/chromium/quic_chromium_client_stream_test.cc index 8965bbb..03be8e8 100644 --- a/net/quic/chromium/quic_chromium_client_stream_test.cc +++ b/net/quic/chromium/quic_chromium_client_stream_test.cc
@@ -22,9 +22,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock_mutant.h" -using net::test::IsError; -using net::test::IsOk; - using testing::AnyNumber; using testing::CreateFunctor; using testing::Invoke;
diff --git a/net/quic/chromium/quic_http_stream_test.cc b/net/quic/chromium/quic_http_stream_test.cc index 3915b81..0734c78b 100644 --- a/net/quic/chromium/quic_http_stream_test.cc +++ b/net/quic/chromium/quic_http_stream_test.cc
@@ -60,9 +60,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::IsError; -using net::test::IsOk; - using std::string; using testing::_; using testing::AnyNumber;
diff --git a/net/quic/chromium/quic_network_transaction_unittest.cc b/net/quic/chromium/quic_network_transaction_unittest.cc index 1b5b54da..f55e667 100644 --- a/net/quic/chromium/quic_network_transaction_unittest.cc +++ b/net/quic/chromium/quic_network_transaction_unittest.cc
@@ -69,9 +69,6 @@ #include "testing/platform_test.h" #include "url/gurl.h" -using net::test::IsError; -using net::test::IsOk; - namespace net { namespace test {
diff --git a/net/quic/chromium/quic_stream_factory_test.cc b/net/quic/chromium/quic_stream_factory_test.cc index 78031a89..f0e1b250 100644 --- a/net/quic/chromium/quic_stream_factory_test.cc +++ b/net/quic/chromium/quic_stream_factory_test.cc
@@ -56,9 +56,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -using net::test::IsError; -using net::test::IsOk; - using std::string; namespace net {
diff --git a/net/quic/core/quic_flags.h b/net/quic/core/quic_flags.h index 9d1aa6d..a1a5ff36 100644 --- a/net/quic/core/quic_flags.h +++ b/net/quic/core/quic_flags.h
@@ -5,7 +5,8 @@ #ifndef NET_QUIC_CORE_QUIC_FLAGS_H_ #define NET_QUIC_CORE_QUIC_FLAGS_H_ -#include <stdint.h> +#include <cstdint> +#include <string> #include "net/quic/platform/api/quic_export.h" @@ -13,4 +14,47 @@ #include "net/quic/core/quic_flags_list.h" #undef QUIC_FLAG +// API compatibility with new-style flags. +namespace base { + +inline bool GetFlag(bool flag) { + return flag; +} +inline int32_t GetFlag(int32_t flag) { + return flag; +} +inline int64_t GetFlag(int64_t flag) { + return flag; +} +inline uint64_t GetFlag(uint64_t flag) { + return flag; +} +inline double GetFlag(double flag) { + return flag; +} +inline std::string GetFlag(const std::string& flag) { + return flag; +} + +inline void SetFlag(bool* f, bool v) { + *f = v; +} +inline void SetFlag(int32_t* f, int32_t v) { + *f = v; +} +inline void SetFlag(int64_t* f, int64_t v) { + *f = v; +} +inline void SetFlag(uint64_t* f, uint64_t v) { + *f = v; +} +inline void SetFlag(double* f, double v) { + *f = v; +} +inline void SetFlag(std::string* f, const std::string& v) { + *f = v; +} + +} // namespace base + #endif // NET_QUIC_CORE_QUIC_FLAGS_H_
diff --git a/net/quic/core/quic_server_session_base_test.cc b/net/quic/core/quic_server_session_base_test.cc index 5bcc109..3b92d1e4 100644 --- a/net/quic/core/quic_server_session_base_test.cc +++ b/net/quic/core/quic_server_session_base_test.cc
@@ -35,22 +35,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::CryptoTestUtils; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; -using net::test::QuicConfigPeer; -using net::test::QuicConnectionPeer; -using net::test::QuicSpdyStreamPeer; -using net::test::QuicSentPacketManagerPeer; -using net::test::QuicSessionPeer; -using net::test::QuicSpdySessionPeer; -using net::test::QuicSustainedBandwidthRecorderPeer; -using net::test::SupportedVersions; -using net::test::kClientDataStreamId1; -using net::test::kClientDataStreamId2; -using net::test::kClientDataStreamId3; -using net::test::kInitialSessionFlowControlWindowForTest; -using net::test::kInitialStreamFlowControlWindowForTest; using std::string; using testing::StrictMock; using testing::_;
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc index 3877e930..2046051f 100644 --- a/net/quic/test_tools/quic_test_utils.cc +++ b/net/quic/test_tools/quic_test_utils.cc
@@ -84,16 +84,16 @@ } QuicFlagSaver::QuicFlagSaver() { -#define QUIC_FLAG(type, flag, value) \ - CHECK_EQ(value, flag) << "Flag set to an expected value. A prior test is " \ - "likely setting a flag " \ - << "without using a QuicFlagSaver"; +#define QUIC_FLAG(type, flag, value) \ + CHECK_EQ(value, base::GetFlag(flag)) \ + << "Flag set to an unexpected value. A prior test is likely " \ + << "setting a flag without using a QuicFlagSaver"; #include "net/quic/core/quic_flags_list.h" #undef QUIC_FLAG } QuicFlagSaver::~QuicFlagSaver() { -#define QUIC_FLAG(type, flag, value) flag = value; +#define QUIC_FLAG(type, flag, value) base::SetFlag(&flag, value); #include "net/quic/core/quic_flags_list.h" #undef QUIC_FLAG }
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc index 7832819..7349aa9 100644 --- a/net/socket/ssl_client_socket_impl.cc +++ b/net/socket/ssl_client_socket_impl.cc
@@ -174,10 +174,7 @@ dict->SetInteger("net_error", result); std::string raw_key; if (result == OK && key && key->ExportRawPublicKey(&raw_key)) { - std::string key_to_log = "redacted"; - if (capture_mode.include_cookies_and_credentials()) { - key_to_log = base::HexEncode(raw_key.data(), raw_key.length()); - } + std::string key_to_log = base::HexEncode(raw_key.data(), raw_key.length()); dict->SetString("key", key_to_log); } return std::move(dict);
diff --git a/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp b/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp deleted file mode 100644 index 51d15bd0..0000000 --- a/net/third_party/mozilla_security_manager/nsKeygenHandler.cpp +++ /dev/null
@@ -1,257 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Vipul Gupta <vipul.gupta@sun.com> - * Douglas Stebila <douglas@stebila.ca> - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "net/third_party/mozilla_security_manager/nsKeygenHandler.h" - -#include <pk11pub.h> -#include <prerror.h> // PR_GetError() -#include <secmod.h> -#include <secder.h> // DER_Encode() -#include <cryptohi.h> // SEC_DerSignData() -#include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() - -#include "base/base64.h" -#include "base/logging.h" -#include "crypto/nss_util.h" -#include "url/gurl.h" - -namespace { - -// Template for creating the signed public key structure to be sent to the CA. -DERTemplate SECAlgorithmIDTemplate[] = { - { DER_SEQUENCE, - 0, NULL, sizeof(SECAlgorithmID) }, - { DER_OBJECT_ID, - offsetof(SECAlgorithmID, algorithm), }, - { DER_OPTIONAL | DER_ANY, - offsetof(SECAlgorithmID, parameters), }, - { 0, } -}; - -DERTemplate CERTSubjectPublicKeyInfoTemplate[] = { - { DER_SEQUENCE, - 0, NULL, sizeof(CERTSubjectPublicKeyInfo) }, - { DER_INLINE, - offsetof(CERTSubjectPublicKeyInfo, algorithm), - SECAlgorithmIDTemplate, }, - { DER_BIT_STRING, - offsetof(CERTSubjectPublicKeyInfo, subjectPublicKey), }, - { 0, } -}; - -DERTemplate CERTPublicKeyAndChallengeTemplate[] = { - { DER_SEQUENCE, - 0, NULL, sizeof(CERTPublicKeyAndChallenge) }, - { DER_ANY, - offsetof(CERTPublicKeyAndChallenge, spki), }, - { DER_IA5_STRING, - offsetof(CERTPublicKeyAndChallenge, challenge), }, - { 0, } -}; - -} // namespace - -namespace mozilla_security_manager { - -// This function is based on the nsKeygenFormProcessor::GetPublicKey function -// in mozilla/security/manager/ssl/src/nsKeygenHandler.cpp. -std::string GenKeyAndSignChallenge(int key_size_in_bits, - const std::string& challenge, - const GURL& url, - PK11SlotInfo* slot, - bool stores_key) { - // Key pair generation mechanism - only RSA is supported at present. - PRUint32 keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN; // from nss/pkcs11t.h - - // Temporary structures used for generating the result - // in the right format. - PK11RSAGenParams rsaKeyGenParams; // Keygen parameters. - SECOidTag algTag; // used by SEC_DerSignData(). - SECKEYPrivateKey *privateKey = NULL; - SECKEYPublicKey *publicKey = NULL; - CERTSubjectPublicKeyInfo *spkInfo = NULL; - PLArenaPool *arena = NULL; - SECStatus sec_rv =SECFailure; - SECItem spkiItem; - SECItem pkacItem; - SECItem signedItem; - CERTPublicKeyAndChallenge pkac; - void *keyGenParams; - bool isSuccess = true; // Set to false as soon as a step fails. - - std::string result_blob; // the result. - - switch (keyGenMechanism) { - case CKM_RSA_PKCS_KEY_PAIR_GEN: - rsaKeyGenParams.keySizeInBits = key_size_in_bits; - rsaKeyGenParams.pe = DEFAULT_RSA_KEYGEN_PE; - keyGenParams = &rsaKeyGenParams; - - algTag = DEFAULT_RSA_KEYGEN_ALG; - break; - default: - // TODO(gauravsh): If we ever support other mechanisms, - // this can be changed. - LOG(ERROR) << "Only RSA keygen mechanism is supported"; - isSuccess = false; - goto failure; - } - - VLOG(1) << "Creating key pair..."; - { - crypto::AutoNSSWriteLock lock; - privateKey = PK11_GenerateKeyPair(slot, - keyGenMechanism, - keyGenParams, - &publicKey, - PR_TRUE, // isPermanent? - PR_TRUE, // isSensitive? - NULL); - } - VLOG(1) << "done."; - - if (!privateKey) { - LOG(ERROR) << "Generation of Keypair failed!"; - isSuccess = false; - goto failure; - } - - // Set friendly names for the keys. - if (url.has_host()) { - // TODO(davidben): Use something like "Key generated for - // example.com", but localize it. - const std::string& label = url.host(); - { - crypto::AutoNSSWriteLock lock; - PK11_SetPublicKeyNickname(publicKey, label.c_str()); - PK11_SetPrivateKeyNickname(privateKey, label.c_str()); - } - } - - // The CA expects the signed public key in a specific format - // Let's create that now. - - // Create a subject public key info from the public key. - spkInfo = SECKEY_CreateSubjectPublicKeyInfo(publicKey); - if (!spkInfo) { - LOG(ERROR) << "Couldn't create SubjectPublicKeyInfo from public key"; - isSuccess = false; - goto failure; - } - - arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); - if (!arena) { - LOG(ERROR) << "PORT_NewArena: Couldn't allocate memory"; - isSuccess = false; - goto failure; - } - - // DER encode the whole subjectPublicKeyInfo. - sec_rv = DER_Encode(arena, &spkiItem, CERTSubjectPublicKeyInfoTemplate, - spkInfo); - if (SECSuccess != sec_rv) { - LOG(ERROR) << "Couldn't DER Encode subjectPublicKeyInfo"; - isSuccess = false; - goto failure; - } - - // Set up the PublicKeyAndChallenge data structure, then DER encode it. - pkac.spki = spkiItem; - pkac.challenge.type = siBuffer; - pkac.challenge.len = challenge.length(); - pkac.challenge.data = (unsigned char *)challenge.data(); - sec_rv = DER_Encode(arena, &pkacItem, CERTPublicKeyAndChallengeTemplate, - &pkac); - if (SECSuccess != sec_rv) { - LOG(ERROR) << "Couldn't DER Encode PublicKeyAndChallenge"; - isSuccess = false; - goto failure; - } - - // Sign the DER encoded PublicKeyAndChallenge. - sec_rv = SEC_DerSignData(arena, &signedItem, pkacItem.data, pkacItem.len, - privateKey, algTag); - if (SECSuccess != sec_rv) { - LOG(ERROR) << "Couldn't sign the DER encoded PublicKeyandChallenge"; - isSuccess = false; - goto failure; - } - - // Convert the signed public key and challenge into base64/ascii. - base::Base64Encode(base::StringPiece(reinterpret_cast<char*>(signedItem.data), - signedItem.len), - &result_blob); - - failure: - if (!isSuccess) { - LOG(ERROR) << "SSL Keygen failed! (NSS error code " << PR_GetError() << ")"; - } else { - VLOG(1) << "SSL Keygen succeeded!"; - } - - // Do cleanups - if (privateKey) { - // On successful keygen we need to keep the private key, of course, - // or we won't be able to use the client certificate. - if (!isSuccess || !stores_key) { - crypto::AutoNSSWriteLock lock; - PK11_DestroyTokenObject(privateKey->pkcs11Slot, privateKey->pkcs11ID); - } - SECKEY_DestroyPrivateKey(privateKey); - } - - if (publicKey) { - if (!isSuccess || !stores_key) { - crypto::AutoNSSWriteLock lock; - PK11_DestroyTokenObject(publicKey->pkcs11Slot, publicKey->pkcs11ID); - } - SECKEY_DestroyPublicKey(publicKey); - } - if (spkInfo) { - SECKEY_DestroySubjectPublicKeyInfo(spkInfo); - } - if (arena) { - PORT_FreeArena(arena, PR_TRUE); - } - - return (isSuccess ? result_blob : std::string()); -} - -} // namespace mozilla_security_manager
diff --git a/net/third_party/mozilla_security_manager/nsKeygenHandler.h b/net/third_party/mozilla_security_manager/nsKeygenHandler.h deleted file mode 100644 index 4c20e56..0000000 --- a/net/third_party/mozilla_security_manager/nsKeygenHandler.h +++ /dev/null
@@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * David Drinan. (ddrinan@netscape.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef _NSKEYGENHANDLER_H_ -#define _NSKEYGENHANDLER_H_ - -#include <string> - -class GURL; -typedef struct PK11SlotInfoStr PK11SlotInfo; - -namespace mozilla_security_manager { - -#define DEFAULT_RSA_KEYGEN_PE 65537L -#define DEFAULT_RSA_KEYGEN_ALG SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION - -// Generates the key pair and the cert request (SPKAC), and returns a -// base64-encoded string suitable for use as the form value of <keygen>. -// Parameters: -// key_size_in_bits: key size in bits (usually 2048) -// challenge: challenge string sent by server -// url: the URL which requested the SPKAC -// slot: a slot to generate the key in, should be authenticated -// stores_key: should the generated key pair be stored persistently? -std::string GenKeyAndSignChallenge(int key_size_in_bits, - const std::string& challenge, - const GURL& url, - PK11SlotInfo* slot, - bool stores_key); - -} // namespace mozilla_security_manager - -#endif //_NSKEYGENHANDLER_H_
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc index 898d42c..9fda719 100644 --- a/net/tools/quic/end_to_end_test.cc +++ b/net/tools/quic/end_to_end_test.cc
@@ -64,7 +64,6 @@ using base::IntToString; using base::StringPiece; using base::WaitableEvent; -using net::EpollServer; using std::string; namespace net {
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc index b086a21..4e9b68e 100644 --- a/net/tools/quic/quic_client_session_test.cc +++ b/net/tools/quic/quic_client_session_test.cc
@@ -24,22 +24,6 @@ using base::StringPrintf; using google::protobuf::implicit_cast; -using net::test::ConstructEncryptedPacket; -using net::test::ConstructMisFramedEncryptedPacket; -using net::test::CryptoTestUtils; -using net::test::DefaultQuicConfig; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; -using net::test::MockQuicSpdyClientStream; -using net::test::PacketSavingConnection; -using net::test::QuicConnectionPeer; -using net::test::QuicPacketCreatorPeer; -using net::test::QuicSpdySessionPeer; -using net::test::SupportedVersions; -using net::test::TestPeerIPAddress; -using net::test::kClientDataStreamId1; -using net::test::kServerDataStreamId1; -using net::test::kTestPort; using std::string; using testing::AnyNumber; using testing::Invoke;
diff --git a/net/tools/quic/quic_client_test.cc b/net/tools/quic/quic_client_test.cc index 9300e3b..3ce369af 100644 --- a/net/tools/quic/quic_client_test.cc +++ b/net/tools/quic/quic_client_test.cc
@@ -18,9 +18,6 @@ #include "net/tools/quic/test_tools/quic_client_peer.h" #include "testing/gtest/include/gtest/gtest.h" -using net::EpollServer; -using net::test::CryptoTestUtils; - namespace net { namespace test { namespace {
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc index 6792f18..f3c7226 100644 --- a/net/tools/quic/quic_dispatcher_test.cc +++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -39,11 +39,6 @@ using base::IntToString; using base::StringPiece; -using net::EpollServer; -using net::test::ConstructEncryptedPacket; -using net::test::CryptoTestUtils; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; using std::string; using testing::CreateFunctor; using testing::DoAll;
diff --git a/net/tools/quic/quic_epoll_connection_helper_test.cc b/net/tools/quic/quic_epoll_connection_helper_test.cc index 0f9106fe..e0d66a67 100644 --- a/net/tools/quic/quic_epoll_connection_helper_test.cc +++ b/net/tools/quic/quic_epoll_connection_helper_test.cc
@@ -8,8 +8,6 @@ #include "net/tools/quic/test_tools/mock_epoll_server.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::MockEpollServer; - namespace net { namespace test { namespace {
diff --git a/net/tools/quic/quic_server_test.cc b/net/tools/quic/quic_server_test.cc index ea381d9..4f5db9ee 100644 --- a/net/tools/quic/quic_server_test.cc +++ b/net/tools/quic/quic_server_test.cc
@@ -16,8 +16,6 @@ #include "testing/gtest/include/gtest/gtest.h" using ::testing::_; -using net::test::CryptoTestUtils; -using net::test::MockQuicDispatcher; namespace net { namespace test {
diff --git a/net/tools/quic/quic_simple_client_test.cc b/net/tools/quic/quic_simple_client_test.cc index 0a571a7..88a2c39a 100644 --- a/net/tools/quic/quic_simple_client_test.cc +++ b/net/tools/quic/quic_simple_client_test.cc
@@ -9,8 +9,6 @@ #include "net/quic/test_tools/quic_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::CryptoTestUtils; - namespace net { namespace test {
diff --git a/net/tools/quic/quic_simple_server_session_test.cc b/net/tools/quic/quic_simple_server_session_test.cc index 3f4d649..3e6f3e1 100644 --- a/net/tools/quic/quic_simple_server_session_test.cc +++ b/net/tools/quic/quic_simple_server_session_test.cc
@@ -32,22 +32,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::CryptoTestUtils; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; -using net::test::QuicConfigPeer; -using net::test::QuicConnectionPeer; -using net::test::QuicSpdyStreamPeer; -using net::test::QuicSentPacketManagerPeer; -using net::test::QuicSessionPeer; -using net::test::QuicSpdySessionPeer; -using net::test::QuicSustainedBandwidthRecorderPeer; -using net::test::SupportedVersions; -using net::test::kClientDataStreamId1; -using net::test::kClientDataStreamId2; -using net::test::kClientDataStreamId3; -using net::test::kInitialSessionFlowControlWindowForTest; -using net::test::kInitialStreamFlowControlWindowForTest; using std::string; using testing::StrictMock; using testing::_;
diff --git a/net/tools/quic/quic_simple_server_stream_test.cc b/net/tools/quic/quic_simple_server_stream_test.cc index 72ff7c47..57eba3e 100644 --- a/net/tools/quic/quic_simple_server_stream_test.cc +++ b/net/tools/quic/quic_simple_server_stream_test.cc
@@ -29,13 +29,6 @@ #include "url/gurl.h" using base::StringPiece; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; -using net::test::MockQuicSpdySession; -using net::test::QuicStreamPeer; -using net::test::SupportedVersions; -using net::test::kInitialSessionFlowControlWindowForTest; -using net::test::kInitialStreamFlowControlWindowForTest; using std::string; using testing::_; using testing::AnyNumber;
diff --git a/net/tools/quic/quic_simple_server_test.cc b/net/tools/quic/quic_simple_server_test.cc index adac378..87969d82 100644 --- a/net/tools/quic/quic_simple_server_test.cc +++ b/net/tools/quic/quic_simple_server_test.cc
@@ -14,7 +14,6 @@ #include "testing/gtest/include/gtest/gtest.h" using ::testing::_; -using net::test::CryptoTestUtils; namespace net { namespace test {
diff --git a/net/tools/quic/quic_spdy_client_stream_test.cc b/net/tools/quic/quic_spdy_client_stream_test.cc index 1c3223f..785025a4 100644 --- a/net/tools/quic/quic_spdy_client_stream_test.cc +++ b/net/tools/quic/quic_spdy_client_stream_test.cc
@@ -18,16 +18,6 @@ #include "testing/gtest/include/gtest/gtest.h" using base::IntToString; -using net::test::CryptoTestUtils; -using net::test::DefaultQuicConfig; -using net::test::MockQuicConnection; -using net::test::MockQuicConnectionHelper; -using net::test::SupportedVersions; -using net::test::kClientDataStreamId1; -using net::test::kServerDataStreamId1; -using net::test::kInitialSessionFlowControlWindowForTest; -using net::test::kInitialStreamFlowControlWindowForTest; - using std::string; using testing::StrictMock; using testing::TestWithParam;
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 74790eb..a409ead 100644 --- a/net/tools/quic/quic_time_wait_list_manager_test.cc +++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -27,13 +27,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using net::test::kTestPort; -using net::test::BuildUnsizedDataPacket; -using net::test::NoOpFramerVisitor; -using net::test::QuicVersionMax; -using net::test::QuicVersionMin; -using net::test::MockPacketWriter; - using testing::Args; using testing::Assign; using testing::DoAll;
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 24abba0..98080af6 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -212,18 +212,10 @@ # define SK_IGNORE_GPU_DITHER #endif -#ifndef SK_SUPPORT_LEGACY_PREROLL -# define SK_SUPPORT_LEGACY_PREROLL -#endif - #ifndef SK_SUPPORT_LEGACY_EVAL_CUBIC # define SK_SUPPORT_LEGACY_EVAL_CUBIC #endif -#ifndef SK_USE_LEGACY_D50_MATRICES -# define SK_USE_LEGACY_D50_MATRICES -#endif - #ifndef SK_DISABLE_COLOR_XFORM_PIPELINE # define SK_DISABLE_COLOR_XFORM_PIPELINE #endif
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index 5b616c2a..0d7d714 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -791,7 +791,6 @@ Bug(none) fast/html/details-remove-summary-6-and-click.html [ Failure ] Bug(none) fast/html/details-replace-summary-child.html [ Failure ] Bug(none) fast/html/details-replace-text.html [ Failure ] -Bug(none) fast/html/keygen.html [ Crash Failure ] Bug(none) images/12-55.html [ Failure ] Bug(none) images/182.html [ Crash Failure ] Bug(none) images/2-dht.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests index fc5555e..ef8e1a6 100644 --- a/third_party/WebKit/LayoutTests/SlowTests +++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -258,8 +258,6 @@ crbug.com/241576 [ Win ] http/tests/appcache/404-manifest.html [ Slow ] crbug.com/241576 [ Win ] virtual/mojo-loading/http/tests/appcache/404-manifest.html [ Slow ] crbug.com/241869 [ Debug ] css3/flexbox/multiline-justify-content.html [ Slow ] -crbug.com/520189 http/tests/misc/submit-post-keygen.html [ Slow ] -crbug.com/520189 virtual/mojo-loading/http/tests/misc/submit-post-keygen.html [ Slow ] crbug.com/245154 editing/selection/modify_move/move-by-character-brute-force.html [ Slow ] crbug.com/246749 inspector/extensions/extensions-panel.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 76b9c3b..75626bc5 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -118,7 +118,7 @@ # Very slight rendering changes caused by Skia rect clipping change. crbug.com/627844 virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html [ Pass Failure ] -crbug.com/630615 [ Win7 ] images/color-profile-background-image-space.html [ Skip ] +crbug.com/630615 [ Win ] images/color-profile-background-image-space.html [ Skip ] crbug.com/632000 [ Win ] images/paint-subrect-grid.html [ Pass Failure ] @@ -728,8 +728,6 @@ crbug.com/636053 [ Mac Win ] virtual/threaded/printing/thead-repeats-at-top-of-each-page-multiple-tables.html [ NeedsManualRebaseline ] crbug.com/636239 [ Win7 ] media/video-zoom-controls.html [ Failure ] -crbug.com/520189 [ Mac ] http/tests/misc/submit-post-keygen.html [ Pass Timeout ] -crbug.com/520189 [ Mac ] virtual/mojo-loading/http/tests/misc/submit-post-keygen.html [ Pass Timeout ] crbug.com/432129 fast/html/marquee-scroll.html [ Failure Pass ] crbug.com/248938 [ Win Debug ] virtual/threaded/animations/transition-and-animation-2.html [ Timeout ] @@ -1190,6 +1188,298 @@ crbug.com/658305 css3/filters/multiple-references-id-mutate-crash.html [ Failure Pass ] crbug.com/658305 css3/filters/reference-filter-update-on-attribute-change.html [ Failure Pass ] +crbug.com/657839 virtual/gpu-rasterization/images/embed-image.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-replaced-height-002.htm [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background-color-border-box.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-invert-hw.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-profile-match.html [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toBlob-jpeg-medium-quality.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-tiled-gradient.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-017.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-022.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/spinvalidation/paint/invalidation/compositing/page-scale-repaint.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/paletted-png-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/mix-blend-mode-isolated-group-1.html [ NeedsRebaseline ] +crbug.com/657839 images/paletted-png-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/block-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 fast/reflections/reflection-masks-opacity.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-single-layer-no-blending.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-block-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-069.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-multiple-background-layers.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-023.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-invert.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/block-replaced-height-003.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-contrast.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-brightness.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-border-image-source.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-029.htm [ NeedsRebaseline ] +crbug.com/657839 mhtml/invalid-bad-boundary2.mht [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-brightness-clamping-hw.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-block-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-031.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-005.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/spinvalidation/paint/invalidation/background-image-paint-invalidation-small-document.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-height-002.htm [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toDataURL-webp.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/effect-background-blend-mode.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-replaced-height-003.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-block-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-041.htm [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background_color_padding_box.htm [ NeedsRebaseline ] +crbug.com/657839 fast/reflections/reflection-masks.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/block-replaced-height-002.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-border-image-source.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toBlob-jpeg-medium-quality.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-blur-hw.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-combined.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-050.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-brightness-clamping.html [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background_repeat_space_content_box.htm [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background-attachment-local-scrolling.htm [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toBlob-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 svg/as-border-image/svg-as-border-image-2.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-image-image.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-029.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-separate-layer-declaration.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-008.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-004.htm [ NeedsRebaseline ] +crbug.com/657839 fast/reflections/reflection-with-zoom.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-076.htm [ NeedsRebaseline ] +crbug.com/657839 svg/W3C-SVG-1.1/struct-image-04-t.svg [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-003.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-drop-shadow.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-009.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/mix-blend-mode-isolated-group-2.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-hue-rotate-hw.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-opaque-layer.html [ NeedsRebaseline ] +crbug.com/657839 virtual/spinvalidation/paint/invalidation/background-image-paint-invalidation-large-abspos-div.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-003.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-block-replaced-height-002.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-022.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-grayscale-hw.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-062.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/effect-background-blend-mode-stacking.html [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toBlob-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-055.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toBlob-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toBlob-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-043.htm [ NeedsRebaseline ] +crbug.com/657839 fast/borders/border-image-omit-right-slice.html [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/none-as-image-layer.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toDataURL-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 [ Mac ] css3/filters/effect-contrast-hw.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-saturate-hw.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/composited-reflected.html [ NeedsRebaseline ] +crbug.com/657839 compositing/reflections/simple-composited-reflections.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toDataURL-webp.html [ NeedsRebaseline ] +crbug.com/657839 images/embed-image.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toBlob-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 images/object-image.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-048.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-image-svg.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-008.htm [ NeedsRebaseline ] +crbug.com/657839 images/paint-subrect.html [ NeedsRebaseline ] +crbug.com/657839 tables/mozilla/bugs/bug82946-2.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-block-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-sepia.html [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/color-behind-images.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/object-image.html [ NeedsRebaseline ] +crbug.com/657839 images/png-color-profile-ignore-gamma.html [ NeedsRebaseline ] +crbug.com/657839 mhtml/image_document.mht [ NeedsRebaseline ] +crbug.com/657839 fast/css/background-shorthand-invalid-url.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-different-image-formats.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-011.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-030.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-020.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toDataURL-webp.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-munsell-adobe-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 fast/inline/inline-box-background-long-image.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/block-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-064.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-034.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-016.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/spinvalidation/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ NeedsRebaseline ] +crbug.com/657839 transforms/transformed-document-element.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-brightness-hw.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-saturate.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-hue-rotate.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-opacity-hw.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-010.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-drop-shadow-hw.html [ NeedsRebaseline ] +crbug.com/657839 virtual/display_list_2d_canvas/fast/canvas/canvas-toDataURL-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toDataURL-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/paint-subrect.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-002.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toDataURL-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toBlob-jpeg-medium-quality.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-profile-match.html [ NeedsRebaseline ] +crbug.com/657839 fast/reflections/reflection-masks-outset.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/regions-expanding.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/float-replaced-width-003.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/float-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-munsell-srgb-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toDataURL-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-block-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-036.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-027.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu/fast/canvas/canvas-toBlob-webp-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/order-of-images.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/crash-filter-change.html [ NeedsRebaseline ] +crbug.com/657839 paint/invalidation/compositing/page-scale-repaint.html [ NeedsRebaseline ] +crbug.com/657839 paint/invalidation/background-image-paint-invalidation-small-document.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background_position_three_four_values.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-015.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-blur.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 svg/W3C-SVG-1.1/struct-image-08-t.svg [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-grayscale.html [ NeedsRebaseline ] +crbug.com/657839 fast/canvas/canvas-toDataURL-jpeg-maximum-quality.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/block-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/mix-blend-mode-isolated-group-3.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-default-value.html [ NeedsRebaseline ] +crbug.com/657839 fast/writing-mode/block-level-images.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-057.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-image-color.html [ NeedsRebaseline ] +crbug.com/657839 ietestcenter/css3/bordersbackgrounds/background-size-aspect-ratio.htm [ NeedsRebaseline ] +crbug.com/657839 fast/reflections/reflection-direction.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-024.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 paint/invalidation/background-image-paint-invalidation-large-abspos-div.html [ NeedsRebaseline ] +crbug.com/657839 virtual/threaded/compositing/visibility/visibility-image-layers.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-sepia-hw.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/block-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-munsell-srgb-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-combined-hw.html [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/inline-replaced-height-001.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-071.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-013.htm [ NeedsRebaseline ] +crbug.com/657839 css3/filters/effect-opacity.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-width-002.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-crossfade-image-gradient.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/block-replaced-width-006.htm [ NeedsRebaseline ] +crbug.com/657839 css3/blending/background-blend-mode-gradient-image.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/inline-block-replaced-height-003.htm [ NeedsRebaseline ] +crbug.com/657839 compositing/visibility/visibility-image-layers.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-munsell-adobe-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/png-color-profile-ignore-gamma.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/block-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/float-replaced-height-003.htm [ NeedsRebaseline ] +crbug.com/657839 compositing/masks/direct-image-mask.html [ NeedsRebaseline ] +crbug.com/657839 css3/blending/effect-background-blend-mode-tiled.html [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/absolute-replaced-width-001.htm [ NeedsRebaseline ] +crbug.com/657839 virtual/layout_ng/css2.1/20110323/float-replaced-width-005.htm [ NeedsRebaseline ] +crbug.com/657839 css2.1/20110323/width-replaced-element-001.htm [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-border-fade.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/cHRM_color_spin.html [ NeedsRebaseline ] +crbug.com/657839 svg/custom/group-opacity.svg [ NeedsRebaseline ] +crbug.com/657839 svg/W3C-SVG-1.1/struct-use-01-t.svg [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-animate.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-canvas.html [ NeedsRebaseline ] +crbug.com/657839 media/color-profile-munsell-bt709-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 virtual/rootlayerscrolls/scrollbars/listbox-scrollbar-combinations.html [ NeedsRebaseline ] +crbug.com/657839 images/cross-fade-background-size.html [ NeedsRebaseline ] +crbug.com/657839 virtual/mojo-loading/http/tests/inspector/network/network-datareceived.html [ NeedsRebaseline ] +crbug.com/657839 images/color-jpeg-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 svg/W3C-SVG-1.1/render-groups-01-b.svg [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-layer.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-group.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-canvas-svg.html [ NeedsRebaseline ] +crbug.com/657839 images/png-suite/test.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-drag-image.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-filter.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-border-radius.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-layer-filter.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-object.html [ NeedsRebaseline ] +crbug.com/657839 svg/W3C-SVG-1.1/render-groups-03-t.svg [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-mask-image-svg.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-canvas.html [ NeedsRebaseline ] +crbug.com/657839 [ Linux Mac ] virtual/gpu-rasterization/images/webp-color-profile-lossy.html [ NeedsRebaseline ] +crbug.com/657839 scrollbars/listbox-scrollbar-combinations.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-reflection.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/png-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-animate-rotate.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-canvas-pattern.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-svg-fill-text.html [ NeedsRebaseline ] +crbug.com/657839 images/webp-color-profile-lossy-alpha.html [ NeedsRebaseline ] +crbug.com/657839 images/cHRM_color_spin.html [ NeedsRebaseline ] +crbug.com/657839 svg/filters/filter-source-position.svg [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-pseudo-content.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-background-image-repeat.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-canvas-svg.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-jpeg-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-svg-foreign-object.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-background-image-cross-fade.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-shape.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-iframe.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-animate.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/jpeg-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-layer-filter.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-shape.html [ NeedsRebaseline ] +crbug.com/657839 images/jpeg-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-border-image.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-iframe.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-svg-foreign-object.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-animate-rotate.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-reflection.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-mask-image-svg.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-background-clip-text.html [ NeedsRebaseline ] +crbug.com/657839 svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml [ NeedsRebaseline ] +crbug.com/657839 virtual/prefer_compositing_to_lcd_text/scrollbars/listbox-scrollbar-combinations.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-background-image-cross-fade-png.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-group.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-svg-resource-url.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-border-fade.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-canvas-pattern.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-svg.html [ NeedsRebaseline ] +crbug.com/657839 images/webp-color-profile-lossy.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-drag-image.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-object-fit.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-background-image-space.html [ NeedsRebaseline ] +crbug.com/657839 [ Linux Mac ] images/color-profile-background-image-space.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-background-image-cover.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-clip.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-pseudo-content.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-svg-fill-text.html [ NeedsRebaseline ] +crbug.com/657839 media/color-profile-video-poster-image.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-background-image-cover.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-object.html [ NeedsRebaseline ] +crbug.com/657839 http/tests/inspector/network/network-datareceived.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-object-fit.html [ NeedsRebaseline ] +crbug.com/657839 images/webp-color-profile-lossless.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-svg.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/png-suite/test.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-background-image-repeat.html [ NeedsRebaseline ] +crbug.com/657839 compositing/color-matching/image-color-matching.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/webp-color-profile-lossy-alpha.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-image-filter-all.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-image-svg-resource-url.html [ NeedsRebaseline ] +crbug.com/657839 svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/cross-fade-background-size.html [ NeedsRebaseline ] +crbug.com/657839 images/png-with-color-profile.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-clip.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/webp-color-profile-lossless.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-border-image.html [ NeedsRebaseline ] +crbug.com/657839 images/color-profile-background-image-cross-fade-png.html [ NeedsRebaseline ] +crbug.com/657839 virtual/gpu-rasterization/images/color-profile-border-radius.html [ NeedsRebaseline ] +crbug.com/657839 media/color-profile-munsell-bt601-smpte-to-srgb.html [ NeedsRebaseline ] +crbug.com/657839 [ Win ] virtual/gpu-rasterization/images/color-profile-filter.html [ NeedsRebaseline ] + crbug.com/267206 [ Mac ] fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ] crbug.com/267206 [ Mac ] virtual/scroll_customization/fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ] @@ -1973,6 +2263,7 @@ # Fail differently when run with --enable-wptserve: (crbug.com/508728) crbug.com/508728 crbug.com/664268 imported/wpt/html/browsers/history/the-location-interface/reload_post_1.html [ Failure Timeout ] crbug.com/508728 imported/wpt/webstorage/document-domain.html [ Failure Timeout ] +crbug.com/508728 virtual/mojo-localstorage/imported/wpt/webstorage/document-domain.html [ Failure Timeout ] # Bug(dpranke) # crbug.com/508728 imported/wpt/workers/Worker_cross_origin_security_err.htm [ Timeout ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index a4fee8c..26cb148b 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -374,5 +374,15 @@ "prefix": "spinvalidation", "base": "svg", "args": ["--enable-blink-features=SlimmingPaintInvalidation"] + }, + { + "prefix": "mojo-localstorage", + "base": "imported/wpt/webstorage", + "args": ["--mojo-local-storage"] + }, + { + "prefix": "mojo-localstorage", + "base": "storage/domstorage/localstorage", + "args": ["--mojo-local-storage"] } ]
diff --git a/third_party/WebKit/LayoutTests/W3CImportExpectations b/third_party/WebKit/LayoutTests/W3CImportExpectations index 6bddf60..bcbe911 100644 --- a/third_party/WebKit/LayoutTests/W3CImportExpectations +++ b/third_party/WebKit/LayoutTests/W3CImportExpectations
@@ -337,6 +337,8 @@ ## Owners: jsbell@chromium.org # imported/wpt/user-timing [ Pass ] imported/wpt/vibration [ Skip ] +## Owners: bsheedy@chromium.org +# imported/wpt/vr [ Pass ] imported/wpt/wai-aria [ Skip ] ## Owners: suzyh@chromium.org # imported/wpt/web-animations [ Pass ]
diff --git a/third_party/WebKit/LayoutTests/accessibility/content-changed-notification-causes-crash-expected.txt b/third_party/WebKit/LayoutTests/accessibility/content-changed-notification-causes-crash-expected.txt index 75eb5f5c..689b10a 100644 --- a/third_party/WebKit/LayoutTests/accessibility/content-changed-notification-causes-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/content-changed-notification-causes-crash-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. >> Ensures that this snippet does not lead to a crash. Bug 86029.
diff --git a/third_party/WebKit/LayoutTests/accessibility/contenteditable-table-check-causes-crash-expected.txt b/third_party/WebKit/LayoutTests/accessibility/contenteditable-table-check-causes-crash-expected.txt index d8d1606..b9ee65a 100644 --- a/third_party/WebKit/LayoutTests/accessibility/contenteditable-table-check-causes-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/accessibility/contenteditable-table-check-causes-crash-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Ensures that this snippet does not lead to a crash in the code that detects if a table is contenteditable. Bug 87409. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash-expected.txt b/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash-expected.txt deleted file mode 100644 index 760e0efe..0000000 --- a/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -PASS successfullyParsed is true - -TEST COMPLETE - -Ensures that it's not possible to have two AXLayoutObjects that point to the same renderer, if the initialization of an AXLayoutObject results in another object with the same renderer being created before AXObjectCache has added that mapping to its hash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash.html b/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash.html deleted file mode 100644 index 27bb839..0000000 --- a/third_party/WebKit/LayoutTests/accessibility/duplicate-axlayoutobject-crash.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!doctype html> -<html> -<head> -<script src="../resources/js-test.js"></script> -</head> -<body> - -<label> - <summary> - <ul style="display: table-header-group"> - <keygen></keygen> - </ul> - </summary> -</label> - -<p id="description"></p> - -<script> - description("Ensures that it's not possible to have two AXLayoutObjects that point to the same renderer, if the initialization of an AXLayoutObject results in another object with the same renderer being created before AXObjectCache has added that mapping to its hash."); - if (window.accessibilityController) - accessibilityController.accessibleElementById("dummy"); -</script> - - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/remove-format-elements-expected.txt b/third_party/WebKit/LayoutTests/editing/execCommand/remove-format-elements-expected.txt index 18f01d8..e2afc97 100644 --- a/third_party/WebKit/LayoutTests/editing/execCommand/remove-format-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/editing/execCommand/remove-format-elements-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 58: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Removed acronym, b, bdo, big, cite, code, dfn, em, font, i, ins, kbd, nobr, q, s, samp, small, strike, strong, sub, sup, tt, u, var Preserved
diff --git a/third_party/WebKit/LayoutTests/fast/block/child-not-removed-from-parent-lineboxes-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/block/child-not-removed-from-parent-lineboxes-crash-expected.txt index ee2bc98..f528f9c1 100644 --- a/third_party/WebKit/LayoutTests/fast/block/child-not-removed-from-parent-lineboxes-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/child-not-removed-from-parent-lineboxes-crash-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: line 12: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. PASS: does not crash
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-first-letter-expected.txt b/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-first-letter-expected.txt index 9f5b4548..633e7760 100644 --- a/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-first-letter-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/float/float-not-removed-from-first-letter-expected.txt
@@ -1,4 +1,2 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Webkit Bug 86019 - Crash due to floats not removed from first-letter element. - PASS. WebKit didn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/split-inline-sibling-of-float-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/block/float/split-inline-sibling-of-float-crash-expected.txt index 7798ab2..4e0a60422 100644 --- a/third_party/WebKit/LayoutTests/fast/block/float/split-inline-sibling-of-float-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/block/float/split-inline-sibling-of-float-crash-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: line 12: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. PASS if no crash or assert under ASAN
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/stale-grid-layout-expected.txt b/third_party/WebKit/LayoutTests/fast/css-grid-layout/stale-grid-layout-expected.txt index f294c90..3c35b3d1 100644 --- a/third_party/WebKit/LayoutTests/fast/css-grid-layout/stale-grid-layout-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/stale-grid-layout-expected.txt
@@ -1,4 +1,2 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. - The test checks that we don't add non-children of the grid into the grid representation This test has passed if it didn't crash under ASAN.
diff --git a/third_party/WebKit/LayoutTests/fast/css/pseudo-required-optional-unapplied-expected.txt b/third_party/WebKit/LayoutTests/fast/css/pseudo-required-optional-unapplied-expected.txt index 300b204..d12f43b 100644 --- a/third_party/WebKit/LayoutTests/fast/css/pseudo-required-optional-unapplied-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/pseudo-required-optional-unapplied-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Check cases that :required/:optional classes are not applied On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen-expected.txt deleted file mode 100644 index e293659..0000000 --- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -Test for bug 63776: Partial layout when a flex-box has visibility: collapse - -This test PASSES if it does not CRASH.
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen.html b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen.html deleted file mode 100644 index 1fe47b8..0000000 --- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-button-keygen.html +++ /dev/null
@@ -1,14 +0,0 @@ -<html> -<body> -<p style="visibility: collapse;"><button><keygen autofocus><input id="test"></keygen></button></p> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -document.body.offsetTop; -document.getElementById('test').parentNode.removeChild(document.getElementById('test')); -document.body.offsetTop; -</script> -<p>Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=63776">63776</a>: Partial layout when a flex-box has visibility: collapse</p> -<p>This test PASSES if it does not CRASH.</p> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1-expected.txt index ee8e0b18..02d7cb5e 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail1-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This page verifies fix for bug 58247. WebKit should not crash when this page is rendered.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt deleted file mode 100644 index e518029..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -This tests the keygen element - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -PASS keygen.options is undefined -PASS keygen.type is "keygen" -PASS keygen.keytype is "rsa" -PASS keygen.getAttribute("keytype") is null -PASS keygen.keytype = "foo"; keygen.keytype is "" -PASS keygen.getAttribute("KEYtype") is "foo" -PASS keygen.setAttribute("keytype", "bar"); keygen.keytype is "" -PASS keygen.getAttribute("KeyType") is "bar" -PASS shadow.firstChild.tagName is "SELECT" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html b/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html deleted file mode 100644 index e00efdf8..0000000 --- a/third_party/WebKit/LayoutTests/fast/dom/HTMLKeygenElement/keygen.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<keygen id="keys" /> -<script> -description("This tests the keygen element"); - -var keygen = document.getElementById('keys'); -shouldBe('keygen.options', 'undefined'); // keygen is not a select -shouldBeEqualToString('keygen.type', 'keygen'); -shouldBeEqualToString('keygen.keytype', 'rsa'); -shouldBeNull('keygen.getAttribute("keytype")'); -shouldBeEqualToString('keygen.keytype = "foo"; keygen.keytype', ''); -shouldBeEqualToString('keygen.getAttribute("KEYtype")', 'foo'); -shouldBeEqualToString('keygen.setAttribute("keytype", "bar"); keygen.keytype', ''); -shouldBeEqualToString('keygen.getAttribute("KeyType")', 'bar'); - -if (window.internals) { - var shadow = internals.shadowRoot(keygen); - shouldBe('shadow.firstChild.tagName', '"SELECT"'); -} -</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/click-method-on-html-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/click-method-on-html-element-expected.txt index b88475f..23a334e5 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/click-method-on-html-element-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/click-method-on-html-element-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. The support of click() method on HTMLElement. Pass: Click event handler called for: a
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt index 9dd5883..fd9361f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 10: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Reflected DOMString attribute test for button/@name Initial value: PASS element.name is "" @@ -149,36 +148,6 @@ PASS element.getAttribute("step") is "456" -Reflected DOMString attribute test for keygen/@name -Initial value: -PASS element.name is "" -PASS element.getAttribute("name") is null -Setting a value via the IDL attribute: -PASS element.name = "foo"; element.name is "foo" -PASS element.getAttribute("name") is "foo" -Setting a value via the content attribute: -PASS element.setAttribute("name", " bar\n"); element.name is " bar\n" -PASS element.getAttribute("name") is " bar\n" -Setting null via the IDL attribute: -PASS element.name = null; element.name is "null" -PASS element.getAttribute("name") is "null" -Setting null via the content attribute: -PASS element.setAttribute("name", null); element.name is "null" -PASS element.getAttribute("name") is "null" -Setting undefined via the IDL attribute: -PASS element.name = undefined; element.name is "undefined" -PASS element.getAttribute("name") is "undefined" -Setting undefined via the content attribute: -PASS element.setAttribute("name", undefined); element.name is "undefined" -PASS element.getAttribute("name") is "undefined" -Setting non-string via the IDL attribute: -PASS element.name = 123; element.name is "123" -PASS element.getAttribute("name") is "123" -Setting non-string via the content attribute: -PASS element.setAttribute("name", 456); element.name is "456" -PASS element.getAttribute("name") is "456" - - Reflected DOMString attribute test for menu/@type Initial value: PASS element.type is ""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html index f633fed..bf28eaad 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html +++ b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection.html
@@ -58,7 +58,6 @@ testDOMStringReflection('form', 'name'); testDOMStringReflection('input', 'name'); testDOMStringReflection('input', 'step'); -testDOMStringReflection('keygen', 'name'); testDOMStringReflection('menu', 'type'); testDOMStringReflection('menu', 'label'); testDOMStringReflection('menuitem', 'label');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt index 81aa283..4fb6653 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 362: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test setting various attributes of a elements to JavaScript null. TEST SUCCEEDED: The value was null. [tested Node.nodeValue] @@ -151,10 +150,6 @@ TEST SUCCEEDED: The value was the empty string. [tested HTMLInputElement.value] -TEST SUCCEEDED: The value was the string 'null'. [tested HTMLKeygenElement.challenge] -TEST SUCCEEDED: The value was the empty string. [tested HTMLKeygenElement.keytype] -TEST SUCCEEDED: The value was the string 'null'. [tested HTMLKeygenElement.name] - TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLabelElement.htmlFor] TEST SUCCEEDED: The value was the string 'null'. [tested HTMLLegendElement.align]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html index 54f94ac..1d85100 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html +++ b/third_party/WebKit/LayoutTests/fast/dom/element-attribute-js-null.html
@@ -358,15 +358,6 @@ ] }, { - type: 'HTMLKeygenElement', - elementToUse: document.createElement('keygen'), - attributes: [ - {name: 'challenge', expectedNull: 'null'}, - {name: 'keytype', expectedNull: ''}, - {name: 'name', expectedNull: 'null'} - ] - }, - { type: 'HTMLLabelElement', elementToUse: document.createElement('label'), attributes: [
diff --git a/third_party/WebKit/LayoutTests/fast/dom/setCustomValidity-null-undefined.html b/third_party/WebKit/LayoutTests/fast/dom/setCustomValidity-null-undefined.html index c5d8a292..7b53e2a 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/setCustomValidity-null-undefined.html +++ b/third_party/WebKit/LayoutTests/fast/dom/setCustomValidity-null-undefined.html
@@ -35,6 +35,5 @@ test2('output'); test2('fieldset'); test2('object'); -test2('keygen'); </script> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt index 7ac42240..d6c0008b 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This tests that layout tests can access shadow DOM.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow.html index aed236b..6851797f 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow.html +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow.html
@@ -4,7 +4,7 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<keygen id="keys" /> +<progress id="progress" max=100></progress> <p id="peas" /> <pre id="console"> This tests that layout tests can access shadow DOM. @@ -13,8 +13,8 @@ <script> if (window.internals) { // Make assertions about a built-in shadow - var keygen = document.getElementById('keys'); - var shadow = internals.shadowRoot(keygen); + var progress = document.getElementById('progress'); + var shadow = internals.shadowRoot(progress); shouldBe('shadow.nodeName', '"#document-fragment"'); // Shadow roots aren't elements, so accessing their shadow should throw.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children-expected.txt index f57033b9..1f49adb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -Children of an element are never rendered is it has a shadow DOM subtree. +Children of an element are never rendered if it has a shadow DOM subtree. Should not see the word FAIL below.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children.html index 8169bfb..3d885468 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children.html +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/no-renderers-for-light-children.html
@@ -7,14 +7,14 @@ window.addEventListener('load', function() { - document.getElementsByTagName('keygen')[0].appendChild(document.createTextNode('FAIL')); + document.getElementsByTagName('input')[0].appendChild(document.createTextNode('FAIL')); }, false); </script> </head> <body> -Children of an element are never rendered is it has a shadow DOM subtree.<br> +Children of an element are never rendered if it has a shadow DOM subtree.<br> Should not see the word FAIL below.<br> -<keygen></keygen> +<input type="datetime" /> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt index 9659ad6..55fc104 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt
@@ -1,7 +1,6 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This tests the shadow host's and shadow root's nodeType. -PASS keygen.nodeType is Node.ELEMENT_NODE +PASS progress.nodeType is Node.ELEMENT_NODE PASS shadow.nodeType is Node.DOCUMENT_FRAGMENT_NODE PASS shadowChild is non-null. PASS shadowChild.nodeType != Node.DOCUMENT_FRAGMENT_NODE is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype.html index 6b25aa5..1cf2a58 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype.html +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype.html
@@ -4,15 +4,15 @@ <script src="../../../resources/js-test.js"></script> </head> <body> -<keygen id="keys" /> +<progress id="progress" max="100"></progress> <pre id="console"> This tests the shadow host's and shadow root's nodeType. </pre> <script> -var keygen = document.getElementById('keys'); -var shadow = internals.shadowRoot(keygen); +var progress = document.getElementById('progress'); +var shadow = internals.shadowRoot(progress); var shadowChild = shadow.firstChild; -shouldBe('keygen.nodeType', 'Node.ELEMENT_NODE'); +shouldBe('progress.nodeType', 'Node.ELEMENT_NODE'); shouldBe('shadow.nodeType', 'Node.DOCUMENT_FRAGMENT_NODE'); shouldBeNonNull('shadowChild'); shouldBeTrue('shadowChild.nodeType != Node.DOCUMENT_FRAGMENT_NODE');
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt index b0a5a340..a1b45cf 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 50: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Tests to ensure that shadow element cannot be created in elements having dynamically created shadow root. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -42,8 +41,6 @@ PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts an user-agent shadow tree.. PROGRESS PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts an user-agent shadow tree.. -KEYGEN -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts an user-agent shadow tree.. VIDEO PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts an user-agent shadow tree.. AUDIO
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable.html index 4d0994a..f484abb 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable.html +++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable.html
@@ -47,7 +47,6 @@ document.createElement('canvas'), document.createElement('meter'), document.createElement('progress'), - document.createElement('keygen'), document.createElement('video'), document.createElement('audio'), document.createElement('fieldset'),
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt index c8e9981..7ec0c4c2 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 26: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This tests wrapper class names for JavaScript. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -394,10 +393,6 @@ FAIL tagPrototypeClassString('kbd') should be HTMLElementPrototype. Was HTMLElement. PASS tagConstructorClassString('kbd') is "Function" PASS tagConstructorName('kbd') is "HTMLElement" -PASS tagClassString('keygen') is "HTMLKeygenElement" -FAIL tagPrototypeClassString('keygen') should be HTMLKeygenElementPrototype. Was HTMLKeygenElement. -PASS tagConstructorClassString('keygen') is "Function" -PASS tagConstructorName('keygen') is "HTMLKeygenElement" PASS tagClassString('label') is "HTMLLabelElement" FAIL tagPrototypeClassString('label') should be HTMLLabelElementPrototype. Was HTMLLabelElement. PASS tagConstructorClassString('label') is "Function"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html index de6c6a5..a0320209 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html +++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html
@@ -202,7 +202,6 @@ testTag("input", "HTMLInputElement"); testTag("ins", "HTMLModElement"); testTag("kbd", "HTMLElement"); - testTag("keygen", "HTMLKeygenElement"); testTag("label", "HTMLLabelElement"); testTag("layer", "HTMLElement"); testTag("legend", "HTMLLegendElement");
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents-expected.txt index 25c5bb3..370d030 100644 --- a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 14: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. PASS: insertAdjacentHTML did not throw an exception when using the a tag. PASS: insertAdjacentHTML did not throw an exception when using the abbr tag. PASS: insertAdjacentHTML did not throw an exception when using the acronym tag.
diff --git a/third_party/WebKit/LayoutTests/fast/forms/access-key-for-all-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/access-key-for-all-elements-expected.txt index 9616ab6b..c945384 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/access-key-for-all-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/access-key-for-all-elements-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test checks to see if accesskey attributes works on all elements. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen-expected.txt deleted file mode 100644 index 39c880ec..0000000 --- a/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. - -This tests whether the keygen element supports the autofocus attribute. - -PASS document.activeElement is document.querySelector("keygen") -PASS document.activeElement.autofocus is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen.html b/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen.html deleted file mode 100644 index da0ffbd..0000000 --- a/third_party/WebKit/LayoutTests/fast/forms/autofocus-keygen.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/js-test.js"></script> -<script src="resources/common.js"></script> -<script> -window.jsTestIsAsync = true; - -waitUntilLoadedAndAutofocused(function() { - shouldBe('document.activeElement', 'document.querySelector("keygen")'); - shouldBe('document.activeElement.autofocus', 'true'); - finishJSTest(); -}); -</script> -</head> -<body> -<keygen autofocus> -<pre id="console"> -This tests whether the keygen element supports the autofocus attribute. - -</pre> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/checkValidity.html b/third_party/WebKit/LayoutTests/fast/forms/checkValidity.html index 2e9e89ee..ea57e58 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/checkValidity.html +++ b/third_party/WebKit/LayoutTests/fast/forms/checkValidity.html
@@ -33,10 +33,6 @@ }, 'checkValidity() for OBJECT should return true.'); test(() => { - assert_true(checkValidityFor('<keygen></keygen>')); -}, 'checkValidity() for KEYGEN should return true.'); - -test(() => { assert_true(checkValidityFor('<select required>' + ' <option>empty</option>' + ' <option>another</option>' +
diff --git a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements-expected.txt index 5bab7fd..1ac5f03 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements-expected.txt
@@ -1,10 +1,9 @@ -CONSOLE WARNING: line 14: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test the elements attibute of HTMLFieldSet element. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS owner.elements.length is 24 +PASS owner.elements.length is 23 PASS owner.elements[0].id is 'button1' PASS owner.elements[1].id is 'fieldset1' PASS owner.elements[2].id is 'inputhidden' @@ -24,27 +23,26 @@ PASS owner.elements[16].id is 'inputimage' PASS owner.elements[17].id is 'inputreset' PASS owner.elements[18].id is 'inputbutton' -PASS owner.elements[19].id is 'keygen1' -PASS owner.elements[20].id is 'object1' -PASS owner.elements[21].id is 'output1' -PASS owner.elements[22].id is 'select1' -PASS owner.elements[23].id is 'textarea1' +PASS owner.elements[19].id is 'object1' +PASS owner.elements[20].id is 'output1' +PASS owner.elements[21].id is 'select1' +PASS owner.elements[22].id is 'textarea1' Check elements array is updated after adding a new element -PASS owner.appendChild(newElement); owner.elements.length is 25 +PASS owner.appendChild(newElement); owner.elements.length is 24 Check elements array is updated after remove an element -PASS owner.removeChild(newElement); owner.elements.length is 24 +PASS owner.removeChild(newElement); owner.elements.length is 23 Check owner.elements is not updated by changing input type to image -PASS document.getElementById("inputfile").type="image"; owner.elements.length is 24 +PASS document.getElementById("inputfile").type="image"; owner.elements.length is 23 Check owner.elements is updated properly after removing from parent PASS form.appendChild(newElement); form.elements.length is 1 PASS form.removeChild(newElement); form.elements.length is 0 -PASS owner.elements.length is 24 -PASS owner.appendChild(newElement); owner.elements.length is 25 -PASS owner.removeChild(newElement); owner.elements.length is 24 +PASS owner.elements.length is 23 +PASS owner.appendChild(newElement); owner.elements.length is 24 +PASS owner.removeChild(newElement); owner.elements.length is 23 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements.html b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements.html index 1eb2f26..d5262b0 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements.html +++ b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-elements.html
@@ -31,7 +31,6 @@ '<input id=inputimage type=image>' + '<input id=inputreset type=reset>' + '<input id=inputbutton type=button>' + - '<keygen id=keygen1></keygen>' + '<label id=label1></label>' + '<meter id=meter1></meter>' + '<object id=object1></object>' + @@ -46,7 +45,7 @@ var owner = document.getElementById('fs'); -shouldBe('owner.elements.length', '24'); +shouldBe('owner.elements.length', '23'); shouldBe('owner.elements[0].id', "'button1'"); shouldBe('owner.elements[1].id', "'fieldset1'"); shouldBe('owner.elements[2].id', "'inputhidden'"); @@ -66,11 +65,10 @@ shouldBe('owner.elements[16].id', "'inputimage'"); shouldBe('owner.elements[17].id', "'inputreset'"); shouldBe('owner.elements[18].id', "'inputbutton'"); -shouldBe('owner.elements[19].id', "'keygen1'"); -shouldBe('owner.elements[20].id', "'object1'"); -shouldBe('owner.elements[21].id', "'output1'"); -shouldBe('owner.elements[22].id', "'select1'"); -shouldBe('owner.elements[23].id', "'textarea1'"); +shouldBe('owner.elements[19].id', "'object1'"); +shouldBe('owner.elements[20].id', "'output1'"); +shouldBe('owner.elements[21].id', "'select1'"); +shouldBe('owner.elements[22].id', "'textarea1'"); var newElement = document.createElement("input"); newElement.setAttribute("type", "text"); @@ -79,15 +77,15 @@ debug(""); debug("Check elements array is updated after adding a new element"); -shouldBe('owner.appendChild(newElement); owner.elements.length', '25'); +shouldBe('owner.appendChild(newElement); owner.elements.length', '24'); debug(""); debug("Check elements array is updated after remove an element"); -shouldBe('owner.removeChild(newElement); owner.elements.length', '24'); +shouldBe('owner.removeChild(newElement); owner.elements.length', '23'); debug(""); debug("Check owner.elements is not updated by changing input type to image"); -shouldBe('document.getElementById("inputfile").type="image"; owner.elements.length', '24'); +shouldBe('document.getElementById("inputfile").type="image"; owner.elements.length', '23'); debug(""); debug("Check owner.elements is updated properly after removing from parent"); @@ -95,9 +93,9 @@ var form = document.getElementById("formElement"); shouldBe('form.appendChild(newElement); form.elements.length', '1'); shouldBe('form.removeChild(newElement); form.elements.length', '0'); -shouldBe('owner.elements.length', '24'); -shouldBe('owner.appendChild(newElement); owner.elements.length', '25'); -shouldBe('owner.removeChild(newElement); owner.elements.length', '24'); +shouldBe('owner.elements.length', '23'); +shouldBe('owner.appendChild(newElement); owner.elements.length', '24'); +shouldBe('owner.removeChild(newElement); owner.elements.length', '23'); container.parentNode.removeChild(container); </script>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list-expected.txt index 1627827..03e782f 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list-expected.txt
@@ -1,11 +1,10 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test ensures fieldset.elements does NOT contain RadioNodeList. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS owner.elements.length is 24 +PASS owner.elements.length is 23 PASS notRadioNodeList instanceof RadioNodeList is false PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list.html b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list.html index 4bdac64e..ce2a0e1 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list.html +++ b/third_party/WebKit/LayoutTests/fast/forms/fieldset/fieldset-form-collection-radionode-list.html
@@ -25,7 +25,6 @@ <input id=inputcommon type=image> <input id=commoninput type=reset> <input id=inputcommon type=button value=buttonValue> - <keygen id=keygen1></keygen> <label id=label1></label> <meter id=meter1></meter> <object id=object1></object> @@ -45,7 +44,7 @@ debug(""); var owner = document.getElementById('fs'); -shouldBe('owner.elements.length', '24'); +shouldBe('owner.elements.length', '23'); var elementsList = owner.elements; var notRadioNodeList = elementsList.namedItem("inputcommon");
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-crash3-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-crash3-expected.txt index 2fd8964..f4c93040 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-crash3-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-crash3-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -This test passes if it doesn't crash. Note: You might need to reload this test many times (or run the test under valgrind / ASAN) to see a crash. +This test passes if it doesn't crash. Note: You might need to reload this test many times (or run the test under valgrind / ASAN) to see a crash.
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-expected.txt index 2d3f9cf..4bdc0ae 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Verify that only elements that are 'form associatable' get a form owner. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -17,8 +16,6 @@ PASS formOwner is "defined" Testing INPUT PASS formOwner is "defined" -Testing KEYGEN -PASS formOwner is "defined" Testing LABEL PASS formOwner is "not defined" Testing INPUT @@ -41,8 +38,6 @@ PASS formOwner is "not defined" Testing INPUT PASS formOwner is "defined" -Testing KEYGEN -PASS formOwner is "defined" Testing OBJECT PASS formOwner is "defined" Testing SELECT
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element.html b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element.html index 649e0c21..28afc67 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-associated-element.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-associated-element.html
@@ -24,7 +24,6 @@ <fieldset onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></fieldset> <input type=radio onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"/> <input type=number onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"/> -<keygen keytype=rsa onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></keygen> <label onerror="" onclick="hasFormOwner(false, typeof canary !== 'undefined' && canary, event);"><input type="button"/></label> <object onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></object> <select onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></select> @@ -40,7 +39,6 @@ <!-- Elements that associated by 'form' reference rather than ancestor. --> <input form=topForm type="number" onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"/> -<keygen form=topForm keytype=rsa onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></keygen> <object form=topForm onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></object> <select form=topForm onerror="hasFormOwner(true, typeof canary !== 'undefined' && canary, event);"></select> <pre form=topForm onerror="hasFormOwner(false, typeof canary !== 'undefined' && canary, event);"></pre>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-attribute-expected.txt index ad823f8..24974af 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-attribute-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-attribute-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test checks the form attribute of the form-associated elements. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -8,7 +7,6 @@ PASS document.getElementsByTagName("button")[0].form is owner PASS document.getElementsByTagName("fieldset")[0].form is owner PASS document.getElementsByTagName("input")[0].form is owner -PASS document.getElementsByTagName("keygen")[0].form is owner PASS document.getElementsByTagName("label")[0].form is null PASS document.getElementsByTagName("object")[0].form is owner PASS document.getElementsByTagName("output")[0].form is owner
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html b/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html index d9fb65a..7fd29b07 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-attribute.html
@@ -17,7 +17,6 @@ '<button name=victim form=owner />' + '<fieldset name=victim form=owner />' + '<input name=victim form=owner />' + - '<keygen name=victim form=owner />' + '<label name=victim form=owner></label>' + '<object name=victim form=owner></object>' + '<output name=victim form=owner />' + @@ -28,7 +27,6 @@ shouldBe('document.getElementsByTagName("button")[0].form', 'owner'); shouldBe('document.getElementsByTagName("fieldset")[0].form', 'owner'); shouldBe('document.getElementsByTagName("input")[0].form', 'owner'); -shouldBe('document.getElementsByTagName("keygen")[0].form', 'owner'); shouldBeNull('document.getElementsByTagName("label")[0].form'); shouldBe('document.getElementsByTagName("object")[0].form', 'owner'); shouldBe('document.getElementsByTagName("output")[0].form', 'owner');
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-expected.txt index 7b9b29f..32c2e71 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-expected.txt
@@ -1,11 +1,10 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test lists all the elements of a form per http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#category-listed. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". This test does not add object element as a listed element. Separate test will cover that. -PASS owner.elements.length is 23 +PASS owner.elements.length is 22 PASS owner.elements[0].id is 'button1' PASS owner.elements[1].id is 'fieldset1' PASS owner.elements[2].id is 'inputhidden' @@ -24,11 +23,10 @@ PASS owner.elements[15].id is 'inputsubmit' PASS owner.elements[16].id is 'inputreset' PASS owner.elements[17].id is 'inputbutton' -PASS owner.elements[18].id is 'keygen1' -PASS owner.elements[19].id is 'object1' -PASS owner.elements[20].id is 'output1' -PASS owner.elements[21].id is 'select1' -PASS owner.elements[22].id is 'textarea1' +PASS owner.elements[18].id is 'object1' +PASS owner.elements[19].id is 'output1' +PASS owner.elements[20].id is 'select1' +PASS owner.elements[21].id is 'textarea1' PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order-expected.txt index 4c86ced..9cb7eaa 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order-expected.txt
@@ -1,28 +1,27 @@ -CONSOLE WARNING: line 27: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test examines the order of form associated elements which are classified as 'listed'. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - Checks the order of form associated elements. -PASS checkOrder([button, fieldset, input, keygen, object, output, select, textarea]) is "OK" +PASS checkOrder([button, fieldset, input, object, output, select, textarea]) is "OK" - Checks the order after some elements removed/inserted. -PASS checkOrder([button, fieldset, input, keygen, output, select, textarea]) is "OK" -PASS checkOrder([fieldset, input, keygen, output, select, textarea]) is "OK" -PASS checkOrder([object, fieldset, input, keygen, output, select, textarea]) is "OK" -PASS checkOrder([object, fieldset, input, keygen, output, select, textarea, button]) is "OK" +PASS checkOrder([button, fieldset, input, output, select, textarea]) is "OK" +PASS checkOrder([fieldset, input, output, select, textarea]) is "OK" +PASS checkOrder([object, fieldset, input, output, select, textarea]) is "OK" +PASS checkOrder([object, fieldset, input, output, select, textarea, button]) is "OK" - Checks the order of form associated elements with form attribute. -PASS checkOrder([button, fieldset, input, keygen, object, output, select, textarea]) is "OK" +PASS checkOrder([button, fieldset, input, object, output, select, textarea]) is "OK" - Checks the order after some elements removed/inserted with form attribute. -PASS checkOrder([button, fieldset, input, keygen, output, select, textarea]) is "OK" -PASS checkOrder([fieldset, input, keygen, output, select, textarea]) is "OK" -PASS checkOrder([fieldset, input, keygen, output, select]) is "OK" -PASS checkOrder([fieldset, input, keygen, object, output, select]) is "OK" -PASS checkOrder([textarea, fieldset, input, keygen, object, output, select]) is "OK" -PASS checkOrder([textarea, fieldset, input, keygen, object, output, select, button]) is "OK" +PASS checkOrder([button, fieldset, input, output, select, textarea]) is "OK" +PASS checkOrder([fieldset, input, output, select, textarea]) is "OK" +PASS checkOrder([fieldset, input, output, select]) is "OK" +PASS checkOrder([fieldset, input, object, output, select]) is "OK" +PASS checkOrder([textarea, fieldset, input, object, output, select]) is "OK" +PASS checkOrder([textarea, fieldset, input, object, output, select, button]) is "OK" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order.html b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order.html index a9bab85..0830c37 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements-order.html
@@ -28,7 +28,6 @@ '<button name=victim></button>' + '<fieldset name=victim>Test</fieldset>' + '<input name=victim/>' + - '<keygen name=victim></keygen>' + '<label name=victim></label>' + '<meter name=victim></meter>' + '<object name=victim></object>' + @@ -41,7 +40,6 @@ var button = document.getElementsByTagName('button')[0]; var fieldset = document.getElementsByTagName('fieldset')[0]; var input = document.getElementsByTagName('input')[0]; -var keygen = document.getElementsByTagName('keygen')[0]; var label = document.getElementsByTagName('label')[0]; var meter = document.getElementsByTagName('meter')[0]; var object = document.getElementsByTagName('object')[0]; @@ -49,25 +47,24 @@ var progress = document.getElementsByTagName('progress')[0]; var select = document.getElementsByTagName('select')[0]; var textarea = document.getElementsByTagName('textarea')[0]; -shouldBe('checkOrder([button, fieldset, input, keygen, object, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([button, fieldset, input, object, output, select, textarea])', '"OK"'); debug(''); debug('- Checks the order after some elements removed/inserted.'); owner.removeChild(object); -shouldBe('checkOrder([button, fieldset, input, keygen, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([button, fieldset, input, output, select, textarea])', '"OK"'); owner.removeChild(button); -shouldBe('checkOrder([fieldset, input, keygen, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([fieldset, input, output, select, textarea])', '"OK"'); owner.insertBefore(object, fieldset); -shouldBe('checkOrder([object, fieldset, input, keygen, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([object, fieldset, input, output, select, textarea])', '"OK"'); owner.appendChild(button); -shouldBe('checkOrder([object, fieldset, input, keygen, output, select, textarea, button])', '"OK"'); +shouldBe('checkOrder([object, fieldset, input, output, select, textarea, button])', '"OK"'); debug(''); debug('- Checks the order of form associated elements with form attribute.'); container.innerHTML = '<button name=victim form=owner></button>' + '<fieldset name=victim form=owner>Test</fieldset>' + '<input name=victim form=owner />' + - '<keygen name=victim form=owner></keygen>' + '<form id=owner>' + '<label name=victim></label>' + '<meter name=victim></meter>' + @@ -81,7 +78,6 @@ button = document.getElementsByTagName('button')[0]; fieldset = document.getElementsByTagName('fieldset')[0]; input = document.getElementsByTagName('input')[0]; -keygen = document.getElementsByTagName('keygen')[0]; label = document.getElementsByTagName('label')[0]; meter = document.getElementsByTagName('meter')[0]; object = document.getElementsByTagName('object')[0]; @@ -89,22 +85,22 @@ progress = document.getElementsByTagName('progress')[0]; select = document.getElementsByTagName('select')[0]; textarea = document.getElementsByTagName('textarea')[0]; -shouldBe('checkOrder([button, fieldset, input, keygen, object, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([button, fieldset, input, object, output, select, textarea])', '"OK"'); debug(''); debug('- Checks the order after some elements removed/inserted with form attribute.'); owner.removeChild(object); -shouldBe('checkOrder([button, fieldset, input, keygen, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([button, fieldset, input, output, select, textarea])', '"OK"'); container.removeChild(button); -shouldBe('checkOrder([fieldset, input, keygen, output, select, textarea])', '"OK"'); +shouldBe('checkOrder([fieldset, input, output, select, textarea])', '"OK"'); container.removeChild(textarea); -shouldBe('checkOrder([fieldset, input, keygen, output, select])', '"OK"'); +shouldBe('checkOrder([fieldset, input, output, select])', '"OK"'); owner.appendChild(object); -shouldBe('checkOrder([fieldset, input, keygen, object, output, select])', '"OK"'); +shouldBe('checkOrder([fieldset, input, object, output, select])', '"OK"'); container.insertBefore(textarea, fieldset); -shouldBe('checkOrder([textarea, fieldset, input, keygen, object, output, select])', '"OK"'); +shouldBe('checkOrder([textarea, fieldset, input, object, output, select])', '"OK"'); container.appendChild(button); -shouldBe('checkOrder([textarea, fieldset, input, keygen, object, output, select, button])', '"OK"'); +shouldBe('checkOrder([textarea, fieldset, input, object, output, select, button])', '"OK"'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements.html b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements.html index 65c34cd4..2edaa97f 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-elements.html
@@ -33,7 +33,6 @@ '<input id=inputimage type=image>' + '<input id=inputreset type=reset>' + '<input id=inputbutton type=button>' + - '<keygen id=keygen1></keygen>' + '<label id=label1></label>' + '<meter id=meter1></meter>' + '<object id=object1></object>' + @@ -48,7 +47,7 @@ var owner = document.getElementById('form1'); -shouldBe('owner.elements.length', '23'); +shouldBe('owner.elements.length', '22'); shouldBe('owner.elements[0].id', "'button1'"); shouldBe('owner.elements[1].id', "'fieldset1'"); shouldBe('owner.elements[2].id', "'inputhidden'"); @@ -67,11 +66,10 @@ shouldBe('owner.elements[15].id', "'inputsubmit'"); shouldBe('owner.elements[16].id', "'inputreset'"); shouldBe('owner.elements[17].id', "'inputbutton'"); -shouldBe('owner.elements[18].id', "'keygen1'"); -shouldBe('owner.elements[19].id', "'object1'"); -shouldBe('owner.elements[20].id', "'output1'"); -shouldBe('owner.elements[21].id', "'select1'"); -shouldBe('owner.elements[22].id', "'textarea1'"); +shouldBe('owner.elements[18].id', "'object1'"); +shouldBe('owner.elements[19].id', "'output1'"); +shouldBe('owner.elements[20].id', "'select1'"); +shouldBe('owner.elements[21].id', "'textarea1'"); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list-expected.txt index 56a8b47..c14ac4b 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. CONSOLE WARNING: line 1: The specified value "inputRadioValue" does not conform to the required format, "yyyy-MM-dd". This test is for RadioNodeList specified at http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#radionodelist @@ -6,7 +5,7 @@ -PASS owner.elements.length is 23 +PASS owner.elements.length is 22 PASS radioNodeList.length is 4 PASS radioNodeList[0].value is 'searching' PASS radioNodeList[1].value is '123' @@ -34,7 +33,7 @@ Check RadioNodeList is updated after adding a new element PASS container.appendChild(nonSubtreeElement); radioNodeList.length is 5 -PASS owner.elements.length is 24 +PASS owner.elements.length is 23 PASS radioNodeList[4].value is 'non subtree element' Check RadioNodeList is updated after change in id, type and checked state of an element
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list.html b/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list.html index 39b2a998e..b62b470 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-collection-radio-node-list.html
@@ -24,7 +24,6 @@ <input id=inputcommon type=image> <input id=commoninput type=reset> <input id=inputcommon type=button value=buttonValue> - <keygen id=keygen1></keygen> <label id=label1></label> <meter id=meter1></meter> <object id=object1></object> @@ -43,7 +42,7 @@ debug(""); var owner = document.getElementById('form1'); -shouldBe('owner.elements.length', '23'); +shouldBe('owner.elements.length', '22'); var elementsList = owner.elements; var radioNodeList = elementsList.namedItem("inputcommon"); @@ -96,7 +95,7 @@ debug(""); debug("Check RadioNodeList is updated after adding a new element"); shouldBe('container.appendChild(nonSubtreeElement); radioNodeList.length', '5'); -shouldBe('owner.elements.length', '24'); +shouldBe('owner.elements.length', '23'); shouldBe('radioNodeList[4].value', "'non subtree element'"); debug("");
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list-expected.txt index 960ec29..5b2a5068 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test RadioNodeLists returned by the HTMLFormElement named-getter. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list.html b/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list.html index 616aff84..4272cc8f 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-radio-img-node-list.html
@@ -4,7 +4,6 @@ <img name=outside1></img> <form id="f1"> <button id=n1></button> - <keygen id=n1></keygen> <output id=n1></output> <object name=n1></object> <select name=n1><option id=n1></option></select>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list-expected.txt index b30038c..f30537c 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list-expected.txt
@@ -1,12 +1,11 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test RadioNodeLists returned by the HTMLFormElement named-getter. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS form1.elements.length is 10 +PASS form1.elements.length is 9 Check that only 'listed elements' are included in the list, if any. -PASS radioNodeList.length is 10 +PASS radioNodeList.length is 9 PASS radioNodeList[0] instanceof HTMLButtonElement is true PASS radioNodeList[1] instanceof HTMLFieldSetElement is true PASS radioNodeList[2] instanceof HTMLInputElement is true @@ -15,14 +14,13 @@ PASS radioNodeList[3].type is "text" PASS radioNodeList[4] instanceof HTMLInputElement is true PASS radioNodeList[4].type is "radio" -PASS radioNodeList[5] instanceof HTMLKeygenElement is true -PASS radioNodeList[6] instanceof HTMLOutputElement is true -PASS radioNodeList[7] instanceof HTMLObjectElement is true -PASS radioNodeList[8] instanceof HTMLSelectElement is true -PASS radioNodeList[9] instanceof HTMLTextAreaElement is true +PASS radioNodeList[5] instanceof HTMLOutputElement is true +PASS radioNodeList[6] instanceof HTMLObjectElement is true +PASS radioNodeList[7] instanceof HTMLSelectElement is true +PASS radioNodeList[8] instanceof HTMLTextAreaElement is true PASS successfullyParsed is true TEST COMPLETE - +
diff --git a/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list.html b/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list.html index 192b816e..f028267 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list.html +++ b/third_party/WebKit/LayoutTests/fast/forms/form-radio-node-list.html
@@ -7,7 +7,6 @@ <input name=n1 type=image> <input name=n1 type=text> <input name=n1 type=radio> - <keygen id=n1></keygen> <output id=n1></output> <object name=n1></object> <select name=n1><option id=n1></option></select> @@ -19,11 +18,11 @@ description("Test RadioNodeLists returned by the HTMLFormElement named-getter."); var form1 = document.getElementById("f1"); -shouldBe("form1.elements.length", "10"); +shouldBe("form1.elements.length", "9"); debug("Check that only 'listed elements' are included in the list, if any."); var radioNodeList = form1["n1"]; -shouldBe("radioNodeList.length", "10"); +shouldBe("radioNodeList.length", "9"); shouldBeTrue("radioNodeList[0] instanceof HTMLButtonElement"); shouldBeTrue("radioNodeList[1] instanceof HTMLFieldSetElement"); @@ -33,10 +32,9 @@ shouldBeEqualToString("radioNodeList[3].type", "text"); shouldBeTrue("radioNodeList[4] instanceof HTMLInputElement"); shouldBeEqualToString("radioNodeList[4].type", "radio"); -shouldBeTrue("radioNodeList[5] instanceof HTMLKeygenElement"); -shouldBeTrue("radioNodeList[6] instanceof HTMLOutputElement"); -shouldBeTrue("radioNodeList[7] instanceof HTMLObjectElement"); -shouldBeTrue("radioNodeList[8] instanceof HTMLSelectElement"); -shouldBeTrue("radioNodeList[9] instanceof HTMLTextAreaElement"); +shouldBeTrue("radioNodeList[5] instanceof HTMLOutputElement"); +shouldBeTrue("radioNodeList[6] instanceof HTMLObjectElement"); +shouldBeTrue("radioNodeList[7] instanceof HTMLSelectElement"); +shouldBeTrue("radioNodeList[8] instanceof HTMLTextAreaElement"); </script>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content-expected.txt index 20feb9b..34932ec 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 22: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. button PASS document.activeElement.id is not "control" details @@ -7,8 +6,6 @@ PASS document.activeElement.id is not "control" iframe PASS document.activeElement.id is not "control" -keygen -PASS document.activeElement.id is not "control" label PASS document.activeElement.id is not "control" select
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content.html b/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content.html index 55d2fb4..5e33245 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content.html +++ b/third_party/WebKit/LayoutTests/fast/forms/label/label-contains-other-interactive-content.html
@@ -3,7 +3,7 @@ <script src="../../../resources/js-test.js"></script> <script src="../resources/common.js"></script> <script> -var interactiveElements1 = ['button', 'details', 'embed', 'iframe', 'keygen', 'label', 'select', 'textarea']; +var interactiveElements1 = ['button', 'details', 'embed', 'iframe', 'label', 'select', 'textarea']; var interactiveElements2 = [ ['a', 'href'], ['audio', 'controls'],
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labelable-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labelable-elements-expected.txt index dde24003..2c068488 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labelable-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labelable-elements-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test labelable elements have labels attribute and others do not. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -19,9 +18,6 @@ Labelable: input [object HTMLInputElement] PASS element.labels.length is 1 -Labelable: keygen [object HTMLKeygenElement] -PASS element.labels.length is 1 - Not labelable: label [object HTMLLabelElement] PASS element.labels is undefined. PASS element.labels is not null
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-htmlFor-label-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-htmlFor-label-expected.txt index 0ed3185f..e546a08 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-htmlFor-label-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-htmlFor-label-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when adding a label whose htmlFor points to that control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 0 PASS element.labels.length is 1 -Check keygen -PASS element.labels.length is 0 -PASS element.labels.length is 1 Check meter PASS element.labels.length is 0 PASS element.labels.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-parent-label-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-parent-label-expected.txt index 00f1980..e56f8e9 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-parent-label-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-add-parent-label-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when adding a label as parent for that form control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 0 PASS element.labels.length is 1 -Check keygen -PASS element.labels.length is 0 -PASS element.labels.length is 1 Check meter PASS element.labels.length is 0 PASS element.labels.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-change-htmlFor-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-change-htmlFor-attribute-expected.txt index f680a1b0..deaaceb34 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-change-htmlFor-attribute-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-change-htmlFor-attribute-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when the htmlFor attribute of a label changes to point to that control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 0 PASS element.labels.length is 1 -Check keygen -PASS element.labels.length is 0 -PASS element.labels.length is 1 Check meter PASS element.labels.length is 0 PASS element.labels.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-multiple-sibling-labels-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-multiple-sibling-labels-expected.txt index 42fc584..91063844 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-multiple-sibling-labels-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-multiple-sibling-labels-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control contains multiple sibling labels. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -8,8 +7,6 @@ PASS element.labels.length is 2 Check input PASS element.labels.length is 2 -Check keygen -PASS element.labels.length is 2 Check meter PASS element.labels.length is 2 Check output
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-parent-and-sibling-labels-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-parent-and-sibling-labels-expected.txt index d1d9d91..7927600 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-parent-and-sibling-labels-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-parent-and-sibling-labels-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control contains both parent label and sibling label. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -8,8 +7,6 @@ PASS element.labels.length is 2 Check input PASS element.labels.length is 2 -Check keygen -PASS element.labels.length is 2 Check meter PASS element.labels.length is 2 Check output
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt index ba0542f..928db5d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when the htmlFor attribute of a label is removed. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 1 PASS element.labels.length is 0 -Check keygen -PASS element.labels.length is 1 -PASS element.labels.length is 0 Check meter PASS element.labels.length is 1 PASS element.labels.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-label-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-label-expected.txt index 69af53e..208e2152 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-label-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-htmlFor-label-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when removing the htmlFor attribute that pointed to that form control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 1 PASS element.labels.length is 0 -Check keygen -PASS element.labels.length is 1 -PASS element.labels.length is 0 Check meter PASS element.labels.length is 1 PASS element.labels.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-parent-label-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-parent-label-expected.txt index f17d896..c061886 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-parent-label-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-remove-parent-label-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when removing a label as parent for that form control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 1 PASS element.labels.length is 0 -Check keygen -PASS element.labels.length is 1 -PASS element.labels.length is 0 Check meter PASS element.labels.length is 1 PASS element.labels.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/forms/label/labels-set-htmlFor-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/label/labels-set-htmlFor-attribute-expected.txt index f680a1b0..deaaceb34 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/label/labels-set-htmlFor-attribute-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/label/labels-set-htmlFor-attribute-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 28: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test that the labels list of a form control is dynamically updated when the htmlFor attribute of a label changes to point to that control. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -10,9 +9,6 @@ Check input PASS element.labels.length is 0 PASS element.labels.length is 1 -Check keygen -PASS element.labels.length is 0 -PASS element.labels.length is 1 Check meter PASS element.labels.length is 0 PASS element.labels.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/forms/large-parts-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/large-parts-expected.txt index 4efc6aab..7b4c69c 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/large-parts-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/large-parts-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test for Bug 41737. PASS unless crash.
diff --git a/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid-expected.txt index f18e0d8..13c4566 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid-expected.txt
@@ -1,10 +1,9 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test checks if reportValidity() returns correctly a true (meaning no error) result. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - lorem ipsum + lorem ipsum Elements valid from the begining PASS document.getElementsByTagName("fieldset")[0].reportValidity() is true @@ -14,7 +13,6 @@ PASS document.getElementsByTagName("textarea")[0].reportValidity() is true PASS document.getElementsByTagName("output")[0].reportValidity() is true PASS document.getElementsByTagName("object")[0].reportValidity() is true -PASS document.getElementsByTagName("keygen")[0].reportValidity() is true PASS document.getElementById("happy_form")[0].reportValidity() is true Element valid when changed
diff --git a/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid.html b/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid.html index 98a9525..b302db88 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid.html +++ b/third_party/WebKit/LayoutTests/fast/forms/reportValidity-valid.html
@@ -13,7 +13,6 @@ <textarea name="victim"></textarea> <output name="victim"></output> <object name="victim"></object> -<keygen name="victim"></keygen> </form> <form action="" id="soon_to_be_happy_form"> <select required="" id="soon_to_be_happy_select"> @@ -32,7 +31,6 @@ shouldBe('document.getElementsByTagName("textarea")[0].reportValidity()', 'true'); shouldBe('document.getElementsByTagName("output")[0].reportValidity()', 'true'); shouldBe('document.getElementsByTagName("object")[0].reportValidity()', 'true'); -shouldBe('document.getElementsByTagName("keygen")[0].reportValidity()', 'true'); shouldBe('document.getElementById("happy_form")[0].reportValidity()', 'true'); debug('');
diff --git a/third_party/WebKit/LayoutTests/fast/forms/resources/common.js b/third_party/WebKit/LayoutTests/fast/forms/resources/common.js index c9e1493..848bbb1 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/resources/common.js +++ b/third_party/WebKit/LayoutTests/fast/forms/resources/common.js
@@ -9,7 +9,6 @@ 'HTMLDataListElement', 'HTMLFieldSetElement', 'HTMLInputElement', - 'HTMLKeygenElement', 'HTMLLabelElement', 'HTMLLegendElement', 'HTMLMeterElement',
diff --git a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments-expected.txt index 935883b4..a01ca5c 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 17: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test how setCustomValidity reacts to too few arguments. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -7,7 +6,6 @@ PASS b.setCustomValidity() threw exception TypeError: Failed to execute 'setCustomValidity' on 'HTMLButtonElement': 1 argument required, but only 0 present.. PASS fs.setCustomValidity() threw exception TypeError: Failed to execute 'setCustomValidity' on 'HTMLFieldSetElement': 1 argument required, but only 0 present.. PASS i.setCustomValidity() threw exception TypeError: Failed to execute 'setCustomValidity' on 'HTMLInputElement': 1 argument required, but only 0 present.. -PASS k.setCustomValidity() threw exception TypeError: Failed to execute 'setCustomValidity' on 'HTMLKeygenElement': 1 argument required, but only 0 present.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments.html b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments.html index dcba5dc..60160bb 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments.html +++ b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-arguments.html
@@ -14,9 +14,6 @@ shouldThrow("fs.setCustomValidity()"); var i = document.createElement('input'); shouldThrow("i.setCustomValidity()"); -var k = document.createElement('keygen'); -shouldThrow("k.setCustomValidity()"); -successfullyParsed = true; </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt index bbd3ebc..fb1d6a2 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Existence tests for .setCustomValidity property On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -12,7 +11,6 @@ PASS typeof document.getElementsByTagName("textarea")[0].setCustomValidity is "function" PASS typeof document.getElementsByTagName("output")[0].setCustomValidity is "function" PASS typeof document.getElementsByTagName("object")[0].setCustomValidity is "function" -PASS typeof document.getElementsByTagName("keygen")[0].setCustomValidity is "function" PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence.html b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence.html index 89498c8..5cb182b 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence.html +++ b/third_party/WebKit/LayoutTests/fast/forms/setCustomValidity-existence.html
@@ -21,7 +21,6 @@ + '<select name="victim"></select>' + '<output name="victim"></output>' + '<object name="victim"></object>' - + '<keygen name="victim">' + '</form>'; shouldBe('typeof document.getElementsByTagName("input")[0].setCustomValidity', '"function"'); @@ -31,7 +30,6 @@ shouldBe('typeof document.getElementsByTagName("textarea")[0].setCustomValidity', '"function"'); shouldBe('typeof document.getElementsByTagName("output")[0].setCustomValidity', '"function"'); shouldBe('typeof document.getElementsByTagName("object")[0].setCustomValidity', '"function"'); -shouldBe('typeof document.getElementsByTagName("keygen")[0].setCustomValidity', '"function"'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt index 5cb67d5a..79efc2a3 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless-expected.txt
@@ -1,5 +1,4 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -CONSOLE MESSAGE: line 44: Test if state of stateless form control types are not saved. +CONSOLE MESSAGE: line 43: Test if state of stateless form control types are not saved. PASS There is a state for hidden PASS There is a state for text PASS There is a state for tel @@ -18,7 +17,6 @@ PASS There is no state for submit PASS There is no state for reset PASS There is no state for button -PASS There is no state for keygen PASS There is no state for output PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html index 22f8993..5071345 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html +++ b/third_party/WebKit/LayoutTests/fast/forms/state-restore-skip-stateless.html
@@ -37,7 +37,6 @@ <select name=name26 ></select> <select name=name27 multiple></select> <textarea name=name28></textarea> -<keygen name=name29> <output name=name30></output> </div> <script> @@ -47,7 +46,7 @@ if (window.internals) { var statefulTypes = ['hidden', 'text', 'tel', 'url', 'email', 'number', 'range', 'checkbox', 'radio', 'file', 'select-one', 'select-multiple', 'textarea']; - var statelessTypes = ['fieldset', 'password', 'submit', 'reset', 'button', 'keygen', 'output']; + var statelessTypes = ['fieldset', 'password', 'submit', 'reset', 'button', 'output']; var states = internals.formControlStateOfHistoryItem(); for (var i = 0; i < statefulTypes.length; ++i) {
diff --git a/third_party/WebKit/LayoutTests/fast/forms/validationMessage-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/validationMessage-expected.txt index 17077b0..0f42546 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/validationMessage-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/validationMessage-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 198: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test for validationMessage DOM property. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -44,7 +43,6 @@ PASS happySelect.validationMessage is '' PASS happyOutput.validationMessage is '' PASS happyObject.validationMessage is '' -PASS happyKeygen.validationMessage is '' PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/validationMessage.html b/third_party/WebKit/LayoutTests/fast/forms/validationMessage.html index de620c4..b944118d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/validationMessage.html +++ b/third_party/WebKit/LayoutTests/fast/forms/validationMessage.html
@@ -194,12 +194,6 @@ form.appendChild(happyObject); shouldBe("happyObject.validationMessage", "''"); -// Keygen controls can't be validated -var happyKeygen = document.createElement("keygen"); -happySelect.name = "keygen"; -form.appendChild(happyKeygen); -shouldBe("happyKeygen.validationMessage", "''"); - form.remove(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/validity-property-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/validity-property-expected.txt index ba12433d..3703bef8 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/validity-property-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/validity-property-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Each form control in this document exposes a validity attribute that returns a live instance of ValidityState. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -39,13 +38,8 @@ PASS validity1 = controls[i].validity; validity1 instanceof ValidityState is true PASS validity2 = controls[i].validity; validity1 === validity2 is true PASS countAttr(controls[i].validity) is 11 -===> Tests for KEYGEN -PASS "validity" in controls[i] is true -PASS validity1 = controls[i].validity; validity1 instanceof ValidityState is true -PASS validity2 = controls[i].validity; validity1 === validity2 is true -PASS countAttr(controls[i].validity) is 11 PASS new ValidityState() threw exception TypeError: Illegal constructor. PASS successfullyParsed is true TEST COMPLETE - +
diff --git a/third_party/WebKit/LayoutTests/fast/forms/validity-property.html b/third_party/WebKit/LayoutTests/fast/forms/validity-property.html index 9722c69..ac72dfb 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/validity-property.html +++ b/third_party/WebKit/LayoutTests/fast/forms/validity-property.html
@@ -11,7 +11,6 @@ <button name="victim"></button> <output name="victim"></output> <object name="victim"></object> -<keygen name="victim"></keygen> </fieldset> <script>
diff --git a/third_party/WebKit/LayoutTests/fast/forms/willvalidate-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/willvalidate-expected.txt index d5a2d5e..dc3f25d 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/willvalidate-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/willvalidate-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 16: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Various tests for .willValidate property On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -12,7 +11,6 @@ PASS typeof controls[i].willValidate is "boolean" PASS typeof controls[i].willValidate is "boolean" PASS typeof controls[i].willValidate is "boolean" -PASS typeof controls[i].willValidate is "boolean" Form association PASS input.willValidate is true @@ -46,9 +44,6 @@ Object element PASS document.getElementsByTagName("object")[0].willValidate is false - -Keygen element -PASS document.getElementsByTagName("keygen")[0].willValidate is false PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/forms/willvalidate.html b/third_party/WebKit/LayoutTests/fast/forms/willvalidate.html index 6430560..a4328fee 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/willvalidate.html +++ b/third_party/WebKit/LayoutTests/fast/forms/willvalidate.html
@@ -21,7 +21,6 @@ + '<select name="victim"></select>' + '<output name="victim"></output>' + '<object name="victim"></object>' - + '<keygen name="victim">' + '</form>'; var controls = document.getElementsByName('victim'); for (var i = 0; i < controls.length; i++) @@ -87,10 +86,6 @@ parent.innerHTML = '<form><object></object></form>'; shouldBeFalse('document.getElementsByTagName("object")[0].willValidate'); -debug(''); -debug('Keygen element'); -parent.innerHTML = '<form><keygen></form>'; -shouldBeFalse('document.getElementsByTagName("keygen")[0].willValidate'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/clone-keygen-expected.txt b/third_party/WebKit/LayoutTests/fast/html/clone-keygen-expected.txt deleted file mode 100644 index 4a0fe71..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/clone-keygen-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -Tests that a cloned keygen has the right shadow pseudo ID. You should see two big keygens with purple text (they should look the same.) - - -PASS specialK.clientHeight is k.clientHeight -PASS internals.shadowPseudoId(cloneShadow.firstChild) is internals.shadowPseudoId(kShadow.firstChild) -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/fast/html/clone-keygen.html b/third_party/WebKit/LayoutTests/fast/html/clone-keygen.html deleted file mode 100644 index ca0396d..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/clone-keygen.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/js-test.js"></script> -<style type="text/css"> -*::-webkit-keygen-select { - color: purple; - zoom: 1.5; /* to work around bug 57966 */ -} -</style> -</head> -<body> -<p> -Tests that a cloned keygen has the right shadow pseudo ID. You should -see two big keygens with purple text (they should look the same.) -</p> -<keygen id="k" style="display: block;"> -<div id="console"></div> -<script> -var k = document.querySelector('#k'); -var specialK = k.cloneNode(); - -k.insertAdjacentElement('afterEnd', specialK); - -shouldBe('specialK.clientHeight', 'k.clientHeight'); - -if (window.internals) { - var kShadow = internals.shadowRoot(k); - var cloneShadow = internals.shadowRoot(specialK); - shouldBe('internals.shadowPseudoId(cloneShadow.firstChild)', - 'internals.shadowPseudoId(kShadow.firstChild)'); -} -</script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/html/keygen.html b/third_party/WebKit/LayoutTests/fast/html/keygen.html deleted file mode 100644 index 5520b8be..0000000 --- a/third_party/WebKit/LayoutTests/fast/html/keygen.html +++ /dev/null
@@ -1,5 +0,0 @@ -<html> -<!--<rdar://problem/5041660> REGRESSION: <keygen> element broken, prevents users from signing up for thawte email certs --> -<keygen id="keygen" name="spkac" challange="9uXv8BxtVEKAed34"> -</html> -
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash-expected.txt deleted file mode 100644 index 66a82f57..0000000 --- a/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 22: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -Test passes if it does not crash. - -
diff --git a/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash.html b/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash.html deleted file mode 100644 index a163909..0000000 --- a/third_party/WebKit/LayoutTests/fast/multicol/span/positioned-child-not-removed-crash.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -Test passes if it does not crash. -<style> -.caption1 { -webkit-column-width: 1px; } -.div1 { position: absolute; } -.keygen1:nth-last-child(even) { display: block; -webkit-column-span: all; } -.flexbox1 { display: -webkit-flexbox; padding-right: 10px; transform: rotate3d(0, 1, 0, 90deg); } -</style> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -function runTest() { - caption1 = document.createElement('caption'); - caption1.setAttribute('class', 'caption1'); - div1 = document.createElement('div'); - div1.setAttribute('class', 'div1'); - flexbox1 = document.createElement('div'); - flexbox1.setAttribute('class', 'flexbox1'); - keygen1 = document.createElement('keygen'); - keygen1.setAttribute('class', 'keygen1'); - - div2 = document.createElement('div'); - div3 = document.createElement('div'); - - flexbox1.appendChild(keygen1); - flexbox1.appendChild(div1); - flexbox1.appendChild(div3); - caption1.appendChild(flexbox1); - document.body.appendChild(caption1); - document.body.offsetTop; - flexbox1.appendChild(div2); - document.body.offsetTop; - flexbox1.removeChild(div1); -} -window.onload = runTest; -</script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash-expected.txt deleted file mode 100644 index 6e405e4d..0000000 --- a/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -PASS if no crash or assert.
diff --git a/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash.html b/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash.html deleted file mode 100644 index 1468693..0000000 --- a/third_party/WebKit/LayoutTests/fast/replaced/keygen-as-table-column-group-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script> - if (window.testRunner) - testRunner.dumpAsText(); -</script> -<div style="display:table;"> - <keygen style="display:table-column-group;"></keygen> - PASS if no crash or assert. -</div>
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/float-object-doesnt-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/float-object-doesnt-crash-expected.txt index 2bcc288..8d1b6a4 100644 --- a/third_party/WebKit/LayoutTests/fast/ruby/float-object-doesnt-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/ruby/float-object-doesnt-crash-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Test passes if it does not crash when run with memory checking for use-after-free. | >
diff --git a/third_party/WebKit/LayoutTests/fast/table/crash-splitColumn-2-expected.txt b/third_party/WebKit/LayoutTests/fast/table/crash-splitColumn-2-expected.txt index 2947528..a03f428 100644 --- a/third_party/WebKit/LayoutTests/fast/table/crash-splitColumn-2-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/table/crash-splitColumn-2-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 26: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. Bug 70171: Crash in LayoutTableSection::splitColumn This test PASSES if it does not CRASH or ASSERT.
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-data-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-data-expected.txt index 6fee9d3b..7017306 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-data-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-data-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests19.dat: 8 9
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-write-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-write-expected.txt index 9c2680f..7017306 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-write-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests19-write-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 165: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests19.dat: 8 9
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-data-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-data-expected.txt index 4218f00..e08f1f6 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-data-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-data-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests25.dat: PASS
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-write-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-write-expected.txt index 2651115..e08f1f6 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-write-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests25-write-expected.txt
@@ -1,2 +1 @@ -CONSOLE WARNING: line 165: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests25.dat: PASS
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-data-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-data-expected.txt index 85c25f56..a34b5b0 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-data-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-data-expected.txt
@@ -1,3 +1,2 @@ CONSOLE ERROR: line 1: Uncaught SyntaxError: Unexpected token < -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests7.dat: PASS
diff --git a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-write-expected.txt b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-write-expected.txt index dad9584..a34b5b0 100644 --- a/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-write-expected.txt +++ b/third_party/WebKit/LayoutTests/html5lib/generated/run-tests7-write-expected.txt
@@ -1,3 +1,2 @@ CONSOLE ERROR: line 1: Uncaught SyntaxError: Unexpected token < -CONSOLE WARNING: line 165: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. ../resources/tests7.dat: PASS
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/resources/check-keygen-post.php b/third_party/WebKit/LayoutTests/http/tests/misc/resources/check-keygen-post.php deleted file mode 100644 index e185a96..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/misc/resources/check-keygen-post.php +++ /dev/null
@@ -1,38 +0,0 @@ -<?php -header("Content-Type: text/html; charset=UTF-8"); -?> -<html> -<head> -<script> - -function runTest() -{ - var r = document.getElementById('result'); - var o = document.getElementById('output').firstChild; - if (o.nodeValue == 'spkac exists') - r.innerHTML = "SUCCESS: keygen was parsed correctly"; - else - r.innerHTML = "FAILURE: keygen was not parsed correctly. value=" + - o.nodeValue; - - if (window.testRunner) - testRunner.notifyDone(); -} - -</script> -</head> -<body onload="runTest()"> -<p> -This is a regression test for keygen tag POST processing: https://bugs.webkit.org/show_bug.cgi?id=70617. -</p> -<div style='display: none;' id='output'><?php -if (array_key_exists('spkac', $_REQUEST)) { - echo "spkac exists"; -} else { - echo "spkac does not exist"; -} -?> -</div> -<div id="result"></div> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt b/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt deleted file mode 100644 index 2223fd1c..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. -This is a regression test for keygen tag POST processing: https://bugs.webkit.org/show_bug.cgi?id=70617. - -SUCCESS: keygen was parsed correctly
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen.html b/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen.html deleted file mode 100644 index 6785257c..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/misc/submit-post-keygen.html +++ /dev/null
@@ -1,19 +0,0 @@ -<html> -<head> -<script> -if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpAsText(); -} -function clickf() -{ - document.f.submit(); -} -</script> -</head> -<body onload="clickf()"> -<form name="f" action="resources/check-keygen-post.php" method="post"> -<keygen name="spkac" keytype="RSA" /> -</form> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt index 3fe90b6..3e02050 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects-exceptions-expected.txt
@@ -10,7 +10,7 @@ FAIL [[Delete]] Should throw on cross-origin objects assert_throws: Can't delete cross-origin indexed property function "function () { delete C[0]; }" did not throw FAIL [[DefineOwnProperty]] Should throw for cross-origin objects assert_throws: Can't define cross-origin value property length function "function () { Object.defineProperty(obj, prop, valueDesc); }" did not throw FAIL [[Enumerate]] should return an empty iterator assert_unreached: Shouldn't have been able to enumerate stop on cross-origin Window Reached unreachable code -FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Window lengths differ, expected 871 got 13 +FAIL [[OwnPropertyKeys]] should return all properties from cross-origin objects assert_array_equals: Object.getOwnPropertyNames() gives the right answer for cross-origin Window lengths differ, expected 870 got 13 PASS A and B jointly observe the same identity for cross-origin Window and Location PASS Cross-origin functions get local Function.prototype FAIL Cross-origin Window accessors get local Function.prototype Cannot read property 'name' of undefined
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-forms-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-forms-expected.txt index 0a4d0a3..793fe3f 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-forms-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/dom/reflection-forms-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 559: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS form.title: 32 tests PASS form.lang: 32 tests @@ -504,11 +503,159 @@ PASS keygen.hidden: 33 tests PASS keygen.accessKey: 32 tests PASS keygen.tabIndex: 24 tests -PASS keygen.autofocus: 33 tests -PASS keygen.challenge: 32 tests -PASS keygen.disabled: 33 tests -PASS keygen.keytype: 23 tests -PASS keygen.name: 32 tests +FAIL keygen.autofocus: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL keygen.autofocus: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: setAttribute() to "autofocus" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.autofocus: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL keygen.autofocus: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL keygen.autofocus: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL keygen.autofocus: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL keygen.autofocus: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL keygen.autofocus: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS keygen.autofocus: IDL set to true +FAIL keygen.autofocus: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL keygen.autofocus: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL keygen.autofocus: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL keygen.autofocus: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL keygen.autofocus: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL keygen.autofocus: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL keygen.autofocus: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL keygen.autofocus: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" +FAIL keygen.challenge: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL keygen.challenge: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to undefined assert_equals: IDL get expected (string) "undefined" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to 7 assert_equals: IDL get expected (string) "7" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to 1.5 assert_equals: IDL get expected (string) "1.5" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to true assert_equals: IDL get expected (string) "true" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to false assert_equals: IDL get expected (string) "false" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "[object Object]" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to NaN assert_equals: IDL get expected (string) "NaN" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to Infinity assert_equals: IDL get expected (string) "Infinity" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to -Infinity assert_equals: IDL get expected (string) "-Infinity" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to "\0" assert_equals: IDL get expected (string) "\0" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to null assert_equals: IDL get expected (string) "null" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "test-toString" but got (undefined) undefined +FAIL keygen.challenge: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (undefined) undefined +FAIL keygen.challenge: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL keygen.challenge: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "test-valueOf" +FAIL keygen.challenge: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL keygen.challenge: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL keygen.challenge: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL keygen.challenge: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL keygen.challenge: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL keygen.challenge: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL keygen.challenge: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL keygen.challenge: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL keygen.challenge: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL keygen.challenge: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL keygen.challenge: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL keygen.challenge: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL keygen.challenge: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (object) object "test-valueOf" +FAIL keygen.disabled: typeof IDL attribute assert_equals: expected "boolean" but got "undefined" +FAIL keygen.disabled: IDL get with DOM attribute unset assert_equals: expected (boolean) false but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to "" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to " foo " assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to undefined assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to null assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to 7 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to 1.5 assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to true assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to false assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to NaN assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to -Infinity assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to "\0" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to object "test-toString" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: setAttribute() to "disabled" assert_equals: IDL get expected (boolean) true but got (undefined) undefined +FAIL keygen.disabled: IDL set to "" assert_equals: hasAttribute() expected false but got true +FAIL keygen.disabled: IDL set to " foo " assert_equals: IDL get expected (boolean) true but got (string) " foo " +FAIL keygen.disabled: IDL set to undefined assert_equals: hasAttribute() expected false but got true +FAIL keygen.disabled: IDL set to null assert_equals: hasAttribute() expected false but got true +FAIL keygen.disabled: IDL set to 7 assert_equals: IDL get expected (boolean) true but got (number) 7 +FAIL keygen.disabled: IDL set to 1.5 assert_equals: IDL get expected (boolean) true but got (number) 1.5 +PASS keygen.disabled: IDL set to true +FAIL keygen.disabled: IDL set to false assert_equals: hasAttribute() expected false but got true +FAIL keygen.disabled: IDL set to object "[object Object]" assert_equals: IDL get expected (boolean) true but got (object) object "[object Object]" +FAIL keygen.disabled: IDL set to NaN assert_equals: hasAttribute() expected false but got true +FAIL keygen.disabled: IDL set to Infinity assert_equals: IDL get expected (boolean) true but got (number) Infinity +FAIL keygen.disabled: IDL set to -Infinity assert_equals: IDL get expected (boolean) true but got (number) -Infinity +FAIL keygen.disabled: IDL set to "\0" assert_equals: IDL get expected (boolean) true but got (string) "\0" +FAIL keygen.disabled: IDL set to object "test-toString" assert_equals: IDL get expected (boolean) true but got (object) object "test-toString" +FAIL keygen.disabled: IDL set to object "test-valueOf" assert_equals: IDL get expected (boolean) true but got (object) object "test-valueOf" +FAIL keygen.keytype: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL keygen.keytype: setAttribute() to "rsa" assert_equals: IDL get expected (string) "rsa" but got (undefined) undefined +FAIL keygen.keytype: setAttribute() to "RSA" assert_equals: IDL get expected (string) "rsa" but got (undefined) undefined +FAIL keygen.keytype: IDL set to "" assert_equals: getAttribute() expected "" but got "RSA" +FAIL keygen.keytype: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "RSA" +FAIL keygen.keytype: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "RSA" +FAIL keygen.keytype: IDL set to 7 assert_equals: getAttribute() expected "7" but got "RSA" +FAIL keygen.keytype: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "RSA" +FAIL keygen.keytype: IDL set to true assert_equals: getAttribute() expected "true" but got "RSA" +FAIL keygen.keytype: IDL set to false assert_equals: getAttribute() expected "false" but got "RSA" +FAIL keygen.keytype: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "RSA" +FAIL keygen.keytype: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "RSA" +FAIL keygen.keytype: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "RSA" +FAIL keygen.keytype: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "RSA" +FAIL keygen.keytype: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "RSA" +PASS keygen.keytype: IDL set to null +FAIL keygen.keytype: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "RSA" +FAIL keygen.keytype: IDL set to object "test-valueOf" assert_equals: getAttribute() expected "test-valueOf" but got "RSA" +FAIL keygen.keytype: IDL set to "rsa" assert_equals: getAttribute() expected "rsa" but got "RSA" +FAIL keygen.keytype: IDL set to "xrsa" assert_equals: getAttribute() expected "xrsa" but got "RSA" +FAIL keygen.keytype: IDL set to "rsa\0" assert_equals: getAttribute() expected "rsa\0" but got "RSA" +FAIL keygen.keytype: IDL set to "sa" assert_equals: getAttribute() expected "sa" but got "RSA" +FAIL keygen.keytype: IDL set to "RSA" assert_equals: IDL get expected "rsa" but got "RSA" +FAIL keygen.name: typeof IDL attribute assert_equals: expected "string" but got "undefined" +FAIL keygen.name: IDL get with DOM attribute unset assert_equals: expected (string) "" but got (undefined) undefined +FAIL keygen.name: setAttribute() to "" assert_equals: IDL get expected (string) "" but got (undefined) undefined +FAIL keygen.name: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: IDL get expected (string) " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got (undefined) undefined +FAIL keygen.name: setAttribute() to undefined assert_equals: IDL get expected (string) "undefined" but got (undefined) undefined +FAIL keygen.name: setAttribute() to 7 assert_equals: IDL get expected (string) "7" but got (undefined) undefined +FAIL keygen.name: setAttribute() to 1.5 assert_equals: IDL get expected (string) "1.5" but got (undefined) undefined +FAIL keygen.name: setAttribute() to true assert_equals: IDL get expected (string) "true" but got (undefined) undefined +FAIL keygen.name: setAttribute() to false assert_equals: IDL get expected (string) "false" but got (undefined) undefined +FAIL keygen.name: setAttribute() to object "[object Object]" assert_equals: IDL get expected (string) "[object Object]" but got (undefined) undefined +FAIL keygen.name: setAttribute() to NaN assert_equals: IDL get expected (string) "NaN" but got (undefined) undefined +FAIL keygen.name: setAttribute() to Infinity assert_equals: IDL get expected (string) "Infinity" but got (undefined) undefined +FAIL keygen.name: setAttribute() to -Infinity assert_equals: IDL get expected (string) "-Infinity" but got (undefined) undefined +FAIL keygen.name: setAttribute() to "\0" assert_equals: IDL get expected (string) "\0" but got (undefined) undefined +FAIL keygen.name: setAttribute() to null assert_equals: IDL get expected (string) "null" but got (undefined) undefined +FAIL keygen.name: setAttribute() to object "test-toString" assert_equals: IDL get expected (string) "test-toString" but got (undefined) undefined +FAIL keygen.name: setAttribute() to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (undefined) undefined +FAIL keygen.name: IDL set to "" assert_equals: getAttribute() expected "" but got "test-valueOf" +FAIL keygen.name: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " assert_equals: getAttribute() expected " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f foo " but got "test-valueOf" +FAIL keygen.name: IDL set to undefined assert_equals: getAttribute() expected "undefined" but got "test-valueOf" +FAIL keygen.name: IDL set to 7 assert_equals: getAttribute() expected "7" but got "test-valueOf" +FAIL keygen.name: IDL set to 1.5 assert_equals: getAttribute() expected "1.5" but got "test-valueOf" +FAIL keygen.name: IDL set to true assert_equals: getAttribute() expected "true" but got "test-valueOf" +FAIL keygen.name: IDL set to false assert_equals: getAttribute() expected "false" but got "test-valueOf" +FAIL keygen.name: IDL set to object "[object Object]" assert_equals: getAttribute() expected "[object Object]" but got "test-valueOf" +FAIL keygen.name: IDL set to NaN assert_equals: getAttribute() expected "NaN" but got "test-valueOf" +FAIL keygen.name: IDL set to Infinity assert_equals: getAttribute() expected "Infinity" but got "test-valueOf" +FAIL keygen.name: IDL set to -Infinity assert_equals: getAttribute() expected "-Infinity" but got "test-valueOf" +FAIL keygen.name: IDL set to "\0" assert_equals: getAttribute() expected "\0" but got "test-valueOf" +FAIL keygen.name: IDL set to null assert_equals: getAttribute() expected "null" but got "test-valueOf" +FAIL keygen.name: IDL set to object "test-toString" assert_equals: getAttribute() expected "test-toString" but got "test-valueOf" +FAIL keygen.name: IDL set to object "test-valueOf" assert_equals: IDL get expected (string) "test-valueOf" but got (object) object "test-valueOf" PASS output.title: 32 tests PASS output.lang: 32 tests PASS output.dir: 62 tests
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt new file mode 100644 index 0000000..6500285 --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt
@@ -0,0 +1,18 @@ +This is a testharness.js-based test. +FAIL The length attribute must return the number of elements in the form assert_equals: The length attribute is incorrect. expected 2 but got 1 +PASS HTMLFormControlsCollection.item(index) must return the indexed item +PASS HTMLFormControlsCollection[index] must return the indexed item +PASS HTMLFormControlsCollection is not callable +PASS HTMLFormControlsCollection[name] must return the named item +PASS HTMLFormControlsCollection.namedItem(name) must return the named item +PASS The namedItem(name) must return an Element +PASS The namedItem(name) must return RadioNodeList +PASS The namedItem(name) must return null if the name is empty +PASS The namedItem(name) must return null if there is no matched element +FAIL Controls can be indexed by id or name attribute assert_equals: Controls can be named by 'id' attribute. expected Element node <keygen id="kg" name="key"></keygen> but got null +PASS The namedItem(name) must return the items with id or name attribute +FAIL The HTMLFormControlsCollection interface is used for collections of listed elements in form element assert_equals: The length should be 8. expected 8 but got 7 +FAIL The HTMLFormControlsCollection interface is used for collections of listed elements in fieldset element assert_equals: The length should be 8. expected 8 but got 7 +PASS The controls in the form element must be sorted in tree order +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/constraints/form-validation-willValidate-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/constraints/form-validation-willValidate-expected.txt index 249cf1a..4f00e7c 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/constraints/form-validation-willValidate-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/constraints/form-validation-willValidate-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 361: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS [INPUT in HIDDEN status] Must be barred from the constraint validation PASS [INPUT in BUTTON status] Must be barred from the constraint validation @@ -8,7 +7,7 @@ FAIL [fieldset] Must not be barred from the constraint validation assert_true: The willValidate attribute should be true. expected true got false FAIL [output] Must not be barred from the constraint validation assert_true: The willValidate attribute should be true. expected true got false PASS [object] Must be barred from the constraint validation -PASS [keygen] Must be barred from the constraint validation +FAIL [keygen] Must be barred from the constraint validation assert_true: The willValidate attribute doesn't exist. expected true got false PASS [INPUT in TEXT status] Must be barred from the constraint validation if it is disabled PASS [INPUT in TEXT status] The willValidate attribute must be true if an element is mutable PASS [INPUT in TEXT status] Must be barred from the constraint validation if it is readonly
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/form-control-infrastructure/form-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/form-control-infrastructure/form-expected.txt index c997ddd..8531b05a 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/form-control-infrastructure/form-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/form-control-infrastructure/form-expected.txt
@@ -1,9 +1,10 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS button.form PASS fieldset.form PASS input.form -PASS keygen.form +FAIL keygen.form assert_equals: expected (object) Element node <form id="form"> +<p><button id="button">button</button> +<... but got (undefined) undefined PASS object.form PASS output.form PASS select.form
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-nameditem.html b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-nameditem.html index 3edf903b..3a9675d 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-nameditem.html +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-form-element/form-nameditem.html
@@ -5,7 +5,6 @@ <script src="/resources/testharnessreport.js"></script> <div id=log></div> <!-- XXX Nothing tests id attributes yet. --> -<!-- XXX Keygen. --> <!-- XXX We also need tests for moving inputs and forms in the DOM. --> <form> <input type=button name=button>
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-label-element/labelable-elements-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-label-element/labelable-elements-expected.txt index 37b09d2..d6fc410 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-label-element/labelable-elements-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/the-label-element/labelable-elements-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS Check if the output element is a labelable element PASS Check if the output element can access 'labels' @@ -14,8 +13,8 @@ FAIL Check if the hidden input element can access 'labels' Cannot read property 'length' of null PASS Check if the input element in radio state is a labelable element PASS Check if the input element in radio state can access 'labels' -PASS Check if the keygen element is a labelable element -PASS Check if the keygen element can access 'labels' +FAIL Check if the keygen element is a labelable element Cannot read property 'id' of null +FAIL Check if the keygen element can access 'labels' Cannot read property 'length' of undefined PASS Check if the meter element is a labelable element PASS Check if the meter element can access 'labels' PASS Check if the fieldset element is not a labelable element
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt index c0df0600..602f860 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS The prototype for OL is HTMLOListElement.prototype PASS 'reversed' property should be defined on OL.
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces-expected.txt index a81a9f7c..3f84091 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 19: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS Interfaces for a PASS Interfaces for A @@ -145,8 +144,6 @@ PASS Interfaces for ISINDEX PASS Interfaces for kbd PASS Interfaces for KBD -PASS Interfaces for keygen -PASS Interfaces for KEYGEN PASS Interfaces for label PASS Interfaces for LABEL PASS Interfaces for legend
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces.js b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces.js index 0280e27..8dc71a1 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces.js +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/interfaces.js
@@ -72,7 +72,6 @@ ["ins", "Mod"], ["isindex", "Unknown"], ["kbd", ""], - ["keygen", "Keygen"], ["label", "Label"], ["legend", "Legend"], ["li", "LI"],
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests19-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests19-expected.txt index fc64c96f..764ae6a 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests19-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests19-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS html5lib_tests19.html 6135e0cbdbb22a97e8a13c2442c3e9a9e0a53298 PASS html5lib_tests19.html 6b46dba2f4d7d1a08359ab21fe5e011463dd8746
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests25-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests25-expected.txt index 66c0f2a3..bd7130d 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests25-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/parsing/html5lib_tests25-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS html5lib_tests25.html 025adbb619bdef9ad228a6b378b9dd6bef9f93dc PASS html5lib_tests25.html 7e561454888535bc5c68e7396de2f4206c81e97d
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/serializing-html-fragments/serializing-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/serializing-html-fragments/serializing-expected.txt index fac9e47..6342787 100644 --- a/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/serializing-html-fragments/serializing-expected.txt +++ b/third_party/WebKit/LayoutTests/imported/wpt/html/syntax/serializing-html-fragments/serializing-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 248: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This is a testharness.js-based test. PASS innerHTML 0 PASS innerHTML 1 <a></a>
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-005-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-005-expected.txt new file mode 100644 index 0000000..41fad1f --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-005-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +PASS A_04_01_05_T01 +FAIL A_04_01_05_T02 assert_equals: Elements in shadow DOM must not be accessible from owner's document keygen.form attribute expected (object) null but got (undefined) undefined +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-007-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-007-expected.txt new file mode 100644 index 0000000..4334e48 --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/wpt/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/test-007-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +PASS A_04_01_07_T01 +FAIL A_04_01_07_T02 assert_equals: Elements in shadow DOM must be accessible from shadow document keygen.form attribute expected (object) Element node <form id="form_id"></form> but got (undefined) undefined +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/vr/idlharness-expected.txt b/third_party/WebKit/LayoutTests/imported/wpt/vr/idlharness-expected.txt new file mode 100644 index 0000000..d925364b --- /dev/null +++ b/third_party/WebKit/LayoutTests/imported/wpt/vr/idlharness-expected.txt
@@ -0,0 +1,103 @@ +This is a testharness.js-based test. +FAIL Window interface: attribute onvrdisplayconnect assert_own_property: The global object must have a property "onvrdisplayconnect" expected property "onvrdisplayconnect" missing +FAIL Window interface: attribute onvrdisplaydisconnect assert_own_property: The global object must have a property "onvrdisplaydisconnect" expected property "onvrdisplaydisconnect" missing +FAIL Window interface: attribute onvrdisplayactivate assert_own_property: The global object must have a property "onvrdisplayactivate" expected property "onvrdisplayactivate" missing +FAIL Window interface: attribute onvrdisplaydeactivate assert_own_property: The global object must have a property "onvrdisplaydeactivate" expected property "onvrdisplaydeactivate" missing +FAIL Window interface: attribute onvrdisplayblur assert_own_property: The global object must have a property "onvrdisplayblur" expected property "onvrdisplayblur" missing +FAIL Window interface: attribute onvrdisplayfocus assert_own_property: The global object must have a property "onvrdisplayfocus" expected property "onvrdisplayfocus" missing +FAIL Window interface: attribute onvrdisplaypresentchange assert_own_property: The global object must have a property "onvrdisplaypresentchange" expected property "onvrdisplaypresentchange" missing +PASS Navigator interface: operation getVRDisplays() +FAIL Navigator interface: attribute activeVRDisplays assert_true: The prototype object must have a property "activeVRDisplays" expected true got false +FAIL Navigator interface: attribute vrEnabled assert_true: The prototype object must have a property "vrEnabled" expected true got false +FAIL HTMLIFrameElement interface: attribute allowvr assert_true: The prototype object must have a property "allowvr" expected true got false +PASS Gamepad interface: attribute displayId +PASS VRDisplay interface: existence and properties of interface object +PASS VRDisplay interface object length +PASS VRDisplay interface object name +FAIL VRDisplay interface: existence and properties of interface prototype object assert_equals: class string of VRDisplay.prototype expected "[object VRDisplayPrototype]" but got "[object VRDisplay]" +PASS VRDisplay interface: existence and properties of interface prototype object's "constructor" property +PASS VRDisplay interface: attribute isConnected +PASS VRDisplay interface: attribute isPresenting +PASS VRDisplay interface: attribute capabilities +PASS VRDisplay interface: attribute stageParameters +PASS VRDisplay interface: operation getEyeParameters(VREye) +PASS VRDisplay interface: attribute displayId +PASS VRDisplay interface: attribute displayName +PASS VRDisplay interface: operation getFrameData(VRFrameData) +PASS VRDisplay interface: operation getPose() +PASS VRDisplay interface: operation resetPose() +PASS VRDisplay interface: attribute depthNear +PASS VRDisplay interface: attribute depthFar +PASS VRDisplay interface: operation requestAnimationFrame(FrameRequestCallback) +PASS VRDisplay interface: operation cancelAnimationFrame(long) +PASS VRDisplay interface: operation requestPresent([object Object]) +PASS VRDisplay interface: operation exitPresent() +PASS VRDisplay interface: operation getLayers() +PASS VRDisplay interface: operation submitFrame() +PASS VRDisplayCapabilities interface: existence and properties of interface object +PASS VRDisplayCapabilities interface object length +PASS VRDisplayCapabilities interface object name +FAIL VRDisplayCapabilities interface: existence and properties of interface prototype object assert_equals: class string of VRDisplayCapabilities.prototype expected "[object VRDisplayCapabilitiesPrototype]" but got "[object VRDisplayCapabilities]" +PASS VRDisplayCapabilities interface: existence and properties of interface prototype object's "constructor" property +PASS VRDisplayCapabilities interface: attribute hasPosition +PASS VRDisplayCapabilities interface: attribute hasOrientation +PASS VRDisplayCapabilities interface: attribute hasExternalDisplay +PASS VRDisplayCapabilities interface: attribute canPresent +PASS VRDisplayCapabilities interface: attribute maxLayers +PASS VRFieldOfView interface: existence and properties of interface object +PASS VRFieldOfView interface object length +PASS VRFieldOfView interface object name +FAIL VRFieldOfView interface: existence and properties of interface prototype object assert_equals: class string of VRFieldOfView.prototype expected "[object VRFieldOfViewPrototype]" but got "[object VRFieldOfView]" +PASS VRFieldOfView interface: existence and properties of interface prototype object's "constructor" property +FAIL VRFieldOfView interface: attribute upDegrees assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function () { [native code] }" +FAIL VRFieldOfView interface: attribute rightDegrees assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function () { [native code] }" +FAIL VRFieldOfView interface: attribute downDegrees assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function () { [native code] }" +FAIL VRFieldOfView interface: attribute leftDegrees assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function () { [native code] }" +PASS VRPose interface: existence and properties of interface object +PASS VRPose interface object length +PASS VRPose interface object name +FAIL VRPose interface: existence and properties of interface prototype object assert_equals: class string of VRPose.prototype expected "[object VRPosePrototype]" but got "[object VRPose]" +PASS VRPose interface: existence and properties of interface prototype object's "constructor" property +PASS VRPose interface: attribute position +PASS VRPose interface: attribute linearVelocity +PASS VRPose interface: attribute linearAcceleration +PASS VRPose interface: attribute orientation +PASS VRPose interface: attribute angularVelocity +PASS VRPose interface: attribute angularAcceleration +PASS VRFrameData interface: existence and properties of interface object +PASS VRFrameData interface object length +PASS VRFrameData interface object name +FAIL VRFrameData interface: existence and properties of interface prototype object assert_equals: class string of VRFrameData.prototype expected "[object VRFrameDataPrototype]" but got "[object VRFrameData]" +PASS VRFrameData interface: existence and properties of interface prototype object's "constructor" property +PASS VRFrameData interface: attribute timestamp +PASS VRFrameData interface: attribute leftProjectionMatrix +PASS VRFrameData interface: attribute leftViewMatrix +PASS VRFrameData interface: attribute rightProjectionMatrix +PASS VRFrameData interface: attribute rightViewMatrix +PASS VRFrameData interface: attribute pose +PASS VREyeParameters interface: existence and properties of interface object +PASS VREyeParameters interface object length +PASS VREyeParameters interface object name +FAIL VREyeParameters interface: existence and properties of interface prototype object assert_equals: class string of VREyeParameters.prototype expected "[object VREyeParametersPrototype]" but got "[object VREyeParameters]" +PASS VREyeParameters interface: existence and properties of interface prototype object's "constructor" property +PASS VREyeParameters interface: attribute offset +PASS VREyeParameters interface: attribute fieldOfView +PASS VREyeParameters interface: attribute renderWidth +PASS VREyeParameters interface: attribute renderHeight +PASS VRStageParameters interface: existence and properties of interface object +PASS VRStageParameters interface object length +PASS VRStageParameters interface object name +FAIL VRStageParameters interface: existence and properties of interface prototype object assert_equals: class string of VRStageParameters.prototype expected "[object VRStageParametersPrototype]" but got "[object VRStageParameters]" +PASS VRStageParameters interface: existence and properties of interface prototype object's "constructor" property +PASS VRStageParameters interface: attribute sittingToStandingTransform +PASS VRStageParameters interface: attribute sizeX +PASS VRStageParameters interface: attribute sizeZ +PASS VRDisplayEvent interface: existence and properties of interface object +FAIL VRDisplayEvent interface object length assert_equals: wrong value for VRDisplayEvent.length expected 2 but got 1 +PASS VRDisplayEvent interface object name +FAIL VRDisplayEvent interface: existence and properties of interface prototype object assert_equals: class string of VRDisplayEvent.prototype expected "[object VRDisplayEventPrototype]" but got "[object VRDisplayEvent]" +PASS VRDisplayEvent interface: existence and properties of interface prototype object's "constructor" property +PASS VRDisplayEvent interface: attribute display +PASS VRDisplayEvent interface: attribute reason +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/html/keygen-expected.txt index 0140d4f..d3234f2 100644 --- a/third_party/WebKit/LayoutTests/platform/android/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/android/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/html/keygen-expected.txt index bec5903..10efa75 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/html/keygen-expected.txt index e30d8e6..2d67c5d3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/html/keygen-expected.txt index 62118d17..3a020a03 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/html/keygen-expected.txt index 5038d78..c33aae22 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/html/keygen-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/html/keygen-expected.txt index 2053d4f..64a7fc1 100644 --- a/third_party/WebKit/LayoutTests/platform/win/fast/html/keygen-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/fast/html/keygen-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. layer at (0,0) size 800x600 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt index 9a4d06b4..03d72d3 100644 --- a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -2176,28 +2176,6 @@ setter valueAsNumber setter webkitdirectory setter width -interface HTMLKeygenElement : HTMLElement - attribute @@toStringTag - getter autofocus - getter challenge - getter disabled - getter form - getter keytype - getter labels - getter name - getter type - getter validationMessage - getter validity - getter willValidate - method checkValidity - method constructor - method reportValidity - method setCustomValidity - setter autofocus - setter challenge - setter disabled - setter keytype - setter name interface HTMLLIElement : HTMLElement attribute @@toStringTag getter type
diff --git a/third_party/WebKit/LayoutTests/sensor/accelerometer.html b/third_party/WebKit/LayoutTests/sensor/accelerometer.html index 9339d358..fdf9d1b 100644 --- a/third_party/WebKit/LayoutTests/sensor/accelerometer.html +++ b/third_party/WebKit/LayoutTests/sensor/accelerometer.html
@@ -14,14 +14,17 @@ const kDefaultReadingX = 1.12345; const kDefaultReadingY = 2.12345; const kDefaultReadingZ = 3.12345; +var readsCount = 0; -function update_sensor_reading(buffer, expects_modified_reading, readsCount) { +function update_sensor_reading(buffer, expects_modified_reading) { buffer[1] = window.performance.now(); buffer[2] = kDefaultReadingX; buffer[3] = kDefaultReadingY; buffer[4] = kDefaultReadingZ; if (expects_modified_reading) buffer[2] += readsCount; + + readsCount++; } function verify_sensor_reading(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..282f633 100644 --- a/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html +++ b/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
@@ -12,12 +12,15 @@ debug('This test cannot be run without the TestRunner'); const kDefaultReadingValue = 3.1415; +var readsCount = 0; -function update_sensor_reading(buffer, expects_modified_reading, readsCount) { +function update_sensor_reading(buffer, expects_modified_reading) { buffer[1] = window.performance.now(); buffer[2] = kDefaultReadingValue; if (expects_modified_reading) buffer[2] += readsCount; + + readsCount++; } function verify_sensor_reading(reading) {
diff --git a/third_party/WebKit/LayoutTests/sensor/gyroscope.html b/third_party/WebKit/LayoutTests/sensor/gyroscope.html index 584824f..2d9150f 100644 --- a/third_party/WebKit/LayoutTests/sensor/gyroscope.html +++ b/third_party/WebKit/LayoutTests/sensor/gyroscope.html
@@ -14,14 +14,17 @@ const kDefaultReadingX = 1.12345; const kDefaultReadingY = 2.12345; const kDefaultReadingZ = 3.12345; +var readsCount = 0; -function update_sensor_reading(buffer, expects_modified_reading, readsCount) { +function update_sensor_reading(buffer, expects_modified_reading) { buffer[1] = window.performance.now(); buffer[2] = kDefaultReadingX; buffer[3] = kDefaultReadingY; buffer[4] = kDefaultReadingZ; if (expects_modified_reading) buffer[2] += readsCount; + + readsCount++; } function verify_sensor_reading(reading) {
diff --git a/third_party/WebKit/LayoutTests/sensor/magnetometer.html b/third_party/WebKit/LayoutTests/sensor/magnetometer.html index 3ad97e5..c392d44 100644 --- a/third_party/WebKit/LayoutTests/sensor/magnetometer.html +++ b/third_party/WebKit/LayoutTests/sensor/magnetometer.html
@@ -14,14 +14,17 @@ const kDefaultReadingValueX = -19.2; const kDefaultReadingValueY = 12.1; const kDefaultReadingValueZ = -44.3; +var readsCount = 0; -function update_sensor_reading(buffer, expects_modified_reading, readsCount) { +function update_sensor_reading(buffer, expects_modified_reading) { buffer[1] = window.performance.now(); buffer[2] = kDefaultReadingValueX; buffer[3] = kDefaultReadingValueY; buffer[4] = kDefaultReadingValueZ; if (expects_modified_reading) buffer[2] += readsCount; + + readsCount++; } function verify_sensor_reading(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 fc1fc8e..ee5f312 100644 --- a/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js +++ b/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js
@@ -291,7 +291,6 @@ return new Promise((resolve, reject) => { let fastSensorNotifiedCounter = 0; let slowSensorNotifiedCounter = 0; - let readingUpdatesCounter = 0; let fastSensorWrapper = new CallbackWrapper(() => { fastSensorNotifiedCounter++; @@ -301,16 +300,11 @@ slowSensorNotifiedCounter++; if (slowSensorNotifiedCounter == 1) { fastSensor.start(); - readingUpdatesCounter = mockSensor.reading_updates_count(); } else if (slowSensorNotifiedCounter == 2) { // By the moment slow sensor (9 Hz) is notified for the // next time, the fast sensor (30 Hz) has been notified // for int(30/9) = 3 times. - // In actual implementation updates are bound to rAF, - // (not to a timer) so fluctuations are possible, so we - // reference to the actual elapsed updates count. - let elapsedUpdates = mockSensor.reading_updates_count() - readingUpdatesCounter; - assert_equals(fastSensorNotifiedCounter, elapsedUpdates); + assert_equals(fastSensorNotifiedCounter, 3); fastSensor.stop(); slowSensor.stop(); resolve(mockSensor);
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js index 236262f3..262145f 100644 --- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js +++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
@@ -41,7 +41,6 @@ this.reporting_mode_ = reportingMode; this.sensor_reading_timer_id_ = null; this.update_reading_function_ = null; - this.reading_updates_count_ = 0; this.suspend_called_ = null; this.resume_called_ = null; this.add_configuration_called_ = null; @@ -64,9 +63,6 @@ return Promise.resolve({frequency: 5}); } - reading_updates_count() { - return this.reading_updates_count_; - } // Adds configuration for the sensor and starts reporting fake data // through update_reading_function_ callback. addConfiguration(configuration) { @@ -131,7 +127,6 @@ this.stopReading(); this.expects_modified_reading_ = false; - this.reading_updates_count_ = 0; this.start_should_fail_ = false; this.update_reading_function_ = null; this.active_sensor_configurations_ = []; @@ -199,17 +194,13 @@ startReading() { if (this.update_reading_function_ != null) { - this.stopReading(); let max_frequency_used = this.active_sensor_configurations_[0].frequency; let timeout = (1 / max_frequency_used) * 1000; this.sensor_reading_timer_id_ = window.setInterval(() => { - if (this.update_reading_function_) { + if (this.update_reading_function_) this.update_reading_function_(this.buffer_, - this.expects_modified_reading_, - this.reading_updates_count_); - this.reading_updates_count_++; - } + this.expects_modified_reading_); if (this.reporting_mode_ === sensor.ReportingMode.ON_CHANGE) { this.client_.sensorReadingChanged(); }
diff --git a/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/imported/wpt/webstorage/README.txt b/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/imported/wpt/webstorage/README.txt new file mode 100644 index 0000000..a10c382 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/imported/wpt/webstorage/README.txt
@@ -0,0 +1 @@ +This directory is for testing localStorage with mojo.
diff --git a/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/storage/domstorage/localstorage/README.txt b/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/storage/domstorage/localstorage/README.txt new file mode 100644 index 0000000..a10c382 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/mojo-localstorage/storage/domstorage/localstorage/README.txt
@@ -0,0 +1 @@ +This directory is for testing localStorage with mojo.
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt index c7cd06c..76eb251 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 18: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test documents all properties on all element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -647,20 +646,6 @@ property dateTime html element kbd html element keygen - property autofocus - property challenge - property checkValidity - property disabled - property form - property keytype - property labels - property name - property reportValidity - property setCustomValidity - property type - property validationMessage - property validity - property willValidate html element label property control property form
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt index f046493..44db129 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -2237,28 +2237,6 @@ setter valueAsNumber setter webkitdirectory setter width -interface HTMLKeygenElement : HTMLElement - attribute @@toStringTag - getter autofocus - getter challenge - getter disabled - getter form - getter keytype - getter labels - getter name - getter type - getter validationMessage - getter validity - getter willValidate - method checkValidity - method constructor - method reportValidity - method setCustomValidity - setter autofocus - setter challenge - setter disabled - setter keytype - setter name interface HTMLLIElement : HTMLElement attribute @@toStringTag getter type
diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js index 9d61ea4..7d337e6f 100644 --- a/third_party/WebKit/LayoutTests/webaudio/resources/audit.js +++ b/third_party/WebKit/LayoutTests/webaudio/resources/audit.js
@@ -98,8 +98,10 @@ this._expected = null; this._expectedDescription = null; - this._result = true; this._detail = ''; + this._printActualForFailure = true; + + this._result = null; /** * @param {Number} numberOfErrors Number of errors to be printed. @@ -132,10 +134,14 @@ } _buildResultText () { - if (!this._actualDescription) { - this._actualDescription = - _generateDescription(this._actual, this._options); - } + if (this._result === null) + _throwException('Illegal invocation: the assertion is not finished.'); + + let actualString = _generateDescription(this._actual, this._options); + + // Use generated text when the description is not provided. + if (!this._actualDescription) + this._actualDescription = actualString; if (!this._expectedDescription) { this._expectedDescription = @@ -168,6 +174,11 @@ this._detail = this._detail.replace(new RegExp(re, 'g'), _generateDescription(this._options[name])); } + + // If the test failed, add the actual value at the end. + if (this._result === false && this._printActualForFailure === true) { + this._detail += ' Got ' + actualString + '.'; + } } _finalize () { @@ -248,6 +259,7 @@ */ throw () { this._processArguments(arguments); + this._printActualForFailure = false; let didThrowCorrectly = false; let passDetail, failDetail; @@ -285,6 +297,8 @@ * "PASS let foo = "bar" did not throw an exception." */ notThrow () { + this._printActualForFailure = false; + let didThrowCorrectly = false; let passDetail, failDetail; @@ -487,6 +501,7 @@ */ beConstantValueOf () { this._processArguments(arguments); + this._printActualForFailure = false; let passed = true; let passDetail, failDetail; @@ -505,7 +520,7 @@ } else { let counter = 0; failDetail = 'Expected ${expected} for all values but found ' - + numberOfErrors + ' unexpected values. : '; + + numberOfErrors + ' unexpected values: '; failDetail += '\n\tIndex\tActual'; for (let errorIndex in errors) { failDetail += '\n\t[' + errorIndex + ']' @@ -532,6 +547,7 @@ */ beEqualToArray () { this._processArguments(arguments); + this._printActualForFailure = false; let passed = true; let passDetail, failDetail; @@ -585,6 +601,7 @@ */ containValues () { this._processArguments(arguments); + this._printActualForFailure = false; let passed = true; let indexedActual = []; @@ -633,6 +650,7 @@ */ notGlitch () { this._processArguments(arguments); + this._printActualForFailure = false; let passed = true; let passDetail, failDetail; @@ -672,11 +690,13 @@ let absExpected = this._expected ? Math.abs(this._expected) : 1; let error = Math.abs(this._actual - this._expected) / absExpected; + // debugger; + return this._assert( error <= this._options.threshold, '${actual} is ${expected} within an error of ${threshold}.', - '${actual} is not close to ${expected} within an error of ' + - '${threshold}'); + '${actual} is not close to ${expected} within a relative error of ' + + '${threshold} (RelErr=' + error + ').'); } /** @@ -697,6 +717,7 @@ */ beCloseToArray () { this._processArguments(arguments); + this._printActualForFailure = false; let passed = true; let passDetail, failDetail;
diff --git a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures-expected.txt b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures-expected.txt index 95b4298..97b8733e 100644 --- a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures-expected.txt
@@ -4,21 +4,22 @@ PASS > [basic-failure] Testing basic assertion failures. FAIL X Setting foo to bar incorrectly threw ReferenceError: "bar is not defined". assert_true: expected true got false FAIL X function () { var foo = 0; } did not throw an exception. assert_true: expected true got false -FAIL X 3 < 5 is not true. assert_true: expected true got false -FAIL X true is not false. assert_true: expected true got false -FAIL X 1 is not equal to 2. assert_true: expected true got false -FAIL X 1 should not be equal to 1. assert_true: expected true got false -FAIL X typeof 3.141592 is not equal to string. assert_true: expected true got false -FAIL X 1 is not greater than 2. assert_true: expected true got false -FAIL X 1 is not greater than or equal to 2. assert_true: expected true got false -FAIL X 2 is not less than 1. assert_true: expected true got false -FAIL X 2 is not less than or equal to 1. assert_true: expected true got false -FAIL X Decoding audio data with no argument rejected incorrectly with TypeError: Failed to execute 'decodeAudioData' on 'BaseAudioContext': 1 argument required, but only 0 present.. assert_true: expected true got false -FAIL X undefined resolved incorrectly. assert_true: expected true got false +FAIL X 3 < 5 is not true. Got false. assert_true: expected true got false +FAIL X true is not false. Got true. assert_true: expected true got false +FAIL X The number of channels is not equal to 2. Got 1. assert_true: expected true got false +FAIL X 1 should not be equal to 1. Got 1. assert_true: expected true got false +FAIL X typeof 3.141592 is not equal to string. Got number. assert_true: expected true got false +FAIL X 1 is not greater than 2. Got 1. assert_true: expected true got false +FAIL X 1 is not greater than or equal to 2. Got 1. assert_true: expected true got false +FAIL X 2 is not less than 1. Got 2. assert_true: expected true got false +FAIL X 2 is not less than or equal to 1. Got 2. assert_true: expected true got false +FAIL X Decoding audio data with no argument rejected incorrectly with TypeError: Failed to execute 'decodeAudioData' on 'BaseAudioContext': 1 argument required, but only 0 present.. Got undefined. assert_true: expected true got false +FAIL X undefined resolved incorrectly. Got undefined. assert_true: expected true got false FAIL < [basic-failure] 13 out of 13 assertions were failed. assert_true: expected true got false PASS > [numerical-failures] Testing numerical assertion failures. -FAIL X 0 is not close to 0.1 within an error of 0 assert_true: expected true got false -FAIL X Expected 5 for all values but found 7 unexpected values. : +FAIL X 0 is not close to 0.1 within a relative error of 0 (RelErr=1). Got 0. assert_true: expected true got false +FAIL X The measured decibel is not close to 62 within a relative error of 0.01 (RelErr=0.04838709677419355). Got 59. assert_true: expected true got false +FAIL X Expected 5 for all values but found 7 unexpected values: Index Actual [0] 1 [1] 8 @@ -59,7 +60,7 @@ [5] 5.9999999999999998e-1 2.0000000000000001e-1 3.9999999999999997e-1 1.9999999999999998e+0 2.0000000000000004e-2 Max AbsError of 5.9999999999999998e-1 at index of 0. Max RelError of 5.9999999999999991e+0 at index of 6. assert_true: expected true got false -FAIL < [numerical-failures] 8 out of 8 assertions were failed. assert_true: expected true got false +FAIL < [numerical-failures] 9 out of 9 assertions were failed. assert_true: expected true got false FAIL # AUDIT TASK RUNNER FINISHED: 2 out of 2 tasks were failed. assert_true: expected true got false Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures.html b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures.html index 7fbace2f4..866e2e4 100644 --- a/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures.html +++ b/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures.html
@@ -27,8 +27,8 @@ should(function () { var foo = 0; }).throw('ReferenceError'); should(3 > 5, '3 < 5').beTrue(); should(true).beFalse(); - should(1).beEqualTo(2) - should(1).notBeEqualTo(1) + should(1, 'The number of channels').beEqualTo(2); + should(1).notBeEqualTo(1); should(typeof 3.141592, 'typeof 3.141592').beEqualTo('string'); should(1).beGreaterThan(2); should(1).beGreaterThanOrEqualTo(2); @@ -49,6 +49,7 @@ task.describe('Testing numerical assertion failures.'); should(0).beCloseTo(0.1, { threshold: 0 }); + should(59, 'The measured decibel').beCloseTo(62, { threshold: 0.01 }); should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49]).beConstantValueOf(5); should([1, 8, 11, 18, 6, 5, 5, 5, 123, 49]) .beEqualToArray([1, 8, 10, 18, 6, 5, 6, 5, 123, 48]);
diff --git a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt index 9b209bf..b147ad6 100644 --- a/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
@@ -1,4 +1,3 @@ -CONSOLE WARNING: line 18: The <keygen> element is deprecated and will be removed in M57, around March 2017. See https://www.chromestatus.com/features/5716060992962560 for more details. This test documents all properties on all element instances. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". @@ -664,20 +663,6 @@ property dateTime html element kbd html element keygen - property autofocus - property challenge - property checkValidity - property disabled - property form - property keytype - property labels - property name - property reportValidity - property setCustomValidity - property type - property validationMessage - property validity - property willValidate html element label property control property form
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 977236a..ce5fa74 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -2752,28 +2752,6 @@ setter valueAsNumber setter webkitdirectory setter width -interface HTMLKeygenElement : HTMLElement - attribute @@toStringTag - getter autofocus - getter challenge - getter disabled - getter form - getter keytype - getter labels - getter name - getter type - getter validationMessage - getter validity - getter willValidate - method checkValidity - method constructor - method reportValidity - method setCustomValidity - setter autofocus - setter challenge - setter disabled - setter keytype - setter name interface HTMLLIElement : HTMLElement attribute @@toStringTag getter type
diff --git a/third_party/WebKit/Source/core/core_idl_files.gni b/third_party/WebKit/Source/core/core_idl_files.gni index f55f132..b0271be5 100644 --- a/third_party/WebKit/Source/core/core_idl_files.gni +++ b/third_party/WebKit/Source/core/core_idl_files.gni
@@ -222,7 +222,6 @@ "html/HTMLHeadingElement.idl", "html/HTMLHtmlElement.idl", "html/HTMLImageElement.idl", - "html/HTMLKeygenElement.idl", "html/HTMLLIElement.idl", "html/HTMLLabelElement.idl", "html/HTMLLegendElement.idl",
diff --git a/third_party/WebKit/Source/core/css/html.css b/third_party/WebKit/Source/core/css/html.css index be7cef3..e21bf12 100644 --- a/third_party/WebKit/Source/core/css/html.css +++ b/third_party/WebKit/Source/core/css/html.css
@@ -392,11 +392,11 @@ } /* Form controls don't go vertical. */ -input, textarea, keygen, select, button, meter, progress { +input, textarea, select, button, meter, progress { -webkit-writing-mode: horizontal-tb !important; } -input, textarea, keygen, select, button { +input, textarea, select, button { margin: 0__qem; font: -webkit-small-control; text-rendering: auto; /* FIXME: Remove when tabs work with optimizeLegibility. */ @@ -484,14 +484,10 @@ pointer-events: auto; } -keygen, select { +select { border-radius: 5px; } -keygen::-webkit-keygen-select { - margin: 0px; -} - textarea { -webkit-appearance: textarea; background-color: white; @@ -610,7 +606,7 @@ input[type="button" i]:disabled, input[type="submit" i]:disabled, input[type="reset" i]:disabled, input[type="file" i]:disabled::-webkit-file-upload-button, button:disabled, -select:disabled, keygen:disabled, optgroup:disabled, option:disabled, +select:disabled, optgroup:disabled, option:disabled, select[disabled]>option { color: GrayText } @@ -978,7 +974,7 @@ outline: none } -input:focus, textarea:focus, keygen:focus, select:focus { +input:focus, textarea:focus, select:focus { outline-offset: -2px }
diff --git a/third_party/WebKit/Source/core/css/themeWin.css b/third_party/WebKit/Source/core/css/themeWin.css index 43cf9e1..1b94dfd 100644 --- a/third_party/WebKit/Source/core/css/themeWin.css +++ b/third_party/WebKit/Source/core/css/themeWin.css
@@ -97,7 +97,6 @@ } /* Windows selects are not rounded. Custom borders for them shouldn't be either. */ -keygen, select, select[size="0"], select[size="1"] {
diff --git a/third_party/WebKit/Source/core/frame/Deprecation.cpp b/third_party/WebKit/Source/core/frame/Deprecation.cpp index 153099c..bc1957e 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.cpp +++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -369,9 +369,6 @@ return replacedBy("'Performance.onwebkitresourcetimingbufferfull'", "'Performance.onresourcetimingbufferfull'"); - case UseCounter::HTMLKeygenElement: - return willBeRemoved("The <keygen> element", M57, "5716060992962560"); - case UseCounter::EncryptedMediaAllSelectedContentTypesMissingCodecs: return String::format( "EME requires that contentType strings accepted by "
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index c058da9..590b0749 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -656,7 +656,6 @@ V8Performance_Navigation_AttributeGetter = 883, V8Performance_Memory_AttributeGetter = 884, V8SharedWorker_WorkerStart_AttributeGetter = 885, - HTMLKeygenElement = 886, // The above items are available in M45 branch. HTMLMediaElementPreloadNone = 892,
diff --git a/third_party/WebKit/Source/core/html/BUILD.gn b/third_party/WebKit/Source/core/html/BUILD.gn index aba5cd5..63cfdfcb 100644 --- a/third_party/WebKit/Source/core/html/BUILD.gn +++ b/third_party/WebKit/Source/core/html/BUILD.gn
@@ -94,8 +94,6 @@ "HTMLImageLoader.cpp", "HTMLImageLoader.h", "HTMLInputElement.cpp", - "HTMLKeygenElement.cpp", - "HTMLKeygenElement.h", "HTMLLIElement.cpp", "HTMLLIElement.h", "HTMLLabelElement.cpp",
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp index fbe421b..b23ea4ea 100644 --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -111,12 +111,16 @@ // misinterpreted as a user-input value const int UndefinedQualityValue = -1.0; -PassRefPtr<Image> createTransparentImage(const IntSize& size) { +sk_sp<SkImage> createTransparentSkImage(const IntSize& size) { DCHECK(ImageBuffer::canCreateImageBuffer(size)); sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(size.width(), size.height()); - return surface ? StaticBitmapImage::create(surface->makeImageSnapshot()) - : nullptr; + return surface->makeImageSnapshot(); +} + +PassRefPtr<Image> createTransparentImage(const IntSize& size) { + sk_sp<SkImage> image = createTransparentSkImage(size); + return image ? StaticBitmapImage::create(image) : nullptr; } } // namespace @@ -1230,8 +1234,9 @@ } if (!m_context) { - *status = NormalSourceImageStatus; - return createTransparentImage(size()); + RefPtr<Image> result = createTransparentImage(size()); + *status = result ? NormalSourceImageStatus : InvalidSourceImageStatus; + return result; } if (m_context->getContextType() == CanvasRenderingContext::ContextImageBitmap) @@ -1245,10 +1250,11 @@ // use paintRenderingResultsToCanvas instead of getImage in order to keep a // cached copy of the backing in the canvas's ImageBuffer. renderingContext()->paintRenderingResultsToCanvas(BackBuffer); - skImage = hasImageBuffer() - ? buffer()->newSkImageSnapshot(hint, reason) - : createTransparentImage(size())->imageForCurrentFrame( - ColorBehavior::transformToGlobalTarget()); + if (hasImageBuffer()) { + skImage = buffer()->newSkImageSnapshot(hint, reason); + } else { + skImage = createTransparentSkImage(size()); + } } else { if (ExpensiveCanvasHeuristicParameters:: DisableAccelerationToAvoidReadbacks && @@ -1256,12 +1262,13 @@ hint == PreferNoAcceleration && m_context->isAccelerated() && hasImageBuffer()) buffer()->disableAcceleration(); - RefPtr<blink::Image> image = renderingContext()->getImage(hint, reason); - skImage = image - ? image->imageForCurrentFrame( - ColorBehavior::transformToGlobalTarget()) - : createTransparentImage(size())->imageForCurrentFrame( - ColorBehavior::transformToGlobalTarget()); + RefPtr<Image> image = renderingContext()->getImage(hint, reason); + if (image) { + skImage = + image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()); + } else { + skImage = createTransparentSkImage(size()); + } } if (skImage) {
diff --git a/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp b/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp deleted file mode 100644 index 17d92d2..0000000 --- a/third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp +++ /dev/null
@@ -1,140 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * (C) 2006 Alexey Proskuryakov (ap@nypop.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "core/html/HTMLKeygenElement.h" - -#include "bindings/core/v8/ExceptionStatePlaceholder.h" -#include "core/HTMLNames.h" -#include "core/dom/Document.h" -#include "core/dom/Text.h" -#include "core/dom/shadow/ShadowRoot.h" -#include "core/frame/Deprecation.h" -#include "core/html/FormData.h" -#include "core/html/HTMLOptionElement.h" -#include "core/html/HTMLSelectElement.h" -#include "core/layout/LayoutBlockFlow.h" -#include "core/loader/FrameLoaderClient.h" -#include "platform/text/PlatformLocale.h" -#include "public/platform/Platform.h" -#include "public/platform/WebLocalizedString.h" -#include "wtf/StdLibExtras.h" - -using namespace blink; - -namespace blink { - -using namespace HTMLNames; - -HTMLKeygenElement::HTMLKeygenElement(Document& document) - : HTMLFormControlElementWithState(keygenTag, document) { - Deprecation::countDeprecation(document, UseCounter::HTMLKeygenElement); - if (document.frame()) - document.frame()->loader().client()->didUseKeygen(); -} - -HTMLKeygenElement* HTMLKeygenElement::create(Document& document) { - HTMLKeygenElement* keygen = new HTMLKeygenElement(document); - keygen->ensureUserAgentShadowRoot(); - return keygen; -} - -LayoutObject* HTMLKeygenElement::createLayoutObject( - const ComputedStyle& style) { - // TODO(mstensho): While it's harmful and meaningless to allow most display - // types on replaced content (e.g. table, table-row or flex), it would be - // useful to honor at least some of them. Table-cell (and maybe table-caption - // too), for instance. See crbug.com/335040 - return new LayoutBlockFlow(this); -} - -void HTMLKeygenElement::didAddUserAgentShadowRoot(ShadowRoot& root) { - DEFINE_STATIC_LOCAL(AtomicString, keygenSelectPseudoId, - ("-webkit-keygen-select")); - - Vector<String> keys; - keys.reserveCapacity(2); - keys.push_back( - locale().queryString(WebLocalizedString::KeygenMenuHighGradeKeySize)); - keys.push_back( - locale().queryString(WebLocalizedString::KeygenMenuMediumGradeKeySize)); - - // Create a select element with one option element for each key size. - HTMLSelectElement* select = HTMLSelectElement::create(document()); - select->setShadowPseudoId(keygenSelectPseudoId); - for (const String& key : keys) { - HTMLOptionElement* option = HTMLOptionElement::create(document()); - option->appendChild(Text::create(document(), key)); - select->appendChild(option); - } - - root.appendChild(select); -} - -void HTMLKeygenElement::parseAttribute(const QualifiedName& name, - const AtomicString& oldValue, - const AtomicString& value) { - // Reflect disabled attribute on the shadow select element - if (name == disabledAttr) - shadowSelect()->setAttribute(name, value); - - HTMLFormControlElement::parseAttribute(name, oldValue, value); -} - -void HTMLKeygenElement::appendToFormData(FormData& formData) { - // Only RSA is supported at this time. - const AtomicString& keyType = fastGetAttribute(keytypeAttr); - if (!keyType.isNull() && !equalIgnoringCase(keyType, "rsa")) - return; - SecurityOrigin* topOrigin = - document().frame()->tree().top()->securityContext()->getSecurityOrigin(); - String value = Platform::current()->signedPublicKeyAndChallengeString( - shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr), - document().baseURL(), KURL(KURL(), topOrigin->toString())); - if (!value.isNull()) - formData.append(name(), value); -} - -const AtomicString& HTMLKeygenElement::formControlType() const { - DEFINE_STATIC_LOCAL(const AtomicString, keygen, ("keygen")); - return keygen; -} - -void HTMLKeygenElement::resetImpl() { - shadowSelect()->reset(); -} - -HTMLSelectElement* HTMLKeygenElement::shadowSelect() const { - ShadowRoot* root = userAgentShadowRoot(); - return root ? toHTMLSelectElementOrDie(root->firstChild()) : nullptr; -} - -bool HTMLKeygenElement::isInteractiveContent() const { - return true; -} - -bool HTMLKeygenElement::supportsAutofocus() const { - return true; -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLKeygenElement.h b/third_party/WebKit/Source/core/html/HTMLKeygenElement.h deleted file mode 100644 index d4bff6a..0000000 --- a/third_party/WebKit/Source/core/html/HTMLKeygenElement.h +++ /dev/null
@@ -1,73 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef HTMLKeygenElement_h -#define HTMLKeygenElement_h - -#include "core/html/HTMLFormControlElementWithState.h" - -namespace blink { - -class HTMLSelectElement; - -class HTMLKeygenElement final : public HTMLFormControlElementWithState { - DEFINE_WRAPPERTYPEINFO(); - - public: - static HTMLKeygenElement* create(Document&); - - bool willValidate() const override { return false; } - - LayoutObject* createLayoutObject(const ComputedStyle&) override; - - private: - explicit HTMLKeygenElement(Document&); - - bool areAuthorShadowsAllowed() const override { return false; } - - bool canStartSelection() const override { return false; } - - void parseAttribute(const QualifiedName&, - const AtomicString&, - const AtomicString&) override; - - void appendToFormData(FormData&) override; - const AtomicString& formControlType() const override; - bool isOptionalFormControl() const override { return false; } - - bool isEnumeratable() const override { return true; } - bool isInteractiveContent() const override; - bool supportsAutofocus() const override; - bool supportLabels() const override { return true; } - - void resetImpl() override; - bool shouldSaveAndRestoreFormControlState() const override { return false; } - - void didAddUserAgentShadowRoot(ShadowRoot&) override; - - HTMLSelectElement* shadowSelect() const; -}; - -} // namespace blink - -#endif // HTMLKeygenElement_h
diff --git a/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl b/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl deleted file mode 100644 index 4b0b21d9..0000000 --- a/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl +++ /dev/null
@@ -1,51 +0,0 @@ -/* - * Copyright (C) 2011 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. - */ - -// https://html.spec.whatwg.org/#the-keygen-element - -interface HTMLKeygenElement : HTMLElement { - [CEReactions, Reflect] attribute boolean autofocus; - [CEReactions, Reflect] attribute DOMString challenge; - [CEReactions, Reflect] attribute boolean disabled; - [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form; - [CEReactions, Reflect, ReflectOnly="rsa", ReflectMissing="rsa"] attribute DOMString keytype; - [CEReactions, Reflect] attribute DOMString name; - - readonly attribute DOMString type; - - readonly attribute boolean willValidate; - readonly attribute ValidityState validity; - readonly attribute DOMString validationMessage; - boolean checkValidity(); - boolean reportValidity(); - void setCustomValidity(DOMString error); - - readonly attribute NodeList labels; -};
diff --git a/third_party/WebKit/Source/core/html/HTMLTagNames.in b/third_party/WebKit/Source/core/html/HTMLTagNames.in index e038fac..0c8b5137 100644 --- a/third_party/WebKit/Source/core/html/HTMLTagNames.in +++ b/third_party/WebKit/Source/core/html/HTMLTagNames.in
@@ -71,7 +71,7 @@ input constructorNeedsCreatedByParser ins interfaceName=HTMLModElement kbd interfaceName=HTMLElement -keygen +keygen interfaceName=HTMLUnknownElement label layer interfaceName=HTMLElement legend
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h index b2d6e63..d1b4b140 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.h +++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -649,7 +649,12 @@ return !isSVG() || (isSVGContainer() && !isSVGHiddenContainer()) || isSVGShape() || isSVGImage() || isSVGText(); } - virtual bool hasNonIsolatedBlendingDescendants() const { return false; } + virtual bool hasNonIsolatedBlendingDescendants() const { + // This is only implemented for layout objects that containt SVG flow. + // For HTML/CSS layout objects, use the PaintLayer version instead. + DCHECK(isSVG()); + return false; + } enum DescendantIsolationState { DescendantIsolationRequired, DescendantIsolationNeedsUpdate,
diff --git a/third_party/WebKit/Source/core/loader/FrameLoaderClient.h b/third_party/WebKit/Source/core/loader/FrameLoaderClient.h index c445ac17..5332b9d3 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoaderClient.h +++ b/third_party/WebKit/Source/core/loader/FrameLoaderClient.h
@@ -263,9 +263,6 @@ // This callback is similar, but for plugins. virtual void didNotAllowPlugins() {} - // This callback notifies the client that the frame created a Keygen element. - virtual void didUseKeygen() {} - virtual WebCookieJar* cookieJar() const = 0; virtual void didChangeName(const String& name, const String& uniqueName) {}
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp index ba68026e..460fa435 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeUpdateTests.cpp
@@ -11,6 +11,8 @@ // Tests covering incremental updates of paint property trees. class PaintPropertyTreeUpdateTest : public PaintPropertyTreeBuilderTest {}; +INSTANTIATE_TEST_CASE_P(All, PaintPropertyTreeUpdateTest, ::testing::Bool()); + TEST_P(PaintPropertyTreeUpdateTest, ThreadedScrollingDisabledMainThreadScrollReason) { setBodyInnerHTML(
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLandingPage.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLandingPage.js index 3f46bef..1187d0da 100644 --- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLandingPage.js +++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineLandingPage.js
@@ -11,6 +11,8 @@ this._tabbedPane = new UI.TabbedPane(); this._tabbedPane.setTabSlider(true); this._tabbedPane.renderWithNoHeaderBackground(); + this._currentTabSetting = Common.settings.createSetting( + 'performanceLandingPageTab', Timeline.TimelineLandingPage.PageId.Basic); var tab = new Timeline.TimelineLandingPage.PerspectiveTabWidget(); tab.appendDescription(Common.UIString( @@ -21,7 +23,7 @@ tab.appendDescription(Common.UIString( 'The basic profile collects network, JavaScript and browser activity as you interact with the page.')); tab.appendOption(config.screenshots, true); - this._tabbedPane.appendTab('basic', Common.UIString('Basic'), tab); + this._tabbedPane.appendTab(Timeline.TimelineLandingPage.PageId.Basic, Common.UIString('Basic'), tab); tab = new Timeline.TimelineLandingPage.PerspectiveTabWidget(); tab.appendDescription(Common.UIString( @@ -31,9 +33,10 @@ tab.appendOption(config.screenshots, true); tab.appendOption(config.javascript, true); tab.appendOption(config.paints, false); - this._tabbedPane.appendTab('advanced', Common.UIString('Advanced'), tab); + this._tabbedPane.appendTab(Timeline.TimelineLandingPage.PageId.Advanced, Common.UIString('Advanced'), tab); this._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, this._tabSelected, this); + this._tabbedPane.selectTab(this._currentTabSetting.get()); this._tabbedPane.show(this.contentElement); /** @@ -48,6 +51,7 @@ _tabSelected() { const tabWidget = /** @type {!Timeline.TimelineLandingPage.PerspectiveTabWidget} */ (this._tabbedPane.visibleView); + this._currentTabSetting.set(this._tabbedPane.selectedTabId); tabWidget.activate(); } }; @@ -79,6 +83,12 @@ } }; +/** @enum {string} */ +Timeline.TimelineLandingPage.PageId = { + Basic: 'Basic', + Advanced: 'Advanced' +}; + Timeline.TimelineLandingPage.PerspectiveTabWidget = class extends UI.VBox { constructor() { super(false);
diff --git a/third_party/WebKit/Source/modules/sensor/BUILD.gn b/third_party/WebKit/Source/modules/sensor/BUILD.gn index 6f59d028..8bc2ebb 100644 --- a/third_party/WebKit/Source/modules/sensor/BUILD.gn +++ b/third_party/WebKit/Source/modules/sensor/BUILD.gn
@@ -32,8 +32,8 @@ "SensorProxy.h", "SensorReading.cpp", "SensorReading.h", - "SensorReadingUpdater.cpp", - "SensorReadingUpdater.h", + "SensorUpdateNotificationStrategy.cpp", + "SensorUpdateNotificationStrategy.h", ] deps = [
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp index 85d932d..62e2a5c 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -13,6 +13,7 @@ #include "modules/sensor/SensorErrorEvent.h" #include "modules/sensor/SensorProviderProxy.h" #include "modules/sensor/SensorReading.h" +#include "modules/sensor/SensorUpdateNotificationStrategy.h" using namespace device::mojom::blink; @@ -25,8 +26,7 @@ : ContextLifecycleObserver(executionContext), m_sensorOptions(sensorOptions), m_type(type), - m_state(Sensor::SensorState::Idle), - m_lastUpdateTimestamp(0.0) { + m_state(Sensor::SensorState::Idle) { // Check secure context. String errorMessage; if (!executionContext->isSecureContext(errorMessage)) { @@ -77,7 +77,7 @@ InvalidStateError, "The Sensor is no longer associated to a frame."); return; } - m_lastUpdateTimestamp = WTF::monotonicallyIncreasingTime(); + startListening(); } @@ -164,7 +164,7 @@ m_sensorProxy = provider->getSensorProxy(m_type); if (!m_sensorProxy) { - m_sensorProxy = provider->createSensorProxy(m_type, document, + m_sensorProxy = provider->createSensorProxy(m_type, document->page(), createSensorReadingFactory()); } } @@ -182,15 +182,10 @@ startListening(); } -void Sensor::onSensorReadingChanged(double timestamp) { - if (m_state != Sensor::SensorState::Activated) - return; - - DCHECK_GT(m_configuration->frequency, 0.0); - double period = 1 / m_configuration->frequency; - if (timestamp - m_lastUpdateTimestamp >= period) { - m_lastUpdateTimestamp = timestamp; - notifySensorReadingChanged(); +void Sensor::onSensorReadingChanged() { + if (m_state == Sensor::SensorState::Activated) { + DCHECK(m_sensorUpdateNotifier); + m_sensorUpdateNotifier->onSensorReadingChanged(); } } @@ -198,6 +193,8 @@ const String& sanitizedMessage, const String& unsanitizedMessage) { reportError(code, sanitizedMessage, unsanitizedMessage); + if (m_sensorUpdateNotifier) + m_sensorUpdateNotifier->cancelPendingNotifications(); } void Sensor::onStartRequestCompleted(bool result) { @@ -211,6 +208,13 @@ return; } + DCHECK(m_configuration); + DCHECK(m_sensorProxy); + auto updateCallback = + WTF::bind(&Sensor::onSensorUpdateNotification, wrapWeakPersistent(this)); + DCHECK_GT(m_configuration->frequency, 0); + m_sensorUpdateNotifier = SensorUpdateNotificationStrategy::create( + m_configuration->frequency, std::move(updateCallback)); updateState(Sensor::SensorState::Activated); } @@ -241,6 +245,9 @@ DCHECK(m_sensorProxy); updateState(Sensor::SensorState::Idle); + if (m_sensorUpdateNotifier) + m_sensorUpdateNotifier->cancelPendingNotifications(); + if (m_sensorProxy->isInitialized()) { DCHECK(m_configuration); m_sensorProxy->removeConfiguration(m_configuration->Clone()); @@ -248,16 +255,31 @@ m_sensorProxy->removeObserver(this); } +void Sensor::onSensorUpdateNotification() { + if (m_state != Sensor::SensorState::Activated) + return; + + DCHECK(m_sensorProxy); + DCHECK(m_sensorProxy->isInitialized()); + DCHECK(m_sensorProxy->sensorReading()); + + if (getExecutionContext() && + m_sensorProxy->sensorReading()->isReadingUpdated(m_storedData)) { + getExecutionContext()->postTask( + TaskType::Sensor, BLINK_FROM_HERE, + createSameThreadTask(&Sensor::notifySensorReadingChanged, + wrapWeakPersistent(this))); + } + + m_storedData = m_sensorProxy->sensorReading()->data(); +} + void Sensor::updateState(Sensor::SensorState newState) { if (newState == m_state) return; if (newState == SensorState::Activated && getExecutionContext()) { DCHECK_EQ(SensorState::Activating, m_state); - // The initial value for m_lastUpdateTimestamp is set to current time, - // so that the first reading update will be notified considering the given - // frequency hint. - m_lastUpdateTimestamp = WTF::monotonicallyIncreasingTime(); getExecutionContext()->postTask( TaskType::Sensor, BLINK_FROM_HERE, createSameThreadTask(&Sensor::notifyOnActivate, @@ -281,14 +303,13 @@ } } -void Sensor::notifySensorReadingChanged() { - DCHECK(m_sensorProxy); - DCHECK(m_sensorProxy->sensorReading()); +void Sensor::onSuspended() { + if (m_sensorUpdateNotifier) + m_sensorUpdateNotifier->cancelPendingNotifications(); +} - if (m_sensorProxy->sensorReading()->isReadingUpdated(m_storedData)) { - m_storedData = m_sensorProxy->sensorReading()->data(); - dispatchEvent(Event::create(EventTypeNames::change)); - } +void Sensor::notifySensorReadingChanged() { + dispatchEvent(Event::create(EventTypeNames::change)); } void Sensor::notifyOnActivate() {
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h index b599797..1e2e7ef 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.h +++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -20,6 +20,7 @@ class ExceptionState; class ExecutionContext; class SensorReading; +class SensorUpdateNotificationStrategy; class Sensor : public EventTargetWithInlineData, public ActiveScriptWrappable<Sensor>, @@ -82,10 +83,11 @@ // SensorController::Observer overrides. void onSensorInitialized() override; - void onSensorReadingChanged(double timestamp) override; + void onSensorReadingChanged() override; void onSensorError(ExceptionCode, const String& sanitizedMessage, const String& unsanitizedMessage) override; + void onSuspended() override; void onStartRequestCompleted(bool); void onStopRequestCompleted(bool); @@ -93,6 +95,8 @@ void startListening(); void stopListening(); + void onSensorUpdateNotification(); + void updateState(SensorState newState); void reportError(ExceptionCode = UnknownError, const String& sanitizedMessage = String(), @@ -107,9 +111,9 @@ device::mojom::blink::SensorType m_type; SensorState m_state; Member<SensorProxy> m_sensorProxy; + std::unique_ptr<SensorUpdateNotificationStrategy> m_sensorUpdateNotifier; device::SensorReading m_storedData; SensorConfigurationPtr m_configuration; - double m_lastUpdateTimestamp; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp index 603e3e2..20d7679 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp +++ b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.cpp
@@ -56,12 +56,12 @@ SensorProxy* SensorProviderProxy::createSensorProxy( device::mojom::blink::SensorType type, - Document* document, + Page* page, std::unique_ptr<SensorReadingFactory> readingFactory) { DCHECK(!getSensorProxy(type)); SensorProxy* sensor = - new SensorProxy(type, this, document, std::move(readingFactory)); + new SensorProxy(type, this, page, std::move(readingFactory)); m_sensorProxies.add(sensor); return sensor;
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h index 6cb2293a..e9c7701 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h +++ b/third_party/WebKit/Source/modules/sensor/SensorProviderProxy.h
@@ -13,7 +13,7 @@ namespace blink { -class Document; +class Page; class SensorProxy; class SensorReadingFactory; @@ -31,7 +31,7 @@ ~SensorProviderProxy(); SensorProxy* createSensorProxy(device::mojom::blink::SensorType, - Document*, + Page*, std::unique_ptr<SensorReadingFactory>); 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 0aad49f4..632a04d 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp +++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.cpp
@@ -4,11 +4,9 @@ #include "modules/sensor/SensorProxy.h" -#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,18 +16,18 @@ SensorProxy::SensorProxy(SensorType sensorType, SensorProviderProxy* provider, - Document* document, + Page* page, std::unique_ptr<SensorReadingFactory> readingFactory) - : PageVisibilityObserver(document->page()), + : PageVisibilityObserver(page), m_type(sensorType), m_mode(ReportingMode::CONTINUOUS), m_provider(provider), m_clientBinding(this), m_state(SensorProxy::Uninitialized), m_suspended(false), - m_document(document), m_readingFactory(std::move(readingFactory)), - m_maximumFrequency(0.0) {} + m_maximumFrequency(0.0), + m_timer(this, &SensorProxy::onTimerFired) {} SensorProxy::~SensorProxy() {} @@ -38,8 +36,6 @@ } DEFINE_TRACE(SensorProxy) { - visitor->trace(m_document); - visitor->trace(m_readingUpdater); visitor->trace(m_reading); visitor->trace(m_observers); visitor->trace(m_provider); @@ -71,10 +67,6 @@ m_type, mojo::MakeRequest(&m_sensor), callback); } -bool SensorProxy::isActive() const { - return isInitialized() && !m_suspended && !m_frequenciesUsed.isEmpty(); -} - void SensorProxy::addConfiguration( SensorConfigurationPtr configuration, std::unique_ptr<Function<void(bool)>> callback) { @@ -101,6 +93,12 @@ m_sensor->Suspend(); m_suspended = true; + + if (usesPollingTimer()) + updatePollingStatus(); + + for (Observer* observer : m_observers) + observer->onSuspended(); } void SensorProxy::resume() { @@ -111,8 +109,8 @@ m_sensor->Resume(); m_suspended = false; - if (isActive()) - m_readingUpdater->start(); + if (usesPollingTimer()) + updatePollingStatus(); } const SensorConfiguration* SensorProxy::defaultConfig() const { @@ -120,6 +118,10 @@ return m_defaultConfig.get(); } +bool SensorProxy::usesPollingTimer() const { + return isInitialized() && (m_mode == ReportingMode::CONTINUOUS); +} + void SensorProxy::updateSensorReading() { DCHECK(isInitialized()); DCHECK(m_readingFactory); @@ -134,14 +136,9 @@ } m_reading = m_readingFactory->createSensorReading(readingData); -} -void SensorProxy::notifySensorChanged(double timestamp) { - // This notification leads to sync 'onchange' event sending, so - // we must cache m_observers as it can be modified within event handlers. - auto copy = m_observers; - for (Observer* observer : copy) - observer->onSensorReadingChanged(timestamp); + for (Observer* observer : m_observers) + observer->onSensorReadingChanged(); } void SensorProxy::RaiseError() { @@ -150,8 +147,7 @@ void SensorProxy::SensorReadingChanged() { DCHECK_EQ(ReportingMode::ON_CHANGE, m_mode); - if (isActive()) - m_readingUpdater->start(); + updateSensorReading(); } void SensorProxy::pageVisibilityChanged() { @@ -173,9 +169,12 @@ return; } - m_state = Uninitialized; - m_frequenciesUsed.clear(); + if (usesPollingTimer()) { // Stop polling. + m_frequenciesUsed.clear(); + updatePollingStatus(); + } + m_state = Uninitialized; // The m_sensor.reset() will release all callbacks and its bound parameters, // therefore, handleSensorError accepts messages by value. m_sensor.reset(); @@ -229,10 +228,7 @@ m_sensor.set_connection_error_handler( convertToBaseCallback(std::move(errorCallback))); - m_readingUpdater = SensorReadingUpdater::create(this, m_mode); - m_state = Initialized; - for (Observer* observer : m_observers) observer->onSensorInitialized(); } @@ -241,11 +237,9 @@ double frequency, std::unique_ptr<Function<void(bool)>> callback, bool result) { - if (result) { + if (usesPollingTimer() && result) { m_frequenciesUsed.append(frequency); - std::sort(m_frequenciesUsed.begin(), m_frequenciesUsed.end()); - if (isActive()) - m_readingUpdater->start(); + updatePollingStatus(); } (*callback)(result); @@ -256,6 +250,9 @@ if (!result) DVLOG(1) << "Failure at sensor configuration removal"; + if (!usesPollingTimer()) + return; + size_t index = m_frequenciesUsed.find(frequency); if (index == kNotFound) { // Could happen e.g. if 'handleSensorError' was called before. @@ -263,6 +260,7 @@ } m_frequenciesUsed.remove(index); + updatePollingStatus(); } bool SensorProxy::tryReadFromBuffer(device::SensorReading& result) { @@ -278,4 +276,28 @@ return true; } +void SensorProxy::updatePollingStatus() { + DCHECK(usesPollingTimer()); + + if (m_suspended || m_frequenciesUsed.isEmpty()) { + m_timer.stop(); + return; + } + // TODO(Mikhail): Consider using sorted queue instead of searching + // max element each time. + auto it = + std::max_element(m_frequenciesUsed.begin(), m_frequenciesUsed.end()); + DCHECK_GT(*it, 0.0); + + double repeatInterval = 1 / *it; + if (!m_timer.isActive() || m_timer.repeatInterval() != repeatInterval) { + updateSensorReading(); + m_timer.startRepeating(repeatInterval, BLINK_FROM_HERE); + } +} + +void SensorProxy::onTimerFired(TimerBase*) { + updateSensorReading(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/SensorProxy.h b/third_party/WebKit/Source/modules/sensor/SensorProxy.h index 3787ef84..3243636 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorProxy.h +++ b/third_party/WebKit/Source/modules/sensor/SensorProxy.h
@@ -12,6 +12,7 @@ #include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" #include "mojo/public/cpp/bindings/binding.h" #include "platform/Supplementable.h" +#include "platform/Timer.h" #include "platform/heap/Handle.h" #include "wtf/Vector.h" @@ -20,7 +21,6 @@ class SensorProviderProxy; class SensorReading; class SensorReadingFactory; -class SensorReadingUpdater; // This class wraps 'Sensor' mojo interface and used by multiple // JS sensor instances of the same type (within a single frame). @@ -38,16 +38,13 @@ // methods can be called. virtual void onSensorInitialized() {} // Platfrom sensort reading has changed. - // |timestamp| Reference timestamp in seconds of the moment when - // sensor reading was updated from the buffer. - // Note: |timestamp| values are only used to calculate elapsed time - // between shared buffer readings. These values *do not* correspond - // to sensor reading timestamps which are obtained on platform side. - virtual void onSensorReadingChanged(double timestamp) {} + virtual void onSensorReadingChanged() {} // An error has occurred. virtual void onSensorError(ExceptionCode, const String& sanitizedMessage, const String& unsanitizedMessage) {} + // Sensor reading change notification is suspended. + virtual void onSuspended() {} }; ~SensorProxy(); @@ -62,10 +59,6 @@ bool isInitializing() const { return m_state == Initializing; } bool isInitialized() const { return m_state == Initialized; } - // Is watching new reading data (initialized, not suspended and has - // configurations added). - bool isActive() const; - void addConfiguration(device::mojom::blink::SensorConfigurationPtr, std::unique_ptr<Function<void(bool)>>); @@ -86,25 +79,20 @@ double maximumFrequency() const { return m_maximumFrequency; } - Document* document() const { return m_document; } - const WTF::Vector<double>& frequenciesUsed() const { - return m_frequenciesUsed; - } - DECLARE_VIRTUAL_TRACE(); private: friend class SensorProviderProxy; - friend class SensorReadingUpdaterContinuous; - friend class SensorReadingUpdaterOnChange; SensorProxy(device::mojom::blink::SensorType, SensorProviderProxy*, - Document*, + Page*, std::unique_ptr<SensorReadingFactory>); + // Returns true if this instance is using polling timer to + // periodically fetch reading data from shared buffer. + bool usesPollingTimer() const; // Updates sensor reading from shared buffer. void updateSensorReading(); - void notifySensorChanged(double timestamp); // device::mojom::blink::SensorClient overrides. void RaiseError() override; @@ -128,7 +116,8 @@ void onRemoveConfigurationCompleted(double frequency, bool result); bool tryReadFromBuffer(device::SensorReading& result); - void onAnimationFrame(double timestamp); + void updatePollingStatus(); + void onTimerFired(TimerBase*); device::mojom::blink::SensorType m_type; device::mojom::blink::ReportingMode m_mode; @@ -145,14 +134,13 @@ mojo::ScopedSharedBufferHandle m_sharedBufferHandle; mojo::ScopedSharedBufferMapping m_sharedBuffer; bool m_suspended; - Member<Document> m_document; Member<SensorReading> m_reading; std::unique_ptr<SensorReadingFactory> m_readingFactory; double m_maximumFrequency; - Member<SensorReadingUpdater> m_readingUpdater; + // Used for continious reporting mode. + Timer<SensorProxy> m_timer; WTF::Vector<double> m_frequenciesUsed; - double m_lastRafTimestamp; using ReadingBuffer = device::SensorReadingSharedBuffer; static_assert(
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp deleted file mode 100644 index 3d35f7da..0000000 --- a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.cpp +++ /dev/null
@@ -1,112 +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/SensorReadingUpdater.h" - -#include "core/dom/Document.h" -#include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" -#include "modules/sensor/SensorProxy.h" -#include "wtf/CurrentTime.h" - -using device::mojom::blink::ReportingMode; - -namespace blink { - -SensorReadingUpdater::SensorReadingUpdater(SensorProxy* sensorProxy) - : m_sensorProxy(sensorProxy), m_hasPendingAnimationFrameTask(false) {} - -void SensorReadingUpdater::enqueueAnimationFrameTask() { - if (m_hasPendingAnimationFrameTask) - return; - - auto callback = WTF::bind(&SensorReadingUpdater::onAnimationFrame, - wrapWeakPersistent(this)); - m_sensorProxy->document()->enqueueAnimationFrameTask(std::move(callback)); - m_hasPendingAnimationFrameTask = true; -} - -void SensorReadingUpdater::start() { - enqueueAnimationFrameTask(); -} - -void SensorReadingUpdater::onAnimationFrame() { - m_hasPendingAnimationFrameTask = false; - onAnimationFrameInternal(); -} - -DEFINE_TRACE(SensorReadingUpdater) { - visitor->trace(m_sensorProxy); -} - -class SensorReadingUpdaterContinuous : public SensorReadingUpdater { - public: - explicit SensorReadingUpdaterContinuous(SensorProxy* sensorProxy) - : SensorReadingUpdater(sensorProxy) {} - - DEFINE_INLINE_VIRTUAL_TRACE() { SensorReadingUpdater::trace(visitor); } - - protected: - void onAnimationFrameInternal() override { - if (!m_sensorProxy->isActive()) - return; - - m_sensorProxy->updateSensorReading(); - m_sensorProxy->notifySensorChanged(WTF::monotonicallyIncreasingTime()); - enqueueAnimationFrameTask(); - } -}; - -// New data is fetched from shared buffer only once after 'start()' -// call. Further, notification is send until every client is updated -// (i.e. until longest notification period elapses) rAF stops after that. -class SensorReadingUpdaterOnChange : public SensorReadingUpdater { - public: - explicit SensorReadingUpdaterOnChange(SensorProxy* sensorProxy) - : SensorReadingUpdater(sensorProxy), - m_newDataArrivedTime(0.0), - m_newDataArrived(false) {} - - DEFINE_INLINE_VIRTUAL_TRACE() { SensorReadingUpdater::trace(visitor); } - - void start() override { - m_newDataArrived = true; - SensorReadingUpdater::start(); - } - - protected: - void onAnimationFrameInternal() override { - if (!m_sensorProxy->isActive()) - return; - - double timestamp = WTF::monotonicallyIncreasingTime(); - - if (m_newDataArrived) { - m_newDataArrived = false; - m_sensorProxy->updateSensorReading(); - m_newDataArrivedTime = timestamp; - } - m_sensorProxy->notifySensorChanged(timestamp); - - DCHECK_GT(m_sensorProxy->frequenciesUsed().front(), 0.0); - double longestNotificationPeriod = - 1 / m_sensorProxy->frequenciesUsed().front(); - - if (timestamp - m_newDataArrivedTime <= longestNotificationPeriod) - enqueueAnimationFrameTask(); - } - - private: - double m_newDataArrivedTime; - bool m_newDataArrived; -}; - -// static -SensorReadingUpdater* SensorReadingUpdater::create(SensorProxy* proxy, - ReportingMode mode) { - if (mode == ReportingMode::CONTINUOUS) - return new SensorReadingUpdaterContinuous(proxy); - return new SensorReadingUpdaterOnChange(proxy); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h deleted file mode 100644 index fa28150..0000000 --- a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h +++ /dev/null
@@ -1,39 +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 SensorReadingUpdater_h -#define SensorReadingUpdater_h - -#include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" -#include "platform/heap/Handle.h" - -namespace blink { - -class SensorProxy; - -// This class encapsulates sensor reading update notification logic. -class SensorReadingUpdater : public GarbageCollected<SensorProxy> { - public: - static SensorReadingUpdater* create(SensorProxy*, - device::mojom::blink::ReportingMode); - - virtual void start(); - - DECLARE_VIRTUAL_TRACE(); - - protected: - explicit SensorReadingUpdater(SensorProxy*); - void enqueueAnimationFrameTask(); - virtual void onAnimationFrameInternal() = 0; - - Member<SensorProxy> m_sensorProxy; - bool m_hasPendingAnimationFrameTask; - - private: - void onAnimationFrame(); -}; - -} // namespace blink - -#endif // SensorReadingUpdater_h
diff --git a/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp b/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp new file mode 100644 index 0000000..1482398 --- /dev/null +++ b/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.cpp
@@ -0,0 +1,85 @@ +// 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/SensorUpdateNotificationStrategy.h" + +#include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h" +#include "platform/Timer.h" +#include "wtf/CurrentTime.h" + +namespace blink { + +// Polls the buffer on signal from platform but not more frequently +// than the given 'pollingPeriod'. +class SensorUpdateNotificationStrategyImpl + : public SensorUpdateNotificationStrategy { + public: + SensorUpdateNotificationStrategyImpl(double frequency, + std::unique_ptr<Function<void()>> func) + : m_pollingPeriod(1 / frequency), + m_func(std::move(func)), + m_timer(this, &SensorUpdateNotificationStrategyImpl::onTimer), + m_lastPollingTimestamp(0.0) { + DCHECK_GT(frequency, 0.0); + DCHECK(m_func); + } + + private: + // SensorUpdateNotificationStrategy overrides. + void onSensorReadingChanged() override; + void cancelPendingNotifications() override; + + void onTimer(TimerBase*); + void notifyUpdate(); + + double m_pollingPeriod; + std::unique_ptr<Function<void()>> m_func; + Timer<SensorUpdateNotificationStrategyImpl> m_timer; + double m_lastPollingTimestamp; +}; + +void SensorUpdateNotificationStrategyImpl::onSensorReadingChanged() { + if (m_timer.isActive()) + return; // Skipping changes if update notification was already sheduled. + + double elapsedTime = + WTF::monotonicallyIncreasingTime() - m_lastPollingTimestamp; + + double waitingTime = m_pollingPeriod - elapsedTime; + const double minInterval = + 1 / device::mojom::blink::SensorConfiguration::kMaxAllowedFrequency; + + // Negative or zero 'waitingTime' means that polling period has elapsed. + // We also avoid scheduling if the elapsed time is slightly behind the + // polling period. + if (waitingTime < minInterval) { + notifyUpdate(); + } else { + m_timer.startOneShot(waitingTime, BLINK_FROM_HERE); + } +} + +void SensorUpdateNotificationStrategyImpl::cancelPendingNotifications() { + m_timer.stop(); +} + +void SensorUpdateNotificationStrategyImpl::notifyUpdate() { + m_lastPollingTimestamp = WTF::monotonicallyIncreasingTime(); + (*m_func)(); +} + +void SensorUpdateNotificationStrategyImpl::onTimer(TimerBase*) { + notifyUpdate(); +} + +// static +std::unique_ptr<SensorUpdateNotificationStrategy> +SensorUpdateNotificationStrategy::create( + double pollingPeriod, + std::unique_ptr<Function<void()>> func) { + return std::unique_ptr<SensorUpdateNotificationStrategy>( + new SensorUpdateNotificationStrategyImpl(pollingPeriod, std::move(func))); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h b/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h new file mode 100644 index 0000000..720e9a1 --- /dev/null +++ b/third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h
@@ -0,0 +1,29 @@ +// 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 SensorUpdateNotificationStrategy_h +#define SensorUpdateNotificationStrategy_h + +#include "wtf/Functional.h" + +namespace blink { + +// This class encapsulates sensor reading update notification logic: +// the callback is invoked after client calls 'onSensorReadingChanged()' +// however considering the given sample frequency: +// guaranteed not to be called more often than expected. +class SensorUpdateNotificationStrategy { + public: + static std::unique_ptr<SensorUpdateNotificationStrategy> create( + double frequency, + std::unique_ptr<Function<void()>>); + + virtual void onSensorReadingChanged() = 0; + virtual void cancelPendingNotifications() = 0; + virtual ~SensorUpdateNotificationStrategy() {} +}; + +} // namespace blink + +#endif // SensorUpdateNotificationStrategy_h
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp index 5540d70..b0525083 100644 --- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp +++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp
@@ -7,7 +7,9 @@ #include "platform/SharedBuffer.h" #include "platform/image-decoders/ImageDecoderTestHelpers.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkImage.h" +#include "third_party/skia/include/core/SkSurface.h" #include "wtf/RefPtr.h" #include <memory> @@ -19,8 +21,8 @@ * SkImage* imageA = decoder.createFrameAtIndex(0); * // supply more (but not all) data to the decoder * SkImage* imageB = decoder.createFrameAtIndex(laterFrame); - * imageB->preroll(); - * imageA->preroll(); + * draw(imageB); + * draw(imageA); * * This results in using the same ImageDecoder (in the ImageDecodingStore) to * decode less data the second time. This test ensures that it is safe to do @@ -49,8 +51,11 @@ decoder->setData(almostCompleteFile, false); sk_sp<SkImage> imageWithMoreData = decoder->createFrameAtIndex(laterFrame); - imageWithMoreData->preroll(); - partialImage->preroll(); + // we now want to ensure we don't crash if we access these in this order + SkImageInfo info = SkImageInfo::MakeN32Premul(10, 10); + sk_sp<SkSurface> surf = SkSurface::MakeRaster(info); + surf->getCanvas()->drawImage(imageWithMoreData, 0, 0); + surf->getCanvas()->drawImage(partialImage, 0, 0); } TEST(DeferredImageDecoderTestWoPlatform, mixImagesGif) {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.cpp b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.cpp index 382151d..4c5c8c8 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.cpp
@@ -25,9 +25,9 @@ String EffectPaintPropertyNode::toString() const { return String::format( - "localTransformSpace=%p outputClip=%p opacity=%f filter=%s", + "localTransformSpace=%p outputClip=%p opacity=%f filter=%s blendMode=%s", m_localTransformSpace.get(), m_outputClip.get(), m_opacity, - m_filter.toString().ascii().data()); + m_filter.toString().ascii().data(), SkBlendMode_Name(m_blendMode)); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp index f5c37e32..accb40e3 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.cpp
@@ -21,10 +21,12 @@ MainThreadScrollingReason::mainThreadScrollingReasonsAsText( m_mainThreadScrollingReasons); return String::format( - "scrollOffsetTranslation=%s clip=%s bounds=%s " - "mainThreadScrollingReasons=%s", + "scrollOffsetTranslation=%s clip=%s bounds=%s userScrollableHorizontal=%s" + " userScrollableVertical=%s mainThreadScrollingReasons=%s", scrollOffset.toString().ascii().data(), m_clip.toString().ascii().data(), m_bounds.toString().ascii().data(), + m_userScrollableHorizontal ? "yes" : "no", + m_userScrollableVertical ? "yes" : "no", mainThreadScrollingReasonsAsText.c_str()); }
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp index c4e74c4..5d780754 100644 --- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp +++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp
@@ -291,11 +291,6 @@ m_webFrame->contentSettingsClient()->didNotAllowPlugins(); } -void FrameLoaderClientImpl::didUseKeygen() { - if (m_webFrame->contentSettingsClient()) - m_webFrame->contentSettingsClient()->didUseKeygen(); -} - bool FrameLoaderClientImpl::hasWebView() const { return m_webFrame->viewImpl(); }
diff --git a/third_party/WebKit/Source/web/FrameLoaderClientImpl.h b/third_party/WebKit/Source/web/FrameLoaderClientImpl.h index 2a8ba08..2fc1deb 100644 --- a/third_party/WebKit/Source/web/FrameLoaderClientImpl.h +++ b/third_party/WebKit/Source/web/FrameLoaderClientImpl.h
@@ -178,7 +178,6 @@ void passiveInsecureContentFound(const KURL&) override; void didNotAllowScript() override; void didNotAllowPlugins() override; - void didUseKeygen() override; WebCookieJar* cookieJar() const override; void frameFocused() const override;
diff --git a/third_party/WebKit/public/platform/Platform.h b/third_party/WebKit/public/platform/Platform.h index 4264a4cd..0aae60e68 100644 --- a/third_party/WebKit/public/platform/Platform.h +++ b/third_party/WebKit/public/platform/Platform.h
@@ -286,20 +286,6 @@ // hash must have been generated by calling VisitedLinkHash(). virtual bool isLinkVisited(unsigned long long linkHash) { return false; } - // Keygen -------------------------------------------------------------- - - // Handle the <keygen> tag for generating client certificates - // Returns a base64 encoded signed copy of a public key from a newly - // generated key pair and the supplied challenge string. keySizeindex - // specifies the strength of the key. - virtual WebString signedPublicKeyAndChallengeString( - unsigned keySizeIndex, - const WebString& challenge, - const WebURL& url, - const WebURL& topOrigin) { - return WebString(); - } - // Same as above, but always returns actual value, without any caches. virtual size_t actualMemoryUsageMB() { return 0; }
diff --git a/third_party/WebKit/public/platform/WebLocalizedString.h b/third_party/WebKit/public/platform/WebLocalizedString.h index 766bbdcd..a6432984 100644 --- a/third_party/WebKit/public/platform/WebLocalizedString.h +++ b/third_party/WebKit/public/platform/WebLocalizedString.h
@@ -104,8 +104,6 @@ FileButtonChooseMultipleFilesLabel, FileButtonNoFileSelectedLabel, InputElementAltText, - KeygenMenuHighGradeKeySize, - KeygenMenuMediumGradeKeySize, MissingPluginText, MultipleFileUploadText, OtherColorLabel,
diff --git a/third_party/WebKit/public/web/WebContentSettingsClient.h b/third_party/WebKit/public/web/WebContentSettingsClient.h index c50f059..933c372 100644 --- a/third_party/WebKit/public/web/WebContentSettingsClient.h +++ b/third_party/WebKit/public/web/WebContentSettingsClient.h
@@ -118,9 +118,6 @@ // were enabled. virtual void didNotAllowScript() {} - // Notifies the client that the frame instantiated a keygen element. - virtual void didUseKeygen() {} - virtual ~WebContentSettingsClient() {} };
diff --git a/third_party/glslang-angle/README.chromium b/third_party/glslang-angle/README.chromium new file mode 100644 index 0000000..d811e31 --- /dev/null +++ b/third_party/glslang-angle/README.chromium
@@ -0,0 +1,10 @@ +Name: Khronos reference front-end for GLSL and ESSL +Short Name: glslang +URL: https://github.com/google/glslang +Version: unknown +Security Critical: yes +License: MIT +License File: LICENSE + +Description: +An OpenGL and OpenGL ES shader front end and validator.
diff --git a/third_party/libdrm/BUILD.gn b/third_party/libdrm/BUILD.gn index 8e2b518..7f040070 100644 --- a/third_party/libdrm/BUILD.gn +++ b/third_party/libdrm/BUILD.gn
@@ -10,7 +10,7 @@ # library shipped with the system. In release builds of Chrome OS we # use the system version, but when building on dev workstations we # bundle it because Ubuntu doesn't ship a usable version. - use_system_libdrm = true + use_system_libdrm = false } if (!use_system_libdrm) {
diff --git a/third_party/libdrm/OWNERS b/third_party/libdrm/OWNERS index 3690db3..2150aae 100644 --- a/third_party/libdrm/OWNERS +++ b/third_party/libdrm/OWNERS
@@ -1,2 +1,3 @@ dcastagna@chromium.org +hoegsberg@chromium.org reveman@chromium.org \ No newline at end of file
diff --git a/third_party/minigbm/BUILD.gn b/third_party/minigbm/BUILD.gn index f0eb520..d8c2e92 100644 --- a/third_party/minigbm/BUILD.gn +++ b/third_party/minigbm/BUILD.gn
@@ -33,6 +33,7 @@ "src/i915.c", "src/marvell.c", "src/mediatek.c", + "src/nouveau.c", "src/rockchip.c", "src/tegra.c", "src/udl.c",
diff --git a/third_party/spirv-headers/README.chromium b/third_party/spirv-headers/README.chromium new file mode 100644 index 0000000..f7df74e --- /dev/null +++ b/third_party/spirv-headers/README.chromium
@@ -0,0 +1,14 @@ +Name: SPIR-V Headers +Short Name: spirv-headers +URL: https://github.com/KhronosGroup/SPIRV-Headers.git +Version: unknown +Security Critical: yes +License: MIT +License File: LICENSE + +Description: +This repository contains machine-readable files from the SPIR-V Registry. This includes: + +* Header files for various languages. +* JSON files describing the grammar for the SPIR-V core instruction set, and for the GLSL.std.450 extended instruction set. +* The XML registry file.
diff --git a/third_party/spirv-tools-angle/README.chromium b/third_party/spirv-tools-angle/README.chromium new file mode 100644 index 0000000..a1ae667a --- /dev/null +++ b/third_party/spirv-tools-angle/README.chromium
@@ -0,0 +1,11 @@ +Name: SPIR-V Tools +Short Name: SPIRV-Tools +URL: https://github.com/KhronosGroup/SPIRV-Tools.git +Version: unknown +Security Critical: yes +License: MIT +License File: LICENSE + +Description: +The SPIR-V Tools project provides an API and commands for processing +SPIR-V modules.
diff --git a/third_party/vulkan-validation-layers/README.chromium b/third_party/vulkan-validation-layers/README.chromium new file mode 100644 index 0000000..f0d4711 --- /dev/null +++ b/third_party/vulkan-validation-layers/README.chromium
@@ -0,0 +1,17 @@ +Name: Vulkan Ecosystem Components +Short Name: Vulkan Layers SDK +Version: unknown +URL: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers +SOURCE CODE: git clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git +Date: 06/07/2016 +Revision: d9da90d92748c37962766868f8b0354637672c2a +Security Critical: no +License: Apache 2.0 +License File: LICENSE.txt + +Description: +The Vulkan Ecosystem Components consist of the Vulkan loader and Validation Layers SDK. The layers help +validate Vulkan programs at runtime for development, and the loader is a utility for loading the Vulkan +entry points and hooking them into the correct layers. These are essential for developing Vulkan +applications. +
diff --git a/tools/chrome_proxy/webdriver/common.py b/tools/chrome_proxy/webdriver/common.py index 53e0b09..381ba75ba 100644 --- a/tools/chrome_proxy/webdriver/common.py +++ b/tools/chrome_proxy/webdriver/common.py
@@ -163,26 +163,25 @@ """ self._OverrideChromeArgs() capabilities = { - 'loggingPrefs': {'performance': 'INFO'}, - 'chromeOptions': { - 'args': list(self._chrome_args) - } + 'loggingPrefs': {'performance': 'INFO'} } - if self._flags.android: - capabilities['chromeOptions'].update({ - 'androidPackage': self._flags.android_package, - }) - self._logger.debug('Will use Chrome on Android') - elif self._flags.chrome_exec: - capabilities['chrome.binary'] = self._flags.chrome_exec - self._logger.info('Using the Chrome binary at this path: %s', - self._flags.chrome_exec) + chrome_options = Options() + for arg in self._chrome_args: + chrome_options.add_argument(arg) self._logger.info('Starting Chrome with these flags: %s', str(self._chrome_args)) - self._logger.debug('Starting ChromeDriver with these capabilities: %s', - json.dumps(capabilities)) + if self._flags.android: + chrome_options.add_experimental_option('androidPackage', + self._flags.android_package) + self._logger.debug('Will use Chrome on Android') + elif self._flags.chrome_exec: + chrome_options.binary_location = self._flags.chrome_exec + self._logger.info('Using the Chrome binary at this path: %s', + self._flags.chrome_exec) + self._logger.debug('ChromeOptions will be parsed into these capabilities: ' + '%s', json.dumps(chrome_options.to_capabilities())) driver = webdriver.Chrome(executable_path=self._flags.chrome_driver, - desired_capabilities=capabilities) + desired_capabilities=capabilities, chrome_options=chrome_options) driver.command_executor._commands.update({ 'getAvailableLogTypes': ('GET', '/session/$sessionId/log/types'), 'getLog': ('POST', '/session/$sessionId/log')})
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp index e142dc2..3e18a280 100644 --- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp +++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -220,6 +220,7 @@ bool IsBlacklistedMethodName(llvm::StringRef name) { static const char* kBlacklistedNames[] = { + "hash", "lock", "unlock", "try_lock", "begin", "end", "rbegin", "rend", }; @@ -349,6 +350,7 @@ "error", "fileUtilities", "font", + "frameBlameContext", "iconURL", "inputMethodController", "inputType",
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc index e031993..08e99d3 100644 --- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc +++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -790,21 +790,14 @@ gesture_params.reset(params); break; } - case content::SyntheticGestureParams::GestureType::POINTER_ACTION: { - content::SyntheticPointerActionParams::PointerActionType action_type; - gfx::PointF position; - int index; - if (!FuzzParam(&action_type, fuzzer)) + case content::SyntheticGestureParams::GestureType::POINTER_ACTION_LIST: { + std::vector<content::SyntheticPointerActionListParams::ParamList> + param_list; + if (!FuzzParam(¶m_list, fuzzer)) return false; - if (!FuzzParam(&position, fuzzer)) - return false; - if (!FuzzParam(&index, fuzzer)) - return false; - content::SyntheticPointerActionParams* params = - new content::SyntheticPointerActionParams(); - params->set_pointer_action_type(action_type); - params->set_position(position); - params->set_index(index); + content::SyntheticPointerActionListParams* params = + new content::SyntheticPointerActionListParams(); + params->params = param_list; gesture_params.reset(params); break; }
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 0961d38..e2aa4a44 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -11320,6 +11320,7 @@ <description> Triggers when the default decision for using key generation is changed. </description> + <obsolete>Support for Keygen was removed.</obsolete> </action> <action name="Options_DefaultMIDISysExSettingChanged">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index efdd7bdb..63c46a9 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -7297,6 +7297,9 @@ </histogram> <histogram name="ContentSettings.DefaultKeygenSetting" enum="ContentSetting"> + <obsolete> + Support for keygen was removed. + </obsolete> <owner>svaldez@chromium.org</owner> <summary> The default setting for using key generation in forms at profile open. @@ -70009,6 +70012,9 @@ </histogram> <histogram name="UserCert.ContentDisposition" enum="UserCertContentDisposition"> + <obsolete> + Removed in M57. + </obsolete> <owner>rsleevi@chromium.org</owner> <owner>svaldez@chromium.org</owner> <summary> @@ -87193,7 +87199,7 @@ <int value="883" label="V8Performance_Navigation_AttributeGetter"/> <int value="884" label="V8Performance_Memory_AttributeGetter"/> <int value="885" label="V8SharedWorker_WorkerStart_AttributeGetter"/> - <int value="886" label="HTMLKeygenElement"/> + <int value="886" label="OBSOLETE_HTMLKeygenElement"/> <int value="887" label="V8SVGElement_OffsetParent_AttributeGetter"/> <int value="888" label="V8SVGElement_OffsetTop_AttributeGetter"/> <int value="889" label="V8SVGElement_OffsetLeft_AttributeGetter"/>
diff --git a/tools/valgrind/gtest_exclude/net_unittests.gtest.txt b/tools/valgrind/gtest_exclude/net_unittests.gtest.txt index df71748..e51393d 100644 --- a/tools/valgrind/gtest_exclude/net_unittests.gtest.txt +++ b/tools/valgrind/gtest_exclude/net_unittests.gtest.txt
@@ -1,6 +1,4 @@ # Very slow under Valgrind. -KeygenHandlerTest.*SmokeTest -KeygenHandlerTest.*ConcurrencyTest CTLogVerifierTest.VerifiesValidConsistencyProofsFromReferenceGenerator # Hangs, see http://crbug.com/61908
diff --git a/ui/base/test/material_design_controller_test_api.cc b/ui/base/test/material_design_controller_test_api.cc index 029af51..c02f674 100644 --- a/ui/base/test/material_design_controller_test_api.cc +++ b/ui/base/test/material_design_controller_test_api.cc
@@ -10,15 +10,23 @@ MaterialDesignControllerTestAPI::MaterialDesignControllerTestAPI( MaterialDesignController::Mode mode) : previous_mode_(MaterialDesignController::mode_), - previous_initialized_(MaterialDesignController::is_mode_initialized_) { + previous_initialized_(MaterialDesignController::is_mode_initialized_), + previous_include_secondary_ui_( + MaterialDesignController::include_secondary_ui_) { MaterialDesignController::SetMode(mode); } MaterialDesignControllerTestAPI::~MaterialDesignControllerTestAPI() { + MaterialDesignController::include_secondary_ui_ = + previous_include_secondary_ui_; MaterialDesignController::is_mode_initialized_ = previous_initialized_; MaterialDesignController::mode_ = previous_mode_; } +void MaterialDesignControllerTestAPI::SetSecondaryUiMaterial(bool value) { + MaterialDesignController::include_secondary_ui_ = value; +} + void MaterialDesignControllerTestAPI::Uninitialize() { MaterialDesignController::Uninitialize(); }
diff --git a/ui/base/test/material_design_controller_test_api.h b/ui/base/test/material_design_controller_test_api.h index 3eb53a3..09cbc67 100644 --- a/ui/base/test/material_design_controller_test_api.h +++ b/ui/base/test/material_design_controller_test_api.h
@@ -19,12 +19,17 @@ explicit MaterialDesignControllerTestAPI(MaterialDesignController::Mode mode); ~MaterialDesignControllerTestAPI(); + // Force the given |value| for IsSecondaryUiMaterial() for the lifetime of the + // test API. + void SetSecondaryUiMaterial(bool value); + // Wrapper functions for MaterialDesignController internal functions. static void Uninitialize(); private: const MaterialDesignController::Mode previous_mode_; const bool previous_initialized_; + const bool previous_include_secondary_ui_; DISALLOW_COPY_AND_ASSIGN(MaterialDesignControllerTestAPI); };
diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc index cee598d8..2b22a57 100644 --- a/ui/gfx/text_elider.cc +++ b/ui/gfx/text_elider.cc
@@ -778,7 +778,8 @@ icu::Locale::getDefault(), status)); if (U_FAILURE(status)) return string.substr(0, length - 1) + kElideString; - bi->setText(string.c_str()); + icu::UnicodeString bi_text(string.c_str()); + bi->setText(bi_text); index = bi->preceding(static_cast<int32_t>(length)); if (index == icu::BreakIterator::DONE || index == 0) { // We either found no valid word break at all, or one right at the
diff --git a/ui/login/account_picker/screen_account_picker.js b/ui/login/account_picker/screen_account_picker.js index 5044a3d..98234932 100644 --- a/ui/login/account_picker/screen_account_picker.js +++ b/ui/login/account_picker/screen_account_picker.js
@@ -225,8 +225,10 @@ bubble.style.visibility = 'hidden'; bubble.hidden = false; // Now we need the bubble to have the new content before calculating - // size. - bubble.replaceContent(error); + // size. Undefined |error| == reuse old content. + if (error !== undefined) + bubble.replaceContent(error); + // Get bubble size. var bubbleOffsetHeight = parseInt(bubble.offsetHeight); var bubbleOffsetWidth = parseInt(bubble.offsetWidth);
diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc index c3097bd4..8b131ee 100644 --- a/ui/views/mus/desktop_window_tree_host_mus.cc +++ b/ui/views/mus/desktop_window_tree_host_mus.cc
@@ -190,6 +190,10 @@ } DesktopWindowTreeHostMus::~DesktopWindowTreeHostMus() { + // The cursor-client can be accessed during WindowTreeHostMus tear-down. So + // the cursor-client needs to be unset on the root-window before + // |cursor_manager_| is destroyed. + aura::client::SetCursorClient(window(), nullptr); MusClient::Get()->RemoveObserver(this); aura::Env::GetInstance()->RemoveObserver(this); desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(this);
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 23c0aa0..3bdfede0 100644 --- a/ui/views/mus/desktop_window_tree_host_mus_unittest.cc +++ b/ui/views/mus/desktop_window_tree_host_mus_unittest.cc
@@ -5,6 +5,7 @@ #include "ui/views/mus/desktop_window_tree_host_mus.h" #include "base/memory/ptr_util.h" +#include "ui/aura/client/cursor_client.h" #include "ui/aura/window.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget.h" @@ -32,6 +33,32 @@ DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostMusTest); }; +class ExpectsNullCursorClientDuringTearDown : public aura::WindowObserver { + public: + explicit ExpectsNullCursorClientDuringTearDown(aura::Window* window) + : window_(window) { + window_->AddObserver(this); + } + + ~ExpectsNullCursorClientDuringTearDown() override { + EXPECT_FALSE(window_); + } + + private: + // aura::WindowObserver: + void OnWindowRemovingFromRootWindow(aura::Window* window, + aura::Window* new_root) override { + aura::client::CursorClient* cursor_client = + aura::client::GetCursorClient(window->GetRootWindow()); + EXPECT_FALSE(cursor_client); + window_->RemoveObserver(this); + window_ = nullptr; + } + + aura::Window* window_; + DISALLOW_COPY_AND_ASSIGN(ExpectsNullCursorClientDuringTearDown); +}; + TEST_F(DesktopWindowTreeHostMusTest, Visibility) { std::unique_ptr<Widget> widget(CreateWidget(nullptr)); EXPECT_FALSE(widget->IsVisible()); @@ -49,4 +76,16 @@ EXPECT_FALSE(widget->GetNativeView()->parent()->IsVisible()); } +TEST_F(DesktopWindowTreeHostMusTest, CursorClientDuringTearDown) { + std::unique_ptr<Widget> widget(CreateWidget(nullptr)); + widget->Show(); + + std::unique_ptr<aura::Window> window(new aura::Window(nullptr)); + window->Init(ui::LAYER_SOLID_COLOR); + ExpectsNullCursorClientDuringTearDown observer(window.get()); + + widget->GetNativeWindow()->AddChild(window.release()); + widget.reset(); +} + } // namespace views
diff --git a/ui/views/mus/mus_client.cc b/ui/views/mus/mus_client.cc index 575cf995..e01e1ff 100644 --- a/ui/views/mus/mus_client.cc +++ b/ui/views/mus/mus_client.cc
@@ -128,6 +128,7 @@ ViewsDelegate::NativeWidgetFactory()); } + base::DiscardableMemoryAllocator::SetInstance(nullptr); DCHECK_EQ(instance_, this); instance_ = nullptr; }
diff --git a/ui/webui/resources/PRESUBMIT.py b/ui/webui/resources/PRESUBMIT.py index 521ad5e6..2f40f71 100644 --- a/ui/webui/resources/PRESUBMIT.py +++ b/ui/webui/resources/PRESUBMIT.py
@@ -46,6 +46,8 @@ for f in input_api.AffectedFiles(): local_path = f.LocalPath() + if local_path.endswith('i18n_behavior.js'): + continue keywords = None if local_path.endswith('.js'):